Modmakers Tutorial: Add new units, improvements, wonders, technologys, and Resources!

Plutarck

LWC Master
Joined
Nov 2, 2001
Messages
137
Location
Earth
Yes my friends, it CAN all be done! And I've even figured how to keep the game from crashing if you right-click in the wrong/right place after making such additions!

I'm thoroughly happy with my progess in whipping Civ3 into shape, even if I am rather mad at whoever the boneheaded Firaxian was that managed to think it was a good idea to hard-code the amount of tech tree icons...but I digress.

It's best to teach by example, so if you follow this tutorial by the end you will have learned how to add the Coracle naval unit, the Chichen Itza Great Wonder, the Kama Sutra Small Wonder (sure, I agree it should be a great wonder, but it's just a joke...unless you really want to be able to build a +10 happyness in all citys wonder :naughty: ), the Guild Hall improvement, and finally the technology Fascism (you can figure out how to add governments on your own. that worked before now anyway)

Terrain is not addable without a patch at this time to my knowledge, so I'm afraid you'll just have to replace/change the current ones to make any such cases.

Note: When you do the overhead zoomed in view of the city the new building (improvement or wonder) will still not show because I have NO idea where they hid those darn graphics, but few people look there anyway.

Also when adding Luxury Resources they will not have their tiny little icon in the city view. The file has no room for additions and Incense is there twice, so I have no idea how that file works. Only known bug in this whole process so far. The file can be stretched out and be given room for additions, but I don't feel like playing around till I figure out how it works right now. No real point in doing such work for such little effect at this time. Too much else to do first.




First a note for anyone at Firaxis who reads this: When you add a new technology to the game the technology with the highest number tech tree icon will crash the game if it is viewed in the civilopedia. This is do to some index which is tucked somewhere in the executable or in a currently unidentified portion of the .bic file. If the game would only use tech tree icons (found in Art\tech chooser\Icons) like it handles all the other icons then this would work without flaw.




Ok, first things first. You will need to already be somewhat familiar with the Scenario Editor (you can learn how to use it by using the helpfile that comes with it), and you will need any kind of word processor that will open, edit, and save .txt files. You will also need the Civ3CopyTool by Gramphos, which is available in the Files section of this very site. While not required I reccommend you go ahead and get the hacked scenario editor while you're at it, but it's not totally neccessary.


Now, open up your C:\Program Files\Infogrames Interactive\Civilization III directory and backup your civ3mod.bic file. This way you can go back to the way the game was before without hassle.

Now right-click your civ3mod.bic file (this is the file which contains all the default rules for civ3 games) and choose "Create Shortcut". Put this shortcut on your desktop. Makes things a lot easier as you can now just double-click it and the editor will open and go right into it. Very convenient.

You'll also need to open your C:\Program Files\Infogrames Interactive\Civilization III\Text directory. You will be editing the Civilopedia.txt file and the PediaIcons.txt file.


Now open the CopyTool, choose the aforementioned civ3mod.bic file, and choose to add 1 Unit, copy the Galley unit, flag the Rename option, and type in the name Coracle into the provided box. Now press the big Copy button and perhaps after a few OKs we're done with that.

Now open the Editor (the editor should be closed when using the CopyTool because it occassionally trys to put a file lock on some .bics) and go into the Units tab. Scroll the drop down box allll the way to the bottom and you should see the Coracle listed vei down der'.

Change it's Prerequisite to None, it's shield cost to 2, it's move to 2, it's transport capacity to 1, have it Upgrade To the Galley, and finally change it's Civilopedia Entry field to PRTO_Coracle.

Shwew! That wasn't all that hard now was it? Now comes the [sarcasm]fun part[/sarcasm]!

Close the Rules editor and save your changes to the .bic, and close the Editor. Open the Civilopedia.txt file and search for a "galley" (case doesn't matter).

When you see something like this:

; _______________________________________________NAVAL UNITS_____________________________________________


#PRTO_Galley
^
^
^The [galley] is the first naval unit you can build. These tiny, primitive ships must end each turn in a
$LINK<coastal=TERR_Coast>
square -- they are in danger of sinking if they end their turn in a $LINK<sea=TERR_Sea> or $LINK<ocean=TERR_Ocean> square.
If $LINK<The Great Lighthouse=BLDG_Lighthouse> is built, galleys may safely end turns at sea, but never ocean squares.
#DESC_PRTO_Galley
^
^
^The galley was the first ship designed for war. Introduced by the Greeks, galleys were powered by banks
of oars on each side, manned by well-trained oarsmen. These oarsmen were highly paid professionals or
patriotic citizens, not slaves and prisoners as depicted in fiction. A huge, bronze "beak" mounted at the
bow of the ship was used to ram and sink enemy ships. Because of its long, narrow hull, the galley was very
unstable in all but the calmest waters, and as a consequence its crew rarely ventured out of sight of land
for long periods of time, lest the ship be caught in a storm and sunk.

...then you're in the right place!

Right above that paste in the following:

#PRTO_Coracle
^
^
^The Coracle is first naval unit you can build. These tiny, primitive round ships must end each turn in a
$LINK<coastal=TERR_Coast>
square -- they are in danger of sinking if they end their turn in a $LINK<sea=TERR_Sea> or $LINK<ocean=TERR_Ocean> square.
If $LINK<The Great Lighthouse=BLDG_Lighthouse> is built, Coracles may safely end turns at sea, but never ocean squares. They are slow and carry only one footsoldier unit.
#DESC_PRTO_Coracle
^
^
^The Coracle is a small, rounded boat made of waterproof material stretched over a wicker or wooden frame. One of the earliest known ships that were more than just canoes, they weren't too terribly much better than canoes. But they could hold a small amount of cargo and were sufficient for water travel so long as they didn't stray too far from shore.


Leave two blank lines in between the top of the Coracle and the section marker above it, and two lines between the entry for the next unit. It's good form to comply with the pre-existing form of the file you're editing. Now save your changes. You can close it if you want, but you'll need this file again later.

Now open PediaIcons.txt. Search for Galley again. It should look like this:
#ICON_PRTO_Galley
art\civilopedia\icons\units\29galley(trireme)large.pcx
art\civilopedia\icons\units\29galley(trireme)small.pcx

The next section is for the Caravel, so ignore that. Copy the full entry for the Galley. Now jump down to the bottom of the units section (line 792 approx.) and paste it in right before the #End Units marker. Make sure it starts on it's own line, so it should look something like this:
#ICON_PRTO_Privateer
art\civilopedia\icons\units\65privateerlarge.pcx
art\civilopedia\icons\units\65privateersmall.pcx
#ICON_PRTO_Galley
art\civilopedia\icons\units\29galley(trireme)large.pcx
art\civilopedia\icons\units\29galley(trireme)small.pcx
#End Units

Now on the line #ICON_PRTO_Galley, change it to read #ICON_PRTO_Coracle. Now save your changes.

All done! Wasn't that just swell? Start up a New Game if you so choose and you'll find the Coracle waiting for you as soon as you build a city than can build naval units.

Was it as good for you as it was for me?


Next item up for bid: the Chichen Itza Great Wonder. This is almost the exact same procedure as before, so this should be simple.

Open the CopyTool and copy The Pyramids wonder (choose to add 1) and complete the Copy like last time.

Open the Editor and go to your new Chichen Itza entry at the bottom of the Improvements and Wonders tab. Make the Prerequisite Code of Laws, unflag the Industrious attribute but keep Religious flagged, change the Gain in Every City on Continent from Granary to Courthouse, and change the Culture it produces to 2 from 4. And finally change the Civilopedia to BLDG_Chichen_Itza. Save and close the editor.

Go to Civilopedia and search for Pyramid. Above the entry add the following:

#BLDG_Chichen_Itza
^
^
^Puts a $LINK<Courthouse=BLDG_Courthouse> in every city on the same continent.
^
^
^
^
^
^
^May trigger $LINK<Golden Age=GCON_Golden_Age> for Religious civilizations.

You can add a description if you like, but I'll leave that to you for now.

Go to PediaIcons.txt and do the same kind of search. Copy out the section and go to the bottom of the section right before "#End Civilopedia Art". Change the name as before. The finished product should look like this:

#ICON_BLDG_Chichen_Itza
SINGLE
art\civilopedia\icons\buildings\pyramidlarge.pcx
art\civilopedia\icons\buildings\pyramidsmall.pcx

Viola! Yes that's right, Viola! A stringed instrument of the violin family, slightly larger than a violin, tuned a fifth lower, and having a deeper, more sonorous tone.


How to get the city view working: Go into your C:\Program Files\Infogrames Interactive\Civilization III\Art\City Screen directory and take note of 2 files: buildings-large.pcx, and buildings-small.pcx. Open one of them up (they are both pretty much the same, but you have to change both in the same way).


CONTINUED...
 
Go down to the bottom and note the open set of squares. The squares from left to right control what the building looks like in each age, and top to bottom is each building in the order of it's appearance in the .bic. In the Editor check the tab Wonders and Improvements. The order the buildings appear there must be the order the buildings appear in these two graphics files.

Just use a line-drawing tool in a graphics editor and connect the green lines into grids, and then use a selection and copy tool to select one whole empty row and just paste it again in the empty pink space below. You will need to increase the canvas size to fit more in, but you need to already be minorly proficient with a graphics editor. So you can figure out if you play with it.

In the future I may release these files with more spaces for extra units, but if anyone else wants to do it first be my guest.


Now I'll leave the Kama Sutra to you, nyuk nyuk nyuk ;)

Same goes with the Guild Hall. Or you could just download my LWC mod when I put out the new version with all manner of such additions :D


Now something that requires some extra finesse. This is one that had me cursing grand profanitys, but I finally narrowed down the scope of causation like a good little hacker and discovered the work around.

Go through previous steps just like before to create the technology, but it has no PediaIcons.txt entry. Here's the real key though.

When you add a technology the game will crash whenever you view the technology in the civilopedia with the highest number icon. It just so happens to go in alphabetical order (though the alphabet has nothing to do with it) leaving Writing to be the one that will lock up the game if viewed.

The way you fix this is edit Writing in the Editor and change the icon down by at least one. Simple, isn't it? But this will allow you to add techs flawlessly, but you cannot currently add new icons. You will need to do this for each tech you add, I believe, so that limits the maximum number of techs that can be added to 82. Screwy that multiple techs have to use the same icons, but at least you can add them now!




How to add new resources to the game:

In the Editor go to the Natural Resources tab. You may need the hacked editor (I'm not sure if you do or not), but click the Add button and name your new resource "Cotton".

Set it to a Bonus Resource, give it 2 commerce, and the civilopedia entry should be GOOD_Cotton.

Notice the Icon number field? Type in the number 22 (gold is number 21, and it's the last used resource icon). Click the up arrow once. Notice how now it's just a pink square? We'll we're going to change that later, but one more thing to do first. Go to the Terrain tab and select Plains. Hold down your Ctrl key and click on the Cotton resource listed at the bottom of the Possible Resources pane. We can go ahead and save our changes and close the Editor.

Now you'll need to be able to use a graphics program, but I won't be teaching that skill. But I'll show you what needs to be changed should you know how.

Go to your C:\Program Files\Infogrames Interactive\Civilization III\Art directory. Now if you have a graphics editor capable of viewing .pcx files open the "resource.pcx" file, not "resources.pcx".

Notice all those nifty looking icons? Zoom in to see them better. Well those look just perfect for resource icons, don't they? Too bad this file seems to be totally unused by Civ3, so we're just going to have to manually rip out the image we want and paste it into another file. But first, look at the 6th icon on the top row, next to the sheep. Looks perfect for Cotton, doesn't it?

Now open the resources.pcx file. This is the file the game uses for resource icons. It also uses resources_shadows.pcx, but it's not neccessary to add resources. The last resource is gold, but lucky for us there is plenty of unused squares. The place next to gold is where we'd paste in the image if we had it, but it should be noted that you have to do some editing to get it to look right (ie, to remove the backround color) and it needs to be resized to fit in the little square and look right.

But I've already done this whole thing for you, so we'll get to that now.

Download the addcotton.zip file at the end of this post, and unzip the file into the C:\Program Files\Infogrames Interactive\Civilization III\Art where we are working. You'll want to backup your current art first, just to be safe.


Now once you've done that you can open the editor again and look at the Cotton resource again. Notice it's nifty new icon? Kinda cool, huh?

You'll want to add the appropriate entrys in Civilopedia.txt and PediaIcons.txt as needed, but you know the drill by now.



Anyhow, this means you won't have to wait anymore to add the things that are so needed in the game. You'll just need to re-use the animations for other units for now, but who really cares? You can still edit the normal unit graphics.

Everyone enjoy your new found powers of modification!
 

Attachments

  • addcotton.zip
    7.9 KB · Views: 1,413
I have now figured out why some mods crash when they delete a wonder, and why the game is crashing when you create a new wonder. :b:

Not only that, but you can now change the way buildings look in the city view...but I'm still not sure about adding new buildings to the City View. I'm not 100% sure it's possible, but you never know.


So here it is:


The problem with Wonders (great and small) was that I forgot one aspect: the wonder splash screen. I searched around and finally found out where the game figures out what picture to use for what wonder.

Open the PediaIcons.txt file and jump down to the very bottom. Right above the era splash listings are the wonder splash listings.

However here is where it gets a bit hairy. All the wonder splashes go by number, so when you delete a wonder all the numbers that come after it must be reduced by one. However when you add a new wonder you have to figure out what number it should have.

Open your .bic with the editor and go to the Improvement and Wonders tab in the rules. Scroll down to nearly the bottom and select Battlefield Medicine.

The wonders are numbered by the position they appear in this list. However, you must begin counting at 0! It's a computer programming thing, so just remember that.

But we'll save ourselves some effort. According to PediaIcons.txt's last entry, Battlefield Medicine is in the 63rd slot. There are 10 spaceship parts, which are counted, so that means the very first item you create is in the 74th position. Because I created Guild Hall first my Chichen Itza is in number 75.

So since I just copied the Pyramid's entrys everywhere else, I just went ahead and did it again. So my entry is this:

#WON_SPLASH_75
art\wonder splash\pyramid.pcx


When Firaxis said the editor didn't do much error checking, they MEANT it! But what they should have said is Civilization 3 itself does nearly no error checking. If you build a wonder with no splash entry or an invalid one the game will crash, not even leaving a sensible error message.

The game does that in multiple places...bad programmers! Bad! No twinkies for you!


Anyhow, the reason why deleting a wonder causes the game to crash is all the wonder splash numbers in PediaIcons.txt end up being wrong, not to mention the fact that the building art gets screwed up, so deleting things is a heck of a lot harder than adding them. Go figure...

Now as for the City View, this happens to be in the City View folder. :cute: How I didn't notice that before I'll never figure out.

Just choose the Buildings folder in there and all the graphics are there. Figuring how to add new buildings to this goes into the "too much trouble for too little payoff" department for me, so I'll just end this lesson here.


I have to go now, but I believe this should clear up all the problems so far.

If anyone else has a problem be sure to post it and I'll try to answer it.
 
Superb work! Plutarck, I haven't read all of your tutorial, but I plan to as soon as I get into modifying civ3 and making scenarios for it in the future. :)

Why not send it to Thunderfall, so he can put it up permanently in the database of reference documents?

It would prevent it from drowning in the heap of threads in here.

Keep up the good work!
 
I might open a reference section later today. :)

Can someome write a modpack installation tutorial for newbies? I have received several emails from newbies about modpack installation. It'll be good to have a simple document on that so I can just point them to the page. :)
 
superb work! haven´t read through it yet, but it looks great.:goodjob:
 
I'll be willing to make mod installation batch files for newbies, including an restore batch file to go back to the original... I did the same for the latest version of my Dutch Modpack.
Mod developers who don't know how to this can send their modpack to me and I write an install.bat and restore.bat for it.

email: gerards@netrexgp.nl
http://www.netrexgp.nl/civ3/
 
You know guys, you don't have to save over the file civ3mod.bic. You can name the file anything you want and as long as it has the extension .bic, Civ3 will recognize it and load it. I highly suggest that you tell people to rename those .bic files very descriptively and uniquely and never name a mod file 'civ3mod.bic'. Make's them a lot easier to keep track of and lessens any danger of overwriting the default file.
 
If the problem with the Science Advisor to which you're referring is the way the tech tree is displayed, I don't think there's anything that can be done about it until/unless Firaxis releases a patch.

Whether the bitmapped backgrounds for the tech tree are displayed or the game generates the tech links on the fly is determined by the name of the bic file in use, so the code that makes the choice must be hardcoded into the game's executable.

I don't know why they didn't just put the filenames for the tech tree background images inside the bic file itself, so we could make our own background images when we alter the tech tree. Maybe Firaxis can be convinced to do this in the upcoming patch.
 
Asterisk: Actually the problem I meant was with the individual technology icons. The icon number for advances is hard-coded somewhere as is the editor (the editor won't let you select an icon number greater than 82), which causes all kinds of oddness. It kind of screws up the icon pictures in the civilopedia, but it doesn't mess anything else up so I just ignore it.


The other problem (I'm not sure which you were refering to), is with the Science Advisor. Somehow the auto-linedrawing function got screwed up and it makes it totally impossible to click any technologys, not to mention the arrows still don't draw right.

The arrows won't draw right if you move techs around or add them, but that's because the arrows are pre-drawn and hard-coded into the game so they won't move no matter what.

Very screwy.



Flak: Actually you must overwrite civ3mod.bic, because otherwise you must choose Load Scenario. And when you do that the Science Advisor will get completely screwed up, and basically makes the game very unstable, easy to lock up, and you can't change what's being researched once you select a tech. You have to wait for it to finish researching.


The only nearly bug-free way of doing it is to overwrite the default .bic file and just use the New Game option instead. Hopefully the patch will fix that.
 
Great work on the tutorial! It will really help.

I have been playing around with the editors with the thought of turning some of my research on the 19th century into a scenario. Civ2 was not able to support what I wanted to do. However, I have not been able to discover how to place cities (not starting locations) on the map, as well as units for each country. Any ideas would be appreciated, sorry if the answer is really obvious - I'm new to scenario creation.

Thanks,

Khan
 
Is there any way I can add (or change) a Civilization Ability (like adding a "Diplomatic" or "Entertain" ability or increasing even more the chance of having a Great Leader when "Militaristic")?
 
Henrique: Nope, afraid not. Even trying to add a small wonder that increases the chance of a leader appearing doesn't work, and I've heard that trying to make it possible to build an army before a leader appears also isn't possible.

I've yet to try it much, but it seems the rules for armys/leaders are hard-coded into the game itself.


Khan: While it is rather stunning (or it was when I first found out), there is no way to place citys, units, or even civilization-specific starting points on the world map!

In other words, building a real scenario is totally impossible. There is also no script language, ensuring it's impossibility. There may be a patch sometime in the future, but it seems the first true Civ3 scenario could be multiple months away.
 
Thanks for your time writing this stuff, but I REALLY HOPE we start hearing from Firaxis real soon concerning the problems mentioned in this thread. I was hoping to start writing some fun scenarios with Civ3 to play against my brothers, and now I'm left without cities, player startup positions, triggers, and no Multiplayer mode, MAJOR dissapointment (and I purchased CIV3 as my B-Day present.
 
I've added a new special unit that is a variation of the Chinese rider using the tweaked editing tool rather than the copy app app (it creates files I can't open, for some reason). Following all the steps listed here, in terms up updating the civolopeda and pedials pages, it seems to go smoothly. It'll show up in the civolopedia, and in my civ's pick list, but the moment I add it to the build queue, the game locks up.

Are the some "gotchas" to this process? Might there be a problem with reusing a graphic, or something like that?

Any help would be appreciated.
 
I found the answer to my problem in another thread. Anyone else who has had similar problems with homemade units should make sure they check the 'Art/Units' folder and make a folder for their unit, copied from whatever is being used for the base art. Then, open that folder and rename the ini file after the new unit.

Thanks to "Skidiwili ". Works like a charm.
 
Top Bottom