So I've ... wasted, admittedly, most of my weekend so far trying to implement non-unique pop_factions (namely, one faction can spawn multiple times) this seems to be impossible as the unique yes/no Boolean is broken, somehow, and derivative factions will never spawn, just one.
But worse than that, ive realised the parameters block is checked daily (when I instructed it to search any planets I got a daily tick-lag, meaning its run every single day.) when is_potential returns as true
I Don't know if eliminating the below code from all vanilla factions would speed up the game much, but it might be having some small effect on a large galaxy with many ais, each with a dozen viable factions, each testing, daily, that they belong to their owner empire (honestly IDK why this is in there, it made sense on the old 1.41 faction structure and might just be a hold over - but the parameters are only used for faction management right now, so they don't need to really be tested daily, and you can always write scripted triggers for that instead).
Furthermore the game has a silent error with the parameters field when you create a parameter with type = sector the game will 100% FAIL TO SPAWN THE FACTION
I assume this is because the 1.5 rewrite (or maybe some faction rewrites in 2.2/more recently) have broken something in the compiled code somewhere.
Right now I only know of 2 "types" that will work - COUNTRY and PLANET (and these can be used as follows [parameter
arametername.GetName] to return a country or parameter. (for example to name your faction "[planet name] <text>" - incidentally you can then scope up to the sector [parameter
arametername.Sector.GetName] but this is horrendously laggy with how the planet-type seems to be tested daily. Ive not tried other scopes but I assume the "type" field is supposed to take any scope (see below wiki list) - your mileage may vary.
In an ideal world we'd be able to use ANY parameters in here, and they'd not be tested daily but as-and-when needed. One could create a dynamically named "Stop the [parameter.scopedwar.GetName] War" faction - a sort of CND movement.
Hopefully someone at paradox will see this and review the pop_faction files soon.
the below is a mess but includes some extra comments that may help anyone working on pop_factions
support_multiplier seems to be used to increase the percentage support for a faction in an election. E.g. you could have a "populist faction" with a mult of = 2 that was always likely to win and throw an empire in to chaos. To clarify, this is purely for base/starting support in the democratic election screen [this support% is further increased or decreased by established leaders, leaders up for re-election and independent candidates that spawn if num factions < X]. This isnt pop attraction - thats handled in the pop attraction block, which can also scope elsewhere.
Anyway, with what i've learned, I'm going to have to go with plan B - write up 1 secessionist faction fully, then copy paste it like 31 times (who ever has more than 32 sectors??) and add a flagging system to the potential field so the game knows how to use them. And avoid the parameters block, with its daily checks, like the plague. Not sure how i'll make it clear which faction is related to which sector.
Either i'll have to add a "show affected worlds" list - or something like that.
OR fire a pop_faction event on creation that does some "proper" scoping (not that parameter BS) and runs set_name to set the pop faction's name accordingly.
But worse than that, ive realised the parameters block is checked daily (when I instructed it to search any planets I got a daily tick-lag, meaning its run every single day.) when is_potential returns as true
I Don't know if eliminating the below code from all vanilla factions would speed up the game much, but it might be having some small effect on a large galaxy with many ais, each with a dozen viable factions, each testing, daily, that they belong to their owner empire (honestly IDK why this is in there, it made sense on the old 1.41 faction structure and might just be a hold over - but the parameters are only used for faction management right now, so they don't need to really be tested daily, and you can always write scripted triggers for that instead).
Code:
empire = { # Name of item i.e. parameter:empire
type = country # scope
valid_objects = {
is_same_value = root
}
}
Furthermore the game has a silent error with the parameters field when you create a parameter with type = sector the game will 100% FAIL TO SPAWN THE FACTION
I assume this is because the 1.5 rewrite (or maybe some faction rewrites in 2.2/more recently) have broken something in the compiled code somewhere.
Code:
secession_sc = { # Name of item i.e. parameter:empire
type = sector # scope [SECTOR DOESNT WORK]
valid_objects = {
owner = { is_same_value = root }
}
}

In an ideal world we'd be able to use ANY parameters in here, and they'd not be tested daily but as-and-when needed. One could create a dynamically named "Stop the [parameter.scopedwar.GetName] War" faction - a sort of CND movement.
Hopefully someone at paradox will see this and review the pop_faction files soon.
the below is a mess but includes some extra comments that may help anyone working on pop_factions
support_multiplier seems to be used to increase the percentage support for a faction in an election. E.g. you could have a "populist faction" with a mult of = 2 that was always likely to win and throw an empire in to chaos. To clarify, this is purely for base/starting support in the democratic election screen [this support% is further increased or decreased by established leaders, leaders up for re-election and independent candidates that spawn if num factions < X]. This isnt pop attraction - thats handled in the pop attraction block, which can also scope elsewhere.


Anyway, with what i've learned, I'm going to have to go with plan B - write up 1 secessionist faction fully, then copy paste it like 31 times (who ever has more than 32 sectors??) and add a flagging system to the potential field so the game knows how to use them. And avoid the parameters block, with its daily checks, like the plague. Not sure how i'll make it clear which faction is related to which sector.
Either i'll have to add a "show affected worlds" list - or something like that.
OR fire a pop_faction event on creation that does some "proper" scoping (not that parameter BS) and runs set_name to set the pop faction's name accordingly.
Last edited: