Modding new Voter Types

Post your mods, mod information requests and suggestions here for the new version of the game (democracy 2)
User avatar
cliffski
Positech Staff
Positech Staff
Posts: 7974
Joined: Sat Feb 11, 2006 10:27 am
Location: UK
Contact:

Modding new Voter Types

Postby cliffski » Sat May 10, 2008 4:28 pm

I'm really doing it this time. see....

Image

Updates to come...
User avatar
cliffski
Positech Staff
Positech Staff
Posts: 7974
Joined: Sat Feb 11, 2006 10:27 am
Location: UK
Contact:

Re: Modding new Voter Types

Postby cliffski » Sat May 10, 2008 7:11 pm

Ok it's in and working, in a limited way. I want some modders feedback on the way I've done it, and any suggestions as to how to improve it. I also need some guinea pigs to give the mod-supporting version a try :D

The new system supports just 3 extra voter types, it expands the block of strips in the middle to squeeze them in. Is that ok? or a bit too limiting?
Anyway, the new voter types are loaded as seperate text file from a new subdirectory under the mods dir. They use the same format as the votertypes.csv but in plain text.
BUT
I added a new field to votertpes.csv which is 'opposite'. It's no longer hard coded that socialists are the opposite of capitalists etc, but it's in data, allowing for you add new groups that are opposites. Unfortunately you can change the opposites for existing groups without editing votertypes.csv.

So...... the big problem was how to allow for new votertypes, without really hacking up all the simulation csv files to add new effects everywhere, making it a bit of a beast to release as a text-file only mod.
The solution is a new scriptable function:

Code: Select all

CreateEffect("IncomeTax","Atheists",0-(0.2*x),4);


(it's a silly example). So this creates an effect FROM income tax TO the new atheists group, with the given effect and inertia of 4.
So far so good, but WHERE can these run from?

tada!
The new mods/data/autorun scripts directory! bung any text file in here with any script and it will run at the start of a game (or when loading a game in).
So in THEORY, this means you can add up to 3 new votergroups to the game, AND effects from them and to them from everything else in the game, all within the mods dir (and thus easily installed).
Any questions? volunteers?

Cheers!
TomPhil
Supreme Robot
Supreme Robot
Posts: 323
Joined: Tue Jan 23, 2007 12:48 pm
Location: Stockport, UK

Re: Modding new Voter Types

Postby TomPhil » Sat May 10, 2008 8:00 pm

It's a while since I did any modding of Democracy but it sound great. I especially like the new autorun directory. I'd be happy to test it for you and give you some feedback.

P.S. Some minor feedback before I even get to test it - would it be best to add the new line to the top rather than the bottom, as that would allow the "everyone" group to stay at the bottom right. It looks a bit funny at the moment to be almost at the bottom right but then to have an extra group of voters below it?
User avatar
cliffski
Positech Staff
Positech Staff
Posts: 7974
Joined: Sat Feb 11, 2006 10:27 am
Location: UK
Contact:

Re: Modding new Voter Types

Postby cliffski » Sun May 11, 2008 8:41 am

aha good point. I'll fix that, then email you a link to the new build.
User avatar
DreamTwister
Supreme Robot
Supreme Robot
Posts: 107
Joined: Mon May 29, 2006 12:24 pm
Location: Poland

Re: Modding new Voter Types

Postby DreamTwister » Sun May 11, 2008 6:03 pm

Hi, would it be possible to add some kind of slider to the interface to allow an unlimited amount of new Voter Groups to be added ?

If it would be too hard for you to do at this time, maybe include at least the option to add 6 new voter groups ,not 3. I think it is a big difference in case of voter groups.Three can be still limiting while you can possibly describe all sensible new unique groups available within a 6-group limit.

Also, will the normal CSV modding of the new voter groups still possible ( not using the new script functions ) ?
User avatar
cliffski
Positech Staff
Positech Staff
Posts: 7974
Joined: Sat Feb 11, 2006 10:27 am
Location: UK
Contact:

Re: Modding new Voter Types

Postby cliffski » Mon May 12, 2008 7:16 am

I don't think I'll have time this week to enlarge beyond 3, bit maybe in the future. As for the csv editing, yes it will be up to you which method to use, obviously the less mods fiddle with the core shipping game data, the better to avoid introducing bugs etc.
User avatar
DreamTwister
Supreme Robot
Supreme Robot
Posts: 107
Joined: Mon May 29, 2006 12:24 pm
Location: Poland

Re: Modding new Voter Types

Postby DreamTwister » Mon May 12, 2008 4:22 pm

I just thought that the new autorun scripting system might be a good way to mitigate the "too-low starting support" flaw mentioned by some (the fact that too often you get very low poll values like 18.49% voters at the start of the game, while they should reasonably be over 50 percent just after winning the initial election). You could simply add several CreateGrudge commands to the autoscript , influencing Everyone and several other major votergroups, with values like ,0.4,0.8 or something similar. This way we can have the cosmetic effect of having high support just after the election, without influencing the real chances of winning the game much ( the effect would wear out quickly). Will commands like the CreateGrudge work in the autoscript ?
cary123
Type III Robot
Type III Robot
Posts: 79
Joined: Thu Jul 12, 2007 7:42 pm

Re: Modding new Voter Types

Postby cary123 » Mon May 12, 2008 8:55 pm

will we be able ot add votergorups to current policys?like potheads to nacrotics
Under socialism all will govern in turn and will soon become accustomed to no one governing.
- Vladimir Lenin -

All history has been a history of class struggles...
Friedrich Engels

Socialism needs democracy like the body needs oxygen.
Leon Trotsky
cary123
Type III Robot
Type III Robot
Posts: 79
Joined: Thu Jul 12, 2007 7:42 pm

Re: Modding new Voter Types

Postby cary123 » Tue May 13, 2008 3:07 am

and im willing to test :)
Under socialism all will govern in turn and will soon become accustomed to no one governing.
- Vladimir Lenin -

All history has been a history of class struggles...
Friedrich Engels

Socialism needs democracy like the body needs oxygen.
Leon Trotsky
User avatar
cliffski
Positech Staff
Positech Staff
Posts: 7974
Joined: Sat Feb 11, 2006 10:27 am
Location: UK
Contact:

Re: Modding new Voter Types

Postby cliffski » Tue May 13, 2008 7:13 am

yes you can add groups to existing policies, just by using the add effect stuff. essentially its the same as adding an effect or an influence to a policy, you just do it somewhere else.
User avatar
cliffski
Positech Staff
Positech Staff
Posts: 7974
Joined: Sat Feb 11, 2006 10:27 am
Location: UK
Contact:

Re: Modding new Voter Types

Postby cliffski » Fri May 16, 2008 12:33 pm

Ok, this is now released in version 1.17, check the patch thread in the main Democracy 2 forum for details. I added in the USA mission too. It all works as listed here but is limited to THREE new voter groups at any one time, so you need to limit your mods to just three.
Any questions or feedback just let me know! Enjoy!
User avatar
jeffryfisher
Type III Robot
Type III Robot
Posts: 72
Joined: Wed Nov 07, 2012 11:58 pm

Re: Modding new Voter Types

Postby jeffryfisher » Sat Apr 20, 2013 10:30 pm

cliffski wrote:aha good point. I'll fix that, then email you a link to the new build.


Or you could move "Everyone" to the upper left where most people start scanning any array of info.

Edit: Oops, I had several threads open and wrote without noticing that this isn't one of the D3 ones. Still an idea though.

BTW, unlimited voter groups could be implemented (visually) with a scroll bar.

Return to “Modding (democracy 2)”

Who is online

Users browsing this forum: No registered users and 1 guest