Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

jo style disruptor

Page: 1 of 1
 divoid
12-23-2003, 7:53 AM
#1
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?
 razorace
12-23-2003, 11:31 AM
#2
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).
 divoid
12-25-2003, 8:06 PM
#3
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....
 Wudan
12-27-2003, 6:24 PM
#4
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.
 divoid
12-27-2003, 6:50 PM
#5
ya, thats what i figured (g_active.c), and ive tried a few things, but ran out of ideas quickly
 Wudan
12-28-2003, 12:39 PM
#6
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.
 divoid
12-29-2003, 4:44 AM
#7
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
 razorace
12-30-2003, 5:17 AM
#8
You're going to have to add a zoom check to PmoveSingle in bg_pmove.c that makes "stiffenedUp" = qtrue.
 Wudan
12-30-2003, 1:38 PM
#9
To make the disruptor cancel out if the player is moving, or moving above a specified velocity:

about line 7201 in bg_pmove.c (http://www.mt-wudan.com/jkamp/bg__pmove_8c-source.html)

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;
}
 Wudan
12-30-2003, 1:40 PM
#10
After putting that in, you'll need to re-compile both your game and cgame dlls.
 Wudan
12-31-2003, 5:40 PM
#11
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.
Page: 1 of 1