News: SMF - Just Installed!
 
Welcome, Guest. Please login or register.
+  AnthraxBio
|-+  Return to Castle Wolfenstein
| |-+  Coding Tutorials
| | |-+  Weapon Controled Player Speeds
« previous next »
Pages: [1] Print
Author Topic: Weapon Controled Player Speeds  (Read 267 times)
SkreamerVirii
Administrator
Full Member
*****
Posts: 133


View Profile
« on: September 03, 2008, 11:05:57 PM »

Weapon controled player speeds
In this Tutorial i will show you how to increase your players speed by which weapon he has
i will be using the venom for demonstration purposes
at the moment when you switch to the venom you walk REALLy slow well were goping to fix that and allow you to run as fast as if you werent carrying it all
so set your project to game and open up bg_pmove.c and scroll to line 368 were you should see this code
// JPW NERVE -- half move speed if heavy weapon is carried
// this is the counterstrike way of doing it -- ie you can switch to a non-heavy weapon and move at
// full speed. not completely realistic (well, sure, you can run faster with the weapon strapped to your
// back than in carry position) but more fun to play. If it doesn't play well this way we'll bog down the
// player if the own the weapon at all.
//
// added #ifdef for game/cgame to project so we can get correct g_gametype variable and only do this in
// multiplayer if necessary
if (pm->gametype != GT_SINGLE_PLAYER)
{
if ((pm->ps->weapon == WP_VENOM) || (pm->ps->weapon == WP_VENOM_FULL) || (pm->ps->weapon == WP_PANZERFAUST))
scale *= 0.5;
if (pm->ps->weapon == WP_FLAMETHROWER) // trying some different balance for the FT
scale *= 0.7;
}
// jpw
return scale;
}

Now make it look like this
// JPW NERVE -- half move speed if heavy weapon is carried
// this is the counterstrike way of doing it -- ie you can switch to a non-heavy weapon and move at
// full speed. not completely realistic (well, sure, you can run faster with the weapon strapped to your
// back than in carry position) but more fun to play. If it doesn't play well this way we'll bog down the
// player if the own the weapon at all.
//
// added #ifdef for game/cgame to project so we can get correct g_gametype variable and only do this in
// multiplayer if necessary
if (pm->gametype != GT_WOLF)
{
if ((pm->ps->weapon == WP_VENOM) || (pm->ps->weapon == WP_VENOM_FULL) || (pm->ps->weapon == WP_PANZERFAUST))
scale *= 0.9;
if (pm->ps->weapon == WP_FLAMETHROWER) // trying some different balance for the FT
scale *= 0.7;
}
// jpw
return scale;
}

Once again changed
if (pm->gametype != GT_SINGLE_PLAYER)
{
to
if (pm->gametype != GT_WOLF)
{
Just for good measure.

and then i changed
scale *= 0.5;

to
scale *= 0.9;

a while back it didnt seem to want to go over 9
if you have that problem then tell me especially if you fixed it
maybe 9 is its max
« Last Edit: September 03, 2008, 11:27:35 PM by SkreamerVirii » Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Free SMF 1.1.5 Forum Theme by Tamuril. © 2008.