Author Topic: Mission enabling/disabling through research  (Read 7406 times)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Mission enabling/disabling through research
« on: March 05, 2016, 03:44:45 pm »
I'm having a problem with mission scripting. I've checked it several times and asked Dioxine to check it out too, but neither of us found a bug and so I am out of options, so please help.

In my current WIP, you fight off pro-alien organizations. The general idea is that you get a mission type "cult activity" from the beginning of the game. Once you get some research into it, you get a new type of mission called "cult hideout", which also has a chance to spawn alongside cult activity. Everything works fine up to this point. But then you complete another research that is supposed to terminate cult activity and start another mission called "cult base", and this doesn't seem to work: I'm still getting cult activity missions and I haven't received a single base.

Now this is a bit complex, since there are several independent cult organizations which count separately for this, and it's all repeated 8 times to randomize when they come up during the month, so I'll just post the data for one cult and just once. The cult is called Black Lotus and here's the mission script:

Code: [Select]
missionScripts:
  - type: CultActivityBlackLotus
    firstMonth: 0
    executionOdds: 8
    missionWeights:
      0:
        STR_CULT_INVESTIGATION_BLACK_LOTUS: 100
    regionWeights:
      0:
        REGION_BLACK_LOTUS: 100
    useTable: false
    researchTriggers:
      STR_BLACK_LOTUS_OPERATIONS: false
    startDelay: 1200

  - type: CultHideoutBlackLotus
    firstMonth: 0
    executionOdds: 6
    missionWeights:
      0:
        STR_CULT_HIDEOUT_BLACK_LOTUS: 100
    regionWeights:
      0:
        REGION_BLACK_LOTUS: 100
    useTable: false
    researchTriggers:
      STR_BLACK_LOTUS_NETWORK: true
    startDelay: 800

  - type: CultBaseBlackLotus
    firstMonth: 0
    executionOdds: 4
    missionWeights:
      0:
        STR_CULT_BASE_BLACK_LOTUS: 100
    regionWeights:
      0:
        REGION_BLACK_LOTUS: 100
    useTable: false
    researchTriggers:
      STR_BLACK_LOTUS_OPERATIONS: true
    startDelay: 1200

As you can see, the key research projects are STR_BLACK_LOTUS_NETWORK which enables CultHideoutBlackLotus and STR_BLACK_LOTUS_OPERATIONS, which enables CultBaseBlackLotus and disables CultActivityBlackLotus. The first one works, the other doesn't.

Please help, since I have no idea if I'm doing it wrong or what.

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: Mission enabling/disabling through research
« Reply #1 on: March 05, 2016, 04:29:35 pm »
i *think* you can't disable missions using researches.
i used to have a similar idea too, but after looking into mission scripting i remember reaching the conclusion that it couldn't be done (i forgot everything about how and why this, too much time passed).

Also your executionOdds seem extremely low, as far as i understand it is a percentage: 'executionOdds: 4' -> 4% chance of executing

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Mission enabling/disabling through research
« Reply #2 on: March 05, 2016, 04:49:04 pm »
i *think* you can't disable missions using researches.
i used to have a similar idea too, but after looking into mission scripting i remember reaching the conclusion that it couldn't be done (i forgot everything about how and why this, too much time passed).

Well, it should work, if I understand this correctly:

Code: [Select]
#    researchTriggers:                   # a list of research topics that can influence the execution of this mission (default empty)
#      STR_THE_MARTIAN_SOLUTION: true    # in this case, the mission would only run if the player has the martian solution
#      STR_CYDONIA_OR_BUST: false        # and does NOT have Cydonia or bust

Besides it works in Piratez, according to Dioxine.

Also your executionOdds seem extremely low, as far as i understand it is a percentage: 'executionOdds: 4' -> 4% chance of executing

Yes, but I have 8 such possible missions per month, as well as several other combinations, so I'm getting one mission per several days on average. So it works pretty well.

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: Mission enabling/disabling through research
« Reply #3 on: March 05, 2016, 05:02:17 pm »
hum guess i was wrong then  :-[

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Mission enabling/disabling through research
« Reply #4 on: March 05, 2016, 05:17:15 pm »
I'm having a problem with mission scripting. I've checked it several times and asked Dioxine to check it out too, but neither of us found a bug and so I am out of options, so please help.

what am i? chopped liver?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Mission enabling/disabling through research
« Reply #5 on: March 05, 2016, 05:23:50 pm »
what am i? chopped liver?

I would never dream of disturbing you for something so insignificant, effendi. :)

But seriously, I'm trying to fix things at home first before making it a public issue, so the very fact I'm opening a thread is a sign it's pretty bad. ;) So I'd really be grateful for some help.

Is there any more info you'd like me to provide? Rulesets?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Mission enabling/disabling through research
« Reply #6 on: March 05, 2016, 05:38:44 pm »
IRC is your best bet, my first instinct is a typo.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Mission enabling/disabling through research
« Reply #7 on: March 06, 2016, 04:18:31 am »
Now this is a bit complex, since there are several independent cult organizations which count separately for this, and it's all repeated 8 times to randomize when they come up during the month, so I'll just post the data for one cult and just once. The cult is called Black Lotus and here's the mission script:

If I'm seeing the code right, then 4% is a really low chance of the STR_CULT_BASE_BLACK_LOTUS mission being generated, as robin already pointed out, even if you have another 7 missions that can generate a base at 4%. You need to jack it up to 100% if you want to ensure that the base appears (at least for testing to see if everything works as it should), otherwise you're at the mercy of the RNG.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Mission enabling/disabling through research
« Reply #8 on: March 06, 2016, 01:13:18 pm »
If I'm seeing the code right, then 4% is a really low chance of the STR_CULT_BASE_BLACK_LOTUS mission being generated, as robin already pointed out, even if you have another 7 missions that can generate a base at 4%. You need to jack it up to 100% if you want to ensure that the base appears (at least for testing to see if everything works as it should), otherwise you're at the mercy of the RNG.

The base not appearing is only part of the problem, the more glaring part is that the one that shouldn't appear does.

I'm supposed to work it out with Warboy later tonight.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Mission enabling/disabling through research
« Reply #9 on: March 06, 2016, 08:48:24 pm »
it isn't the scripts that are at fault, the missions are being generated properly, but the region they operate within is only capable of producing activity missions and hideouts due to the texture assignments.
« Last Edit: March 08, 2016, 06:41:28 pm by Warboy1982 »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Mission enabling/disabling through research
« Reply #10 on: March 07, 2016, 08:01:47 pm »
Thank you for your help, Warboy. I know it took a lot of your time. :)