Hello! I'm trying to make a decision code.
When the decision is activated, the ROOT country should create puppet states on all occupied territories that are cores of those states.
I've had several attempts to create a working code. Here's what I've got:
Code №1:
When this code is activated, it simply returns the occupied territories to the countries that exist and have cores on them. No puppet is created.
Code №2:
When this is activated, a state with the same name and flag as mine is created on my states. It looks as if I entered "civilwar" in the console, a civil war started, and the rebel state won. The new state has cores on all my territory, but the old state's cores remain.
Code №3:
When activated, it creates a country on the occupied territories with my name and flag. Again, it looks like I entered "civilwar" in the console, but the new state appears only on the occupied territories.
Code №4:
Here cores for a puppet state are created on the occupied territories, but the country itself is not created.
--------------------------
None of the codes provided have allowed me to implement my idea successfully. Either the game does not understand to whom the states should be transferred, or it transfers them back to me.
I would like to achieve the effect like when using the "Occupied territories" tab, where you release states, but to create states immediately on all occupied territories. If a state already exists on the map, then another state is created (as if a peace conference took place, and two states created a puppet out of the same country).
I planned for democratic states controlled by AI to immediately liberate territories after defeating an enemy, if AI annexes enemy territories as a result of the conference.
Please help me make a working decision code.
When the decision is activated, the ROOT country should create puppet states on all occupied territories that are cores of those states.
I've had several attempts to create a working code. Here's what I've got:
Code №1:
Code:
TEST1 = {
icon = generic_form_nation
allowed = {
always = yes
}
available = {
always = yes
}
cost = 0
ai_will_do = {
factor = 10
}
fire_only_once = no
complete_effect = {
every_occupied_country = {
PREV = {
release_on_controlled = PREV
}
}
}
}
When this code is activated, it simply returns the occupied territories to the countries that exist and have cores on them. No puppet is created.
Code №2:
Code:
TEST2 = {
icon = generic_form_nation
allowed = {
always = yes
}
available = {
always = yes
any_state = {
is_controlled_by = ROOT
}
}
cost = 0
ai_will_do = {
factor = 0
}
fire_only_once = no
complete_effect = {
create_dynamic_country = {
original_tag = PREV
save_event_target_as = test11
every_state = {
limit = {
is_controlled_by = ROOT
}
event_target:test11 = {
transfer_state = PREV
}
}
}
}
}
When this is activated, a state with the same name and flag as mine is created on my states. It looks as if I entered "civilwar" in the console, a civil war started, and the rebel state won. The new state has cores on all my territory, but the old state's cores remain.
Code №3:
Code:
TEST3 = {
icon = generic_form_nation
allowed = {
always = yes
}
available = {
always = yes
}
cost = 0
ai_will_do = {
factor = 0
}
fire_only_once = no
complete_effect = {
create_dynamic_country = {
original_tag = PREV
save_event_target_as = test11
every_state = {
limit = {
is_controlled_by = ROOT
NOT = { is_core_of = ROOT }
}
if = { // If condition is met
limit = { NOT = { any_core_country = { is_tag = ROOT } } }
event_target:test11 = {
transfer_state = PREV
}
}
}
}
}
}
Code №4:
Code:
TEST4 = {
icon = generic_form_nation
allowed = {
always = yes
}
available = {
always = yes
}
cost = 0
ai_will_do = {
factor = 0
}
fire_only_once = no
complete_effect = {
IF = {
every_occupied_country = {
save_event_target_as = my_country
}
original_tag = PREV
}
every_state = {
limit = {
is_controlled_by = ROOT
NOT = { is_core_of = ROOT }
set_temp_variable = { target_country = THIS }
}
create_dynamic_country = {
original_tag = event_target:my_country
ideology = ROOT
transfer_state = yes
}
}
}
}
Here cores for a puppet state are created on the occupied territories, but the country itself is not created.
--------------------------
None of the codes provided have allowed me to implement my idea successfully. Either the game does not understand to whom the states should be transferred, or it transfers them back to me.
I would like to achieve the effect like when using the "Occupied territories" tab, where you release states, but to create states immediately on all occupied territories. If a state already exists on the map, then another state is created (as if a peace conference took place, and two states created a puppet out of the same country).
I planned for democratic states controlled by AI to immediately liberate territories after defeating an enemy, if AI annexes enemy territories as a result of the conference.
Please help me make a working decision code.