Thread Tools
Old September 18, 2002, 13:43   #1
gigapimp3001
Chieftain
 
Local Time: 08:13
Local Date: November 1, 2010
Join Date: Aug 2002
Posts: 35
Unit Modding madness....
I`m adding a few units to the Default Apolyton mod, notably in the aerial department with an Attack helicopter and a combat UAV to spice up the otherwise lack lusture aerial units.

Anyway as far as i know I have done everything I should have done with regards sprites, icons, newsprite.txt and uniticon.txt.

Now what I considered the easy part , APOL_units.txt is actually the problem.

When i spark up CTP it crashes telling me "Expected String ID 4242 "etc then goes through alist of fields that it thinks should be there and isn't (such as attack points, shield cost and so forth)

I beg to differ but arguing with a computer gets you now-where.

Can anyone point me in the right direction?
gigapimp3001 is offline  
Old September 18, 2002, 14:14   #2
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 05:13
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Can you attach the file?
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old September 18, 2002, 14:30   #3
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 09:13
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
sounds like you have a } missing at the end of one of the unit records, or one too many or something. check them all. There should be a { at the end of the UNIT_*** line, and then one } for every { thereafter, and a } before the beginning of the next unit record.
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Immortal Wombat is offline  
Old September 18, 2002, 18:37   #4
gigapimp3001
Chieftain
 
Local Time: 08:13
Local Date: November 1, 2010
Join Date: Aug 2002
Posts: 35
I tried going over the code with a fine toothed code and i still can`t see anything wrong with it. Mind you I`m not a programmer, I don`t have the patience for it so a more trained eye might find something..
Attached Files:
File Type: txt apol_units.txt (100.9 KB, 3 views)
gigapimp3001 is offline  
Old September 18, 2002, 20:50   #5
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 08:13
Local Date: November 1, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
It's line number 4242: "Description DESCRIPTION_UNIT_COMBAT_UAV" and line number 4298 "Description DESCRIPTION_UNIT_ATTACK_HELICOPTER". IIRC, these descriptions are not actually used by the game but have to be some existing description, e.g. DESCRIPTION_UNIT_WARRIOR.

BTW, what's a COMBAT_UAV and what sprite are you using?
Peter Triggs is offline  
Old September 18, 2002, 21:09   #6
gigapimp3001
Chieftain
 
Local Time: 08:13
Local Date: November 1, 2010
Join Date: Aug 2002
Posts: 35
Unmanned Aerial Vehicle. Basically a fighter (I think I used Crousto`s EuroFighter 2000 thats on this sight somewhere.

The advantage of a UAV is that its cheaper than a piloted craft (no life support, ejection seat etc) no pilots can be shot down and used as bargining by the enemy and can pull manuovres (sic) that would knock a human out.

Its a rough sketch anyway as I have to see how it pans out (its giving an error message somewhere in the attack copter text now
gigapimp3001 is offline  
Old September 19, 2002, 13:29   #7
gigapimp3001
Chieftain
 
Local Time: 08:13
Local Date: November 1, 2010
Join Date: Aug 2002
Posts: 35
Does anybody else have as much trouble as me tweaking CTP:II !

Anyway the latest glitch is that when I click into the cheat mpde and go to play around with my units the game crashes without any (vaguely) helpful error message.

I`m guessing its some cockup with the tga files and seeing as i can't seem to edit or even view said files I`m a little stumped.

I`ve attached the relevant files and hope some1 can help me. On the plus side my pain should help others who want to mod

(Oh and if anyone can explain what a tga is and how can i play about with them that would be grand..)
Attached Files:
File Type: zip icon bother.zip (14.7 KB, 5 views)
gigapimp3001 is offline  
Old September 19, 2002, 16:00   #8
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 10:13
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
I think the problem are the Eurofighter *.tga files. CTP1/2 *.tga files should be in 16bit uncompressed subformat and not in 24bit uncompressed subformat.

Try the files in the attachment.

-Martin
Attached Files:
File Type: zip upo099.zip (1.6 KB, 2 views)
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old September 19, 2002, 16:46   #9
J Bytheway
Call to Power PBEMCall to Power II Democracy GameCTP2 Source Code Project
Emperor
 
J Bytheway's Avatar
 
Local Time: 09:13
Local Date: November 1, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
Yes, everyone has problems with those darn Eurofighter tga files .
J Bytheway is offline  
Old September 19, 2002, 17:21   #10
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 08:13
Local Date: November 1, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
TGA's are pictures and you can view them with Microsoft Picture It! Express 2000. (That's the program on my computer that does it. There may be better ones.)

As it happens, I've put the Attack Helicopter unit in the mod I'm working on. Here's the data I've used with some (hopefully) explanatory comments.

Code:
 from uniticon.txt

ICON_UNIT_ATTACK_HELICOPTER { 

    FirstFrame     "UPUP097L.TGA"                          
              // a 38k picture of the unit, must be in ...\cpt2_data\default\graphics\pictures

    Movie          "NULL"                                  // Wonders get movies here

    Gameplay       "UNIT_ATTACK_HELICOPTER_GAMEPLAY"       
              // the Great Library entry for UNIT_ATTACK_HELICOPTER_GAMEPLAY, must be in Great_Library.txt

    Historical     "UNIT_ATTACK_HELICOPTER_HISTORICAL"     // likewise
    Prereq         "UNIT_ATTACK_HELICOPTER_PREREQ"         // likewise
    Vari           "UNIT_ATTACK_HELICOPTER_STATISTICS"     // likewise

    Icon           "UPUP097A.TGA"                          
              // a 2k picture of the unit, must be in ... \cpt2_data \default \graphics \pictures

    LargeIcon      "UPUP097L.TGA"                          
              // a 38k picture of the unit, must be in ...\cpt2_data\default\graphics\pictures

    SmallIcon      "UPUP097B.TGA"                          
              // a 1k picture of the unit, must be in ...\cpt2_data\default\graphics\pictures

    StatText       "UNIT_ATTACK_HELICOPTER_SUMMARY"        
              // the Great Library entry for UNIT_ATTACK_HELICOPTER_SUMMARY, must be in Great_Library.txt
    
 }
The FirstFrame picture can be a different picture from the LargeIcon picture.

BTW, you should use 97 for the ATTACK_HELICOPTER's number: the TGA's are as above and the sprite will be GU097.SPR

The number 98 was reserved for Harlan's Missile Cruiser, but I think Caranorn's about to give us a proper animated version of this unit.

So, here's the Copter tga's you need.
Attached Files:
File Type: zip coptertgas.zip (12.9 KB, 2 views)

Last edited by Peter Triggs; September 19, 2002 at 17:34.
Peter Triggs is offline  
Old September 19, 2002, 19:31   #11
gigapimp3001
Chieftain
 
Local Time: 08:13
Local Date: November 1, 2010
Join Date: Aug 2002
Posts: 35
thanks for the help guys but the game is still cutting out on me. It happens as i go to to click on the air units in cheat mode and just #poof# closes down on me.

I modded a unit earlier and aside from an outsized icon in cheat mode worked fine and the game didn`t cut out.

Am I missing something here?
gigapimp3001 is offline  
Old September 19, 2002, 21:44   #12
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 05:13
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
I used to have those crash that happen when the game doesnt find a particular tga.
Here are a couple of stuff to test.

1) The names are mispelled. Make sure any typo happened. I suggest copy the name form the file and past inside the "".

2) The pictureas are not in the right directory. They have to be in the ctp2_data\default\graphics\pictures.
A good way to test this is to open the great library and check for the unit entry you create. It wont crash here but if the large picture truly isnt in this folder it wont show up (the background of the GL will be in its place.

3) Make sure the pics hav the correct size: Large Icons should have 160x120, Icons 36 x 24, and Small Icons 24 x 18. The small icon is the one that shows up in the cheat editor.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old September 20, 2002, 07:31   #13
Caranorn
Warlord
 
Caranorn's Avatar
 
Local Time: 09:13
Local Date: November 1, 2010
Join Date: Mar 2000
Location: Luxembourg, Europe
Posts: 116
1) wrong format of the tga shoudl not crash the game. The wrong bit type should just end up giving a distorted image, at least that's what I experienced.
2)As Pedrunn said, get those names exactly right, if the game can't find the image it's looking for it will shut down.
3) I'm not so sure about picture size, that definitelly won't crash the game. In some cases the wrong tga size means icons don't fit into their window and overlap others, in other cases it seems to be scaled and just looks ugly. I still believe there might be room for a 4th size tga file in the game (96x72) as one of the game icons is that size (none of the official files though). I haven't had time to test this though.

In short, get right right kind of targa into the right slot. L (120x90) for the great library and large icon. A (32x24) for the normal icon. B (24x18) for the small icon. A different size (96x72) might work for the large icon, but that's as yet untested, it would also have to be labelled consistantly (use the L label for the large icon and use a different one, G maybe for the GreatLibrary).

If you add or modify a unit also always remember to check whether you modified all files concerned (you can create DESCRIPTION_UNIT_COMBAT_UAV, you'll just have to tell the game in the correct file what that is). I haven't done any of this since my return to CTP2, but I'm sure most explanatory material from the CTP days still exists on Apolyton and is largely applicable to CTP2.

Seriously modifying the game can be tough at times, but once you get the hang of it you'll be able to isolate your errors quick (you'll still make mistakes but al least you will know what you did wrong

Marc aka Caran...

P.S.: Concerning the Missile Cruiser, that Civ3 flic really represents a fast patrol craft (missile). Still up to anyone how they wish to use the sprites in a mod once they are converted. For now that particular sprite is on backburner though.
Caranorn is offline  
Old September 20, 2002, 08:31   #14
J Bytheway
Call to Power PBEMCall to Power II Democracy GameCTP2 Source Code Project
Emperor
 
J Bytheway's Avatar
 
Local Time: 09:13
Local Date: November 1, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
Quote:
Originally posted by Caranorn
1) wrong format of the tga shoudl not crash the game. The wrong bit type should just end up giving a distorted image, at least that's what I experienced.
I haven't tried in CTP2, but in CTP I found that using the wrong compression (ie. compressed when it should be uncompressed or vice versa - I can never remember which it should be...) caused corrupted graphics, but using the wrong bit depth caused crashes exactly as described.

Which picture is it that appears on the cheat screen? Is it the SmallIcon?

Last edited by J Bytheway; September 20, 2002 at 08:39.
J Bytheway is offline  
Old September 20, 2002, 09:05   #15
Caranorn
Warlord
 
Caranorn's Avatar
 
Local Time: 09:13
Local Date: November 1, 2010
Join Date: Mar 2000
Location: Luxembourg, Europe
Posts: 116
Okay, I decided to test my 4 different icon sizes theory. I think I was rightand wonder why Activision just uses 3 files and accordingly has to scale 1 file down within the game.

The Cheat uses icon A which is normal size (32x24) (forgot to check the uniticon file again to see what their exact label is there).

I created the following picture through screenshots. I used 4 tga files instead of the usual 3. I think it's self explanatory. File L used 96x72, G 160x120, A 36x24 and B 24x18. The letters within the images are taken from the screenshot (to be safe I added the letter to each targa).

I also inadvertently (made a mistake with the files at first tested whether the game crashes if the wrong bit setting is used. It doesn't at least not for icons A, B and L.

Marc aka Caran...

P.S.: All sprites I create in future will have 4 targas and explanations how to use them.
Attached Thumbnails:
Click image for larger version

Name:	targasizes.jpg
Views:	60
Size:	118.0 KB
ID:	25049  

Last edited by Caranorn; September 20, 2002 at 09:35.
Caranorn is offline  
Old September 20, 2002, 13:12   #16
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 05:13
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Quote:
1) wrong format of the tga shoudl not crash the game. The wrong bit type should just end up giving a distorted image, at least that's what I experienced.
But i have once used for small icon larger files from CTP (cant remember the size but it is the smallest CTP size). it didnt crashed the game but they werent re-scaled. So in the army manager one targa was invading th others ones one space
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand

Last edited by Pedrunn; September 20, 2002 at 13:28.
Pedrunn is offline  
Old September 20, 2002, 13:26   #17
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 05:13
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
DP
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old September 20, 2002, 14:26   #18
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 09:13
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Quote:
But i have once used for small icon larger files from CTP (cant remember the size but it is the smallest CTP size). it didnt crashed the game but they werent re-scaled. So in the army manager one targa was invading th others ones one space
That's just an x-y size difference. The format affects the "z-size" - how high quality the image is, and how compressed the file is and whatever... (or something)
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Immortal Wombat is offline  
Old September 24, 2002, 14:00   #19
gigapimp3001
Chieftain
 
Local Time: 08:13
Local Date: November 1, 2010
Join Date: Aug 2002
Posts: 35
Okay I`ve built my first brand spanking new Attack Hellicopter was moving to one of my cities with an air carrier and halfway through the games did its rude crashing without explaination thing.

Now if I had missed out something the the text then my unit would not have ben built without the game crashing the moment it the sprite came onto the screen. Why of all things should it crash in the middle of a move?
gigapimp3001 is offline  
Old September 25, 2002, 08:46   #20
J Bytheway
Call to Power PBEMCall to Power II Democracy GameCTP2 Source Code Project
Emperor
 
J Bytheway's Avatar
 
Local Time: 09:13
Local Date: November 1, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
Did it crash when the sprite came around to a certain facing, or when one of the pictures was first attempted to be displayed that had not been before?
J Bytheway is offline  
Old September 25, 2002, 12:49   #21
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 05:13
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
I think the picture is also the problem. When they have to show up and the game cant find it a crash happen.

Can you attach the uniticon.txt here.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old September 25, 2002, 13:17   #22
gigapimp3001
Chieftain
 
Local Time: 08:13
Local Date: November 1, 2010
Join Date: Aug 2002
Posts: 35
actually I tried again later and thpough the game did crash again it was with another new unit and the helicopter worked out fine.

I have a horrible feeling I might be blowing some memory or cpu limit or perhaps its just me being paranoid.

Anyway I'll attach the uniticon file for your amusement!
Attached Files:
File Type: txt apol_uniticon.txt (147.7 KB, 2 views)
gigapimp3001 is offline  
Old September 25, 2002, 13:40   #23
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 05:13
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
There are several errors in the file.

1) You wrote a spr file for the First Frame entry when it should have the 160 x 120 tga file. 37 KB one although this size can be changed according to Caracorn. But you must make it a TGA. I think the correct ons should be UPU099L.tga for the UVA and UPUP097L.TGA for the helicopter.

2) In the entry Movie you should write "NULL" since there is no unit movies in CTP2.

3) In the Icon entry for the ICON_UNIT_ATTACK_HELICOPTER you forgot to write the .TGA at the end of the picture name.

I think this will solve your problem.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old September 25, 2002, 16:15   #24
Caranorn
Warlord
 
Caranorn's Avatar
 
Local Time: 09:13
Local Date: November 1, 2010
Join Date: Mar 2000
Location: Luxembourg, Europe
Posts: 116
Name of the file shouldn't matter, but definitelly file type.

Not having taken a look at the file in question I neverless think Pedrunn is right. All of the above could have created the error. A non existing movie, and unidentifiable files (mispelled or missing the tga extension).

Marc aka Caran...
Caranorn is offline  
Old September 25, 2002, 18:26   #25
gigapimp3001
Chieftain
 
Local Time: 08:13
Local Date: November 1, 2010
Join Date: Aug 2002
Posts: 35
Well thanks for the input, the game is stable for the moment, I think it was that missing file extension that may have been the problem.

We shall wait and see
gigapimp3001 is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 04:13.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team