Author Topic: Alternative retaliation  (Read 192 times)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8320
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Alternative retaliation
« on: March 02, 2019, 03:14:05 pm »
Please help me with the following idea.
I would like modify how alien retaliation works in my mod. Instead of one behaviour (base assault), there would be two missions, chosen at random according to weights:
* mission 1: standard base assault
* mission 2: an "air domination" mission, where many hunter-killer UFOs are spawned to patrol the affected area and get in the way of X-Com operations for a while.
Making the missions themselves is trivial (one is the vanilla retal, the other a generic mission with UFOs), but how do I script it?
« Last Edit: March 02, 2019, 03:15:56 pm by Solarius Scorch »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1610
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Alternative retaliation
« Reply #1 on: March 02, 2019, 04:16:13 pm »
It depends on which trigger you want to use for the retaliation. If you're talking about retaliation caused by shooting down UFOs, the game first looks for the retaliation defined on the alienRace (only one per race), or picks randomly from all retaliation missions in your mod.
Code: [Select]
alienRaces:
  - type: STR_SOME_RACE
    retaliationMission: STR_AIR_DOMINATION

If you're talking about ones spawned by missionScripts (either research or number of game months passed), then it's just by putting both types in missionWeights in the script.
Code: [Select]
missionScripts:
  - type: retal
    missionWeights:
      0:
        STR_ALIEN_RETALIATION: 50
        STR_AIR_DOMINATION: 50