douanier007 Posted June 7, 2002 Share 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 ? Link to comment Share on other sites More sharing options...
Tchouky Posted June 8, 2002 Share 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..) Link to comment Share on other sites More sharing options...
furrycat Posted June 8, 2002 Share 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. Link to comment Share on other sites More sharing options...
Tchouky Posted June 8, 2002 Share 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 Link to comment Share on other sites More sharing options...
Subject452 Posted June 8, 2002 Share Posted June 8, 2002 u can allso define a new button in q_shared.h Link to comment Share on other sites More sharing options...
Da MaN Posted June 8, 2002 Share Posted June 8, 2002 It's done both in game and cgame. Link to comment Share on other sites More sharing options...
Subject452 Posted June 8, 2002 Share 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. Link to comment Share on other sites More sharing options...
furrycat Posted June 8, 2002 Share 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... Link to comment Share on other sites More sharing options...
douanier007 Posted June 8, 2002 Author Share 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). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.