Page 1 of 1

Simply Hex

Posted: Tue Aug 30, 2005 5:54 am
by Storm
Hello. I'm quite new to the SWBF modding scene, and I'm curious of just 1 question. Has anybody found out the hex for changing how many reinforcements are in each LVL? I'm modifying the XBox game and not PC so the SDK won't work (I don't own the PC game so it won't load for me :-\). Is there any documentation regarding the hex of certain values and places? Wouldn't mind changing the speed of the gun fires as well, but that too, needs to be found in hex. I'll continue my search and hopefully someone can lend a helping hand.

RE: Simply Hex

Posted: Tue Aug 30, 2005 9:46 am
by sawyerdk9
I asked about changing reinforcements and how many people are on the map at once but nobody seemed to know

RE: Simply Hex

Posted: Tue Aug 30, 2005 4:30 pm
by JabbaLovesLava
mmm, i bet guru can help. He's a computer (and hex-editer) geek :D (geek as in you know a lot, not as in insult)

Posted: Wed Aug 31, 2005 8:35 am
by Storm
Nobody could take a current .lvl, edit it to more reinforcements, then find the odd offset?? Or is there much more to it than that.. I wouldn't think so.

Posted: Wed Aug 31, 2005 1:27 pm
by sawyerdk9
if u have the mod tools you can make an new map and change that stuff in the lua, then when your all done munge it and the take your actual level file and replace it with one of the shipped ones. thats what I do

Posted: Wed Aug 31, 2005 3:29 pm
by Nimlot
Its definitly possible Storm, but it breaks the games warrenty, thus is not condoned. But if you really want to do, search these forums, this was discussed a lot back in the beginning.

Posted: Fri Sep 02, 2005 1:05 pm
by Leviathan
Or simply ask here... I like hex-edit some *.LVL files ! :wink:

Posted: Sat Sep 03, 2005 8:32 am
by Storm
That is what I'm asking. If someone has the modding tool, take a current level they have, with say 200 reinforcements, then export/munge/etc. Then same level, change to 300 reinforcements, then export/munge/etc. and then give me the offset number that's different. How is that breaking the game's warranty? o.O

Posted: Sat Sep 03, 2005 2:19 pm
by Leviathan
So, you just want to change the number of reinforcements for shipped maps... But which ones ?

Posted: Sat Sep 03, 2005 4:11 pm
by Storm
Any, just do 1, do 200 reinforcements, then do the exact same map with 300 reinforcements, then use hex editor to see which offset on 1 map is different. The only offset that should be different is the reinforcements.

Posted: Sun Sep 04, 2005 2:26 pm
by Leviathan
It can be realized... I'll see what I can do... :wink:

Posted: Sun Sep 04, 2005 2:32 pm
by Riley75
I don't know what differences there may be on the X-Box, in terms of location and structure of files... But if the files are the same as on the PC, this is how the reinforcement count is stored:

It's in the \_LVL_PC\mission.lvl file for all the shipped maps. I don't have all the specific offsets written down, but you can identify them by:
1) Finding the map name (eg. "bes1a").
2) Scrolling down after a section of string values.
3) Finding the hex bytes "C6 31 00 80". That's how it looks for a count of 200. Other values are "C6 36 00 80" for 220 (Kamino - clones only), and "46 3E 00 80" for 250 (Hoth and a few others). Keep in mind this will appear twice for each map - once for each side. They're usually fairly close to each other for the same map. If you're looking at them in UltraEdit in hex mode (16 bytes per line), they're usually about 8 lines apart.

Here are some possible values you might want :
300 = "C6 4A 00 80"
400 = "C6 63 00 80"
500 = "C6 7C 00 80"
1000 = "C6 F9 00 80"

For anyone who decides to try this... please remember to back up your mission.lvl file! (And I'm assuming this is for single-player instant action mode; make sure you put it back to what it was before you play multiplayer!)

Now, I'm sure people are going to ask how these numbers are computed... The best I can do is direct you here:
http://personal.riley-man.com/swbf/edit ... l-scr.html
And say that it has to do with how Lua byte code is stored. What you're finding above is actually a "PUSHINT 200" opcode.

One easy rule: If the number (call it N) you want is divisible by 4, the hex for it is always of the pattern "C6 xx 00 80". The "xx" is (N - 4) / 4. If it isn't divisible by 4 (such as for 250), well, you'll have to read over the page I linked to understand it all.


And um... to those who remember me... hi again. ;)

Posted: Wed Sep 07, 2005 4:18 pm
by Storm
The one man I was hoping would reply! Thanks a bunch Riley!

Posted: Wed Sep 07, 2005 5:25 pm
by Nimlot
ooo, Riley! I hope you stick around for BF2, I definitely would love more lvl documenting :)

Posted: Sat Sep 10, 2005 1:05 pm
by Riley75
Possibly. ;)
Certain things about Battlefront kind of disappointed me, to be honest. Once I started working with the map editor, the AI controls available (boundaries, hubs, connections, hints) I found tough to deal with. The lack of additional game modes, and the lack of a more comprehensive single-player experience, were downers. I was really hoping to build not just new maps, but entire campaigns of related maps.
My prospects for Battlefront II have improved as of late, though. I've been reading about all the new game modes (capture the flag, hunt mode, etc.) and the single-player campaign. So perhaps I'll be back. ;)

Posted: Sat Sep 10, 2005 2:55 pm
by Leviathan
Riley', you gave us a manner to tweak reinforcements' number through hex-editing... Personally, I prefer making these modifications using SWBF Mod Tools' materials... :wink:

PS : By the way, welcome back ! I've not seen you for a long time... :)

Posted: Sat Sep 10, 2005 7:53 pm
by Riley75
Yep, a simple mod tool to do this would be great. 8) If someone were to write up a program for it, I'd recommend also allowing the person to set the unit count -- and allowing the person to set the counts back to defaults.

Posted: Sun Sep 11, 2005 1:40 pm
by Leviathan
I guess such a program could be done, using VBS scripts... (Based on "BFBuilder.hta")

Posted: Sun Sep 11, 2005 2:23 pm
by Riley75
You could, yes. Before BFBuilder, I didn't even know about this "HTML Application" (*.hta files) functionality. :oops: I tend to do stuff like this in C/C++. heh.

Posted: Mon Sep 12, 2005 12:37 pm
by Leviathan
I've already known those *.HTA files... (Like a sound player for Internet Explorer, and many other funny stuffs like that... :P)