Author Topic: Controlling UFO spawns?  (Read 1344 times)

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Controlling UFO spawns?
« on: January 19, 2023, 10:49:15 am »
I've been trying to learn how the spawning of UFOs work but the exact method of controlling it is still escaping me.

To test this I've setup a small testing mod that has several races and also has all of the default alienMissions: and missionScripts: deleted. The regions: have also been altered to change the missionWeights: settings.

(Edit: Found the mistake in my code causing Cruisers to spawn. They still aren't spawning very often though.)
With that I thought I had it but the UFOs are not spawning correctly so I am missing something and despite setting all the alienMissions: to spawn only STR_SURVEY_SHIP I'm still getting Cruisers and the UFOs are also not spawning very often even though the waves: timer: was set to a low number.

Spoiler:


I'm not totally sure how missionScripts: 'recon' & 'invasion' work as they are mostly empty compared to the other entries:

Code: [Select]
  - type: recon
    firstMonth: 1
  - type: invasion
    firstMonth: 6

My theory is that 'recon' starts all UFOs spawning and 'invasion' is the same as 'recon' and that both will run at the same time doubling the amount of spawned UFOs starting at month 6.

The race of the aliens crewing the UFOs did not seem to change very often until I reduced the number of ships in each alienMissions:  waves: to 1. Is the race of the craft only selected when the beginning of a waves: starts and is then used for all the other ships that will appear in that wave?


Any help would be appreciated, what am I missing here?
« Last Edit: January 20, 2023, 05:29:21 am by The Martian »

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: Controlling UFO spawns?
« Reply #1 on: January 20, 2023, 05:27:26 am »
I feel foolish for missing this, the Cruiser UFO is still appearing because it is setup to do so with this line of code in the alienMissions:  section:
Code: [Select]
  - type: STR_ALIEN_PROBE_MISSION_03
    refNode: *STR_ALIEN_PROBE_MISSION
    waves:
      - ufo: STR_CRUISER
        count: 2
        trajectory: P4
        timer: 10

I still haven't been able to determine why such a low number of UFOs are spawning though. Sometimes it seems to only spawn one alien mission per month.

Do the alienMissions:  not repeat during the same month that if they have already run?
« Last Edit: January 20, 2023, 05:30:31 am by The Martian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8717
    • View Profile
Re: Controlling UFO spawns?
« Reply #2 on: January 20, 2023, 09:39:38 am »
Do the alienMissions:  not repeat during the same month that if they have already run?

There is no functionality in OpenXcom for missions repeating themselves automatically (other than hardcoded endless retaliation).

When a mission ends, it dies and goes to mission heaven.

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: Controlling UFO spawns?
« Reply #3 on: January 27, 2023, 04:30:57 pm »
Thank you for the help.

So far my understanding is as follows:
. missionScripts: determines when and which alienMissions: will run.
. alienMissions: determines which UFOs are part of a missions waves and the alien race involved.
. The race of all UFOs in the same wave is assigned when that alienMissions: entry is run by a missionScripts: entry.
. regions: determines where a UFO will spawn on the globe when a mission starts.