Page 1 of 1
Hex Editing a Compiled Script
Posted: Fri Aug 05, 2011 12:30 pm
by austin12456
I have a beta version of BF2 that was only playable online (the servers are now long gone), and I need to figure out how to change the global variable gDemoHasSplitscreen in the compiled script files. Does anyone have any experience with this?
Re: Hex Editing a Compiled Script
Posted: Fri Aug 05, 2011 12:46 pm
by fasty
I know
Zerted was a beta tester. The best way to get ahold of him is by PM.
Re: Hex Editing a Compiled Script
Posted: Sat Aug 06, 2011 1:20 am
by [RDH]Zerted
Lucky for you, someone else PMed me today.
The beta was fun, but I can't think of any reason to keep playing it. If you have the PC beta, you basically have the entire game...
Is this for the PC? If so, you should be able to install the v1.3 patch and use custom user scripts or addme scripts to change whatever you need.
From the mod tool's source, gDemoHasSplitscreen is only used by this.buttons.split.hidden in Shell/scripts/ifs_main.lua (line 397). That gets munged into shell.lvl. If that split button isn't what you're trying to change, what are you trying to do?
Re: Hex Editing a Compiled Script
Posted: Sat Aug 06, 2011 12:32 pm
by austin12456
I'm trying to do this for a PS2 beta. I want to play it to see the difference from the final version. I'm hoping if I enabled that variable, the splitscreen option will appear on the menu.
EDIT: I looked at that LUA file and that's probably what I need to change. Is there any easy way to compile shell.lvl to make it work with the PS2? The only problem is that this is an early version of the game, so ifs_main may not be the same.
EDIT2: SHELL.LVL and SHELLPS2.LVL do not contain the string "gDemoHasSplitscreen" in their compiled ifs_main.

Re: Hex Editing a Compiled Script
Posted: Mon Aug 08, 2011 1:10 am
by [RDH]Zerted
For the PC, making a shell.lvl is as simple as copying all the shell files from Assets or Data into your map and clicking the Shell option in VisualMunge.
I don't do much hex editing, so I can't tell you how to find the variables. However, it might be easier to swap around the button tags. Look at the top of ifs_main.lua. See the buttonlist table? Hex edit the split tag to something else and maybe the tutorials tag to split. After swapping the tags, the game will process clicking on the tutorial button as clicking on the split button. The tags are how SWBF2 keeps track of which buttons are what.
Re: Hex Editing a Compiled Script
Posted: Tue Aug 09, 2011 4:03 pm
by austin12456
[RDH]Zerted wrote:For the PC, making a shell.lvl is as simple as copying all the shell files from Assets or Data into your map and clicking the Shell option in VisualMunge.
I don't do much hex editing, so I can't tell you how to find the variables. However, it might be easier to swap around the button tags. Look at the top of ifs_main.lua. See the buttonlist table? Hex edit the split tag to something else and maybe the tutorials tag to split. After swapping the tags, the game will process clicking on the tutorial button as clicking on the split button. The tags are how SWBF2 keeps track of which buttons are what.
That's a great idea, but unfortunately it didn't work. Maybe I could figure out how to emulate a PS2 server somehow...
Thank you for your ideas and help!
EDIT
Progress has been made!
I have loaded the singeplayer menu, but when I try to load a map it fails

Crashes at that screen ^^
Any tips?
Double posting is against the RULES; please EDIT your post instead -Staff