Game Development Community

Teleporting Trigger for you all

by Night Fox · in Torque Game Engine · 06/27/2006 (8:00 pm) · 1 replies

Sorry if this is the wrong place to post this script, I just got torque not to long ago and I'm slowly unraveling it.

With help of the teacher I was able to perfect a script where you make a portal trigger that will teleport you to a drop node.


here it is. This was made in torsion and much of the // is there to help other newbs (like me) understand what any of it means.


//********************************************Teleporter*******************


datablock TriggerData(Teleporter) //the trigger name is Teleporter
{

tickPeriodMS = 100; //1 tick is 32milliseconds in torque
};


//-----------------------------------------------------------------------------

function Teleporter::onEnterTrigger(%this,%trigger,%obj)
{

Parent::onEnterTrigger(%this,%trigger,%obj);

%position = getWords (Drop.getTransform(), 0, 2); //remember to include the object that information is to be gathered from. This means in Torque create a node called Drop and place it where you want the character to be portaled.

echo(%position); //this is to test if it worked

%obj.setTransform(Drop.getTransform()); //when passing as a string you don't need quotes!



}








Hoping to be able to help and be helped by the community


Night Fox sigining out!!!!

#1
06/27/2006 (8:00 pm)
Forgot to tell you all this would be put in the triggers.cs file located in the server/scripts