Teleporters Help
Posted: February 21st, 2006, 2:56 am
Hey, I was wondering if any of you guys had any knowledge on how to make teleporters that could send you from on place to another by walking into a trigger. Thanks
CoDJumper.com - For all your CoDJumping needs!
https://www.codjumper.com/forums/
In the editor, go to your departure point, draw out a decent size brush and texture it trigger, right click in 2d view, go down and make it trigger_multiple.
with the trigger still selected press n and enter these values
Key = target Value = gohere
Key = targetname Value = enter
Press n again to close the entity box
(Thats it for the trigger, press esc.)
Navigate your way in the editor to where you want to be teleported to.
Right click in the 2d view and create a script_origin (a red cube should appear)
With that still selected, press n and enter these values
Key = targetname Value = gohere
Press n again to close the entity box
You can rotate the red cube until the arrow faces the direction you wish to be facing when teleported.
With the script_origin still selected go back to the trigger and select them both, now hold down the Ctrl key and hit the k key to connect them. Press esc.
If you have things correct you should now see a red line connecting trigger and red cube.
(I think thats it for the mapping bit)
Compile,
Make a .gsc containing this script (just call it teleport)
.....................................................................................
main()
{
entTransporter = getentarray("enter","targetname");
if(isdefined(entTransporter))
{
for(lp=0;lp entTransporter[lp] thread Transporter();
}
}
Transporter()
{
while(true)
{
self waittill("trigger",other);
entTarget = getent(self.target, "targetname");
wait(0.10);
other setorigin(entTarget.origin);
other setplayerangles(entTarget.angles);
wait(0.10);
}
}
Code: Select all
main()
{
entTransporter = getentarray("enter","targetname");
if(isdefined(entTransporter))
{
for(i=0;i<entTransporter.size;i++)
entTransporter[i] thread Transporter();
}
}
Transporter()
{
while(1)
{
self waittill("trigger",user);
entTarget = getent(self.target, "targetname");
wait .1;
user setorigin(entTarget.origin);
wait .1;
}
}
My map is an MP map so, yes MP and SP.Anonymous wrote:can you juse teleporters in mp or only in sp
Depends what time my brother comes off PC.Rince wrote:omg drof =O msn 2 night teleporters for denmark~
GoodNightmare wrote:Drofder, thank you sooo much man! It works! Luke, I tried your way but it didnt work for me, thanks anyway!
Your way does work Luke if the code was correctedLuke wrote:GoodNightmare wrote:Drofder, thank you sooo much man! It works! Luke, I tried your way but it didnt work for me, thanks anyway!what i posted was just what i found on modsonline.com, don't get the wrong idea that i know what i'm talking about
Code: Select all
{
for(lp=0;lp entTransporter[lp] thread Transporter();
}
Code: Select all
{
for(i=0;i<entTransporter.size;i++)
entTransporter[i] thread Transporter();
}
Code: Select all
Key = targetname Value = transporter_01
Code: Select all
main()
{
thread Transporter_01();
}
Transporter_01()
{
while(1)
{
players = getentarray("player", "classname");
for(i=0;i<players.size;i++)
{
finishtrig = getent ("transporter_01","targetname");
finishtrig waittill ("trigger",user);
user setOrigin( (-152, 736,1000) );
}
wait .5;
}
}
Code: Select all
user setOrigin( (-152, 736,1000) );
I dont think you need the for loop with the while loop as the loop will find the "user" of the trigger anyway.leveller wrote: i use the :in the script, so i can set it to an other position without having to recompile the map again.Code: Select all
user setOrigin( (-152, 736,1000) );