Teleporters
By: FireMission
i am going to show you how to make a teleporter in your map.. this is quite a simple method there are other ways but this is by far the most simplistic. ok.. so.
firstly select your trigger texture. do this by going to
textures -> usage -> tools Look for gray texture that says "trig" all over it.
Okay, now draw a brush making sure that the box your drawing is more that 16 units each direction on the axis. x,y,z. (otherwise the trigger wont work*). also note that if the trigger in overlapping inside something it also wont work**.
Eight now there are several types of teleporter you can use. this is defined in the trigger entity box and in your maps .GSC file. now when i said there are different versions of teleports its differed by a few things. whether you just want to walk into the trigger and it teleports you, or if you want to press a button then you can or if you have a damage trigger that you can do damage to and hey presto you are magically teleported.
So 3 ways i will show you very simple to do.
For the walk into and teleport its simply a case of right clicking on your 2d view select trigger multiple. select the brush opening up your entity box by pressing
N twice then entering the values.
See below - Code:
-
Key: classname
Value: trigger_multiple
Key: targetname
Value: teleport
and for a teleport that you can press a button for its a follows
- Code:
-
Key: classname
Value: trigger_use
Key: targetname
Value: teleport
and for a teleport that makes you teleport when u do damage for it is like this
- Code:
-
Key: classname
Value: trigger_damage
Key: targetname
Value: teleport
there are certain ways you can customise the damage you will notice there are little boxes that show up now you have a trigger damage box. like below...
Now
Right Click on the 2D Grid and go to
Script -> OriginAdd one of these to wherever you want to teleport too, if you rotate this origin, you will get rotated in to the direction it's facing.
if you need help just ask ofc. right.. now the boring part the script. its quite simplistic copy and paste this in to your maps .gsc file.. if you dont have one make a .txt file on your desktop rename it to your map. eg mp_yourmapname.gsc then open it up..
paste this inside:
- Code:
-
main()
{
//EVERYTHING YOU HAVE IN MAIN THREAD GOES HERE
thread teleportenter();
}
teleportenter()
{
teleporters = getentarray("enter","targetname");
for(i=0;i < teleporters.size; i++)
teleporters[i] thread teleport();
}
teleport()
{
gotos = getentarray(self.target,"targetname");
while(true)
{
self waittill("trigger", player);
self thread teleportnow(player,gotos);
}
}
teleportnow(player,gotos)
{
go = gotos[randomInt(gotos.size)];
player setorigin(go.origin);
player setPlayerangles(go.angles);
}
then compile your map when this is all done hope its works for ya
any problems you can contact me on this site plenty of links ill try get back to you asap
Added by Fixz:With this script you can also connect the
trigger with many more
script_origins and you will get teleported to one of the nodes, and voila, you've got a random teleports
*well it will firemission, i made one 0.25x0.25x0.25 - both use and multiple
**it will indeed, just remember make sure it's not inside another brush.