divoid Posted December 23, 2003 Share Posted December 23, 2003 Im trying to restore the old style disruptor from jedi outcast, where you cant move if your zoomed in and charged. I have pretty much got it done, except for some jittering when you try to move. I believe this is due to the client prediction, since it only appears for me, and i cant see it when other clients do it. so how can i get rid of the jitter, so when someone tries to move while zoomed in and charged, it doesnt do anything? Link to comment Share on other sites More sharing options...
razorace Posted December 23, 2003 Share Posted December 23, 2003 Jittering is the result of you not making the nessicary changes to the PM sections of the code and not compiling/using both sides of the game (client and server). Link to comment Share on other sites More sharing options...
divoid Posted December 26, 2003 Author Share Posted December 26, 2003 i seriously doubt you have to do anything to the client code, that would be extremely stupid. but what would you set for the pm style or whatever its called (not looking at code right now)? PM_FREEZE would sorta do it, but that screws with clipping.... Link to comment Share on other sites More sharing options...
Wudan Posted December 27, 2003 Share Posted December 27, 2003 If you change anything PM / BG wise, you must recompile both of the DLLs or you may not get the expected results. The jittering is because the client movement prediction is different from what the server is predicting. You can probably hack something up in g_active.c and not screw up the client, IIRC. Link to comment Share on other sites More sharing options...
divoid Posted December 27, 2003 Author Share Posted December 27, 2003 ya, thats what i figured (g_active.c), and ive tried a few things, but ran out of ideas quickly Link to comment Share on other sites More sharing options...
Wudan Posted December 28, 2003 Share Posted December 28, 2003 Does it work now? You can try browsing through the JK2 MP Source linked from my site in my sig, and try to find out where the disruptor's zoom gets interupted by player movement. Link to comment Share on other sites More sharing options...
divoid Posted December 29, 2003 Author Share Posted December 29, 2003 i had sorted through the jk2 code looking for it before, but didnt find anything. i'll look again, maybe i missed something, and i'll just try some more stuff and if i get it, i'll post it here Link to comment Share on other sites More sharing options...
razorace Posted December 30, 2003 Share Posted December 30, 2003 You're going to have to add a zoom check to PmoveSingle in bg_pmove.c that makes "stiffenedUp" = qtrue. Link to comment Share on other sites More sharing options...
Wudan Posted December 30, 2003 Share Posted December 30, 2003 To make the disruptor cancel out if the player is moving, or moving above a specified velocity: about line 7201 in bg_pmove.c Change this section in PM_Weapon(): if (pm->ps->weapon == WP_DISRUPTOR && pm->ps->zoomMode == 1) { if (pm_cancelOutZoom) { pm->ps->zoomMode = 0; pm->ps->zoomFov = 0; pm->ps->zoomLocked = qfalse; pm->ps->zoomLockTime = 0; PM_AddEvent( EV_DISRUPTOR_ZOOMSOUND ); return; } if (pm->cmd.forwardmove || pm->cmd.rightmove || pm->cmd.upmove > 0) { return; } } To this: if (pm->ps->weapon == WP_DISRUPTOR && pm->ps->zoomMode == 1) { if (pm->cmd.forwardmove || pm->cmd.rightmove || pm->cmd.upmove > 0) { pm_cancelOutZoom = qtrue; } if (pm_cancelOutZoom) { pm->ps->zoomMode = 0; pm->ps->zoomFov = 0; pm->ps->zoomLocked = qfalse; pm->ps->zoomLockTime = 0; PM_AddEvent( EV_DISRUPTOR_ZOOMSOUND ); } return; } What this'll do is cancel the zoomMode if the player is moving at all. What you might want to try is this: //here's a float for the player's velocity: float playerspeed = 0; if (pm->ps->weapon == WP_DISRUPTOR && pm->ps->zoomMode == 1) { playerspeed = VectorLength( pm->ps->velocity ); // the 5.0 is just ... a number - //play with it to get the desired effect. if ( playerspeed > 5.0 ) { pm_cancelOutZoom = qtrue; } if (pm_cancelOutZoom) { pm->ps->zoomMode = 0; pm->ps->zoomFov = 0; pm->ps->zoomLocked = qfalse; pm->ps->zoomLockTime = 0; PM_AddEvent( EV_DISRUPTOR_ZOOMSOUND ); } return; } Link to comment Share on other sites More sharing options...
Wudan Posted December 30, 2003 Share Posted December 30, 2003 After putting that in, you'll need to re-compile both your game and cgame dlls. Link to comment Share on other sites More sharing options...
Wudan Posted December 31, 2003 Share Posted December 31, 2003 There's another similar check further down in the code that you'll need to replace with a playerspeed check - unless you want to keep the 'don't move while charging' thing. A normal moving player goes about 250 units per second, 90 walking and 125 crouching. There's a call to keep the player from jumping while zoomed, i took it out because it was lame - the speed checks'll kick em out anyway. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.