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

Swizzlewizzle

First Lieutenant
7 Badges
May 6, 2016
214
49
  • Magicka
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Megacorp
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
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.
 
  • 1
Reactions:
I think your scope for saving a country flag is incorrect there.After create country you can use

last_created_country = {
set_country_flag = some_flag
save_event_target_as = some_target
}

Or alternatively use PREV and PREVPREV to identify that country.

I haven't had this issue with flags before but definitely with event_targets.
 
Code:
random_country = {
    limit = {
        has_country_flag = some_flag
    }
    ROOT/PREVPREV = {    ## Depending on scope
        set_owner = PREV
    }
}

You can just wing it like that if you can't save an event target.This happens to me all allot,if the game loads an event file before one that you used to save a target,it won't register at all.
 
Last edited: