Repost: Editing Policies

Discuss how to make your own events, policies and dilemmas, even whole new missions for the games
User avatar
cliffski
Positech Staff
Positech Staff
Posts: 7967
Joined: Sat Feb 11, 2006 10:27 am
Location: UK
Contact:

Repost: Editing Policies

Postby cliffski » Sat Feb 11, 2006 6:09 pm

If you're wondering how I created my recent Financial Auditing mod, here's a nice tutorial for creating your own policy...

First, let's take the first step: Open your policies.csv file in the data\simulation folder. If you have excel, it will be easier.

Read the "Adding new events" post for an explanation on how CSV files work.
The values come in the following format:

#,PolicyName,GUI Name,slidername,description,CANCELLABLE?,TYPE,minexp,maxep, CostModifier,timetochange,minincome,maxincome,IncModifier,#Effects,effect...

# = this is the first value. it has to be # and that indicates that this is a valid line in the file

PolicyName = this is a unique name given to the policy, and is referenced in other CSV files or policies

GUI Name = this is the name the player will see, and is (usually) gramatically correct

description = this is shown to the player in the policy details box

CANCELLABLE? = either TRUE or FALSE (case sensitive), this determines whether the player can cancel the policy

TYPE = the type of policy, must be written in all caps (TAX, LAW & ORDER, ECONOMY, WELFARE, FOREIGN POLICY, PUBLIC SERVICE, TRANSPORT)

CostModifier = when set as an object name, the cost is increased or decreased by the value of the object

minexp = the minimum cost of the policy

maxexp = the maximum cost of the policy

timetochange = this number dictates how many turns it takes for a policy to change

minincome = the minimum amount of income generated by the policy

maxincome = the maximum amount of income generated by the policy

IncModifier = same as CostModifier, but for income


#Effects = separates effects from the rest of the data

effect = effect it has on a voter group or national attribute

The format for effects is...
Object,modifier 1[operator](modifier 2 [operator] x)

For example...

GDP,0.5-(0.05*x)

For every increment on the slider put into a policy (and there are a lot of increments), the GDP will go down by 0.5 less than 5%. This is because the parenthetical dictates getting 5% of the GDP (represented by x), which the minus sign shows is being subtracted from it. However, the 0.5's presence shows that 0.5 is being added to the GDP first. This makes the effect:

GDP - (0.5-(5% of GDP))

Now that you have your policy, you'll need to create an icon. If you don't have Photoshop, you'll have to recycle one of the current icons, ask someone to make one for you, or simply do without an icon. For the first method:

Go to the data\bitmaps folder. Scroll down until you see the "icons_policyname.dds" files. Copy the one that corresponds to your icon of choice, and rename it "icons_yourpolicyname.dds". Replace yourpolicyname with the PolicyName value in the Policies.csv file.

However, if you have Photoshop, you'll need to download this plugin:

http://download.nvidia.com/developer/NV ... 5.1320.exe

With the plugin installed, open Photoshop and create a 64x64 pixel image. Fill the background with white. Click the Channels tab on the layers pallette, and click the arrow on the toolbar of that pallete. On the drop-down menu, select Create new channel.

On your new channel, draw your image, making sure not to switch to the RGB channel. Preferrably use white to remain consistent with the other icons. When you're done, save the file with the naming scheme described above, but make sure that when the File Settings box with the Nvidia logo appears, select "No Mip Maps," and in the drop down menu on the left select "DXT3 ARGB (Explicit Alpha)."

Congratulations! You've created your first policy.

Tommorrow's lesson: Situations
TiCi
Line Supervisor
Line Supervisor
Posts: 19
Joined: Mon May 01, 2006 12:39 pm

Postby TiCi » Tue May 02, 2006 1:59 pm

The format for effects is...
Object,modifier 1[operator](modifier 2 [operator] x)

For example...

GDP,0.5-(0.05*x)


Could you explain this in a little more detail?

I mean basically what happens if I change the numbers from 0,5 to something else?
User avatar
cliffski
Positech Staff
Positech Staff
Posts: 7967
Joined: Sat Feb 11, 2006 10:27 am
Location: UK
Contact:

Postby cliffski » Tue May 02, 2006 7:02 pm

GDP,0.5-(0.05*x)

translates to

the effect on GDP is to boost it by 0.5 then subtract 0.05 times the value of X, where X is whatever you are editing, such as a policy

In most cases the initial value will be 0 so for this:

GDP,0+(0.1*x)

we are basically saying this policy will have no effect on GDP at all when x is zero (which means the policy is implemented but its slider is at zero), and a +0.1 (10%) change to GDP when the policy slider is at maximum.
The reason there is that stareting value, is you can have a policy that has a certain effect regardless of the slider. So if you want a policy to have an effect of between 30 to 40% rise in GDp accross its slider you would use this:

GDP,0.3+(0.1*x)

Make sense?
TiCi
Line Supervisor
Line Supervisor
Posts: 19
Joined: Mon May 01, 2006 12:39 pm

Postby TiCi » Tue May 02, 2006 8:29 pm

Much clearer! Thanks... [Am working on new policies at the moment]
User avatar
cycloneprime
Type III Robot
Type III Robot
Posts: 87
Joined: Wed May 24, 2006 8:52 pm

Postby cycloneprime » Tue Jun 06, 2006 10:58 pm

Trying to create a policy here. However, the game won't even start a game or load a game because of my policy. I'm not sure what is wrong with it (however: i am very bad with these things). So, I can't even test it (the effects put there are just to experiment with)

Some help please?

This is my policy, which is in the mods/policies folder.

#, mino, Visible Minorities, default, "This stipulates how visible minorities, whether they are religous, ethnic, etc, are treated and respected in society. Liberals argue that to show tolerance to these groups will allow them to better integrate society. However, Patriots claim that to much liberty to express their difference will only push them to break the national spirit apart.", TRUE, WELFARE, 100, 700,, 10, 0, 0,, #Effects, "Liberal, 0.5+(0.20*x)", "Patriot, -0.5-(0.20*x)",,,
User avatar
cliffski
Positech Staff
Positech Staff
Posts: 7967
Joined: Sat Feb 11, 2006 10:27 am
Location: UK
Contact:

Postby cliffski » Wed Jun 07, 2006 8:17 am

As far as I can see, its the space in front of 'default', and the spaces elsewhere in the data. You cant have a space after the commas, the spaces screw it up. They shouldnt do, thats poor coding by me, but remove them and it loads fine :D
User avatar
cycloneprime
Type III Robot
Type III Robot
Posts: 87
Joined: Wed May 24, 2006 8:52 pm

Postby cycloneprime » Wed Jun 07, 2006 1:46 pm

thanks
that was indeed the problem
User avatar
DreamTwister
Supreme Robot
Supreme Robot
Posts: 107
Joined: Mon May 29, 2006 12:24 pm
Location: Poland

Postby DreamTwister » Sat Jun 10, 2006 9:45 pm

I have a question about the exact format and limits of setting policy effects.
I know that both * and ^ symbols can be used,but what about other arithmetic operations? Is there any way ,for example,to make policy effects regarding something very positive when it is set 0.5+ but only a little negative when 0.5- without using ^ symbol? (if i use the ^ symbol the max or min value will have to be 1.0,wchich i would like to avoid).
frost_maze
Line Manager
Line Manager
Posts: 33
Joined: Fri Oct 05, 2007 7:09 pm
Location: Londinium

Postby frost_maze » Fri Oct 05, 2007 7:16 pm

How do you use the 'everyone' voter group? I tried using it like any other, as in:

Code: Select all

Everyone,-0.03-(0.03*x)


But it doesn't work.

Also, is there a way to increase cynism in the public as a result of a policy?
And come to think of it, what is cynism (or the lack of it)?

And what does this mean:

Code: Select all

_security_,0+(0.15*x)
User avatar
cliffski
Positech Staff
Positech Staff
Posts: 7967
Joined: Sat Feb 11, 2006 10:27 am
Location: UK
Contact:

Postby cliffski » Sat Oct 06, 2007 8:25 am

security is the value that decide if a terrorist attack works. Everyone is actually called _All_ as I recall (have a look in the voters group spreadsheet.

Return to “Modding (democracy 1)”

Who is online

Users browsing this forum: No registered users and 1 guest