#1 20-05-2008 15:03

Jackie47
Registered: 16-05-2008
Posts: 4

I need something that'll either be easy or impossible...

I was hoping someone could help me out, I made a mod that replaces CJ with another character (http://www.gtaforums.com/index.php?show … 12207&st=0) and I need to replace a crapload of American.gxt entries, but I wanted to keep the mod compatible with other mods.

Is it possible to write a script similar to gxthook that would operate in essentially the same way but would replace entries in the MAIN table of American.gxt rather than create new entries for use by other scripts?  My feeling was that it would either be an easy thing or be impossible without causing too much processing overhead, but code and I don't get along.

Thanks in advance,
- JC

Offline

#2 20-05-2008 15:19

Seemann
Registered: 07-08-2006
Posts: 2,156

Re: I need something that'll either be easy or impossible...

It's easy, and GXTHook allows that. You just need to use the same entry name as in the american.gxt for your new fxt text. To find out the correct entry name, open the file GTASA.text, which is located in the sanny\help\GXT strings directory. Find needed text, for example: 10OG        // O.G.. Then create a new .fxt file and write:

10OG Tommy

and now each time the game will read the 10OG gxt entry, it will display not O.G but Tommy. Got it? Do the same for all entries you need to replace.

Offline

#3 20-05-2008 15:42

Jackie47
Registered: 16-05-2008
Posts: 4

Re: I need something that'll either be easy or impossible...

Really? that's awesome!

I had thought (not having tried, but just from what the gxthook readme said) that the gxthook would only add new entries for CLEO scripts to use, I didn't realize that it would redirect existing entries smile

Since that one turned out to be easy, maybe you can help with another problem I have:
What I need is a script that will load a file that works in the same way as clothes.dat - I discovered the hard way that clothes.dat just doesn't work anymore and causes crashes when it becomes too long. essentially, the part of the function I need is where it replaces CJ's head with a different DFF (keeping the same TXD) depending on if he has another DFF loaded, and replaces that different DFF with yet another DFF when in a cutscene. Here is the relevant code excerpt from the clothes.dat file that I wrote that was too long and caused a crash (if a CLEO script were to take care of this function, it would bring my clothes.dat file within limits so it wouldn't crash anymore):

START CODE

IGNORE wedge
SETC capovereye head cs_zorro -
SETC caprimup head cs_zorro -
SETC capside  head cs_zorro -
SETC boxingcap head cs_zorro -
SETC hatmanc  head boxingshoe -
SETC cappolice head boxingshoe -
SETC trilby  head boxingshoe -
SETC capback  head cs_zorro -
ENDIGNORE wedge
EXCLUSIVE wedge
SETC bandana  head tramline -
SETC bikerhelmet head tramline -
SETC boater  head tramline -
SETC bowler  head tramline -
SETC boxingcap head cs_flatears -
SETC cap  head tramline -
SETC capback  head tramline -
SETC capknit  head tramline -
SETC capovereye head tramline -
SETC caprimup head tramline -
SETC capside  head tramline -
SETC captruck head tramline -
SETC cowboy  head tramline -
SETC flatears head tramline -
SETC hatmanc  head tramline -
SETC tracktr  head tramline -
SETC trilby  head tramline -
SETC worktr  head tramline -
SETC cappolice head tramline -
ENDEXCLUSIVE wedge
EXCLUSIVE afro
SETC bandana  head cs_zorro -
SETC bikerhelmet head cs_zorro -
SETC boater  head cs_zorro -
SETC bowler  head cs_zorro -
SETC cap  head cs_zorro -
SETC capknit  head cs_zorro -
SETC captruck head cs_zorro -
SETC cowboy  head cs_zorro -
SETC flatears head cs_zorro -
SETC tracktr  head cs_zorro -
SETC worktr  head cs_zorro -
ENDEXCLUSIVE afro
EXCLUSIVE cornrows
SETC bandana  head gimptorso -
SETC bikerhelmet head gimptorso -
SETC boater  head gimptorso -
SETC bowler  head gimptorso -
SETC cap  head gimptorso -
SETC capknit  head gimptorso -
SETC captruck head gimptorso -
SETC cowboy  head gimptorso -
SETC flatears head gimptorso -
SETC tracktr  head gimptorso -
SETC worktr  head gimptorso -
ENDEXCLUSIVE cornrows
EXCLUSIVE elvishair
SETC bandana  head cs_bandana -
SETC bikerhelmet head cs_bandana -
SETC boater  head cs_bandana -
SETC bowler  head cs_bandana -
SETC cap  head cs_bandana -
SETC capknit  head cs_bandana -
SETC captruck head cs_bandana -
SETC cowboy  head cs_bandana -
SETC flatears head cs_bandana -
SETC tracktr  head cs_bandana -
SETC worktr  head cs_bandana -
ENDEXCLUSIVE elvishair
EXCLUSIVE flattop
SETC bandana  head boxingshoe -
SETC bikerhelmet head pimp  -
SETC boater  head boxingshoe -
SETC bowler  head pimp  -
SETC cap  head boxingshoe -
SETC capknit  head boxingshoe -
SETC captruck head boxingshoe -
SETC cowboy  head pimp  -
SETC flatears head boxingshoe -
SETC tracktr  head pimp  -
SETC worktr  head pimp  -
ENDEXCLUSIVE flattop
EXCLUSIVE groovecut
SETC bandana  head country  -
SETC bikerhelmet head country  -
SETC boater  head country  -
SETC bowler  head country  -
SETC cap  head country  -
SETC capknit  head country  -
SETC captruck head country  -
SETC cowboy  head country  -
SETC flatears head country  -
SETC tracktr  head country  -
SETC worktr  head country  -
ENDEXCLUSIVE groovecut
EXCLUSIVE highafro
SETC bandana  head flipflop -
SETC bikerhelmet head flipflop -
SETC boater  head flipflop -
SETC bowler  head flipflop -
SETC cap  head flipflop -
SETC capknit  head flipflop -
SETC captruck head flipflop -
SETC cowboy  head flipflop -
SETC flatears head flipflop -
SETC tracktr  head flipflop -
SETC worktr  head flipflop -
ENDEXCLUSIVE highafro
EXCLUSIVE jheri
SETC bandana  head boxingshoe -
SETC bikerhelmet head boxingshoe -
SETC boater  head boxingshoe -
SETC bowler  head boxingshoe -
SETC cap  head boxingshoe -
SETC capknit  head boxingshoe -
SETC captruck head boxingshoe -
SETC cowboy  head boxingshoe -
SETC flatears head boxingshoe -
SETC tracktr  head boxingshoe -
SETC worktr  head boxingshoe -
ENDEXCLUSIVE jheri
EXCLUSIVE mohawk
SETC bandana  head boxingshoe -
SETC bikerhelmet head pimp  -
SETC boater  head boxingshoe -
SETC bowler  head pimp  -
SETC cap  head boxingshoe -
SETC capknit  head boxingshoe -
SETC captruck head boxingshoe -
SETC cowboy  head pimp  -
SETC flatears head boxingshoe -
SETC tracktr  head pimp  -
SETC worktr  head pimp  -
ENDEXCLUSIVE mohawk
EXCLUSIVE slope
SETC bandana  head cs_bandana -
SETC bikerhelmet head cs_bandana -
SETC boater  head cs_bandana -
SETC bowler  head cs_bandana -
SETC cap  head cs_bandana -
SETC capknit  head cs_bandana -
SETC captruck head cs_bandana -
SETC cowboy  head cs_bandana -
SETC flatears head cs_bandana -
SETC tracktr  head cs_bandana -
SETC worktr  head cs_bandana -
ENDEXCLUSIVE slope
EXCLUSIVE head
SETC bandana  head cs_zorro -
SETC bikerhelmet head cs_zorro -
SETC boater  head cs_zorro -
SETC bowler  head cs_zorro -
SETC cap  head cs_zorro -
SETC capknit  head cs_zorro -
SETC captruck head cs_zorro -
SETC cowboy  head cs_zorro -
SETC flatears head cs_zorro -
SETC tracktr  head cs_zorro -
SETC worktr  head cs_zorro -
ENDEXCLUSIVE head
IGNORE balaclava
SETC bandknots head  tramline  -
SETC helmet  head  tramline  -
SETC skullycap head  tramline  -
SETC moto  head  tramline  -
ENDIGNORE balaclava
CUTS cornrows cs_cornrows
CUTS  afro  cs_afro
CUTS highafro cs_highafro
CUTS wedge  cs_wedge
CUTS slope  cs_slope
CUTS  flattop  cs_flattop
CUTS tramline cs_tramline
CUTS groovecut cs_groovecut
CUTS jheri  cs_jheri
CUTS  mohawk  cs_mohawk
CUTS elvishair cs_elvishair
CUTS  hands  cs_hands
CUTS boater  cs_bikerhelmet
CUTS  balaclava cs_tramline
CUTS cs_zorro cs_bandknots
CUTS cs_flatears cs_bandmask
CUTS cs_bandana tshirt2
CUTS pimp  hawaii
CUTS boxingshoe trackytop1
CUTS country  gimpfeet
CUTS gimptorso gimpmask
CUTS flipflop capover
CUTS  head  cs_head

END CODE

Note that it is very important that the change happen before the next animation is loaded, because in the case of the cutscene versions of the DFFs there is a different animation skeleton, so if the animation is loaded without the proper DFF being already in place there is a crash. For test purposes, the first beta of my mod available here has all the relevant files though the clothes.dat file included in that release has had many features from the code above stripped in order to keep from crashing.

Thanks a ton, I hope you can help because I've been banging my head against this problem for the past six months.

Last edited by Jackie47 (20-05-2008 15:45)

Offline

Board footer

Powered by FluxBB