aliens

Author Topic: [DONE] Spawn new enemies during the mission / Reinforcements script  (Read 7236 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9172
    • View Profile
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...
« Last Edit: December 02, 2020, 04:17:04 pm by Meridian »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Spawn new enemies during the mission
« Reply #1 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?)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11785
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Spawn new enemies during the mission
« Reply #2 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.

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Spawn new enemies during the mission
« Reply #3 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.

Offline Starving Poet

  • Colonel
  • ****
  • Posts: 265
    • View Profile
Re: Spawn new enemies during the mission
« Reply #4 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.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9172
    • View Profile
Re: [WIP] [Feedback] Spawn new enemies during the mission
« Reply #5 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.
« Last Edit: November 22, 2020, 04:16:46 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9172
    • View Profile
Re: [DONE] Spawn new enemies during the mission
« Reply #6 on: November 22, 2020, 04:18:56 pm »
Updated description above.
Feature available in OXCE v6.8.

Offline HT

  • Colonel
  • ****
  • Posts: 456
    • View Profile
Re: [DONE] Spawn new enemies during the mission
« Reply #7 on: November 22, 2020, 05:15:56 pm »
Finally! That was one waited for ages!

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11785
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [DONE] Spawn new enemies during the mission / Reinforcements script
« Reply #8 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.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9172
    • View Profile
Re: [DONE] Spawn new enemies during the mission / Reinforcements script
« Reply #9 on: December 08, 2020, 11:03:59 pm »
already possible
(check `percentageOutsideUfo`)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11785
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [DONE] Spawn new enemies during the mission / Reinforcements script
« Reply #10 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?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9172
    • View Profile
Re: [DONE] Spawn new enemies during the mission / Reinforcements script
« Reply #11 on: April 06, 2023, 04:21:38 pm »
with 'markAsReinforcementsBlock: true'

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11785
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [DONE] Spawn new enemies during the mission / Reinforcements script
« Reply #12 on: April 06, 2023, 09:29:43 pm »
Thank you. Works like a charm.