View Full Version : swoops and shaolin code

08-07-2004, 01:04 AM
hey Razor, this is the coding i was talking about that i did for swoop bikes that i want to submit to ojp:

first to make the swoops float on top of water rather being stuck inside of them there's a code in bg_pmove.c that says

if ( pVeh->m_pVehicleInfo->bouyancy >= 2.0f ) {//sit on water

change the 2.0f to 1.0f and now all swoops should be operable on water like in sp.

Next what i did was make the pitch of the swoop bike orient itself properly w/ the ground slope just like the roll does.

There's a line in cg_players.c that says:

{ //yeah, a hack, sorry.
VectorSet(nhAngles, 0, cent->lerpAngles[YAW], cent->lerpAngles[ROLL]);

i changed it to this

{ //yeah, a hack, sorry.
VectorSet(nhAngles, cent->lerpAngles[PITCH], cent->lerpAngles[YAW], cent->lerpAngles[ROLL]);

so the thing can recognize the pitch. Under the VH_SPEEDER functions in cg_event.c and cg_main.c i commented out:

vehAngles[PITCH] = 0.0f;


data->mAngles[PITCH] = 0.0f;

Now, what will happen is that everytime you pitch your mouse up and down the swoop bikes will also pitch up and down which looks stupid, so you wanna change it to where it is simply based on ground slope. So go to bg_pmove.c and there's this thing that reads:

veh->m_pVehicle->m_vOrientation[PITCH] = pm->ps->viewangles[PITCH];

comment it out and you should have a swoop that now floats on water and is parallel to the ground in both pitch and slope.

And i was also telling you about running on the surface of water shaolin style. This is the code i used for it in bg_pmove.c and i stuck it in void BG_AdjustClientSpeed(.... function because that's where it would compile properly, i stated:

if ( (cmd->forwardmove) > 0 && !(cmd->buttons&BUTTON_WALKING) && (ps->speed >= 300) && (ps->fd.forcePowersActive & (1 << FP_SPEED)) )
{//shaolin run over water surface with force speed level 3 :)


what that does is whenever you enable force speed you can run across the surface of the water. its buggy and i'm havin difficulty getting it to just get it to work on force speed level 3 :/
anyways, that's the major chunk of what we were talking about, if you have any questions lemme know.

08-07-2004, 01:20 AM
If you wanna limit the shaolin run it to just Force Level 3, just add this check:

&& (ps->fd.forcePowerLevel[FP_SPEED]==FORCE_LEVEL_3)

Also, for consistency you could probably add the code to Pmove_Single, right underneath where BG_AdjustClientSpeed is called.

Those are cool ideas Tinny.

08-07-2004, 02:08 AM