Author Topic: scratching my head on missionScripts  (Read 3619 times)

Offline robin

  • Commander
  • *****
  • Posts: 1226
  • ULTIMATE ROOKIE
    • View Profile
scratching my head on missionScripts
« on: November 16, 2019, 02:56:01 pm »
As far as I know, missionScripts are executed monthly.

  - type: alienA
    executionOdds: 100
    startDelay: 1000

The above script will start executing STR_MISSION_A after a delay of 1000 + the 'timer' of the first wave, from the beginning (day 1st) of the month (let's call it "month x")?
If the waves timers are short enough, will STR_MISSION_A be run many times during month x, or will it be executed only once?

Then comes "month x+1" and alienA is interrupted, to be executed again for month x+1 ?
This time though STR_MISSION_B is selected and STR_MISSION_A is halted after the last wave. Is it correct?
STR_MISSION_B will start executing from:
 - month x+1 day 1st + 1000 + timer
 - STR_MISSION_A last wave end (let's say the mission  is so long it goes on on month x+1) + 1000 + timer

Thanks.

« Last Edit: November 16, 2019, 03:03:37 pm by robin »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9144
    • View Profile
Re: scratching my head on missionScripts
« Reply #1 on: November 16, 2019, 03:04:32 pm »
The script is executed only at the beginning of the month.
It cannot influence anything else than creation of a mission.
All other logic is mission logic, not script logic.

If the mission ends in the middle of a month, the script can't create another one... until the next month.

The script also cannot interrupt ongoing missions, it can only generate new ones.

Offline robin

  • Commander
  • *****
  • Posts: 1226
  • ULTIMATE ROOKIE
    • View Profile
Re: scratching my head on missionScripts
« Reply #2 on: November 16, 2019, 06:34:33 pm »
Thanks for the explanation.

Offline robin

  • Commander
  • *****
  • Posts: 1226
  • ULTIMATE ROOKIE
    • View Profile
Re: scratching my head on missionScripts
« Reply #3 on: November 18, 2019, 11:17:15 pm »
Dumb questions round 2nd.
The following is from vanilla

    waves:
      - ufo: STR_SMALL_SCOUT
        count: 1
        trajectory: P0
        timer: 9000
      - ufo: STR_MEDIUM_SCOUT
        count: 1
        trajectory: P2
        timer: 7800
      - ufo: STR_LARGE_SCOUT
        count: 2
        trajectory: P4
        timer: 9000

Why is there a 9000 timer on the first wave? What is it counted from:
a) From the moment this mission is generated by the script
b) From the end of the last wave of the previous mission generated by the same script
c) something else entirely
?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9144
    • View Profile
Re: scratching my head on missionScripts
« Reply #4 on: November 19, 2019, 11:35:22 am »
It's counted from the moment the mission is generated.

The game uses:

a/ either startDelay from mission script and ignores the first wave timer

b/ or if startDelay from mission script is zero... it uses the first wave counter instead

Offline robin

  • Commander
  • *****
  • Posts: 1226
  • ULTIMATE ROOKIE
    • View Profile
Re: scratching my head on missionScripts
« Reply #5 on: November 20, 2019, 11:38:03 pm »
It's counted from the moment the mission is generated.

The game uses:

a/ either startDelay from mission script and ignores the first wave timer

b/ or if startDelay from mission script is zero... it uses the first wave counter instead
Thanks