Ive recently been playing around with an internal politics mod too, I wonder if ours could play off of each other in some way? I've been implementing a full election system for democracies, along with the requirement to form essentially coalition governments out of the factions running for election.
[...]
Obviously there is still a lot of work left to do yet, modding the UI can be a real pain.
Are you using Agendas at all in your mod?
I've spent the last 3 hours trying to get one to work, trying every loophole I can think of with them, and my god the sheer amount of spaghetti code that must exist behind the oligarchic/dictatorial election system is just bloody awful.
I'd planned to add agendas to populists to emancipate (then have them stand down if that gets passed) but it's not worth the headache lol. It seems the adgendas.txt file is based on
old old stellaris practices, it doesn't support sequential files/enumeration, like how defines does, for example, You've got to overwrite the thing wholesale, and 90% of the time custom agendas wont spawn for me even if they should, like the game has some weird hidden internal index set up to fetch them, beyond the exposed weights. Not touched mandates (democratic one) but a quick skim of the wiki at least indicates they're a little more customisable.
It's also worth noting - for anyone whose modding elections - that these on_actions ONLY work for
democratic elections - not for oligarchic/dictatorial ones:
Code:
# Called when an election starts
# scope: country
on_election_started = {
}
# Called when an election ends
# scope: country
on_election_ended = {
}
I spent way too long scratching my head over that crap wondering if i'd missed a bracket or a scope that the error log wasnt picking up, but nope it wont fire an error as it doesnt see oligarchic elections as... elections. Total. Spaghetti. Code.
Anyway got what i wanted to do working in the end via traits at the same time as the party leader is created (or re-made in some situations).
Emancipationist rulers (and down the line other rulers will get their own perks as appropriate) spawn with a special ruler perk, if elected slaves gain +300% PP (might increase this further to 400 or 500%, see stab effect below, 300% still isnt enough to incite empire-wide riots lol)
slave PP with a populist leader in power
slave pp with a populist leader in power AND a slave-processing centre on the world.
base_pop_pp*(stratum PP reduction = -75% for slaves)*(1+[300%pp_increase from my new trait-25% pp from slave processing centre])
1.0 *(1-0.75)* (1+[3.00-0.25]) = 0.9375
PP calculations are a hell of a drug. Even when slaves outnumber masters 2-1 and have 0% happiness AND have +300%(3x) PP, this still isn't enough to make a world dip into <50% stability [let alone the <40% for some events to fire) Planet stability is so absurdly balanced in stellaris, you have to be lobotomised to trigger a riot lol.
Now lets look at that worlds stability again but jack up the ruler perk from +300%(3x) to +500%(5x) slave PP.
33 slaves : 15 free masters (2.2:1 ratio, not bad could be better a good slave world might have 3+x slaves to masters).
+5x slave pp causes stability to drop from 57% to 41%
Maybe I should go for broke and just make it +1000% PP for slaves, seeing as this is going to be such a rare event. I essentially want it to be that if a populist comes to power (unhappy) slaves get very rowdy very fast, and within 6m you get an ultimatum (the ultimatum just needs to fire after N months of a leader of the emancipation party - or atleast a leader with that custom trait coming to power) to ban slavery (works for AI too) or risk a full-on uprising.
This would be one of the two main methods for an empire-wide uprising, the other being a slow burn over time if the faction gains traction.
Also need to give it a custom icon..
Edit:
What 10x slave PP looks like, same situation as above but it drops from 57% to 9% stability, rather than 41% lol (10x ...
might be overkill, maybe 6 or 7x is best? More testing needed.)
It might be a little unrealistic to have a pro-emancipation lobby group representing slaves, but it might lead to a rare case where AIs elect one of these parties and the above occurs which leads to more interesting galactic scenarios, and that's what I'm all for.
(my incumbent ruler running as an independent after a government change and winning a majority lol)
(in theory it's possible to use events and flags attached to attraction modifiers and PP scalars to "rig" other empires elections ... though I wont be doing it for this mod, as that's a very different beast, also I have a feeling PDX will flesh out hooks in that area a lot with 2.9, so i'll stick to factions and skip espionage)
I'll look in to adding an empire event (X empire has given in to slave demands, Y empire has elected a [advanced faction leader]*, Z empire has fallen into civil war with N faction)
* certain AI elections will be important to keep in mind when I eventually do the Ultranationalist special faction, letting (militarist/spiritualist and xenophobic) empires fight off a xenophobic coup/secession... or give in to their demands and become fanatic purifiers lol.