T3D 1.1 Beta 2 - Triggers overlap (altFire & jetJump use same trigger, crouch uses "jet" trigger) - LOGGED
by Henry Todd · in Torque 3D Professional · 08/28/2010 (4:13 am) · 2 replies
Build: T3D 1.1 Beta 2 & all previous T3D versions.
Platform: Windows 7 64 bit, Intel Core 2 Quad, geForce GTX 285.
Target: Player Class, Player scripting.
Issue: The Move object holds 6 triggers, but Player is only making use of 5 of these, resulting in some overlap. Alt Fire uses trigger[1], as does the jetJump function. Jump uses 2, that's fine. Crouch uses trigger[3], which is the "jet" function in vehicles and should probably be Player jetJump to keep things consistant. Prone is 4, and 5 is unused.
To Replicate: If you have a weapon with alt fire and a Player with jetJump both functions are activated with mouse2 (trigger[1]). If you've defined a jet function for vehicles (trigger[3]), it will crouch when controlling a Player.
Suggestion: This might be the most consistant:
0: Primary Fire
1: Alt Fire
2: Jump
3: Jet/jetJump
4: Crouch
5: Prone
However, for a simpler code change:
0: Primary Fire
1: Alt Fire
2: Jump
3: Crouch
4: Prone
5: Jet/jetJump *(change Vehicle Class to use trigger[5] as well)
in Player.cpp, Player::UpdateMove change:
In Vehicle.cpp, Vehicle::UpdateMove change:
Additionally add this function to game/scripts/client/default.bind.cs:
While we're at it, add jetting and crouching to the control options dialog to allow remapping:
in core/scripts/gui/optionsDlg.cs in the long list that starts with "$RemapCount = 0;" add:
Platform: Windows 7 64 bit, Intel Core 2 Quad, geForce GTX 285.
Target: Player Class, Player scripting.
Issue: The Move object holds 6 triggers, but Player is only making use of 5 of these, resulting in some overlap. Alt Fire uses trigger[1], as does the jetJump function. Jump uses 2, that's fine. Crouch uses trigger[3], which is the "jet" function in vehicles and should probably be Player jetJump to keep things consistant. Prone is 4, and 5 is unused.
To Replicate: If you have a weapon with alt fire and a Player with jetJump both functions are activated with mouse2 (trigger[1]). If you've defined a jet function for vehicles (trigger[3]), it will crouch when controlling a Player.
Suggestion: This might be the most consistant:
0: Primary Fire
1: Alt Fire
2: Jump
3: Jet/jetJump
4: Crouch
5: Prone
However, for a simpler code change:
0: Primary Fire
1: Alt Fire
2: Jump
3: Crouch
4: Prone
5: Jet/jetJump *(change Vehicle Class to use trigger[5] as well)
in Player.cpp, Player::UpdateMove change:
if (move->trigger[1] && !isMounted() && canJetJump())to
if (move->trigger[5] && !isMounted() && canJetJump())
In Vehicle.cpp, Vehicle::UpdateMove change:
if (move->trigger[3]) {to:if (move->trigger[5]) {Additionally add this function to game/scripts/client/default.bind.cs:
function doJet(%val)
{
$mvTriggerCount5++;
}While we're at it, add jetting and crouching to the control options dialog to allow remapping:
in core/scripts/gui/optionsDlg.cs in the long list that starts with "$RemapCount = 0;" add:
$RemapName[$RemapCount] = "Jet"; $RemapCmd[$RemapCount] = "doJet"; $RemapCount++; $RemapName[$RemapCount] = "Crouch"; $RemapCmd[$RemapCount] = "doCrouch"; $RemapCount++;
About the author
Associate Michael Hall
Distracted...