Game Development Community

vehicle door trigger

by Anthony Rosenbaum · in Torque Game Engine · 03/11/2002 (6:04 pm) · 2 replies

Maybe someone can help with this
If I want my vehicl's door's to open when then vehicle spawns then close when ther person is mounted" I would
function VehicleThing::onAdd(){
Parent::0nAdd(%this, %obj);
//other code
[b]
%obj.schedule(5500, "playThread", $ActiveThread, "open_door");[/b]
}

then

function VehicleThing:playerMounted(%data, %obj, %player, %node){
//other code
//HERE I HAVE NO CLUE}

so it takes the sequence "open_door" and plays it till the end(assuming it is non cyclic)could someone explain the 5500 , im sure it deals with ticks or something.

What do I put in the schedule for on mounted? I found a referance to
bool setThreadDir(thread,bool);

so could it be
%obj.schedule(5500, "setThreadDir", $ActiveThread, ,"open_door", false);

if so how does it know which thread to use? someone please clarify?

#1
03/16/2002 (2:56 am)
%obj.schedule(5500, "setThreadDir", $ActiveThread, false);

ActiveThread is the thread to use. That was already set in the play function, so this will just reverse the direction.
#2
03/16/2002 (10:26 am)
OK I got my jeep IN the game and I implimented this code
function Vamp::onAdd(%this, %obj)
{
   Parent::onAdd(%this, %obj);
   %obj.mountImage(ScoutChaingunParam, 0);
   %obj.mountImage(ScoutChaingunImage, 2);
   %obj.mountImage(ScoutChaingunPairImage, 3);
   %obj.nextWeaponFire = 2;
   %obj.schedule(3500, "playThread", $ActivateThread, "door");
}
I used the t2 shrike "activate" code snippet found in the vehicle.cs. . . to open my car door about 3 seconds after spawning. BUT THERE IS A CATCH. TIM I need your help
when I impliment it the doors opens fine
BUT
the steering wheel animation also moves to its final postion and when you mount the vehicle it stay locked (the wheels move, just not steering wheel). I was thinking the "ActiveThread" Variable is controling ALL the threads. . .is there any way to stop this bug? please I need your help

NEW
I tried putting %obj.playThread(0,"open"); and still locks up
NEW NEW
OK I got the door to open, close and reopen when when I impliment it I Loose the steering animation can anyone HELP me PLEASE!@@!!!