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

Pancakelord

Lord of Pancakes
44 Badges
Apr 7, 2018
3.375
12.292
  • Cities: Skylines - Green Cities
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Ancient Relics
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Imperator: Rome
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Cities: Skylines Industries
  • Imperator: Rome Deluxe Edition
  • Magicka: Wizard Wars Founder Wizard
  • Stellaris: Nemesis
  • Europa Universalis IV
  • Stellaris: Necroids
  • Sword of the Stars
  • Crusader Kings III
  • War of the Roses
  • Cities: Skylines
  • Stellaris: Federations
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris: Lithoids
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Stellaris - Path to Destruction bundle
  • Stellaris: Megacorp
  • Stellaris: Synthetic Dawn
  • Crusader Kings II
  • Stellaris
  • Cities: Skylines Deluxe Edition
  • Sword of the Stars II
  • March of the Eagles
  • Darkest Hour
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).
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 }
            }
        }
Right now I only know of 2 "types" that will work - COUNTRY and PLANET (and these can be used as follows [parameter:parametername.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:parametername.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.
1620487392396.png


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.
1620486666196.png

1620487606648.png


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:
If you're having trouble with processing on daily ticks a handy trick is to use if = { limit = { NOT = { [CHECK YOUR FLAG NAME HERE] } [The process and checks you want to run] } }

After running the check that you want to be monthly add [YOUR FLAG NAME HERE] for 29 days. That way you'll shorten the lag on all but 1/30th of days.