aliens

Author Topic: How to run research-dependent mission once?  (Read 7433 times)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11697
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
How to run research-dependent mission once?
« on: November 13, 2016, 01:08:51 pm »
One way to make the mission only run once is to use the same value on firstMonth and lastMonth. But is it possible to have a unique, one-time mission that is unlocked by research rather than a set month?

Offline Nord

  • Commander
  • *****
  • Posts: 1743
  • The Gate is open.
    • View Profile
Re: How to run research-dependent mission once?
« Reply #1 on: November 13, 2016, 02:31:40 pm »
How about:
 
Code: [Select]
    lastMonth: 0
    researchTriggers: STR_SECRET_MISSION_RESEARCH
?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: How to run research-dependent mission once?
« Reply #2 on: November 14, 2016, 04:55:40 am »
#    maxRuns: 12                         # this mission type can only execute this number of times, -1 for infinite (default -1)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11697
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: How to run research-dependent mission once?
« Reply #3 on: November 14, 2016, 01:59:15 pm »
#    maxRuns: 12                         # this mission type can only execute this number of times, -1 for infinite (default -1)

Great, thanks!
(I feel silly now)

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: How to run research-dependent mission once?
« Reply #4 on: November 15, 2016, 07:09:08 pm »
From Area 51 missionScripts:

Code: [Select]
  - type: bluebookD
    label: 7
    firstMonth: 1
    maxRuns: 1
    missionWeights:
      0:
        STR_COUNCIL_MISSION: 100
    researchTriggers:
      STR_DATA_DISK_2: true
    regionWeights:
      0:
        BLUEBOOKD: 100
    varName: bluebookd
    useTable: false

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11697
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: How to run research-dependent mission once?
« Reply #5 on: November 16, 2016, 08:36:05 pm »
From Area 51 missionScripts:

Code: [Select]
  - type: bluebookD
    label: 7
    firstMonth: 1
    maxRuns: 1
    missionWeights:
      0:
        STR_COUNCIL_MISSION: 100
    researchTriggers:
      STR_DATA_DISK_2: true
    regionWeights:
      0:
        BLUEBOOKD: 100
    varName: bluebookd
    useTable: false

What would happen if you don't discover STR_DATA_DISK_2 within the first few months?

Offline Chiko

  • Colonel
  • ****
  • Posts: 174
    • View Profile
Re: How to run research-dependent mission once?
« Reply #6 on: November 17, 2016, 01:27:42 am »
...Wait, wut? Research-dependent missions? How, wut? D_D

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: How to run research-dependent mission once?
« Reply #7 on: November 17, 2016, 03:57:50 pm »
What would happen if you don't discover STR_DATA_DISK_2 within the first few months?

It's irrelevant when you discover STR_DATA_DISK_2. The 'firstMonth: 1' means that the mission can only be generated from February onwards and there isn't a limit set to when the mission can take place.

...Wait, wut? Research-dependent missions? How, wut? D_D

They were already present on the original game regarding alien retaliations. The missionScript adds a monthly Retaliation once the game reaches a certain month (depending on the difficulty level) or The Martian Solution is researched, in addition to the retaliations caused by UFO shoot downs.
« Last Edit: November 17, 2016, 04:36:35 pm by Hobbes »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11697
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: How to run research-dependent mission once?
« Reply #8 on: November 17, 2016, 06:35:36 pm »
It's irrelevant when you discover STR_DATA_DISK_2. The 'firstMonth: 1' means that the mission can only be generated from February onwards and there isn't a limit set to when the mission can take place.

OK, I'm in a really bad shape. I meant if it was lastMonth, not first:

Code: [Select]
  - type: bluebookD
    label: 7
    lastMonth: 1
    maxRuns: 1
    missionWeights:
      0:
        STR_COUNCIL_MISSION: 100
    researchTriggers:
      STR_DATA_DISK_2: true
    regionWeights:
      0:
        BLUEBOOKD: 100
    varName: bluebookd
    useTable: false

Offline Nord

  • Commander
  • *****
  • Posts: 1743
  • The Gate is open.
    • View Profile
Re: How to run research-dependent mission once?
« Reply #9 on: November 17, 2016, 07:27:43 pm »
How i understand description, lastmonth 1 means "no missions after january", lastmonth 0 means " only one time."

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: How to run research-dependent mission once?
« Reply #10 on: November 17, 2016, 07:59:58 pm »
OK, I'm in a really bad shape. I meant if it was lastMonth, not first:

Code: [Select]
  - type: bluebookD
    label: 7
    lastMonth: 1
    maxRuns: 1
    missionWeights:
      0:
        STR_COUNCIL_MISSION: 100
    researchTriggers:
      STR_DATA_DISK_2: true

On this case the mission can never take place in January if the player starts the game with STR_DATA_DISK_2 already researched. And for the mission to take place in February, the player needs to recover and research STR_DATA_DISK_2 before January ends. The important thing to remember is that the missionScript is only run at the beginning of a new month, so if the conditions aren't met, then no mission is generated.

How i understand description, lastmonth 1 means "no missions after january", lastmonth 0 means " only one time."

Everytime you see on a ruleset the value 0 associated with a list (of months, damageType, etc.) it means the first entry of the list, on this case January.  maxRuns: 1 is used to run the mission 'only one time'
« Last Edit: November 17, 2016, 08:01:54 pm by Hobbes »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11697
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: How to run research-dependent mission once?
« Reply #11 on: November 17, 2016, 09:07:59 pm »
OK, I thought so. Thanks!

Offline Thirsk

  • Captain
  • ***
  • Posts: 62
    • View Profile
Re: How to run research-dependent mission once?
« Reply #12 on: February 02, 2017, 12:29:55 pm »
I'm having trouble trying to work out the opposite of this.

How do you stop a mission script (with no lastmonth variable) from continuing? I tried to put in research trigger: STR_SABOTAGE to false. So that would mean that if I researched SABOTAGE, then the mission script would finally stop? Seems to keep going for me..

Or is it that the mission will keep repeating each month and I have to research it every single month to prevent it from executing? How is that possible..lol I'm so confused.

EDIT: Strangely I can't seem to stop missions from repeating at all. Setting lastmonth to 0, maxruns to 1...nothing seems to prevent it from coming back month after month. Is there some kind of bug?
« Last Edit: February 02, 2017, 12:42:40 pm by Thirsk »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11697
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: How to run research-dependent mission once?
« Reply #13 on: February 02, 2017, 03:08:03 pm »
I'm having trouble trying to work out the opposite of this.

How do you stop a mission script (with no lastmonth variable) from continuing? I tried to put in research trigger: STR_SABOTAGE to false. So that would mean that if I researched SABOTAGE, then the mission script would finally stop? Seems to keep going for me..

Or is it that the mission will keep repeating each month and I have to research it every single month to prevent it from executing? How is that possible..lol I'm so confused.

EDIT: Strangely I can't seem to stop missions from repeating at all. Setting lastmonth to 0, maxruns to 1...nothing seems to prevent it from coming back month after month. Is there some kind of bug?

This is a mission script that definitely works for me:

Code: [Select]
  - type: CultActivityEXALT
    firstMonth: 0
    executionOdds: 8
    missionWeights:
      0:
        STR_CULT_INVESTIGATION_EXALT: 100
    regionWeights:
      0:
        REGION_EXALT: 100
    useTable: false
    researchTriggers:
      STR_EXALT: true
      STR_EXALT_OPERATIONS: false
    startDelay: 1200

It is enabled by STR_EXALT and disabled by STR_EXALT_OPERATIONS. And it works! (Of course, starting next month.)

Offline Thirsk

  • Captain
  • ***
  • Posts: 62
    • View Profile
Re: How to run research-dependent mission once?
« Reply #14 on: February 03, 2017, 03:01:31 am »
Thanks Solarius! Actually I figured out after many hours of hair pulling that the problem was I was using the wrong IDs for global locations  :-\ funny how just a few numbers can make or break a game!