Hey so me and some other users have been talking and we ran into this strange problem where a monthly modifier is getting added on but takes a month to go into effect using script values to bring a variable to influence a modifier. The modifier then gets deleted the same day though so that it doesn't repeat infinitely and scale massively so it never actually is used.
So the goal is to add a monthly civilization modifier to a province depending on the ratio of civilians to total population. Here is what user Jay DoubleU made.
Those is the script values.
That is the event.
That is the scripted effect.
That is the modifier.
And the event is fired by putting into the monthly_province_pulse in the monthly_province text file in the on_action file.
If you do this, you get an outcome where the modifier is added and deleted at the beginning of the month. This works fine with the monthly manpower modifier for a province, but for local_monthly_civilization, it requires a month to be added to the province in the temporary province modifiers, another month to register and get added to the monthly civilization tooltip, and then ANOTHER month to actually increase the civilization rating of the province. This might be a bug, I'm not sure. But since the modifier is being added and removed at the beginning of the month it doesn't work. I will add pictures to show what I mean by this.
The modifier being added to the temporary province modifiiers.
The province doesn't get added immediately once in the temporary modifiers list... Is this the bug?
After a month it gets added but then in the same day, it gets removed by the scripted effect and then immediately switches back to the previous picture.
If anyone has an idea on what can be done to work around this or fix it, I would be eternally grateful.
So the goal is to add a monthly civilization modifier to a province depending on the ratio of civilians to total population. Here is what user Jay DoubleU made.
walrus_variable = {
value = 0
scope:walrus_farm = {
every_pops_in_province = {
limit = {
pop_type = citizen
}
add = 1
}
}
}
walrus_variable_2 = {
value = 0
scope:walrus_farm = {
every_pops_in_province = {
add = 1
}
}
}
walrus_variable_3 = {
value = 0
add = walrus_variable
divide = walrus_variable_2
multiply = 100
}
Those is the script values.
GE_events.14 = {
type = province_event
title = "GE_events.6.t"
desc = "GE_events.6.desc"
hidden = yes
left_portrait = scope:governor_of_province
picture = city_construction
is_triggered_only = yes
trigger = {
}
immediate = {
ROOT = {
save_scope_as = walrus_farm
}
}
option = {
name = "GE_events.6.a"
scope:walrus_farm = {
add_province_modifier_stack = {
MOD = walrus_civilization
NUM = walrus_variable_3
DUR = -1
}
}
}
}
That is the event.
add_province_modifier_stack = {
if = {
limit = {
has_province_modifier = $MOD$
}
remove_province_modifier = $MOD$
}
while = {
count = $NUM$
add_province_modifier = {
name = $MOD$
mode = add
duration = $DUR$
}
}
}
That is the scripted effect.
walrus_civilization = {
local_monthly_civilization = 0.01
}
That is the modifier.
And the event is fired by putting into the monthly_province_pulse in the monthly_province text file in the on_action file.
If you do this, you get an outcome where the modifier is added and deleted at the beginning of the month. This works fine with the monthly manpower modifier for a province, but for local_monthly_civilization, it requires a month to be added to the province in the temporary province modifiers, another month to register and get added to the monthly civilization tooltip, and then ANOTHER month to actually increase the civilization rating of the province. This might be a bug, I'm not sure. But since the modifier is being added and removed at the beginning of the month it doesn't work. I will add pictures to show what I mean by this.
The modifier being added to the temporary province modifiiers.
The province doesn't get added immediately once in the temporary modifiers list... Is this the bug?
After a month it gets added but then in the same day, it gets removed by the scripted effect and then immediately switches back to the previous picture.
If anyone has an idea on what can be done to work around this or fix it, I would be eternally grateful.