Jump triggers
by Snowman · in Torque Game Engine · 11/27/2001 (11:46 am) · 3 replies
Hi-
I was having trouble because I wanted the jumping to happen based on once instead of continuous. (Right now, it incriments the move trigger on keyup and keydown.)
So, I went in to the code, in gameConnectionMoves.cc and looked at teh function bool GameConnection::getNextMove(Move &curMove).
I changed the if statement so that after it checks it resets the moveTrigger variable to 0. (that took care of my problem).
Now, my questions is, Will that have any unforseen consequences? Everything runs how I want it now, but I don't really know what the other trigger(s) are used for. I'm wondering if doing that would break something else.
Also, if that *is* a problem, can I count on i being equal to 2 every time the jump trigger comes up? (so that I can do a special case to handle the jump stuff).
Here's the old code:
if(MoveManager::mTriggerCount[i] & 1)
curMove.trigger[i] = true;
else if....
Here's my new code:
if(MoveManager::mTriggerCount[i])
{
curMove.trigger[i] = true;
MoveManager::mTriggerCount[i] = 0;
}
else if...
Thanks!
-Snowman
I was having trouble because I wanted the jumping to happen based on once instead of continuous. (Right now, it incriments the move trigger on keyup and keydown.)
So, I went in to the code, in gameConnectionMoves.cc and looked at teh function bool GameConnection::getNextMove(Move &curMove).
I changed the if statement so that after it checks it resets the moveTrigger variable to 0. (that took care of my problem).
Now, my questions is, Will that have any unforseen consequences? Everything runs how I want it now, but I don't really know what the other trigger(s) are used for. I'm wondering if doing that would break something else.
Also, if that *is* a problem, can I count on i being equal to 2 every time the jump trigger comes up? (so that I can do a special case to handle the jump stuff).
Here's the old code:
if(MoveManager::mTriggerCount[i] & 1)
curMove.trigger[i] = true;
else if....
Here's my new code:
if(MoveManager::mTriggerCount[i])
{
curMove.trigger[i] = true;
MoveManager::mTriggerCount[i] = 0;
}
else if...
Thanks!
-Snowman
About the author
#2
You could do something like this:
Then just use Con::addVariable so that you can access the $increaseTurn variable from c++ code, and check for that variable in your move function.
11/30/2001 (9:35 am)
Herm....You could do something like this:
function sharpTurn( %state )
{
$increaseTurn = %state;
}
moveMap.bind( "shift", "sharpTurn" );Then just use Con::addVariable so that you can access the $increaseTurn variable from c++ code, and check for that variable in your move function.
#3
I could probably add a variable to be like the other movevariables (I'll need to make sure it gets sent to the server too.)
Thanks for the idea!
-Snowman
PS GG guys, see any big problem with doing what I did in my first post? Thanks!
12/02/2001 (12:37 pm)
Yes, I suppose that is an option, thank you =)I could probably add a variable to be like the other movevariables (I'll need to make sure it gets sent to the server too.)
Thanks for the idea!
-Snowman
PS GG guys, see any big problem with doing what I did in my first post? Thanks!
Torque Owner Snowman
When I map a function to "shift left" it works fine *only* if I hit shift then left. I want the user to be able to be holding down left, hit shit (doing a different function), and release shift continuing to the original function.
Right now left turns my skiier, shift left would be a sharper turn. As you can see, it is desireable that I am able to hit shift while holding left.
Thank you!
-Snowman