OpenXcom Forum

Modding => Help => Topic started by: Solarius Scorch on March 02, 2019, 03:14:05 pm

Title: Alternative retaliation
Post by: Solarius Scorch 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?
Title: Re: Alternative retaliation
Post by: ohartenstein23 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