OpenXcom Forum

Modding => OpenXcom Extended => OXCE Suggestions DONE => Topic started by: Meridian on December 20, 2016, 02:54:06 pm

Title: [DONE] Spawn new enemies during the mission / Reinforcements script
Post by: Meridian on December 20, 2016, 02:54:06 pm
I'll be looking at this feature during Xmas.

Requested by hellrazor on IRC long ago:
"18:24    hellrazor    Meridian, i would like the ability to spawn aliens after a trigger was activated :D"

@hellrazor: if you have any more details, explanations, ideas... please post them here

Of course, everybody else is welcome to discuss too...
Title: Re: Spawn new enemies during the mission
Post by: Hobbes on December 20, 2016, 04:26:50 pm
I've thought about this since XCOM: Enemy Unknown as a way to change gameplay.

There's at least two things that would be required: where to spawn the units (which route nodes? which map blocks?) and what would be the trigger (objective destroyed? timers?)
Title: Re: Spawn new enemies during the mission
Post by: Solarius Scorch on December 20, 2016, 04:35:15 pm
We've already discussed it a little on the Discord channel and it looks like there are three mods of appearing on the battlefield:

1) Paradropping. It means appearing on random tiles, not under a roof.
2) Infiltration. (In the sense of tabletop strategy games - using teleports, hidden underground tunnels, whatever; it deosn't matter.) It also means appearing on random tiles, but nodes can be used.
3) Reinforcements. Appearing at a given coordinates, which usually means at the edge of the map. (Would probably require allowing many entry points, so they it is chosen randomly.) Reinforcements should probably arrive together, more or less in the same place.
Title: Re: Spawn new enemies during the mission
Post by: hellrazor on December 20, 2016, 05:13:03 pm
E.g.: Destroying a certain object defined in ruleset, will lead to mission objective success, like when you destroy the Alien Base Command Modules.
After this additional alien reinforcements arrive.
Or a engineering team of aliens to repair the damage.

Basically I wanna recreate the "Bomb Disposal Mission" from xcom2012, which is already possible in vanilla nightly, but additional enemies need to spawn in after completing mission objective (destroying UFO Power Sources on the Map modules.
Title: Re: Spawn new enemies during the mission
Post by: Starving Poet on December 20, 2016, 05:37:56 pm
Bomb disposal missions were literally the worst missions in that entire game!  If you next say you want to add thinmen, I'm out of here!    ;D

/edit: All jokes aside - they were actually the worst missions because they only worked once.  Once you knew their infiltration points, all they did was add one extra turn of tedium to an already tedious game.
Title: Re: [WIP] [Feedback] Spawn new enemies during the mission
Post by: Meridian on November 04, 2020, 09:04:44 pm
Happy Necroing everyone :)

Feature added.

Wiki description: https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Reinforcements_Script

Sample syntax of the ruleset:

Code: [Select]
alienDeployments:
  - type: STR_MEDIUM_SCOUT
    reinforcements:
      - type: firstwave
        briefing:
          palette: 6
          textOffset: -16
          title: STR_TITLE_TEST
          desc: STR_DESC_TEST
          music: GMNEWMAR
          background: BACK05.SCR
          cutscene: ""
          showCraft: false
          showTarget: false
        minDifficulty: 0
        maxDifficulty: 4
        objectiveDestroyed: false
        turns: [10,15,20,25]
        minTurn: 5
        maxTurn: 20
        executionOdds: 75
        maxRuns: 2
        mapBlockFilterType: 2
        spawnBlocks: [EDGES]
        spawnBlockGroups: [7, 8, 9]
        useSpawnNodes: true
        spawnNodeRanks: [0, 2]
        spawnZLevels: [2, 3]
        randomizeZLevels: false
        minDistanceFromXcomUnits: 10
        maxDistanceFromBorders: 2
        forceSpawnNearFriend: true
        data:
          - alienRank: 5
            lowQty: 7
            highQty: 15
            dQty: 0
            extraQty: 0
            percentageOutsideUfo: 0
            itemSets:
              - [ STR_RIFLE, STR_RIFLE_CLIP ]
              - [ STR_RIFLE, STR_RIFLE_CLIP ]
              - [ STR_RIFLE, STR_RIFLE_CLIP ]
            extraRandomItems:
              - [ STR_GRENADE, STR_MOTION_SCANNER ]
            customUnitType: STR_MUTON_ENGINEER

          - alienRank: 4
            lowQty: 3
            highQty: 4
            ...
      - type: secondwave
        minDifficulty: 0
        maxDifficulty: 4
        ...

And algorithm/logic is explained in the attached diagram.

Feedback welcome.
Title: Re: [DONE] Spawn new enemies during the mission
Post by: Meridian on November 22, 2020, 04:18:56 pm
Updated description above.
Feature available in OXCE v6.8.
Title: Re: [DONE] Spawn new enemies during the mission
Post by: HT on November 22, 2020, 05:15:56 pm
Finally! That was one waited for ages!
Title: Re: [DONE] Spawn new enemies during the mission / Reinforcements script
Post by: Solarius Scorch on December 08, 2020, 10:57:37 pm
After releasing the first XCF version with reinforcements a surprisingly large number of people asked if it's possible to use the reinforcements feature for also spawning civilians.

While I haven't thought about it before, and don't have any concrete plans for it right now, the volume of these questions suggests significant interest from players. I think it could potentially be useful, like for defensive missions where you get regular reinforcements, or throwing more civilians to slaughter if you take too long to clear a terror, etc. So perhaps it would be worthwhile to consider adding such a feature.
Title: Re: [DONE] Spawn new enemies during the mission / Reinforcements script
Post by: Meridian on December 08, 2020, 11:03:59 pm
already possible
(check `percentageOutsideUfo`)
Title: Re: [DONE] Spawn new enemies during the mission / Reinforcements script
Post by: Solarius Scorch on April 05, 2023, 05:21:33 pm
What can I say? Whoa. :)

EDIT:
mapBlockFilterType: 1 is described as "blocks marked in the map script". How to mark this in the map script?
Title: Re: [DONE] Spawn new enemies during the mission / Reinforcements script
Post by: Meridian on April 06, 2023, 04:21:38 pm
with 'markAsReinforcementsBlock: true'
Title: Re: [DONE] Spawn new enemies during the mission / Reinforcements script
Post by: Solarius Scorch on April 06, 2023, 09:29:43 pm
Thank you. Works like a charm.