Page 1 of 1
Hex editing- how to replace unit with longer name?
Posted: Sun Apr 16, 2006 4:31 am
by fung1224
Hi all!
I am Fung, a big fan of Star Wars.
Like most of the ppl who have played battlefront II for some time, I started modifying the game by using hex editor.
At first everything going just fine, for example making a playable gamorrean, making jedi vs clone trooper, and many other silly trials.
But all my modifications are bound by one thing- i can only replace the original by another unit with smaller or same number of characters in the name.
So, my question is, just as the subject depicted, how can i replace the original unit with longer name by hex editing? I know it is possible because some modders can do it, by making the Arc trooper with chaingun available.
RE: Hex editing- how to replace unit with longer name?
Posted: Sun Apr 16, 2006 4:35 am
by DeathRow
I am no good at Hex-editing (or anything). So you want to Change the units name to make it longer?
BTW = Welcome to Gametoast
RE: Hex editing- how to replace unit with longer name?
Posted: Sun Apr 16, 2006 5:05 am
by CarbineImpulse
Why restrict yourself to just hex editting when the tools are available? you could create a new side and use the localise tool to change names etc.... if you're just sticking with hex then I don't know.. sorry.
RE: Hex editing- how to replace unit with longer name?
Posted: Sun Apr 16, 2006 5:08 am
by ShadowHawk
Regretably you can't. Shorter, yes, provided there are spaces to make it exactly the length of the name, but not longer. Hexing is just altering the hexidecimal code from a compiled source. Changing the length also changes the code in some important areas and sometimes alter the size, rendering the exe useless. try abbreviating it so it will fit the length of the unit you are replacing.
RE: Hex editing- how to replace unit with longer name?
Posted: Sun Apr 16, 2006 10:40 am
by fung1224
Thx all~

So, wht u guys mean is all i need to do is to use the official mod tools to create a new side?
Anyway i will try that later.
But i have heard that some modders can do that, for instance, the mod of "clone trooper vs storm trooper in kamino" seems to be made by replacing unit with longer name, eg. rifle jet trooper, sniper jet trooper and arc trooper with chaingun.
Re: Hex editing- how to replace unit with longer name?
Posted: Thu Nov 27, 2008 5:56 pm
by arphaxad
Solved.
It is completely possible and tested without problems.
The key is the hex number in front of the unit name, which indicates the length of the name:
e.g. all_inf_rifleman, in hex code, there will be a prefix 04 11 and 3 bytes of 00 beforehead and an additional byte 00 for separation. 11H = 17 (dec) = length(all_inf_rifleman) + 1;
So if you want to replace a unit with longer name, e.g.,
to substitute all_hero_hansolo_tat (length = 20 = 14H) by all_hero_hansolo_storm (length = 22 =16H), you should do what follows.
1. replace the prefix from 04 15 00 00 00 to 04 17 00 00 00
2. remove the subsequent unit (fill with 00) but add a proper prefix to indicate the length. Suppose the subsequent unit has a length of 16 =10H (e.g., all_inf_rifleman). Then its prefix will be 04 11 00 00 00.
Original HEX:
74 61 74 00 04 11 00 00 00 61 6c 6c 5f 69 6e 66
t a t a l l _ i n f.....
Modified HEX:
73 74 6f 72 6d 00 04 0f 00 00 00 00 00 00 00 00 ......
s t o r m
The price you pay is to sacrifice one unit in the team, or at least, to replace the original unit with one of shorter name in order to balance the total length. The basic rule for HEX editing is that the total local length must be kept unchanged. (Otherwise you will have problems opening other maps)