Rupe
Apr 25, 2007, 02:50 PM
Can anyone tell me if there is a way to make a unit obsolete. I am trying to make it impossible to build a settler after X tech has been discovered. I Like the size of the bigger maps when I play but hate the fact that the whole planet is covered with cities. I couldn't see any obvious place to make this kind of change in the assets files.
Or is there a way to put a limit on the total number of cities there can be either in the wold or per civ.
I like having huge battles over open terrain and like to have a more natural looking world. Thanks for any help.
primordial stew
Apr 26, 2007, 01:29 AM
It depends on exactly what you want. Here are some options:
The simplest way is to really limit the number of civs, and play on the biggest map. Eventually they should stop expanding.
Python would be the most flexible method to implement this. I don't know off hand what would be a good way (disable the settle function after a date, don't allow settlers to be built if the active civ already has too many cities..).
In just xml.. try adding "settler_not" (set bFound to 0) as a unit which the settler unit upgrades to. Have the settler_not available with some mid-game tech.
Yet another way would be to give each civ some number of settlers when the game starts, and then in the xml change the iCost of a settler to -1. This makes them unbuildable. Or, make them national units, but allow 0 (in the unitclasses file). Either will work.
ripple01
Apr 26, 2007, 08:27 AM
It might be possible to do in XML only, you can make a new unit called "Settler 2" or whatever unlockable with tech x, and then make the original settler upgrade into Settler 2. Then simply make the Settler 2 unit unbuildable.
It's a little messy, but it should accomplish what you want to do.
[EDIT]
I realize this sounds a little confusing, let me know if you need clarification...
Rupe
Apr 26, 2007, 08:13 PM
Thanks for the replies. I thought that the options you two provided would work but wanted to check to see if I could judt edit the settler itself. Just lazy i guess. I will try the method that has the settler upgrade to a new unit at the time I want them to be unbuildable then make the new unit unbuildable. I have never added a unit before so I will have to look up some info on how to do that but I am guessing I might be able to just copy the original settler info and just change the name and some other info. I will give it a try. Thanks for the help.
Amra
Apr 26, 2007, 08:25 PM
You could try adding the following code to the GlobalDefinesAlt.xml file in your mod's Assets\XML directory.
<Define>
<DefineName>MIN_CITY_RANGE</DefineName>
<iDefineIntVal>2</iDefineIntVal>
</Define>Change the "2" to something higher like maybe a "4". Basically, this code forces the both the player and the AI to build all cities a minimum of "X" squares apart.
In my mod I have it set to "3" which gives a little more space but maybe not as much as you want.
ripple01
May 04, 2007, 03:48 PM
Hey Rupe,
Just curious, did my suggestion work for you?
Cheers,
ripple01
Zebra 9
May 04, 2007, 06:28 PM
If you'd like I could realy easy do up the python (I've already done it:lol:).:goodjob: