Jump to content

Home

jo style disruptor


divoid

Recommended Posts

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...