Game Development Community

Run and Jump Energy Drain

by Daniel Neilsen · in Torque Game Engine · 10/08/2001 (2:40 pm) · 6 replies

Has anyone actually managed to get the run and jump energy drain to work? I certainly cant seem to.

The problem, it would seem, is in this piece of code in player.cc at line 1665

if (mEnergy >= mDataBlock->minRunEnergy) {
mEnergy -= mDataBlock->runEnergyDrain;
pv = moveVec;
}

for some reason, the pointer of
mDataBlock->runEnergyDrain
always resolves to 0, irrespective of what value has been assigned to it in the datablock in both player.cc and player.cs.

This is the same for the jumpEnergyDrain as well.

Does anyone have any ideas in relation to this?

#1
10/08/2001 (4:36 pm)
It works fine for me. But it doesn't only drain while running, it drains while standing there too.

It should be an easy fix though. I'm avoiding adding anything else to the engine until the new version is finished.


Dark
#2
10/09/2001 (1:49 pm)
For me, even with the supplied v12test.exe, it dosnt want to work. For some reason the pointers always return 0.

:(
#3
10/10/2001 (12:13 pm)
Did you look at the engine code? I might have tweaked something to get it to work.


Dark
#4
10/10/2001 (2:03 pm)
No problems
I got it working.
I had a rogue script messing things up...heh :)
#5
01/14/2004 (9:01 pm)
How did u fix it what did the rogue script do?
i haev the same issue
#6
01/14/2004 (9:19 pm)
Solved, the script player.cs overrides the code player.cc