Just a heads up for everyone.
It seems that when you are creating a new empire/race through a system initializer, any flags you add to it *cannot* be referenced from *inside* the initializer you are working in.
For example, you create a country from inside of the init_effect of a planet in your system initializer:
create_country = {
name = "Test"
type = fallen_empire
ignore_initial_colony_error = yes
government = stagnated_ascendancy
species = last_created
flag = random
effect = {
set_country_flag = test_flag
}
}
If you then try, later in another planet in the same initializer, or in a 'neighbor_system' intializer, to use the flag for further logic, for example:
every_country = {
limit = {
has_country_flag = test_flag
}
save_event_target_as = test_flag
}
set_owner = event_target:test_flag
It doesn't pick the flag up.
It seems that the game needs to pop out of the initializer loop before it actually registers flags like this (and i'm also assuming global flags as well).
Just seemed a bit odd to me that it's working this way...
Of course, you can just use last_created_country for a working effect.
Hope this helps someone.
It seems that when you are creating a new empire/race through a system initializer, any flags you add to it *cannot* be referenced from *inside* the initializer you are working in.
For example, you create a country from inside of the init_effect of a planet in your system initializer:
create_country = {
name = "Test"
type = fallen_empire
ignore_initial_colony_error = yes
government = stagnated_ascendancy
species = last_created
flag = random
effect = {
set_country_flag = test_flag
}
}
If you then try, later in another planet in the same initializer, or in a 'neighbor_system' intializer, to use the flag for further logic, for example:
every_country = {
limit = {
has_country_flag = test_flag
}
save_event_target_as = test_flag
}
set_owner = event_target:test_flag
It doesn't pick the flag up.
It seems that the game needs to pop out of the initializer loop before it actually registers flags like this (and i'm also assuming global flags as well).
Just seemed a bit odd to me that it's working this way...
Of course, you can just use last_created_country for a working effect.
Hope this helps someone.
- 1