Hex Editing a Compiled Script
Moderator: Moderators
-
austin12456
- Recruit Womprat Killer
- Posts: 9
- Joined: Mon Jul 11, 2011 8:20 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Hex Editing a Compiled Script
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?
-
fasty
- 1st Lieutenant

- Posts: 438
- Joined: Thu Apr 15, 2010 4:17 am
- Projects :: Server modding
- Contact:
Re: Hex Editing a Compiled Script
I know Zerted was a beta tester. The best way to get ahold of him is by PM.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Hex Editing a Compiled Script
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?
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?
-
austin12456
- Recruit Womprat Killer
- Posts: 9
- Joined: Mon Jul 11, 2011 8:20 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: Hex Editing a Compiled Script
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.
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.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Hex Editing a Compiled Script
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.
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.
-
austin12456
- Recruit Womprat Killer
- Posts: 9
- Joined: Mon Jul 11, 2011 8:20 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: Hex Editing a Compiled Script
That's a great idea, but unfortunately it didn't work. Maybe I could figure out how to emulate a PS2 server somehow...[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.
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
