aliens

Author Topic: [Solved] Making more retaliation missions  (Read 3335 times)

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
[Solved] Making more retaliation missions
« on: July 18, 2017, 10:35:06 pm »
I discussed this topic in the past in this thread: https://openxcom.org/forum/index.php/topic,5304.0.html. Now I am returning to tackle it again, this time in OXCE. As I learned from the other thread, I can use OXCE scripting to alter the set of aliens which enter your base during the final assault. I can already make the attacking ship type vary but I'd like to learn how to make the aliens match the ship.

I am a veteran openxcom modder, but I am completely new to OXCE. Can someone walk me through this step by step?

Here's what I have from regular openxcom:
Code: [Select]
alienMissions:
  - type: STR_ALIEN_RETALIATION
    raceWeights:
      0:
        STR_SECTOID: 16
        STR_SNAKEMAN: 16
        STR_ETHEREAL: 16
        STR_MUTON: 16
        STR_FLOATER: 16
        STR_MIXED_OPERATIONS: 10
        STR_MIXED_TERROR: 10
  - type: STR_ALIEN_RETALIATION_2
    points: 0
    objective: 4
    spawnUfo: STR_TERROR_SHIP
    raceWeights:
      0:
        STR_SECTOID: 16
        STR_SNAKEMAN: 16
        STR_ETHEREAL: 16
        STR_MUTON: 16
        STR_FLOATER: 16
        STR_MIXED_OPERATIONS: 10
        STR_MIXED_TERROR: 10
    waves:
      - ufo: STR_SMALL_SCOUT
        count: 1
        trajectory: P8
        timer: 3000
      - ufo: STR_MEDIUM_SCOUT
        count: 2
        trajectory: P8
        timer: 3000
      - ufo: STR_LARGE_SCOUT
        count: 3
        trajectory: P8
        timer: 3000
      - ufo: STR_TERROR_SHIP
        count: 2
        trajectory: P8
        timer: 3000

missionScripts:

  - type: researchRetaliation
    missionWeights:
      0:
        STR_ALIEN_RETALIATION: 10
        STR_ALIEN_RETALIATION_2: 90

  - type: beginnerRetaliation
    missionWeights:
      0:
        STR_ALIEN_RETALIATION_2: 100

  - type: experiencedRetaliation
    missionWeights:
      0:
        STR_ALIEN_RETALIATION: 10
        STR_ALIEN_RETALIATION_2: 90

  - type: veteranRetaliation
    missionWeights:
      0:
        STR_ALIEN_RETALIATION: 20
        STR_ALIEN_RETALIATION_2: 80

  - type: geniusRetaliation
    missionWeights:
      0:
        STR_ALIEN_RETALIATION: 30
        STR_ALIEN_RETALIATION_2: 70

  - type: superhumanRetaliation
    missionWeights:
      0:
        STR_ALIEN_RETALIATION: 40
        STR_ALIEN_RETALIATION_2: 60

I've been told the missionScripts change wouldn't affect the ship type used in retaliations in response to you shooting alien craft down, so I'm not sure what difficultyRetaliation is for. But whether the chances are 20/80 or 50/50, I know I have successfully gotten terror ships to sometimes (often) attack the base. I couldn't create a separate deployment set for the terror ship, but its crew is very similar to battleship crew so it doesn't really matter.

But I want to add more ship types to the list. If possible I would like to affect their likelihood of spawning from any trigger including (most importantly) shooting down alien craft. But the main thing I want to do is create new deployments based on the craft coming in.
« Last Edit: February 11, 2023, 04:19:03 pm by Meridian »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: Making more retaliation missions
« Reply #1 on: July 19, 2017, 11:29:32 am »
I've been told the missionScripts change wouldn't affect the ship type used in retaliations in response to you shooting alien craft down, so I'm not sure what difficultyRetaliation is for.

The alien mission spawned after shooting down craft is:
1. "retaliationMission" defined on the alien race from the shot down UFO
2. if not defined, then a random (based on weights) mission with objective 4 (retaliation)

But whether the chances are 20/80 or 50/50, I know I have successfully gotten terror ships to sometimes (often) attack the base. I couldn't create a separate deployment set for the terror ship, but its crew is very similar to battleship crew so it doesn't really matter.

Code: [Select]
ufos:
  - type: STR_UFO_TYPE
    craftCustomDeploy: STR_BATTLESHIP_1 #override craft default deployment.
    missionCustomDeploy: STR_TERROR_MISSION_2 #override mission default deployment.
    raceBonus: #bonus stats per race.
      STR_SECTOID: #name of race that bonus apply.
        craftCustomDeploy: STR_BATTLESHIP_3 #override craft default deployment.
        missionCustomDeploy: STR_TERROR_MISSION_2 #override mission default deployment.


But I want to add more ship types to the list. If possible I would like to affect their likelihood of spawning from any trigger including (most importantly) shooting down alien craft.

For which mission spawns, see first answer.

For probability to spawn:

Based on race:

Code: [Select]
alienRaces:
  - id: STR_SECTOID
    retaliationMission: STR_ALIEN_RETALIATION   #default mission spawn after destroying ufo.
    retaliationAggression: 0                    #chance modifier to spawn retaliation mission.
    baseCustomDeploy: STR_ALIEN_BASE_ASSAULT_2  #override alien base default deployment.
    baseCustomMission: STR_MIB_BASE             #override alien base construction.

But the main thing I want to do is create new deployments based on the craft coming in.

See above "missionCustomDeploy".
« Last Edit: June 14, 2020, 01:48:12 pm by Meridian »