• 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.

RedWalrus

Sergeant
81 Badges
Jun 19, 2012
68
303
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Pre-order
  • Stellaris: Galaxy Edition
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: El Dorado
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Imperator: Rome Deluxe Edition
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Battle for Bosporus
  • Europa Universalis 4: Emperor
  • Stellaris: Necroids
  • Europa Universalis IV
  • Imperator: Rome
  • Stellaris: Nemesis
  • Europa Universalis IV: Golden Century
  • Stellaris: Humanoids Species Pack
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • The Showdown Effect
  • Victoria 3 Sign Up
  • Hearts of Iron IV: By Blood Alone
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.

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.

Screenshot_21.png


The modifier being added to the temporary province modifiiers.

Screenshot_22.png


The province doesn't get added immediately once in the temporary modifiers list... Is this the bug?

Screenshot_23.png


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.