Author Topic: Can Mission Scripts generate the same mission twice?  (Read 1209 times)

Offline wolfreal

  • Colonel
  • ****
  • Posts: 298
    • View Profile
Can Mission Scripts generate the same mission twice?
« on: December 22, 2023, 12:17:24 am »
Hi

This is the case:

I have mission A in alienMissions:

i use missionScripts to generate the mission each month.

Let's say I have research  STR_some_research. The idea is to generate more of the mission A after this research

I tried and... it only generate one STR_MissionA, even when the research is researched.

  - type: generate_A
    missionWeights:
      0:
        STR_MissionA: 100
    regionWeights:
      0:
        REGION_some 100
    useTable: false
   targetBaseOdds: 100
    executionOdds: 100
    startDelay: 100
    randomDelay: 1000
   
  - type: generate_A_twice
    missionWeights:
      0:
        STR_MissionA: 100
    regionWeights:
      0:
        REGION_some 100
    useTable: false
    executionOdds: 100
    startDelay: 2500
    randomDelay: 20000
   researchTriggers:
    STR_some_research: true

It is not possible to do it?

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: Can Mission Scripts generate the same mission twice?
« Reply #1 on: December 22, 2023, 02:10:26 am »
I seem to remember reading in a post that the game won't generate another mission if that same mission is already running in the same region. It will have no problem if it chooses a different region. If this is correct, it'll be part of your problem.

I've also noticed that your 1st script contains targetBaseOdds, but the 2nd doesn't, is this intentional?

Finally, mission scripts are executed at the beginning of each month, so the 2nd script should run at the beginning of the month following the month the research was completed in.

I believe it is possible to simulate running 2 copies of a mission in the same region (assuming I was correct at the start of this reply) by essentially duplicating the mission you want to run twice

Code: [Select]
alienMissions:
  - type: STR_MissionA
    <...mission parameters...>
  - type: STR_MissionA_RT
    <...same mission parameters...>

and then have your 2nd script reference STR_MissionA_RT. For the game, these will be 2 different missions but for the player they will appear to be the same one. You might have to add extra strings for the duplicate mission so that it uses the same text as the original mission.
« Last Edit: December 22, 2023, 02:22:34 am by CrazedHarpooner »

Offline wolfreal

  • Colonel
  • ****
  • Posts: 298
    • View Profile
Re: Can Mission Scripts generate the same mission twice?
« Reply #2 on: December 22, 2023, 12:08:38 pm »
Hi.

Thanks for the reply.

TargetBaseOdds is intentional. To be fair, some parameters are missing, this was just an example.

I am testing it with running the research and later going to the new month.

I tried changing the region it can be generated and effectively, it worked.