TriggerCount wont work
by Dennis Lamers · in Torque Game Engine · 12/18/2017 (3:57 am) · 3 replies
Hello,
For two years I have been trying to get this to work but at one point I gave up. Until today I wanted to fix this as crouch is a really must-have in my game. In default.bind, the crouch button is calling up this script.
Default.bind
..but in OptionsDlg.cs it's calling up a jet function on TriggerCount3.
In the original game where this is made for, crouch works. In the 1.5.2 version, crouch seems to be broken. Or is there some kind of engine edit needed?
For two years I have been trying to get this to work but at one point I gave up. Until today I wanted to fix this as crouch is a really must-have in my game. In default.bind, the crouch button is calling up this script.
Default.bind
function crouch(%val)
{
//$mvCrouch = %val;
$mvTriggerCount3++;
}..but in OptionsDlg.cs it's calling up a jet function on TriggerCount3.
function jet(%val)
{
if(%val)
$mvTriggerCount3++;
}In the original game where this is made for, crouch works. In the 1.5.2 version, crouch seems to be broken. Or is there some kind of engine edit needed?
About the author
Creator of Peekarica and Blockland Classic Mod.
Torque Owner Sorin Daraban
Default Studio Name
In what original game does this work?
Am I to understand that you're using the 1.5.2 version of the engine for your game?
From what I see, I believe that $mvTriggerCount3 is assigned in the engine to activate and deactivate the jet function. This means that you would have to go into the engine and assign a trigger for the crouch. You can assign up to nine triggers.
So, if $mvTriggerCount3 is assigned to enable and disable jetting, use $mvTriggerCount6, for example, to do the same for crouching.
There has to be a "CrouchPose" assigned to the player in the Player.h and Player.cpp files, the same way the other poses are assigned, such as the "StandPose."
So, in the engine, when you want to activated the crouch pose, you would have to have move->trigger[6] = true to enable and move->trigger[6] = false to disable crouching in Player::updateMove(const Move* move) in the Player.cpp class/file.
Lastly, you would have to go your crouch function in DefaultBind.cs and modify the $mvTriggerCount3++ to $mvTriggerCount6++.
Also don't forget to disable the crouch when not active with $mvTriggerCount6 = 0;
function crouch(%val) { if(%val) $mvTriggerCount6++; //Sorin D: Crouch (trigger[6] = true) is On. else $mvTriggerCount6 = 0; //Sorin D: Crouch (trigger[6] = false) is Off. }