Editing Rules.txt

ADVANCES

You don't have to have new advances to have new units, but I usually do. The easy way to make new advances is to use the tools that came with the Fantastic Worlds CD. I won't go into this, as the Fantastic Worlds manual tells you how to use them. The other way to program new advances is to change the rules.txt. This is risky business so I suggest you have a back up of this file first. The rules.txt file is in the main Civ2 directory. To edit it you can use any program that can read text files. I use a program called X-Tree Gold, but hardly anyone uses this, so if you don't have this I suggest you use Wordpad. To change or add new advances go down to the section that says "Civilization Advances". There is a vague description of how to change advances. Sometimes this is hard to understand, so I will try to explain it more. I will use the Advanced Flight advance as my example. The green words are the values that Advanced Flight has.
The first value is the name of the advance. Advanced Flight.
The second value is the AI value. This is how highly the computer rates the advance. The higher it is the more valuable it is in trades and the more likely the computer is going to research it. So if the value was low the computer would usually only research it if there was nothing left to research and you couldn't trade a low one for a high one. This is the reason why the computer also demands Gunpowder. 4.
The third value is the AI modifier. This determines what sort of personality leader will research it. If the value is negative, the leaders more interested in war will want this technology while the leaders interested in peace will shy away. It is exactly the opposite if the value is positive. A value of 0 means both will want the advance. -2.
The forth and fifth values are the prerequisites. These are the technologies that you must discover before you can discover that advance. Each advance has an abbreviation of two or three letters, that are used here. The abbreviation of the current advance is the value at the end. It is good if you can learn these abbreviations as it speeds up changing advances. You can also place the value of "nil" as one of the prerequisites. So if you have one advance and nil, you can research the new advance as soon as you discover the first prerequisites. If the prerequisites are nil and nil, you can research this as the start of the game. Radio and Machine Tools, which are abbreviated to Rad and Too.
The sixth value is the Epoch. All this does is determine which picture the advance is given. 0 = Ancient, 1 = Renaissance,
2 = Industrial Revolution, 3 = Modern. 3.
The seventh value is the Category. Again, all this does is determine which picture the advance is given. 0 = Military, 1 = Economic, 2= Social, 3 = Academic, 4 = Applied. 4.
The final value as mentioned before is the abbreviation the advance is given. The abbreviation is used to determine prerequisites and for determining what advance you need to build a unit. That will be explained later. Again it is good if you can learn these abbreviations. AFl.
So when all complete this is what the line for Advanced Flight looks like:
Advanced Flight, 4, -2, Rad, Too, 3, 4 ; AFl
Always use commas to separate values except for the abbreviation where you use a semi-colon. When editing the rules, you don't have to keep the values in line but it does make it easier to manage. Now let's try to make one of our own.
Advanced Tactics, 5, -2, Gue, Nil, 3, 0 : ATc
This advance would be called Advanced Tactics.
The computer would want to research it very quickly.
It would appeal to the militaristic leader and not the perfectionist.
You need to discover Guerilla Warfare before you can research it.
It is a Modern Military advance.
Its abbreviation would be ATc.
When making new advances you can either replace one of the existing ones of use one of the User Defined Slots. There are three of these, though if you have the Fantastic Worlds add on you will have an additional seven extra spots. When using these extra spots you must keep the abbreviation of U1 or X1. You also cannot change the abbreviation of Future Technology. That is about all you need to know about changing advances. Just remember to have a back up of these files, before you edit them.

UNITS

Well after making a new technology to discover, you can make a unit that comes with that technology. Again you can use the Fantastic World tools or edit the rules.txt with the same program you used to edit the advances. Again make sure you have a back up of the rules.txt. So open the rules.txt file and scroll down until you reach the "Unit Types" heading. Underneath there is a vague description. Again I will try to explain this in more detail. This time I will use the Phalanx as the example. Again the green words are the Phalanx's values.
The first value is the name of the unit. Phalanx.
The second value is when the unit becomes obsolete. Again you use the abbreviations that are designated to the advances as mentioned earlier. So when you discover the advance, you can no longer build this unit. A value of nil means the unit is never obsolete. Feu which is Feudalism.
The third value is the domain. This means if the unit is a land, sea or air unit. 0 = Ground, 1 = Air, 2 = Sea. 0.
The fourth value is the movement. The number here shows how many movement points the units gets each turn. Thought this can be altered if the unit is damaged. 1.
The fifth value is the range. You must put a 0 here for land and sea units. I don't know what happens if you put a 1, because I have never tried it, but the game would probably go crazy. This is only for air units. This shows how many turns the unit can go without fuel. If the value is one the unit must refuel every turn. If it is two, the unit must refuel every second turn. If an air unit has a value of 0 for range, it becomes like a helicopter and loses hitpoints for each turn it does not refuel. 0.
The sixth value is the attack strength. This is the unit's attack score that comes into calculations, if the unit attacks another. This makes the unit more likely to hit another unit in combat. 1.
The seventh value is defence strength. This is the unit's defence score that comes into calculations when being attacked. This makes a unit more likely to avoid being hit in combat. 2.
The eighth value are the hit-points. This is a number x10. So if the value is 1 the unit has 10 hitpoints and so on. Hit-points are just how many hits unit can take in combat. 1.
The ninth value is the firepower. This is important, because this is what gives modern day units an edge above ancient units. The firepower is how much damage is done when the unit hits another in combat. So the bigger the firepower, the quicker the unit can win a combat. 1.
The tenth value is the building cost. This value x10 is how many shields you have to raise to produce a unit. So if this value is 1 you would need 10 shields to build the unit. If the value is 6 you would need 60 shields to build the unit. 2.
The eleventh value is how many units it can hold. This only applies to sea units. 0.
The twelfth value is the role of the unit. The role is just so the computer knows how to use the unit. Here is a list of the roles. 0 = Attacking unit. The computer will use this unit to attack opponents.
1 = Defensive unit. The computer will use this unit to guard cities.
2 = Naval Superiority. The computer will use this unit to attack other boats.
3 = Air Superiority. The computer will use this unit to attack other units.
4 = Sea Transport. The computer will use this unit to transport other units and won't use it to attack other boats.
5 = Settle. This gives the unit the power to build cities, fortress, mines, roads and improve the land.
6 = Diplomacy. This gives the unit the power to going into an enemy city and function as a diplomat or spy.
7 = Trade. This gives the unit the power to carry goods to trade with other cities.
So use this to give units special powers or to tell the computer how you want to unit to be used. 1.
The thirteenth value is the prerequisite of the unit. This means, you have to discover this advance to build the unit. Again it uses the abbreviations of the advances as mentioned above. A value of nil means you can build the unit from the start of the game. Bro.
The fourteenth and final value is the flag. This is what you edit to give a unit special powers. Here is a list of the flags:

100000000000000 - Unit can spot submarines.
010000000000000 - Defence is doubled against air units.
001000000000000 - Destroyed after attacking.
000100000000000 - Free support for fundamentalism
000010000000000 - Defence is doubled against mounted units.
000001000000000 - Treats all squares as roads.
000000100000000 - Can make paradrops.
000000010000000 - Can carry air units.
000000001000000 - Negates city walls.
000000000100000 - Ship must stay near land.
000000000010000 - Can attack air units.
000000000001000 - Submarine advantages and disadvantages.
000000000000100 - Can make amphibious assaults.
000000000000010 - Ignores Zones of Control.
000000000000001 - Two space visibility.

Use these flags wisely and make it so they make sense. That is, don't have a land unit that must stay near land and so on. These are powerful tools. You can also use more than one number 1 in each flag, so you can have all 1's if you wanted, though it wouldn't be very good. 000000000000000.
These are all of the values that a unit needs. Here is the complete line for the Phalanx.
Phalanx, Feu, 0, 1., 0, 1a, 2d, 1h, 1f, 2, 0, 1, Bro, 000000000000000.
You must have commas between each value and you must use the letters a, d, h, f after their value and you must have a full stop after the movement points value. Now let's make a unit of our own that comes with the advance we made before.
Commando, nil, 0, 2., 0, 6a, 6d, 2h, 2f, 6, 0, 0, ATc, 100001100010111.
This is an elite unit here is a description:
This unit is called a Commando.
It never becomes obsolete.
It is a land unit.
Every turn it has two movement points.
It has an attack strength of 6.
It has a defence strength of 6.
It has twenty hit-points.
It has a firepower of 2.
It costs 60 shields to build.
It is an attacking unit.
You need Advanced Tactics to build one.
It can spot submarines, it treats all squares as roads, it can make paradrops, it can attack air units, it can make amphibious assaults, it can ignore Zones of Control and it has a two space visibility.
Now you have a new unit to go with the new advance. Again there are three spots to put new units, or if you have Fantastic Worlds there are another eight spots, or you can just go over some of the old units. This is the first half of making a new unit. Read on for the second half of making one.

The second half of making a new unit, is giving it a picture and a new sound. This is important, because if you place the Commando over the Pikemen slot in the rules, the Commando would look like a Pikemen, so you have to change the picture. To edit a picture of the unit, you will need a program. I like to use Paint Shop Pro so all of the instructions I give will be for Paint Shop Pro. The program must be able to cut and paste, unless you are a really good drawer. The file you need to edit is called Units.gif. I suggest you make a back-up of this file before editing it. So go into your editing program and open Units.gif. You will see a picture with all of the units in the game. Now you will have to put in your own units. You can either draw your own in, which is hard if you can't draw very well, or you can download pictures of the internet. Many sites have files that have pictures you can use. Once you have downloaded your pictures, you will have to open that file as well. So now you have two files opened. Units.gif and the one you downloaded off the internet. Now go to the file you downloaded off the internet. Zoom in to about 5:1 size then go up to the toolbar and click on the dotted rectangle. To highlight the unit use the cursor and click on the top right corner of the unit's box. Then drag the cursor to the bottom left corner and let go. Now you should see that the unit is being surrounded by a flashing rectangle. This is the selected area. Make sure you have got just the unit and nothing else. You should also have the green border with the unit. When the unit is highlighted go to the top and click on the copy button. This button has two pieces of paper together. Then go back to the Units.gif. Go to edit, paste, as new selection, or just go Control-E. You will now see that the unit you highlighted before is floating around and you can move it. Now place that unit over the unit you want to replace. So if the Commando took the place of the Pikemen, you should put the new picture over the Pikemen. Once it has stopped moving, zoom in to make sure it is properly aligned with the other units. Now that you have placed the unit in it's spot, you can now either place another one, or save. Don't use "Save as" as that doesn't work. You will have to use "save". So make sure you have a back-up of Units.gif. If your unit was placed in the User Defined Slots, you need to replace those weird units that aren't in the game. If you have the Fantastic Worlds add-on, the extra units will have the number 1-8 on them and a picture of the Barbarian leader. Now you have finished putting the picture in, you can now make the unit have a new sound.

To make a new sound, you must know what sound you want the unit to have. We shall give the Commando unit the same sound the Marine has. This file is called Mchnguns.wav. Since we are replacing the Pikemen, which has the sound of Swordfgt.wav. So you will need to copy Mchnguns.wav over Swordfgt.wav. I use X-Tree Gold as well for this, though I think you can just use Windows Explorer to copy the file over the other file. Now that you have done this, the Commando will now will have the same sound as the Marine. So will the Warrior, Phalanx, Legion and other units. So this would only work if you had a scenario in the future, where these units would not be produced. Another way to do this is the custom sound method. If you placed the Commando in one of the User Defined Slots, say number 1, you would have to do this. You would have to make a copy of the Mchnguns.wav and then name it Custom1.wav and put it into the sound folder. When you have finished making your scenario, all of the sounds that you have edited have to be in a "sound" folder. This folder should be inside the scenario folder where the .scn file is. Now you have a unit with new values, a new picture and a new sound. That is how to make a unit.

TERRAIN

Now, if you are doing a scenario that is not on Earth you will want a different terrain to show this. To edit and terrain you will need to open up the rules.txt file again. Once you are at rules.txt scroll down until you get to the heading, Terrain. There is a description there about how to change terrain. Hopefully I can explain it in more detail. There are two types of terrain in the list. There are base terrain, such as plains and grassland. There is also resource terrain, such as buffalo and oil. The resource terrains only have the first few values but those first few are the same for the base terrain. I will use hills as my example.
The first value is the name of the terrain. Hills.
The second value is the movement cost. 2.
The third value is the defence rating of the terrain. To work this out is the number x 50%. So if there was a value of 4 the unit defending there would have double defence strength. 4.
The fourth value is how much food the terrain produces without improvements. 1.
The fifth value is how many shields the terrain produces without improvements. 0.
The sixth value is how many arrows the terrain produces without improvements. 0.
The following values only apply to base terrains. Resources don't have the following attributes.
The seventh value is whether the terrain can be irrigated. If the value is yes it means it can. No mean's it can't, though sometimes there is an abbreviation. This means that when you irrigate that land, that square becomes the terrain that has that abbreviation. The abbreviation is at the end of the line. Yes.
The eighth value is how much extra food the terrain produces when it is irrigated. 1.
The ninth value is how many turns it takes for a Settler to irrigate that terrain. 10.
The tenth value is what level of government the computer is when it starts to irrigate that terrain. 0 = Never, 1 = Despotism, 2 = Monarchy, 3 = Communism, 4 = Fundamentalism, 5 = Republic, 6 =Democracy. 0.
The eleventh value is whether the terrain can be mined. Again it is either a yes, no or the abbreviation of the terrain that it will become if you mine it. Yes.
The twelfth value is how many extra shields are produced in that terrain after you mine it. 3.
The thirteenth value is how many turns it takes Settlers to mine that terrain. 10.
The fourteenth value is what level of government the computer is when it starts to mine that terrain. The same numbers apply to this as they did earlier. 1.
The fifteenth value is what occurs if you transform that terrain with an engineer. Again it uses the abbreviations of the terrain. Pln which are Plains.
The sixteenth value is the abbreviation of the terrain. This is used in the line for the transformation and other values. Hil. So those are all of the values. Here is what the hills command line looks like: Hills, 2, 4, 1, 0, 0, 0, Yes, 1, 10, 0, Yes, 3, 10, 1, Pln ; Hil Each value must be separated with a comma. Again it is a good idea to keep all of the values aligned with each other. Now let's make a terrain of our own. Beach, 1, 2, 1, 0, 1, Yes, 2, 10, 5, For, 0, 10, 0, Pln : Bea This new terrain square would be called Beach.It would take 1 movement point to move across it.A unit would have normal defence strength, if defending on this terrain.The Beach would produce 1 food.It would produce 0 shields. It would produce 1 arrow.It can be irrigated.Irrigation gives it 2 extra food.It takes ten turns to irrigate.The computer would have to be a Republic or higher to start irrigating the terrain.If it was mined it would become a forest.It would not produce any extra shields.It would take 10 turns to make it into a forest.The computer would never want to mine it.If an engineer transformed it, it would become a Plain.Its abbreviation would be Bea.So there we have a new terrain. To make a new resource you just have to edit the resources of them. But to make a new resource appear on the right terrain you have to make a correct replacement. So say if the Beach went over Swamp. Your resource for the beach would have to be over Peat or Spice. Now that you have the attributes for the new terrain you have to have a new picture for the terrain.

The process is similar to editing the Units.gif but this time you are editing Terrain1.gif and Terrain2.gif. Go into Paint Shop Pro and open this two files. They are in the Civ2 directory. Again you can either draw your own or use another file. If you are using another file open that as well. So just copy the picture you want and then paste over the terrain that you overwrote. So say if we put Beach over swamp, you would paste a picture of a beach over the picture of the swamp. It gets hard if you placed your new terrain over Mountains, Forest, Hills or Ocean. I suggest you only replace these if you have to. If you do you will need to copy your new picture over all of the squares. These terrains are in the Terrain2.gif file. Forest, Hills and Mountains have 16 pictures each, because they change appearance when next to each other. You can either have a different picture of the terrain you have made and put them over each of the existing picture, using the tile-connections at the top to guide you, or you can just place the same picture over all of the 16 existing pictures. This is a very brief explanation, so I don't recommend going over these terrains. Changing ocean is even harder, because you have keep the coastline. This is very hard, so don't ever put something over the ocean terrain unless necessary. You can experiment with the ocean though, but make a backup of the file first. Now we have a new terrain, that has new attributes and a new picture. You can now incorporate this into your scenario.

CITY IMPROVEMENTS AND WONDERS

To change these, go back to rules.txt and go down to the section under advances. You can't do much with City Improvement and Wonders except change their name, how much it takes to build them and how much maintenance they require. Here are what the numbers mean.The first value is the name of the City Improvement.The second value is how many shields you need to build one. This value is x10, so 4 means it takes 40 shields to build that improvement.The third value, is how much gold a turn it take to maintain the building.The fourth value is what technology you need before you can build it. Again it uses the technologies abbreviations.To change the icon of a City Improvement are wonder, you will have to go to Paint Shop Pro and open Icons.gif. Now you will have to copy and paste a new icon over the existing one. You can also change the icons for everything in the game. Another tool is to say when a Wonder expires. Go back to the rules.txt and go to where it says "Expiration advances for Wonders of the World". The first value is the abbreviation of the advance that makes the wonder expire. If there is a nil there, the Wonder never expires. You cannot change what a City Improvement or Wonder does. You can only change cost, upkeep, expiration advance, prerequisite and icon.

LEADERS

To edit civilization leaders, open the rules.txt and go down to the heading Leaders. There is a brief description. I will attempt to explain it in more detail. I will use the Romans as an example. The green words are the Roman attributes.
The first value is the male leader's name. Caesar.
The second value is the female leader's name. Livia.
The third value is the default gender of the leader. This just means the when the computer plays as this civilization they will always be this gender. 0 = Male, 1 = Female. 0.
The fourth value is the colour of the civilization. To change the actual colour, you have to edit the Cities.gif file. This just means what flag they have. 1 = White, 2 = Green, 3 = Blue, 4 = Yellow, 5 = Light Blue, 6 = Orange, 7 = Purple. 1.
The fifth value is what city style the civilization is. 0 = Bronze Age, 1 = Classical, 2 = Far East, 3 = Medieval Castle. To change what a city looks like you have to edit the Cities.gif file. This just means what set of city to use. 1.
The sixth value is the plural. This means what are the people of the civilization called. Romans.
The seventh value is the adjective. This is how you would describe a city. Roman.
The eighth value is their personality if they are attacking. 1 = Aggressive, -1 = Rational, 0 = In between. 0.
The ninth value is their personality if they are expanding. 1 = Expansionist, -1 = Perfectionist, 0 = In between. 1.
The tenth value is their personality if they are civilized. 1 = Civilized, -1 = Militaristic, 0 = In between. 1.
The eleventh value is if they have different titles from the specified ones. The specified ones are listed under the heading government. To change a title just write the number of government, 0 = Anarchy, 1 = Despotism, 2 = Monarchy, 3 = Communism, 4 = Fundamentalism, 5 = Republic, 6 = Democracy, and then the title that you want to go with that government. 1, Dictator, Dictator, 2, Imperator, Imperatrix.
These are all of the values for changing a leader. Here is the Roman command line:
Caesar, Livia, 0, 1, 1, Romans, Roman, 0, 1, 1, 1, Dictator, Dictator, 2, Imperator, Imperatrix.
Each value must be separated with a comma. Again try to keep all values in line with others. That is how to edit the leader of a civilization. There are some examples in the rules.txt.

EFFECTS AND NAMES

These are the only remaining things that we haven't covered in the rules.txt. Effects is at the top under Cosmic Principles. There is a description given for each value, so I won't cover it. Just experiment with these to see what they do. Also through the rules.txt, you can change names of things. You can change the names of governments, caravan commodities, difficulty levels and attitudes. But while you can change the names of these you can't change the effects of them. They will always remain the same. You can only make it fit into your scenario by changing it's name to suit you.

Well, that covers it. You now know how to edit the rules.txt to make a great scenario. Always remember to have a backup of the rule.txt file and all of the other ones you may edit. Thank you for reading the guide, if you have any problems with editing or you think I should add something to this guide e-mail me at halljulian@giga.net.au. Thanks.

 

BACK TO TIPS PAGE

If you have any suggestions, comments, or information please email me at civjar@oocities.com

.................

| Home | Modpacks | Scenario |Maps |Utilities| Mod Files |Links | About Author | Spanish Version