Game Development Community

Going from prone to stand - walk speed too slow

by Andy J Edmonds · in Torque 3D Professional · 03/28/2012 (2:10 am) · 12 replies

Hi all,

I've added prone to our character by giving it the animations and adding the following to default.bind.cs:

function doProne(%val)
{
   $mvTriggerCount4++;
}

movemap.bind(keyboard, z, doProne);

I have a problem in that if I go from prone back to standing and walk forwards, the character speed stays at the prone speed (ie too slow). If I go to crouch and back, the problem doesn't exist. I have tried to track the problem down and am outputting mPose to the console.

When I go from prone back to stand, mPose constantly alternates between 3 (prone) and 0 (stand) whereas when I go from crouch back to stand, mPose stays constant at 0 so it looks like mPose isn't getting set correctly when I go back to stand from prone.

Has anyone else seen this problem?

Thanks,

Andy

About the author

Formed in 2005, EiKON Games is an indie games development project based in the UK working on the tactical first person shooter "Epoch: Incursion". See the Join Us or Contact Us pages at http://www.eikon-games.com/


#1
03/28/2012 (7:12 am)
the soldier_rigged.cs has entries:

"setSequenceGroundSpeed"
and
"setSequenceCyclic"

try adding new one's for the new poses
#2
03/28/2012 (7:20 am)
Hey deepscratch (long time no speak)

I just tried that and still no joy. In fact, I dropped our player character straight into a fresh install of T3D 1.2, added the doProne() function and it worked perfectly so it must be something I have broken :)

I'm currently chipping away at Player.cpp to try and work it out...
#3
03/28/2012 (7:33 am)
So here's an interesting thing...

In Player.cpp just before
setPose( desiredPose );
I echo desiredPose out to the console

While standing, I get:
desiredPose: 0
desiredPose: 0
desiredPose: 0
desiredPose: 0
..all good.

While crouching, I get:
desiredPose: 2
desiredPose: 2
desiredPose: 2
desiredPose: 2
...also good

Back to standing:
desiredPose: 0
desiredPose: 0
desiredPose: 0
desiredPose: 0
...correct

While prone, I get:
desiredPose: 3
desiredPose: 3
desiredPose: 3
desiredPose: 3
...again, fine

However, when I go back to standing from prone, I get:
desiredPose: 3
desiredPose: 0
desiredPose: 3
desiredPose: 0
desiredPose: 3
desiredPose: 0

..Not so good.
#4
03/28/2012 (8:58 am)
Is there a reason that your desiredPose variable is missing its %?

I'm just wondering, because sim names (object names, GUI object names, etc) are usually written this way and there might be something weird happening under the hood....
#5
03/28/2012 (1:13 pm)
Hi Richard,

I'm not sure I understand the question... The output above is just an output to the console of the desiredPose variable (the number referring to the Pose enum) using:
Con::errorf("desiredPose: %d", desiredPose);
There is definitely something weird going on under the hood though - I just need to figure out what it is :)
#6
03/28/2012 (3:16 pm)
Ah - engine side console output. I thought you were using echo() from script and that made me expect %desiredPose instead of desiredPose.
#7
03/28/2012 (3:22 pm)
@Richard
That's what you get for trying to be helpful first thing in the morning without enough tea/coffee in you ... happens to me all the time! ;)
#8
03/30/2012 (4:08 am)
Riiiiiiight... So I just finished merging every single source code change from our game into a fresh install of T3D 1.2 - one by one: merge, compile, test... Yeah, tedious.. :)

At the end of all that, it still worked perfectly in the fresh install. So I moved the compiled FPS Example binaries from my test over to the actual game and ran it from there... And it was broken again.

Which means it's definitely not a source code problem. I was absolutely convinced it was. Time to start on the scripts now.

...You just know this is going to turn out to be something unbelievably simple / stupid on my part, don't you?
#9
03/30/2012 (5:52 am)
Gaaaah... Exactly as predicted. Turns out that it was the boundingBox in my PlayerData datablock that was causing the problem all along! I'm not entirely sure why it happened, but at least it's fixed!
#10
03/30/2012 (5:59 am)
Hurray for fixings!
#11
03/30/2012 (6:27 am)
My nemesis has been syntax errors that Torsion doesn't feel like catching for me if they occur in the right circumstances. For instance - that extra ) at the end of an if....

Or -
MyObject.myMember;

when you forget to assign something. This made the entire script decide not to load. If I had hair I'd have been pulling it out - fortunately my boss asked me what I was trying to do there. My answer was "Aw, really?"
#12
03/30/2012 (7:58 am)
= / ==

Sometimes it's a worthy opponent!

If typos can be classed as opponents ...