Jump to content

How to integrate alterations of "g_speed" and "g_gravity" commands *directly into the Mod file* or at least make it work in the config/.cfg file? (increase movement speed & jump in SP mode)

Recommended Posts

Good Evening,

As some of you might already know by now, I'm constantly modding the Singleplayer mode of SoF2, which engine-wise should behave almost the same or very similar to JK2 & JK3 games, since all 3 games use (almost) the same engine, including GHOUL2 modeling and ICARUS scripting systems.

Right now, aside from weapon modeling, I'm trying to increase movement speed (increase "g_speed" command) and jump height (decrease "g_gravity" command) of the player in SP mode in order to make SoF2 "feel" more like SoF1 while still retaining the more realistic & tactical-like gameplay of the former (the latter, SoF1, was very unrealistic; the developers intended to make the first instalment realistic and authentic but either didn't have enough time or resources to do that - which they eventually did or tried in SoF2). Initially, I just wanted to insert the "g_speed" & "g_gravity" commands directly into my config file (SoF2.cfg), since both commands are considered cheats.

I did exactly that, but unfortunately, it didn't work the way I intended it to work: when starting a NEW game (campaign), the changes in the config did not take effect and I have to (re-)enable both commands every time for every level/map change. And yes, "hash sv_cheats 1" has already been set in the game's launch options (SoF2.exe), the game's .cfg file and finally in the ingame console BEFORE starting a new game and AFTER having a new game started - so, that cannot be the reason for the error. Finally, I created a savegame immediately after that in order for the "hash sv_cheats 1" setting to become persistent. But it didn't persist - like said, I have to re-type these 2 commands every single time for a new level/map change.

Binding these commands to a key in SoF2.cfg (and then make the file read-only) like this...

bind X "g_speed 350"
bind Y "g_gravity 640"

...also didn't work! When starting a new game - the pressing the buttons simply doesn't do anything. I have to type these commands in the console window AFTER loading a level in order to get them to work for that specific level only!

And that's not supposed the way to do it anyway, because from modding perspective, those 2 commands are not cheats but simply variables - so I'm looking for a way to integrate those 2 functions directly in the mod file or *at least* make it work properly in the game's config file and then the above-mentioned hassles become obsolete on it's own.


Any suggestions?



Link to comment

Okay... oddly, it apparently seems to work now! Initially, it didn't work for whatever reason but after making some changes for the keybinds, it now finally works for an odd reason. Both assigning the 2 above-mentioned commands to a key, as well as putting them directly into the .cfg file (so they're automatically applied each time I start up the game) appears to be working. HOWEVER, in the case of "g_gravity 640", it doesn't get applied when put directly in the config file - which means, I have to press the assigned key for that command each time (re-)loading a level. Oddly, "g_speed 350" always gets automatically applied once inserted in the .cfg file. As usual, I make the config file read-only after finishing editing it.

Any assumptions, why this is so?


Link to comment
  • 3 months later...

I suggest you modify the init scripts for each map - use DevaheB to decompile your scripts, then use BehavEd to recompile them - or alternatively find some other way to execute your script before the player can take control again.

It seems SoFII has direct injection for console commands and cvars - probably allowing you to make a cheat injection script or potentially modifying gravity directly in ICARUS - provided you can somehow extract more headers for BehaveEd to use. Just incase you're curious you could try if JKAs ICARUS command to modify gravity still works, or if IBIZE.exe will refuse a compile of your script and how such a script if sucessfully compiled would behave in game.

Screenshot 2023-07-12 162850.jpg

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...