• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

VEUltimateL

Recruit
8 Badges
Feb 26, 2020
8
0
  • Crusader Kings II
  • Europa Universalis IV
  • Cities: Skylines
  • Magicka 2
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings III
When I was handling with this trigger I met some problems,so I wrote this script to test about it with the console command "run".

Here is my script.

Code:
if = {
    limit = {
        NOT = { 87 = { has_province_modifier = the_staple_port } }
        # 87 = { has_province_modifier = the_staple_port
    }
    ROOT = {
        add_treasury = 1
    }
}

87 = {
    add_province_modifier = {
        name = the_staple_port
        duration = -1
    }
}

# 87 = {
#     remove_province_modifier = the_staple_port
# }

When you start with England and execute this script,the decision "Designate Calais as The Staple Port" is gone as designed since there's a trigger
Code:
NOT = { 87 = { has_province_modifier = the_staple_port } }
in the potential of the decision and we just add the province modifier to Calais, whose province ID is 87.

However,if you execute the script once again,you will surprisingly find that you gain one ducat still,even though that is impossbile because of the limit of the effect.

Then you can try to remove the province modifier,and you still gain one ducat,while at the same time the decision is back, too.

And you can still try to modify the limit of the effect to make it executed with the province modifier,but you'll never gain the ducat then with or without the modifier.

All these tests seem to prove that the trigger "has_province_modifier" is actually not working properly,at least in this case.

So it is quite confusing that it is the trigger's problem or just my code's problem?Can you give me some suggestions?
 
This seems to be one of the cases where triggers in run files don't work if the RHS is a string which is defined somewhere in the game files. Checking for the trade good of a province has the same problem

Disclaimer: I'm not working for Paradox. I'm just trying to help people.
 
This seems to be one of the cases where triggers in run files don't work if the RHS is a string which is defined somewhere in the game files. Checking for the trade good of a province has the same problem
That did explain why,thanks for your answer.It's a pity that sometimes you just can't check these complex conditional statements but have to restart the game because of this dumb bug.