A Qusetion About Units and CivEdit

JackA

Master Trainer
Joined
Apr 21, 2004
Messages
237
How do you add units in the Mac CivEdit?
 
There's an add-on that was created by one of the locals to enable an Add button in the editor. I'm sorry, I don't know off-hand where it is, but if you scan the editor-related threads around here I'm sure you'll find it.
 
I belive that not only was an "iEditCiv" app made for this purpose, but also a modified version of the editor itself, the latter at least having been made by a certain Mr. Ghost of Stephan Foster, who used a Civ I Stealth Bomber (or was it a stealth fighter?) as his avatar (the name Senecasax comes to mind, but I'm not sure). The modded editor put "add" and "delete" buttons right into the heads of each rule page.
UNFORTUNATELY, the link to the package you need is now dead.
FORTUNATELY, I had it in an older copy of Civ 3 in a dusty, forgotten section of my hard drive.
UNFORTUNATELY, the edition of the editor that the package was a part of contained the nasty bug that destroyed all entry information of the first object in each rules list.
FORTUNATELY, I was able to isolate the original nib contents required to add the buttons and added them to the up-to-date editor. It currently is working perfectly and I have not seen any (mod package-induced) problems whatsoever. I will upload it now.

Civ 3 Edit Add/Delete
 
Thank you! This community is helpful!
 
Has anyone actually added units to Civ III for Mac? i tried to do this, and followed directions as i found them as closely as possible by adding lines to the Pediaicons file, etc. What i discovered was that Civ III would crash upon startup with the added lines to the Pediaicons file, so i couldn't get far enough to even see if my added unit actually worked or not. If anyone has actually been successful in adding units, i'd really like to know how they did it... step by step, if possible. i'd love to add a few of my own.

Thanks.
 
I haven't done it myself, but here's a thought:

Did you use the correct line endings in the text files? Instructions for Windows users don't need to mention it because Civ3 uses DOS/Windows standard return+linefeed endings, but Mac text editors put return only, and Unix editors put line feed only. You need a text editor that allows you to choose DOS line endings. BBEdit does it, XCode does it, and (cue commercial jingle) the modified TextEdit in my sig does it.
 
i downloaded your version of TextEdit, but i seem to be overlooking what you are talking about. i don't see where i can designate Dos line endings... the only thing i added to the pedicons file was the line:

#ICON_PRTO_B52
art\civilopedia\icons\units\B52large.pcx
art\civilopedia\icons\units\B52small.pcx
#End Units

Are you talking about encodings? i see many different DOS options there... i'm not sure what you are talking about i guess.
 
If you edit the file and then save it, all the line endings will be changed to Mac unless you use the right options.

Re. my modified TextEdit, did you select Plain Text in the Format menu? If not then you are trying to save as Rich text and you are really on a loser. If you have selected Plain text, when you Save As ... you should see the panel below, where you can select the CR/LF option button. If you don't see that modified Save As ... panel then you haven't opened my version of TextEdit.
 

Attachments

  • TextEdit.jpg
    TextEdit.jpg
    19.2 KB · Views: 206
i'll try that, however, i observed that when i deleted the lines that i had added, the game had no problems.
 
Okay. The game is no longer crashing, so editing the text files with your textEdit is the thing to do apparently. However, now as the game is not crashing, the unit is not appearing either. i have changed the prerequisites i had made for it so that i could test it at the beginning of the game just to see if it would appear, but even though i am saving the scenario file every-time i reopen it, all the fields are unchanged, even though i changed them several times and saved it. You've been very helpful. i'm going to go see Spider Man 2 and when i get back i'm going to take another hack at it. If you have any more suggestions, they'd be helpful. Thanks.
 
Oh... the unit is appearing in the civilopedia (although the picture is not there, it is just pink). i'm going to add another unit as the B52 i originally added i made it so that it would not be available until advance flight and the resources needed for it are not available until later in the game (rubber, etc.)--but even though i changed those values to no resources needed, and no prerequisites, it still is not showing up to purchase. And when i reopen the file in the editor, all the values are back at what i had originally stipulated.
 
When you talk specifics about the editor you're in my uncharted territory. I have opened it a few times, but never tried to do anything serious. I do seem to recall having trouble getting thisngs I asked it to to to stick. I hope one of the more knowledgeable editor gurus around here may be able to help. You might like to try sending a PM to Frunobulax, or mosey over to JackA's thread hereabouts. He's having problems with customisation, but I don't thnk they are to do with saving the file. Maybe you two can get together?
 
Gottesfreunde said:
Oh... the unit is appearing in the civilopedia (although the picture is not there, it is just pink). i'm going to add another unit as the B52 i originally added i made it so that it would not be available until advance flight and the resources needed for it are not available until later in the game (rubber, etc.)--but even though i changed those values to no resources needed, and no prerequisites, it still is not showing up to purchase. And when i reopen the file in the editor, all the values are back at what i had originally stipulated.

[Previous entry Crossposted]

Are you and JackA working together already? You're both talking about B52, and JackA sent me a scenario where I could built one at 4000 BC :hmm:
 
Gottesfreunde said:
i'll try that, however, i observed that when i deleted the lines that i had added, the game had no problems.
Hmm. It's a while since I worked on that. Maybe it only puts Mac line endings on the changed or new lines.
 
i've successfully added eight new units to the game! WOW. It is not as hard as it seems at first glance. Thanks for your suggestions AlanH.
 
Gottesfreunde said:
i've successfully added eight new units to the game! WOW. It is not as hard as it seems at first glance. Thanks for your suggestions AlanH.
Congratulations! :goodjob:

Having worked out the magic incantations, I hope you'll find it in your heart to assist JackA, as I'm out of my depth when it comes to the editor.
 
i have cheated a little bit... i moved to the editor on my PC to add the units because the Mac editor tends to not save information well. Additionally, the PC editor allows for the placement of cities to create a real scenario with truer start locations, etc. However, adding units is incredibly easy. Some things to keep in mind though are:

Definitely use the editor that AlanH has provided if you are working on the Mac (both the TextEdit as well as the CivEdit).

When you add a unit, make sure that the name you choose for the unit in the box that appears when you click the "add" button, is identical to the name of the folder and the subsequent .ini file of the unit you are adding... i had made the mistake, for example, of naming the unit "B52 Bomber" and then putting in the civilopedia box PRTO_B52 which coincided with the name of the unit and the .ini file. But this was not working. When i changed the name of the folder the unit was in, as well as the .ini file to "B52 Bomber" then it worked. A pretty simple thing, but frustrating if you didn't know about this.

You only have to add the unit to the PediIcons file, it is not necessary to add it to the civilopedia file.

A good way to test the unit to make sure it is in working order is to save a test .bic with the unit not needing any resources or prerequisites, make you civilization begin as a republic and give it money enough to purchase the added units outright. If the units show up, and you do not get an error message when you click on them to buy, then chances are they are going to work. Go ahead and buy them though and try them out.

If the game crashes at startup or crashes when you select the unit to purchase it, then you have probably failed to use the TextEdit supplied by AlanH. Open the file again and save it with CR/LF option clicked. Try it again and things should work.

After you know things are working, then go back and set the values for the unit that you want (prerequisites and resources needed for it, etc.) Adding the unit to the units32.pcx file (i used photoshop) will allow it to be seen when you are buying it, but i have not been able to get it to show up in the civilopedia as a picture--i just get a pink box).

It seems frustrating at first, but once you figure out to keep the name the same, and to make sure that you are saving the file correctly then relatively simple.
 
Just correlating what I know about the software side of the picture:

The .BIC file (and .SAV files based on it) uses three references for a unit as far as I know. They are the name, the civilopedia tag and the Icon index number.

For the caravel, for example, the standard BIC has:
Name = 'Caravel' - I guess you are saying this has to match the Art/units folder and .INI file names.

Civilopedia tag = 'PRTO_Caravel' - this must match tags like #ICON_PRTO_Caravel in the pediaicons.txt file and #PRTO_Caravel in the civilopedia.txt file, but can be, and sometimes is, completely different from the Name.

Icon Index = 30 - must match the position of the units_32.pcx icon.

Within the unit folder there are .wav and .pcx files for the unit, and the .INI text file defines which image and sound are used for which unit action.

Re. your Civilopedia pictures:

I imagine that the civilopedia requires two .pcx files in the /Art/Civilopedia/icons/units/ folder, one large and one small, and a reference in pediaIcons.txt to these files. For example:

#ICON_PRTO_Caravel
art\civilopedia\icons\units\30caravellarge.pcx
art\civilopedia\icons\units\30caravelsmall.pcx

Then you need an entry in the Civilopedia .txt file for the unit itself, with its description etc, using the #PRTO_Caravel and #DESC_PRTO_Caravel tags. I assume you've tried all this with o your units, and still get the pink squares?

It seems surprising to me that the editor doesn't manage all these items for you. It only appears to edit the .BIC, but it shouldn't be difficult to include the edits for the text file entries as well to ensure that they all match. It's also very strange that it fails to save your changes sometimes.
 
So does anyone know if there is a way to look inside a saved game file to see why the game is crashing? i worked for hours on this scenario, adding units, etc. i placed cities, etc. in the PC editor (that allows one to do this) and after i was finished, the scenario literally took two or more hours to load... no kidding. Anyway, after i had it loaded, everything worked like i expected without any glitches, and saved games opened as quickly as any other. However, after playing the game (wanting only to get to the modern age) when i get to the "modern age" the game just crashes. It crashes on both my Mac as well as my PC. Is there a way to test a scenario in the editor to see if it works before one wastes countless hours after creating the scenario to only find that it doesn't friggin' work when it is played? There is no way that i can redo the scenario, then spend five days playing it to find out that it is going to crash when it reaches a certain point in the game.
 
First the obvious:

1) What does the OS X crash log say? Open the /Applications/Utilities/Console and look for the Civ3 crash log.

2) I assume there's no error message from Civ3 before it goes down?

I can have a look at it if you like. Zip up all your modified files plus the save that crashes and either upload and post the zip file here or email it to alanh(at)gotm(dot)civfanatics(dot)net. Replace the bracketed words with the appropriate symbols to make it into an email address.
 
Back
Top Bottom