Quantcast

Jump to content

» «
Photo

New Clothes without changing American.gxt

  • This topic is locked This topic is locked
2 replies to this topic
JC_COOP
  • JC_COOP

    Player Hater

  • Members
  • Joined: 07 Dec 2006

#1

Posted 22 May 2008 - 06:28 PM

I was helping someone out and wound up writing a tutorial, so I thought I'd post it for everyone:

[QUOTE]
[QUOTE]
But I don't know how to make clothes gxt lines with CLEO. I like CLEO mods, they works without replacing any files. So, could you tell me, how to make CLEO code for clothes? mercie_blink.gif
[/QUOTE]

Alrighty (I really should when I finish beta2 of my mod write a tutorial LOL)... essentially there is no way getting around having to replace clothes.dat and shopping.dat in the SA data directory. However, you don't have to replace American.gxt

What you need to do is download gxthook (available at the sannybuilder website) and look at its example file. The IDs you want to use are in the second column of data in the shopping.dat file clothing section - those are the game IDs that tell it what text to associate with the piece of clothing. In the file you make for your custom FXT file in the Cleo_Text directly, each line will be the ID for something you replaced, followed by a space - everything after that space is the text that will show up in-game. This way you can rename things without altering the american.gxt.

Example of an FXT file (which you make in notepad):

CODE

CUTDENM Daisy Dukes


This single line will make it so that when the ID CUTDENM (normally cut off denims, which loads from cutoffdenims.txd) is referenced by the game, it is intercepted by gxthook.cs and directed to say "Daisy Dukes" (which is what my mod replaces the cut off denims with).

Now, you can go a step further than replacing clothes with this method up to the limits of San Andreas (which I believe is 12 of each clothing item per store, so a total of 36 pants, 36 torsos, etc... but you can't actually get that much because SA gets unstable when the player.img gets beyond a certain arbitrary number of files in it - more on that later). You can add completely new clothes so long as you use an ID naming convention nobody else is likely to use.

Shopping.Dat uses the txd name as the identifying name of each article of clothing. A line in the clothes section looks like this (with tabs instead of spaces - that's important to remember as SA doesn't like it if you don't use tabs):
CODE

cutoffdenims CUTDENM shorts 2 respect 0 sexy 7 1000


What this translates to is the first item (cutoffdenims) is the name of the txd, which must be unique to EVERY ITEM in Shopping.dat. The second item is the ID for American.gxt (or in our case our custom fxt file). The third is the name of the DFF file you want the item to use - you can reuse a DFF as many times as you want. The fourth item (the number "2" in this case) is a number that tells the game what type of clothing this is. The fifth thing ("respect") cannot be changed and must be there or it can cause a crash error. The sixth thing ("0") is the numeric modifier to the player's respect statistic while wearing this item. The seventh thing ("sexy") cannot be changed and must be there or it can cause a crash error. The eighth thing ("7") is the numeric modifier to the player's sexiness statistic when wearing this item. The final thing on the line ("1000") is the dollar cost of the item in a store.

Possible values for items four, six, and eight are:
CODE

# 0 = torso cant go over 25 for stats
# 2 = legs cant go over 10 for stats
# 3 = shoes cant go over 5 for stats
# 13 = extra1 (necklace) cant go over 2 for stats
# 14 = extra2 (bracelet/watch) cant go over 3 for stats
# 15 = extra3 (glasses) cant go over 2 for stats
# 16 = extra4 (hats) cant go over 3 for stats


Now that you know what each of these lines does, we can duplicate them. Copy one of these lines and paste it to the end of the clothes section of shopping.dat. Change the first item to the name of a txd you have created (omit the file extension), change the second item to something completely unique using only numbers and capital letters and no more than seven characters (my personal preference is to use my first and last initial, followed by the initials of my mod's name, followed by two numbers: so the first thing I make would be JCFCJ01, the second JCFCJ02, etc). Change the dff name to whatever dff you want it to use, and change the fourth item (a number) to the appropriate value as previously explained. Then change the statistic values as you see fit, and congrats you have a piece of clothing added to the game.

Now, that doesn't do much good unless the player can buy it... so we have to alter another part of the shopping.dat to put it in-game.

In the shopping.dat there are various sections referring to different shops, for example:
CODE

section Csdesgn # VICTIM
 type clothes
 item hoodjackbeige
 item suit1grey
 item suit1blk
 item leather
 item painter
 item hawaiiwht
 item hawaiired
 item sportjack
# END OF VICTIM TORSO
 item leathertr
 item leathertrchaps
 item suit1trgrey
 item suit1trblk
 item cutoffdenims
# END OF VICTIM LEGS
 item cowboyboot
 item biker
 item snakeskin
# END OF VICTIM SHOES
 item neckropes    
 item neckropeg  
# END OF VICTIM CHAINS
 item watchgno
 item watchgno2
# END OF VICTIM WATCHES
 item glasses03dark
 item glasses03
# END OF VICTIM GLASSES
 item beretred
 item beretblk
 item capblk
 item capblkback
 item capblkside
 item capblkover
 item capblkup
 item tshirtmaddgrey
 item tshirtmaddgrn
 item tshirtlocgrey
 item baskballloc
# END OF VICTIM HATS
end


At this point, what you need to do should be pretty self-explanatory, just find the store you want to add to and add a line into the code that says
CODE

item "your txd name"

Sans quotes of course.

And bing batta boom, you have a new piece of clothing in-game. Now, I mentioned something about stability of the player.img file earlier... I discovered quite by accident that strange bugs occur if you put a lot of new filenames into the player.img. "But this means I can't add new stuff doesn't it?" you might ask... but the truth is that you can add files - its just a bit arbitrary based on file size how many you can add before the IMG file becomes unstable - but we won't let that stop us smile.gif You see, there are quite a few files that the game has in the player.img that AREN'T USED and therefore may be safely replaced before you start add totally new ones, so this delays running into instabilities. I discovered that the following TXD files aren't used and should be safe to replace:

CODE

fez
bandanablu
bandanaflag
bandanagang
bandanaleaf
bandanared
bandanaskull
bandgang4
bbjack
capgrey
capgreyback
capgreyup
capknitblk
capnband
capnbandgang
capovergang
capoverred
cappolice
capzipup
chucksblack
dustmask
glassesx
legsbocerswht
legspantsgrey
shadesblk
shirtbblue
shoesandal
tracktrblustr
tshirt2
tshirt
tshirtmercgry
tshirtmercred
tshirtmercwht
tshirtprowh
visor


And the following DFF files aren't used:
CODE

cappolice
glassesx


Now, this doesn't mean you are limited to just replacing these files for adding new stuff... it just means that you should replace these first, and then start adding new files.

Whew... that was a mouthful.

Hope that helps you out my friend smile.gif If so just give me a shout out and I'll be happy +grins+

Keep up the good work on that mod, there are a lot of people looking forward to it.

- JC

goodmakers
  • goodmakers

    TI FAN

  • BUSTED!
  • Joined: 21 Aug 2009

#2

Posted 10 October 2009 - 09:55 AM

THATS COOL BUT ANY IDEAS FOR DELETING ALL OLD CLOTHES AND ADDING NEW

CharmingCharlie
  • CharmingCharlie

    Proud PC Gamer

  • Members
  • Joined: 23 May 2006

#3

Posted 11 October 2009 - 02:44 AM

Why the hell you felt the need to bump a year old post is beyond me.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users