douanier007 Posted June 7, 2002 Posted June 7, 2002 I made a JetPack and I would like to create a key. When i use the key (or when I type the bound console command) I would like the funtion PM_Jetpack to be launched. Can u help me ?
Tchouky Posted June 8, 2002 Posted June 8, 2002 cgame.dll cg_consolecmds.c create a command and a function and link the command to your fucntion in the array.... (not very clear ..i know..)
furrycat Posted June 8, 2002 Posted June 8, 2002 You need to do it in g_cmds.c. Make your function toggle some server flag for the caller. I made a new value for pm_flags in playerState_t since the client code shares bg_pmove.c, which is where your jetpack functions will be. Check for the flag in here and launch (no pun intended) the function is it is set.
Tchouky Posted June 8, 2002 Posted June 8, 2002 yeah i m stupid .... cg_ of course it s g_ it s the server !! whoa i m too tired i ll get some sleep ... lol
Subject452 Posted June 8, 2002 Posted June 8, 2002 q_shared.h is a shared header therefor its in all modules, yes, dont forget to build all modules after that.
furrycat Posted June 8, 2002 Posted June 8, 2002 Yep, you also need to build both cgame and game after messing with bg_pmove.c. There are two ways of attacking the jetpack problem. The way I'm doing is to have a command "jetpack" which turns the jetpack on. When it's active, jump and duck will control thrust. The other way is to make a new button as you described and apply thrust when it is pressed. That way you can have a separate command while still retaining jump and duck. The way I'm doing just seems more sensible to me (which is why I'm doing it, duh!) but the key way is still perfectly valid. I also didn't like to use a whole new button when I can get away without doing so in case anyone ever wanted to incorporate the jetpack in a mod which NEEDED a new button. I don't want to waste them...
douanier007 Posted June 8, 2002 Author Posted June 8, 2002 my JetPack is different... when you turn it on, you jump back (higher than a forcejump) . Imagine if you use it with the rocket launcher (that I ameliorated 2) ! I don't want it to be fully controllable. You'll probably just be able to move forward and backward (like in Episode 2).
Recommended Posts
Archived
This topic is now archived and is closed to further replies.