Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site forums as they ran on Ultimate Bulletin Board, 1998–2001. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 2005 site & forums

  Apolyton Civilization Site Forums
  CtP2-Creation
  Anyone figured out units yet?

Post New Topic  Post A ReplyPost A Reply In A New Window

profile | register | preferences | faq | search next newest topic | next oldest topic bottom of page
Author
Topic:   Anyone figured out units yet? Format for Better Printing
Frugal_Gourmet
Chieftain
Dallas, TX, USA
b.02-15-99
posted November 18, 2000 01:56   Click Here to See the Profile for Frugal_GourmetClick Here to Email Frugal_Gourmet  send a private message to Frugal_Gourmet
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
I'd like to add a small number of custom-made units to the game. Probably way too early to be asking... but when someone figures it out could they let me know?
Locutus
Prince
Apolyton Borg Hengelo/Enschede, The Netherlands
Nov 1999
posted November 18, 2000 08:56   Click Here to See the Profile for LocutusClick Here to Email Locutus  send a private message to LocutusSend a Message to UIN: 52912776 Visit Locutus's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Well, I haven't actually tried it yet, but I'll give you a description of how I think it should work and if it doesn't it should at least give you a good headstart (keep in mind that I don't have the final product yet so the names of things might be slightly different than the ones I use). Presuming you have all the sprites and graphics that you need/want (if you don't, check the CtPI modification section to find out how to make those):

1) place the sprites in [CtP2 folder]\ctp2_data\default\graphics\sprites

2) place the tga's in [CtP2 folder]\ctp2_data\default\graphics\graphics

3) edit [CtP2 folder]\ctp2_data\default\gamedata\spriteID.txt. E.g. if you have a Chariot unit add the line UNIT_CHARIOT2 100. Both the UNIT-name and the number need to be unique and the number needs to be the same as the number as the sprite (same as in CtPI). So in my example you'd need to call you sprite 'Gu100.spr'.

4) edit [CtP2 folder]\ctp2_data\default\gamedata\uniticon.txt. For my Chariot example it might look like this (I copied this for the CtPII Cannon unit):
ICON_UNIT_CHARIOT { FirstFrame "UPUP100L.TGA" Movie "NULL" Gameplay "UNIT_CHARIOT_GAMEPLAY" Historical "UNIT_CHARIOT_HISTORICAL" Prereq "UNIT_CHARIOT_PREREQ" Vari "UNIT_CHARIOT_STATISTICS" Icon "UPUP100A.TGA" LargeIcon "UPUP100L.TGA" SmallIcon "UPUP100B.TGA" StatText "UNIT_CHARIOT_SUMMARY" }

5) Then add the appriopriate texts to the bottom of [CtP2 folder]\ctp2_data\english\gamedata\Great_Library.txt. Example:

code:
[UNIT_CHARIOT_PREREQ]
Requires:
< L : DATABASE_ADVANCES,ADVANCE_THE_WHEEL > The Wheel < e >

[UNIT_CHARIOT_STATISTICS]
Attack: {UnitDB(UnitRecord[0]).Attack / 100}
Ranged: {UnitDB(UnitRecord[0]).ZBRangeAttack}
Defense: {UnitDB(UnitRecord[0]).Defense / 100}
Armor: {UnitDB(UnitRecord[0]).Armor / 100}
Damage: {UnitDB(UnitRecord[0]).Firepower}
Vision: {UnitDB(UnitRecord[0]).VisionRange}
Movement: {UnitDB(UnitRecord[0]).MaxMovePoints / 10000}
[END]

[UNIT_CHARIOT_SUMMARY]
Ancient Flanking Unit
[END]

[UNIT_CHARIOT_GAMEPLAY]
Due to it's large attack factor the Chariot is one of the most formidable Ancient
attack units and, though slower, only surpassed by the < L : DATABASE_UNITS,UNIT_ELEPHANT_WARRIOR > War Elephant < e > .
Also, it's a flanking unit so it can provide support to other units during combat.[END]

[UNIT_CANNON_HISTORICAL]
The Chariot was one of the most important Cavalry units of the Ancient Age.
[END]


Edit: I had to change this a little 'cause the script was screwing everything up but you can look at the other entries of the Great_Library file yourself and do it properly.

6) Add an entry to [CtP2 folder]\ctp2_data\default\gamedata\Units.txt. It might look like this:

code:
## UNIT 100
UNIT_CANNON {
Description DESCRIPTION_UNIT_CHARIOT
DefaultIcon ICON_UNIT_CHARIOT
DefaultSprite SPRITE_CHARIOT
Category UNIT_CATEGORY_FLANKER
Attack 20
Defense 10
ZBRangeAttack 0
Firepower 2
Armor 1
MaxHP 10
ShieldCost 500
PowerPoints 400
ShieldHunger 6
FoodHunger 0
MaxMovePoints 300
VisionRange 2
EnableAdvance ADVANCE_THE_WHEEL
ObsoleteAdvance ADVANCE_FEUDALISM
ActiveDefenseRange 0
LossMoveToDmgNone
MaxFuel 0
CanEntrench
CanExpel
CanPillage
CanPirate
ExertsMartialLaw
DeathEffectsHappy
IsFlanker
SoundSelect1 SOUND_SELECT1_KNIGHT
SoundSelect2 SOUND_SELECT2_KNIGHT
SoundMove SOUND_MOVE_KNIGHT
SoundAcknowledge SOUND_ACKNOWLEDGE_KNIGHT
SoundCantMove SOUND_CANTMOVE_KNIGHT
SoundAttack SOUND_ATTACK_KNIGHT
SoundWork SOUND_WORK_KNIGHT
SoundVictory SOUND_VICTORY_KNIGHT
SoundDeath SOUND_DEATH_KNIGHT

CanAttack: Land
CanSee: Standard
MovementType: Land
Size: Medium
VisionClass: Standard

CanReform {
Sound SOUND_ID_REFORM_CITY
Effect SPECEFFECT_REFORMCITY
}
}

############################################################


Now start up the game and prey it works (Yes, it's quite a process, but once you get the hang of it, it probably won't be too difficult or time-consuming).

Hope that helps in any way,

Locutus
[This message has been edited by Locutus (edited November 18, 2000).]

Frugal_Gourmet
Chieftain
Dallas, TX, USA
b.02-15-99
posted November 18, 2000 14:34   Click Here to See the Profile for Frugal_GourmetClick Here to Email Frugal_Gourmet  send a private message to Frugal_Gourmet
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Wow, thanks alot. I will try that and see if it works!

Frugal_Gourmet
Chieftain
Dallas, TX, USA
b.02-15-99
posted November 18, 2000 15:25   Click Here to See the Profile for Frugal_GourmetClick Here to Email Frugal_Gourmet  send a private message to Frugal_Gourmet
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
All right. I tried it and *almost* succeeded. I got a couple of error messages. The first said that the unit description string was missing. I filled out another section of a text file to stop that error (apparently this part wasn't necessary in CTP1, as I don't see it in any of the old mods). The second time, I got it to load despite an error message that "sprite not in sprite database". I wasn't sure how to fix that since the sprite was in the right directory and referenced properly in "spriteid.txt", but the game allowed me to continue. However, once I tried to use my new unit the game showed me a brief picture of it and (inexplicably) completely crashed...

I'll keep toying with it and see if I can figure out what else I need to change... I feel like I'm close.

Frugal_Gourmet
Chieftain
Dallas, TX, USA
b.02-15-99
posted November 18, 2000 15:32   Click Here to See the Profile for Frugal_GourmetClick Here to Email Frugal_Gourmet  send a private message to Frugal_Gourmet
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Eureka!

Never mid. I figured it out. Sprite referneces in CTP2 are not to be made in SpriteID.txt. This will cause an error message. Sprite references should now be made in the the file newsprite.txt, which is also located in the "gamedata" directory and looks very similar in content. Apparently, they've devised a separate location for adding new units.

Subtle diffenrece...

Locutus
Prince
Apolyton Borg Hengelo/Enschede, The Netherlands
Nov 1999
posted November 19, 2000 10:18   Click Here to See the Profile for LocutusClick Here to Email Locutus  send a private message to LocutusSend a Message to UIN: 52912776 Visit Locutus's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Great!

That's very good to hear. Now if you could just tell us how exactly you solved that first error (what section of what text file you changed), that would be a great help to other people trying to add units to the game.


Frugal_Gourmet
Chieftain
Dallas, TX, USA
b.02-15-99
posted November 19, 2000 16:57   Click Here to See the Profile for Frugal_GourmetClick Here to Email Frugal_Gourmet  send a private message to Frugal_Gourmet
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
The text file error is caused by an invalid reference in the DESCRIPTION section of the units.txt file. (The first line of any unit). To make it work, I had to reference an already existing description. For instance, for my legion unit I had to use the same description as the swordsman:

Description DESCRIPTION_UNIT_SWORDSMAN

I'm sure there's a way to create your own descriptions, but I haven't figured it out yet.

Apolyton Civilization Site Forums
> > > CtP2-Creation Forum

next newest topic | next oldest topictop of page

All times are EDT

Administrative Options: Close Topic | Archive/Move | Delete Topic | Top
Post New Topic  Post A ReplyPost A Reply In A New Window
Hop to:

Contact Us
Apolyton Civilization Site

Powered by: Ultimate Bulletin Board, Version 5.44a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.

Front Page | Civilization III | Dinosaurs | Civilization II | Call to Power | Call to Power II | Alpha Centauri | Alternative Civs | Misc | Links | About ACS | GameStats
GameLeague | Scenario League | Hodadian Award Central | Civilization Scenario Collection | Spanish CivII Site | Clash of Civs | CtP Maps | Art of War