OpenXcom Forum
Modding => Work In Progress => Topic started by: Solarius Scorch 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:
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.
-
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
-
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:
# 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.
-
hum guess i was wrong then :-[
-
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?
-
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?
-
IRC is your best bet, my first instinct is a typo.
-
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.
-
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.
-
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.
-
Thank you for your help, Warboy. I know it took a lot of your time. :)