Sprint Button
by Daniel Neilsen · 05/13/2002 (10:56 am) · 79 comments
Download Code File
Adding a Player Sprint Key
by Daniel "Wizard_TPG" Neilsen
wizardsworld@bigpond.com
This is quite a simple thing to do but requires the editing of
several files in the torque engine. I have based this on the
latest HEAD version as at 13/5/02 but, I originally coded this
for the original release of torque so it should be compatible
with all torque versions to date.
Before we go too much further I should say this
DISCLAIMER - I am certainly not the best at C++ in the world but
this worked for me so it should work for you too.
- The line numbers are taken from my edit version of
the engine so should be considered approximate only.
STEP 1 - Adding a sprint toggle into the engine
Open MoveManager.h and add this line to line 29
bool sprint;
result should look like this
bool freeLook;
bool sprint;
bool trigger[MaxTriggerKeys];
Add this to line 50
static bool mSprint;
result should look like this
static bool mFreeLook;
static bool mSprint;
static F32 mPitch;
static F32 mYaw;
static F32 mRoll;
Open GameConnectionMoves.cc and add this line to line 29
bool MoveManager::mSprint = false;
result should look like this
bool MoveManager::mFreeLook = false;
bool MoveManager::mSprint = false;
F32 MoveManager::mPitch = 0;
F32 MoveManager::mYaw = 0;
F32 MoveManager::mRoll = 0;
Add this to line 64
Con::addVariable("mvSprint", TypeBool, &mSprint);
result should look like this
Con::addVariable("mvFreeLook", TypeBool, &mFreeLook);
Con::addVariable("mvSprint", TypeBool, &mSprint);
Con::addVariable("mvPitch", TypeF32, &mPitch);
Con::addVariable("mvYaw", TypeF32, &mYaw);
Con::addVariable("mvRoll", TypeF32, &mRoll);
Add this to line 148
stream->writeFlag(sprint);
result should look like this
stream->writeFlag(freeLook);
stream->writeFlag(sprint);
Add this to line 172
sprint = stream->readFlag();
result should look like this
freeLook = stream->readFlag();
sprint = stream->readFlag();
Add this to line 199
curMove.sprint = MoveManager::mSprint;
result should look like this
curMove.freeLook = MoveManager::mFreeLook;
curMove.sprint = MoveManager::mSprint;
Open default.bind.cs and add the following
function toggleSprint( %val )
{
if ( %val )
$mvSprint = true;
else
$mvSprint = false;
}
moveMap.bind( keyboard, q, toggleSprint );
ok, cool, we got a sprint button....but it dosnt do didly squat...doh!
hmmm better make it do something then eh?
Just a quick offside... For those that didnt notice, we literally copied the freelook
all the way. This method can be used for any toggle button you wish to add.
STEP 2 - THE SPRINT DATABLOCK SETTINGS
The next step is to add new properties into the playerdata datablock
for the sprint speed, force, energy drain and min energy
Open player.h and add the following at line 57
F32 SprintSpeedMult; // Player max speed increase when sprinting eg. 1.2 = 20% increase
F32 SprintForceMult; // Player run force increase when sprinting eg. 1.2 = 20% increase
F32 sprintEnergyDrain; // Energy drain/tick
F32 minSprintEnergy; // Energy required to sprint
Result should look like this:
F32 SprintSpeedMult;
F32 SprintForceMult;
F32 sprintEnergyDrain; // Energy drain/tick
F32 minSprintEnergy;
F32 maxStepHeight;
F32 runSurfaceAngle; // Angle from vertical in degrees
Open player.cc and add the following at line 170
SprintSpeedMult = 1.2;
SprintForceMult = 1.2;
sprintEnergyDrain = 2;
minSprintEnergy = 2;
Result should look like this:
SprintSpeedMult = 1.2;
SprintForceMult = 1.2;
sprintEnergyDrain = 2;
minSprintEnergy = 2;
maxStepHeight = 1;
runSurfaceAngle = 80;
add the following at line 450
addField("SprintSpeedMult", TypeF32, Offset(SprintSpeedMult, PlayerData));
addField("SprintForceMult", TypeF32, Offset(SprintForceMult, PlayerData));
addField("sprintEnergyDrain", TypeF32, Offset(sprintEnergyDrain, PlayerData));
addField("minSprintEnergy", TypeF32, Offset(minSprintEnergy, PlayerData));
Result should look like this:
addField("SprintSpeedMult", TypeF32, Offset(SprintSpeedMult, PlayerData));
addField("SprintForceMult", TypeF32, Offset(SprintForceMult, PlayerData));
addField("sprintEnergyDrain", TypeF32, Offset(sprintEnergyDrain, PlayerData));
addField("minSprintEnergy", TypeF32, Offset(minSprintEnergy, PlayerData));
addField("runSurfaceAngle", TypeF32, Offset(runSurfaceAngle, PlayerData));
addField("recoverDelay", TypeS32, Offset(recoverDelay, PlayerData));
addField("recoverRunForceScale", TypeF32, Offset(recoverRunForceScale, PlayerData));
add the following at line 643
stream->write(SprintSpeedMult);
stream->write(SprintForceMult);
stream->write(sprintEnergyDrain);
stream->write(minSprintEnergy);
Result should look like this:
stream->write(SprintSpeedMult);
stream->write(SprintForceMult);
stream->write(sprintEnergyDrain);
stream->write(minSprintEnergy);
stream->write(recoverDelay);
stream->write(recoverRunForceScale);
add the following at line 761
stream->read(&SprintSpeedMult);
stream->read(&SprintForceMult);
stream->read(&sprintEnergyDrain);
stream->read(&minSprintEnergy);
Result should look like this:
stream->read(&runSurfaceAngle);
stream->read(&SprintSpeedMult);
stream->read(&SprintForceMult);
stream->read(&sprintEnergyDrain);
stream->read(&minSprintEnergy);
stream->read(&recoverDelay);
stream->read(&recoverRunForceScale);
STEP 3 - THE MOVEMENT
Now we have the button working, and we have the sprint settings in the engine
Time to make it all work. The basics of sprinting is we are "amplifying" the
players speed.
Before these three lines at approx line 1660
// Desired move direction & speed
VectorF moveVec;
F32 moveSpeed;
add the following:
//Check if sprinting
F32 tempSprintSpeedMult;
F32 tempSprintForceMult;
tempSprintSpeedMult = 1;
tempSprintForceMult = 1;
if (move->sprint)
{
tempSprintSpeedMult = mDataBlock->SprintSpeedMult;
tempSprintForceMult = mDataBlock->SprintForceMult;
if (mEnergy < mDataBlock->minSprintEnergy)
{
tempSprintSpeedMult = 1;
tempSprintForceMult = 1;
}
}
Change the following lines at approx line 1422 like so..
if (move->y > 0)
{
if( mWaterCoverage >= 0.9 )
moveSpeed = getMax(mDataBlock->maxUnderwaterForwardSpeed * tempSprintSpeedMult * move->y,
mDataBlock->maxUnderwaterSideSpeed * tempSprintSpeedMult * mFabs(move->x));
else
moveSpeed = getMax(mDataBlock->maxForwardSpeed * tempSprintSpeedMult * move->y,
mDataBlock->maxSideSpeed * tempSprintSpeedMult * mFabs(move->x));
}
else
{
if( mWaterCoverage >= 0.9 )
moveSpeed = getMax(mDataBlock->maxUnderwaterBackwardSpeed * tempSprintSpeedMult * mFabs(move->y),
mDataBlock->maxUnderwaterSideSpeed * tempSprintSpeedMult * mFabs(move->x));
else
moveSpeed = getMax(mDataBlock->maxBackwardSpeed * tempSprintSpeedMult * mFabs(move->y),
mDataBlock->maxSideSpeed * tempSprintSpeedMult * mFabs(move->x));
}
Change the following lines at approx line 1482 like so..
VectorF pv;
if(moveSpeed > 0)
{
if (move->sprint && mEnergy >= mDataBlock->minSprintEnergy)
{
mEnergy -= mDataBlock->sprintEnergyDrain;
}
else if (mEnergy >= mDataBlock->minRunEnergy)
{
mEnergy -= mDataBlock->runEnergyDrain;
pv = moveVec;
}
}
else
pv.set(0,0,0);
Change the following lines at approx line 1513 like so..
// Clamp acceleratin, player also accelerates faster when
// in his hard landing recover state.
F32 maxAcc = (mDataBlock->runForce / mMass) * TickSec;
if (move->sprint)
maxAcc *= mDataBlock->SprintForceMult;
if (mState == RecoverState)
maxAcc *= mDataBlock->recoverRunForceScale;
if (runSpeed > maxAcc)
runAcc *= maxAcc / runSpeed;
acc += runAcc;
And there you have it. A working sprint key.
Enjoy :)
Adding a Player Sprint Key
by Daniel "Wizard_TPG" Neilsen
wizardsworld@bigpond.com
This is quite a simple thing to do but requires the editing of
several files in the torque engine. I have based this on the
latest HEAD version as at 13/5/02 but, I originally coded this
for the original release of torque so it should be compatible
with all torque versions to date.
Before we go too much further I should say this
DISCLAIMER - I am certainly not the best at C++ in the world but
this worked for me so it should work for you too.
- The line numbers are taken from my edit version of
the engine so should be considered approximate only.
STEP 1 - Adding a sprint toggle into the engine
Open MoveManager.h and add this line to line 29
bool sprint;
result should look like this
bool freeLook;
bool sprint;
bool trigger[MaxTriggerKeys];
Add this to line 50
static bool mSprint;
result should look like this
static bool mFreeLook;
static bool mSprint;
static F32 mPitch;
static F32 mYaw;
static F32 mRoll;
Open GameConnectionMoves.cc and add this line to line 29
bool MoveManager::mSprint = false;
result should look like this
bool MoveManager::mFreeLook = false;
bool MoveManager::mSprint = false;
F32 MoveManager::mPitch = 0;
F32 MoveManager::mYaw = 0;
F32 MoveManager::mRoll = 0;
Add this to line 64
Con::addVariable("mvSprint", TypeBool, &mSprint);
result should look like this
Con::addVariable("mvFreeLook", TypeBool, &mFreeLook);
Con::addVariable("mvSprint", TypeBool, &mSprint);
Con::addVariable("mvPitch", TypeF32, &mPitch);
Con::addVariable("mvYaw", TypeF32, &mYaw);
Con::addVariable("mvRoll", TypeF32, &mRoll);
Add this to line 148
stream->writeFlag(sprint);
result should look like this
stream->writeFlag(freeLook);
stream->writeFlag(sprint);
Add this to line 172
sprint = stream->readFlag();
result should look like this
freeLook = stream->readFlag();
sprint = stream->readFlag();
Add this to line 199
curMove.sprint = MoveManager::mSprint;
result should look like this
curMove.freeLook = MoveManager::mFreeLook;
curMove.sprint = MoveManager::mSprint;
Open default.bind.cs and add the following
function toggleSprint( %val )
{
if ( %val )
$mvSprint = true;
else
$mvSprint = false;
}
moveMap.bind( keyboard, q, toggleSprint );
ok, cool, we got a sprint button....but it dosnt do didly squat...doh!
hmmm better make it do something then eh?
Just a quick offside... For those that didnt notice, we literally copied the freelook
all the way. This method can be used for any toggle button you wish to add.
STEP 2 - THE SPRINT DATABLOCK SETTINGS
The next step is to add new properties into the playerdata datablock
for the sprint speed, force, energy drain and min energy
Open player.h and add the following at line 57
F32 SprintSpeedMult; // Player max speed increase when sprinting eg. 1.2 = 20% increase
F32 SprintForceMult; // Player run force increase when sprinting eg. 1.2 = 20% increase
F32 sprintEnergyDrain; // Energy drain/tick
F32 minSprintEnergy; // Energy required to sprint
Result should look like this:
F32 SprintSpeedMult;
F32 SprintForceMult;
F32 sprintEnergyDrain; // Energy drain/tick
F32 minSprintEnergy;
F32 maxStepHeight;
F32 runSurfaceAngle; // Angle from vertical in degrees
Open player.cc and add the following at line 170
SprintSpeedMult = 1.2;
SprintForceMult = 1.2;
sprintEnergyDrain = 2;
minSprintEnergy = 2;
Result should look like this:
SprintSpeedMult = 1.2;
SprintForceMult = 1.2;
sprintEnergyDrain = 2;
minSprintEnergy = 2;
maxStepHeight = 1;
runSurfaceAngle = 80;
add the following at line 450
addField("SprintSpeedMult", TypeF32, Offset(SprintSpeedMult, PlayerData));
addField("SprintForceMult", TypeF32, Offset(SprintForceMult, PlayerData));
addField("sprintEnergyDrain", TypeF32, Offset(sprintEnergyDrain, PlayerData));
addField("minSprintEnergy", TypeF32, Offset(minSprintEnergy, PlayerData));
Result should look like this:
addField("SprintSpeedMult", TypeF32, Offset(SprintSpeedMult, PlayerData));
addField("SprintForceMult", TypeF32, Offset(SprintForceMult, PlayerData));
addField("sprintEnergyDrain", TypeF32, Offset(sprintEnergyDrain, PlayerData));
addField("minSprintEnergy", TypeF32, Offset(minSprintEnergy, PlayerData));
addField("runSurfaceAngle", TypeF32, Offset(runSurfaceAngle, PlayerData));
addField("recoverDelay", TypeS32, Offset(recoverDelay, PlayerData));
addField("recoverRunForceScale", TypeF32, Offset(recoverRunForceScale, PlayerData));
add the following at line 643
stream->write(SprintSpeedMult);
stream->write(SprintForceMult);
stream->write(sprintEnergyDrain);
stream->write(minSprintEnergy);
Result should look like this:
stream->write(SprintSpeedMult);
stream->write(SprintForceMult);
stream->write(sprintEnergyDrain);
stream->write(minSprintEnergy);
stream->write(recoverDelay);
stream->write(recoverRunForceScale);
add the following at line 761
stream->read(&SprintSpeedMult);
stream->read(&SprintForceMult);
stream->read(&sprintEnergyDrain);
stream->read(&minSprintEnergy);
Result should look like this:
stream->read(&runSurfaceAngle);
stream->read(&SprintSpeedMult);
stream->read(&SprintForceMult);
stream->read(&sprintEnergyDrain);
stream->read(&minSprintEnergy);
stream->read(&recoverDelay);
stream->read(&recoverRunForceScale);
STEP 3 - THE MOVEMENT
Now we have the button working, and we have the sprint settings in the engine
Time to make it all work. The basics of sprinting is we are "amplifying" the
players speed.
Before these three lines at approx line 1660
// Desired move direction & speed
VectorF moveVec;
F32 moveSpeed;
add the following:
//Check if sprinting
F32 tempSprintSpeedMult;
F32 tempSprintForceMult;
tempSprintSpeedMult = 1;
tempSprintForceMult = 1;
if (move->sprint)
{
tempSprintSpeedMult = mDataBlock->SprintSpeedMult;
tempSprintForceMult = mDataBlock->SprintForceMult;
if (mEnergy < mDataBlock->minSprintEnergy)
{
tempSprintSpeedMult = 1;
tempSprintForceMult = 1;
}
}
Change the following lines at approx line 1422 like so..
if (move->y > 0)
{
if( mWaterCoverage >= 0.9 )
moveSpeed = getMax(mDataBlock->maxUnderwaterForwardSpeed * tempSprintSpeedMult * move->y,
mDataBlock->maxUnderwaterSideSpeed * tempSprintSpeedMult * mFabs(move->x));
else
moveSpeed = getMax(mDataBlock->maxForwardSpeed * tempSprintSpeedMult * move->y,
mDataBlock->maxSideSpeed * tempSprintSpeedMult * mFabs(move->x));
}
else
{
if( mWaterCoverage >= 0.9 )
moveSpeed = getMax(mDataBlock->maxUnderwaterBackwardSpeed * tempSprintSpeedMult * mFabs(move->y),
mDataBlock->maxUnderwaterSideSpeed * tempSprintSpeedMult * mFabs(move->x));
else
moveSpeed = getMax(mDataBlock->maxBackwardSpeed * tempSprintSpeedMult * mFabs(move->y),
mDataBlock->maxSideSpeed * tempSprintSpeedMult * mFabs(move->x));
}
Change the following lines at approx line 1482 like so..
VectorF pv;
if(moveSpeed > 0)
{
if (move->sprint && mEnergy >= mDataBlock->minSprintEnergy)
{
mEnergy -= mDataBlock->sprintEnergyDrain;
}
else if (mEnergy >= mDataBlock->minRunEnergy)
{
mEnergy -= mDataBlock->runEnergyDrain;
pv = moveVec;
}
}
else
pv.set(0,0,0);
Change the following lines at approx line 1513 like so..
// Clamp acceleratin, player also accelerates faster when
// in his hard landing recover state.
F32 maxAcc = (mDataBlock->runForce / mMass) * TickSec;
if (move->sprint)
maxAcc *= mDataBlock->SprintForceMult;
if (mState == RecoverState)
maxAcc *= mDataBlock->recoverRunForceScale;
if (runSpeed > maxAcc)
runAcc *= maxAcc / runSpeed;
acc += runAcc;
And there you have it. A working sprint key.
Enjoy :)
About the author
#22
06/08/2002 (6:07 pm)
yeah I got all that. This is really odd.
#23
Edit: oops, it appears to be working, but the player's energy was draining so fast, that by the time my PC had quit jerking the graphics around, the player had been drained of energy! :P
06/10/2002 (7:12 pm)
I have the code into a CVS HEAD version I took out today, but it doesn't seem to alter the movement speed. I'll check if it is in fact toggling the sprint, but so far it doesn't look like it is.Edit: oops, it appears to be working, but the player's energy was draining so fast, that by the time my PC had quit jerking the graphics around, the player had been drained of energy! :P
#24
06/11/2002 (3:27 am)
well I don't think I'm draining at all. maybe draining too fast as you said mmm...
#25
06/11/2002 (4:24 am)
It might help to drop in an energy bar to see what's happening.
#26
06/11/2002 (4:36 am)
good idea!
#27
to:
This will exaggerate the sprinting and make it easier to spot what's happening.
06/11/2002 (9:23 am)
A good way to test is change the variables fromSprintSpeedMult = 1.2; SprintForceMult = 1.2; sprintEnergyDrain = 2; minSprintEnergy = 2;
to:
SprintSpeedMult = 2; SprintForceMult = 2; sprintEnergyDrain = 1; minSprintEnergy = 2;
This will exaggerate the sprinting and make it easier to spot what's happening.
#28
Replace the existing Health Bar Hud in playGui.gui with this:
Make sure these are set in player.cs:
And I think you're good to go!! If I've forgotten anything or this doesn't work, let me know.
The last thing I want to implement for the sprint feature is to have the player's energy be reduced by the same amount when the player takes damage. So if you're injured, you can't run for the same length of time as when you're healthy.
06/13/2002 (8:00 am)
Also, with a small bit of work, you can tie the sprinting feature into the hidden energy bar.Replace the existing Health Bar Hud in playGui.gui with this:
new GuiHealthBarHud() {
profile = "GuiDefaultProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "440 20";
extent = "184 25";
minExtent = "8 8";
visible = "1";
helpTag = "0";
showFill = "1";
showFrame = "1";
displayEnergy = "0";
fillColor = "0.000000 0.000000 0.000000 0.500000";
frameColor = "0.000000 1.000000 0.000000 0.500000";
damageFillColor = "0.000000 1.000000 0.000000 1.000000";
pulseRate = "1000";
pulseThreshold = "0.5";
value = "1";
};
new GuiHealthBarHud() {
profile = "GuiDefaultProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "440 60";
extent = "184 25";
minExtent = "8 8";
visible = "1";
helpTag = "0";
showFill = "1";
showFrame = "1";
displayEnergy = "1";
fillColor = "0.000000 0.000000 0.000000 0.500000";
frameColor = "0.000000 1.000000 0.000000 0.500000";
damageFillColor = "0.000000 1.000000 0.000000 1.000000";
pulseRate = "1000";
pulseThreshold = "0.5";
value = "1";
};Make sure these are set in player.cs:
runEnergyDrain = 0; sprintEnergyDrain = 0.5;
And I think you're good to go!! If I've forgotten anything or this doesn't work, let me know.
The last thing I want to implement for the sprint feature is to have the player's energy be reduced by the same amount when the player takes damage. So if you're injured, you can't run for the same length of time as when you're healthy.
#29
06/13/2002 (3:39 pm)
Weird, I had it so that when the player took damage, the energy was affected as well. But now it isn't. Has anyone managed to get this working?
#30
not be:
Also, I'm trying to force the player to walk when energy runs out while sprinting, but I'm not having any luck. Not matter what I try, the player keeps sprinting, even though the condition is reached where:
Has anyone else tried this?
06/14/2002 (7:16 am)
I have a couple of questions. Should:if (move->sprint) maxAcc *= mDataBlock->SprintForceMult;
not be:
if (move->sprint) maxAcc *= tempSprintForceMult ;
Also, I'm trying to force the player to walk when energy runs out while sprinting, but I'm not having any luck. Not matter what I try, the player keeps sprinting, even though the condition is reached where:
mEnergy < mDataBlock->minSprintEnergy
Has anyone else tried this?
#31
The only changes I made were the ones I listed above. Of course most of the line numbers referenced in the second have of the tut didn't really line up for me quite the same.
06/14/2002 (7:29 am)
I have a visible energy bar in and the Sprint action works fine with it. The player Sprints with the button held down until the energy level is drained, then the player reverts to the normal walk.The only changes I made were the ones I listed above. Of course most of the line numbers referenced in the second have of the tut didn't really line up for me quite the same.
#32
Edit: the player does appear to slow down when his energy reaches zero, but not to a walking pace. It's somewhere between the normal speed and the sprint speed, though it's nearer sprint than walk. Then again, I use:
06/14/2002 (7:46 am)
Hmmmmmmm, mine doesn't work that way for some reason.Edit: the player does appear to slow down when his energy reaches zero, but not to a walking pace. It's somewhere between the normal speed and the sprint speed, though it's nearer sprint than walk. Then again, I use:
SprintSpeedMult = 2.0; SprintForceMult = 2.0;
#33
Here's my current player settings:
rechargeRate = 0.1;
SprintSpeedMult = 2.0;
SprintForceMult = 2.0;
sprintEnergyDrain = 0.5;
minSprintEnergy = 5;
06/14/2002 (9:11 am)
Maybe your energy level is recharging a little too quick.Here's my current player settings:
rechargeRate = 0.1;
SprintSpeedMult = 2.0;
SprintForceMult = 2.0;
sprintEnergyDrain = 0.5;
minSprintEnergy = 5;
#34
Thanks
06/14/2002 (9:16 am)
Ok now I see it. That appears to work better, except that when the sprint button is down and energy is below the minimum, things are slightly jerky. But that does work better. I had a rechargeRate of 0.256.Thanks
#35
When you make your player run, the footstep sounds don't speed up; they stay at the same rate. I'm going to see if I can work out how to fix it, but don't hold your breath!
06/28/2002 (2:19 pm)
I found a problem with this implementation, or at least something that needs addressing somehow.When you make your player run, the footstep sounds don't speed up; they stay at the same rate. I'm going to see if I can work out how to fix it, but don't hold your breath!
#36
Maybe the run animation should be sped up a bit to match the increase in speed. I haven't looked to see what triggers the footstep sound.
07/01/2002 (6:16 am)
Good point Mike. I hadn't really noticed that, but I'm sure you're right. Maybe the run animation should be sped up a bit to match the increase in speed. I haven't looked to see what triggers the footstep sound.
#37
When the player sprints and fires, any muzzle flash is displayed behind the muzzle of the gun, due to extra speed. It works fine when you're walking though.
07/23/2002 (10:44 am)
Something else to think about.When the player sprints and fires, any muzzle flash is displayed behind the muzzle of the gun, due to extra speed. It works fine when you're walking though.
#38
I think the way around this is to animate the weapon model to display a muzzle flash and use the muzzlePoint of the weapon for smoke or additional effects like that. I'm pretty sure that's what most FPS style games do. That's why the muzzleflashes in those games seem to always be in the right spot. I think even the Crime Wars demo does it this way. I've looked at the script and it appears they initially tried it like the default method in the Torque engine, then switched over to the animated weapon method and use the RifleFireEmitter for smoke.
07/23/2002 (11:02 am)
I also see this when you simple jump off a cliff firing or while using the jetting ability I've added (mostly from sources here). I think the way around this is to animate the weapon model to display a muzzle flash and use the muzzlePoint of the weapon for smoke or additional effects like that. I'm pretty sure that's what most FPS style games do. That's why the muzzleflashes in those games seem to always be in the right spot. I think even the Crime Wars demo does it this way. I've looked at the script and it appears they initially tried it like the default method in the Torque engine, then switched over to the animated weapon method and use the RifleFireEmitter for smoke.
#39
What I mean is that implementing a sprint button seems to cause a few side effects elsewhere.
07/23/2002 (12:24 pm)
Maybe another (large scale) solution would be to implement a "walk" button, instead of a "sprint" button.What I mean is that implementing a sprint button seems to cause a few side effects elsewhere.
#40
07/29/2002 (3:11 pm)
anyone get this piece workin right yet? 
Torque Owner Sabrecyd
1 - the curMove.freeLook = MoveManager::mSprint;
should be curMove.sprint = MoveManager::mSprint; (looks like it's fixed now in the example).
2 - the line missing from the example (pv = moveVec; )
The only other thing might be the location you have your code. I'd check the section that says to place it around line 1660. It's more like 1410 before adding any other code changes. Also make sure that section comes before the 3 lines:
// Desired move direction & speed
VectorF moveVec;
F32 moveSpeed;
Oh, and make sure you have the "q" toggle setup in both the default.bind.cs and the config.cs if there is one. Might want to delete those two .dso files just to make sure it creates new ones.
config.cs is in the fps\client folder.