Announcement

Collapse
No announcement yet.

Modmakers Tutorial: How to add new units, improvements, wonders, and technologys!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Modmakers Tutorial: How to add new units, improvements, wonders, and technologys!

    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 ), 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:

    ; _______________________________________________NAV AL UNITS_____________________________________________


    #PRTO_Galley
    ^
    ^
    ^The [galley] is the first naval unit you can build. These tiny, primitive ships must end each turn in a
    $LINK
    square -- they are in danger of sinking if they end their turn in a $LINK or $LINK square.
    If $LINK 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
    square -- they are in danger of sinking if they end their turn in a $LINK or $LINK square.
    If $LINK 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 in every city on the same continent.
    ^
    ^
    ^
    ^
    ^
    ^
    ^May trigger $LINK 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).


    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


    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 my post a few spots down from this one, 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!
    Last edited by Plutarck; November 14, 2001, 14:39.
    Better to be wise for a second than stupid for an entire lifetime.

    Creator of the LWC Mod for Civ3.

  • #2
    Great Thanks!!

    Now how do we delete units/wonders, etc without the game crashing!!!

    Do we delete their respective area in those text files?

    Comment


    • #3
      Hmm.. ok one questionf or my clueless self... Copytool? What copytool?

      Comment


      • #4
        Note: I've edited my first post with information on adding resources in addition to everything else.

        Here's the file as promised.


        Shadow99: It's the Civ3CopyTool. Check the Files forum. It's made by Gramphos.

        Avahz_D: Does the game crash when you delete wonders? I was not aware of that...hmmm...not sure what will be need there.


        I'm now currently working on figuring out how to get the City Screen icons working, so I'll post again if I figure out how it works.
        Attached Files
        Better to be wise for a second than stupid for an entire lifetime.

        Creator of the LWC Mod for Civ3.

        Comment


        • #5
          I have updated my post again with how to fix the problem where there is no icon for the building in the City View.

          Hopefully this covers all the information that is needed...
          Better to be wise for a second than stupid for an entire lifetime.

          Creator of the LWC Mod for Civ3.

          Comment


          • #6
            Is it possible to edit the new unit's look? I don't want my new unit looking the same as the old unit!!!!!

            Comment


            • #7
              I think it is treating units and wonder/improvments, in the same manner.

              If you delete them it causes the game to crash. I can get around the unit problem, just simply but not allowing a unit to be created by any nation.

              It seems it has something to do with the game still trying to reference the txt proto... part with something in game. Not sure but If you delete something that is referenced in those txt files, it seems to cause the game to go snaffu.

              I am no programer and what editing I do, usually involvs HOURS spent on the baords reading up on what you guys discover. All I usually do is bug hunt... I REALLY appreciat that info about adding units/buildings. Its no problem to just *fix* a unit so it cant be used buy anyone, thus the txt file still *sees* its reference point. But you just can not *turn* off buildings the way you do units...

              Once we can figure this snaffu out, all we have to do is get a better map editor and city/unit/etc placer, for our basic editor. Then if we can get an events trigger that would be WONDERFUL...

              I was contemplating just changing the names of the teck to corrispond with actual historical tech. For example, Concrete would work wonders in a *middle* Roman scenario. But I am not sure if changing the actually advance name wouldnt cause even more crash problems...

              Comment


              • #8
                To change the look of the unit on the main map I'm afraid requires editing a .flic file, which at this time I can't do.

                If I had access to the Pro Motion program I believe I could actually figure out how to make it work. What could be done is just open a unit's animation and save it to a different file without making any changes. Then use Hex Workshop to compare the two files. Without much difficulty we should be able to just blindly copy Firaxis' special additions. It would still restrict how we could change/add units, but it would at least be possible to do some alteration on them.

                But after quite a bit of...we'll say "searching", I haven't found any such "Try Before you Buy: Full Version" downloads, if you get my drift. $49 is too much to edit the way units look, and that's about all I would be doing. Even then I wouldn't be doing it much (I'm not much of a graphics person).


                However, what I failed to mention is that you can change the way the unit looks on some other screens. Go into your C:\Program Files\Infogrames Interactive\Civilization III\Art\units directory and open the file units_32.pcx. That's all the land units so you can change the way they look there.


                The way to tell the difference in new and old units without right-clicking is to go into your Military Advisor screen. I'm not sure which file is used there, but I know it isn't a .flic. Your unit's new graphics will be shown there, so you can just use that to find your units instead.

                Not the most enjoyable way of playing, but it works.


                Avahz_D: Hm, I haven't really spent much time deleting things so I hadn't run into that problem. However I believe the problem at least with the buildings is in the City View building graphics files.

                The game chooses the graphics based on the order they appear in the .bic, so it's possible that when you delete a building the game gets screwed up as all the graphics on the buildings now end up wrong.

                So the best way is just to change/rename the building to what you want it to be instead. You can change everything about it, but if you want a game with only a few improvements that of course isn't quite so easy.


                There may be something else though, I'm just not sure what.
                Better to be wise for a second than stupid for an entire lifetime.

                Creator of the LWC Mod for Civ3.

                Comment


                • #9
                  From what I've heard the flics with units contain extra info in the header, so that they can't be created by any tool.
                  Creator of the Civ3MultiTool

                  Comment


                  • #10
                    About deleting stuff I believe it is caused by the indexes changing. (All references are stored as an index of the thing it referees to. That is the reason why the copytool adds everything last.)
                    Creator of the Civ3MultiTool

                    Comment


                    • #11
                      Problem with new Wonder

                      Plutarck, I created a new Wonder following your instructions (this one creates Libraries in all cities instead of Courthouses.) Everything worked fine until construction of the Wonder was complete, the game immediately crashed.

                      Any advice?

                      Red Monk

                      Comment


                      • #12
                        Checking it out now. Hopefully it's not another hidden index bug...bleh.

                        I'll let you know after I test it.
                        Better to be wise for a second than stupid for an entire lifetime.

                        Creator of the LWC Mod for Civ3.

                        Comment


                        • #13
                          Originally posted by Plutarck
                          Checking it out now. Hopefully it's not another hidden index bug...bleh.

                          I'll let you know after I test it.
                          I know what it is.

                          In pediaicons.txt after
                          Code:
                          #WON_SPLASH_63
                          art\wonder splash\Battlefield Medicine.pcx
                          add
                          Code:
                          #WON_SPLASH_[i]wonderindex#[/i]
                          art\wonder splash\[i]picture[/i].pcx
                          If no other buildings have been added the index should be 74.
                          Creator of the Civ3MultiTool

                          Comment


                          • #14
                            [edit]Gramphos sort beat me to it, LOL. We figured it out sepperately [/edit]

                            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.

                            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. 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.
                            Better to be wise for a second than stupid for an entire lifetime.

                            Creator of the LWC Mod for Civ3.

                            Comment


                            • #15
                              Adding Civs?

                              How about successfully adding (not replacing) civs and making them playable without crashing... Can this be done yet?

                              Thanks for this guide.

                              Comment

                              Working...
                              X