PDA

View Full Version : How to make a teleport by eLEos



eLEos
20th July 2012, 14:52
CoD2 Radiant part

1. Click right mouse on 2d view and click trigger>use_touch
2. Press N and type key:targetname
value:enter
also type key:target
value: (A name of the place you will go. Example:room)
3. Click right mouse on 2d view and click script>origin
Put it at the place you want to be teleported. (A bit higher from the ground)
4. Press N and type key:targetname
value: (The name of the place you choosed to type before)
Now a red line is between them. If there isn't red line you have made a mistake somewhere.

Scripting part

1. Open a notepad and paste this:


main()
{

entTransporter = getentarray("enter","targetname");
if(isdefined(entTransporter))
{
for(lp=0;lp<entTransporter.size;lp=lp+1)
entTransporter[lp] thread Transporter();
}


}


Transporter()
{
while(true)
{
self waittill("trigger",other);
entTarget = getent(self.target, "targetname");

other setorigin(entTarget.origin);
other setplayerangles(entTarget.angles);
//iprintlnbold ("You have been teleported !!!");
wait(0.10);
}
}

Save it in your maps/mp as teleport.gsc and change the Save as box to All files

2. Open your mp_mapname.gsc file and add this line:

maps\mp\teleport::main();

Finished.
Now compile and test. :)

kung foo man
20th July 2012, 16:28
thats a nice teleport-script :) because you can make as much "enter"-teleports as you want with only one script. thanks

you can also make it a bit easier: dont set the target for the trigger by hand, just click on trigger, then origin and press W

thats doing an auto-connection :D

eLEos
20th July 2012, 18:43
Yes i know that.
It is much easier :)

pornesz
28th October 2012, 19:31
Just a Question: and if I dont make the ''scripting part'' I cant use the teleport?

kung foo man
28th October 2012, 19:39
Without scripting nothing will happen ^^

IzNoGoD
24th September 2023, 18:57
Removed the wait 0.1 between the waittill and the setorigin. That's always fucking up jump mods. People should never use that, and removing it has (mostly) no negative effects.