Press a key for Auto Run???
by Eric Clausing · in Torque Game Engine · 02/12/2007 (4:33 pm) · 8 replies
Is there a way for a user to just assign a key and have it auto run forward? Like num lock back in the EQ days.
#2
02/13/2007 (7:01 am)
.
#3
02/13/2007 (7:05 am)
I tested the code, and it works fine. No errors, and functionality is perfectly replicated.
#4
02/13/2007 (7:11 am)
.
#5
This will reset auto running once the player takes control again, much like EQ, DAoC and so on.
*EDIT* You'll obviously want to repeat this in moveBackward.
02/13/2007 (7:13 am)
The one amendment I'll make to the code is this:function moveforward(%val)
{
$mvForwardAction = %val * $movementSpeed;
[b] $bAutoRun = 0;[/b]
}This will reset auto running once the player takes control again, much like EQ, DAoC and so on.
*EDIT* You'll obviously want to repeat this in moveBackward.
#6
02/13/2007 (9:11 am)
.
#7
02/13/2007 (9:36 am)
Sweet. That got me going. Thanks Michael.

Employee Michael Perry
ZombieShortbus
In example\starter.fps\client\scripts\default.bind.cs:
$bAutoRun = 0; function toggleAutoRun(%val) { if(%val) { $bAutoRun = !$bAutoRun; $mvForwardAction = $bAutoRun * $movementSpeed; } } moveMap.bind( keyboard, scrolllock, toggleAutoRun);