Jump Height

  • Thread starter Thread starter Newt
  • Start date Start date
N

Newt

Guest
I'm working on a Half-Life 2 mod and I've been trying to figure out how to modify jump height, but can't find any element in the SDK that might allow me to modify how high your character can jump.

Has anyone else tried anything like this? It seems like a fairly simple thing to do, but I can't figure it out (it doesn't help that I'm a coding noob).
 
Ah, this is very useful. I figured out how to change the jump height and I started looking how to do these two things. Thank you much, you saved me a lot of searching and headaches.
 
The wall jumping tutorial is giving me some trouble. In the beginning of the tutorial he says to put the following code:

// Override default jump behavior
bool CheckJumpButton();

Below the "constructor", but I don't know what a constructor is. I also don't know what the "definition of the constructor" is.

Additionally, I'm doing this for a singleplayer mod, does that mean I should be doing this in the gamemovement.cpp or something (as opposed to the sdk_gamemovement.cpp)? Or does it not matter?
 
I don't remember Computer Science very well, but a constructor is a special method type thing that sets up variables and stuff for the class. The definition of the constructor is where it's defined... iirc it looks like a normal method but it'll probably have the same name as whatever class you're editing and it'll set up / initialize any variables necessary.
 
Could you point me to where it is in the document he's referring to(in the tutorial theholygod posted above)? I looked up the definition of constructor, but I am very much noob, so the definition contained technical information I wasn't familiar with.

I'm not really a coder, so I don't really have any business trying to make a mod, but I really just want two simple things: modified jump height (which I accomplished) and being able to wall jump. After that I can do everything else just fine (i.e. textures, level design etc).
 
Ok, i have just started coding for source myself (3 days ago) but i think the constructor is where you have Something::Something, where both somethings are the same.

you should be leaving the SDK files alone, you will probably only want gamemovement.ccp
 
Well, I went through the jump code on the gamemovement.cpp file and added the stuff from the big chunk of code in the tutorial. I added "player->" before all the "m_pSurfaceData" lines in the jump code section, since I had an error when compiling and that seemed to do the trick.

So now the code is there and it compiles without any errors, but the wall jumping doesn't work.

In the tutorial you have to declare the g_bMovementOptimizations in the c_baseplayer.h and player.h files, but I didn't do that since I'm not using the sdk_gamemovement.cpp (and because I'm not getting an error saying I should declare it somewhere), just the normal gamemovement.cpp. Do I have to declare something somewhere or turn something on to make the new code in the gamemovement.cpp work?

(I can post the jump code if anyone wants to see what I'm doing. I might very well be missing something)
 
I'm currently attempting to do this very thing at the moment, though have a custom item pick up trigger the ability to jump great heights. The two links mentioned earlier on in the topic are both dead now- is there any chance anyone can post a mirror or something if there is one? I'd really like to see those tutorials.

Cheers.
 
Back
Top