Author Topic: Teleport Trigger?  (Read 1548 times)

I'm trying to teleport a player to XYZ Via a trigger in the mission, is it possible to do with out any sort of script outside of the mission file? If possible could you post an example of the trigger implemented within the mission?

Mission files are just script files that create a bunch of objects, you could have a weapon inside a mission file and it'd probably be fine - just create it how you normally would in a cs but at the bottom (very bottom) of the mis instead.

Mission files are just script files that create a bunch of objects, you could have a weapon inside a mission file and it'd probably be fine - just create it how you normally would in a cs but at the bottom (very bottom) of the mis instead.
Actually, I know from experience you have to put any "script" that's being loaded in the mission before the Mission Object.

Anyway I need a script/link that shows me how to make a trigger teleport me to XYZ because I still suck at scripting altogether.

Actually, I know from experience you have to put any "script" that's being loaded in the mission before the Mission Object.

Anyway I need a script/link that shows me how to make a trigger teleport me to XYZ because I still suck at scripting altogether.

Yeah, for a trigger you'd put the script at the top since the trigger will be created directly below it. Anyway, you can try something like this (provided you know how to create a trigger object and datablock but even if you don't there are lots of examples on gg.com and these forums):
Code: [Select]
function TriggerData::onTriggerEnter(%this,%obj,%trigger)
{
    %obj.setTransform("yourxyzhere 0 0 0 1");
}


Is this right?
Code: [Select]
datablock TriggerData(TeleportTrigger)
{
tickPeriodMS = 100;
};

function TeleportTrigger::onTriggerEnter(%this,%obj,%trigger)
{
    %obj.setTransform("100 100 100 1");
}
I've missed something or done something wrong...  Did I correctly name it or did I screw your code over? Explain more or link me to an example that might show me the light. I'm still learning this, its fun though :D

That'd be fine but just change the "100 100 100 1" to "100 100 100 1 0 0 0".

Now you just need to create a trigger in the game which you can do with f11.

I believe irk did this with physical zones.

I believe irk did this with physical zones.

Physical zones don't have entry and exit callbacks so - no.

Then he must have done a hacky speed modification where it sends you instantly flying to the wanted location.

Then he must have done a hacky speed modification where it sends you instantly flying to the wanted location.

No... He used triggers like Packer is trying to do here.

Then he must have done a hacky speed modification where it sends you instantly flying to the wanted location.
Player datablocks have a max up/horizontal speed.

Tried the code like you said Ephi and it doesn't do anything at all, no errors in the console. I'm baffled

Uh, might be onEnterTrigger.

Uh, might be onEnterTrigger.
Yeah, it is. And the args are %this(Datablock?),%trigger,%obj

Eheh... its teleporting the trigger to 100 100 100 not the player >.<
Code: [Select]
datablock TriggerData(TeleportTrigger)
{
tickPeriodMS = 100;
};

function TeleportTrigger::onEnterTrigger(%this,%obj,%trigger)
{
    %obj.setTransform("100 100 100 1 0 0 0");
}