lfnetwork.com mark read register faq members calendar

Thread: swoops and shaolin code
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 08-07-2004, 02:04 AM   #1
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
swoops and shaolin code

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
traceContents |= (CONTENTS_WATER|CONTENTS_SLIME|CONTENTS_LAVA);
}

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;

and

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
pm->tracemask |= (CONTENTS_WATER|CONTENTS_SLIME|CONTENTS_LAVA);

}

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.


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 08-07-2004, 02:20 AM   #2
Azymn
 
Azymn's Avatar
 
Join Date: Jul 2002
Location: ~(40.14, -111.40)
Posts: 544
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.

Azymn is offline   you may: quote & reply,
Old 08-07-2004, 03:08 AM   #3
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,187
Agreed.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > swoops and shaolin code

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:44 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.