Victoria II

Victoria II

How to write an event that remove cores over time
Hi, so what I'm trying to do is after I extended the end date I want to make a system like eu4 which countries can gain core of a province if they own it for 50 years without change, and after another 50 years other countries' cores (if any) are removed. I used the event of imperialism gaining core as template to achieve the first goal (adding core), but when i tweak the template again to try to remove cores, it does not work as I expected. The event for adding core that I come up with is like this:
# Gain Core event province_event = { id = 2560 title = "EVTNAME2560" desc = "EVTDESC2560" trigger = { NOT = { is_core = THIS } controlled_by = THIS owner = { tag = THIS } } mean_time_to_happen = { months = 2 //for easier testing modifier = { factor = 1.5 NOT = { OR = { port = yes any_neighbor_province = { AND = { is_core = THIS controlled_by = THIS //this modifier is for land that does not connect with your core } } } } } modifier = { factor = 0.5 is_primary_culture = yes } modifier = { factor = 0.9 NOT = { average_militancy = 1 } } modifier = { factor = 0.9 NOT = { average_militancy = 2 } } modifier = { factor = 0.95 NOT = { average_militancy = 3 } } modifier = { factor = 0.9 NOT = { average_consciousness = 4 } } } option = { name = "EVTOPTA2560" add_core = THIS } }

So this one works okay with the observation of Venice, it has the core of Venice at the start and after a few months the core of Austria is added (since I tested with 2 months mean_time_to_happen)

But when I used the same idea for removing core, it doesn't work and Venice's core of Venice does not get removed. I have been tweaking the code here and there for quite a while and this is the simple one I come up with:
# Loss Core event province_event = { id = 8888 title = "EVTNAME8888" //I have added these in localisation csv desc = "EVTDESC8888" trigger = { is_core = { AND = { THIS NOT = {THIS} } } controlled_by = THIS owner = { tag = THIS } } mean_time_to_happen = { months = 2 //for easier testing modifier = { factor = 1.5 is_primary_culture = yes } } option = { name = "EVTOPTA8888" //has added in localisation remove_core = { NOT = {THIS} } } }
So...I have a feeling that maybe I'm using the NOT wrong but not sure exactly where and how to fix it...Anyway thank you so much for reading these far and any help is really appreciated~~~~(>_<)~~~~

P.S. btw the //blabla part isn't in the actual coding
< >
12/2 megjegyzés mutatása
I would go on the official forums, there is a pretty active modding community that can help you there. Just make a PDS forum account and then link your Steam account to it and it should give you access.
Zsrai eredeti hozzászólása:
I would go on the official forums, there is a pretty active modding community that can help you there. Just make a PDS forum account and then link your Steam account to it and it should give you access.
Thanks, I have already done that.
< >
12/2 megjegyzés mutatása
Laponként: 1530 50

Közzétéve: 2017. febr. 17., 17:23
Hozzászólások: 2