Page 1 of 3
Teleporting Through Scripting
Posted: Mon May 12, 2003 3:18 pm
by Sgt.Pepper
Well, I managed to add a teleport in a stock map through scripting. I did it more or less to see if it was possible, and if I could do it.
I can't really see any practical use for it, perhaps it can make Malta not so big. It could be used maliciously by a server admin to give the advantage in an obj/TOW map, but it can also be used in anti-cheat. If a mod feels that it could be used for cheating then delete my link.
Anyway, the map is Crossroads and the trigger box is at the east end surrounded by crates. It will take you to the west side of the map. The crates are poorly placed, I only added them in quickly.
Seems to only work in SH, so add it to your mainta.
http://members.rogers.com/sgt.pepper/im ... letest.pk3
Posted: Mon May 12, 2003 3:23 pm
by jv_map
Na ofcourse I won't remove the link. Irritating server admins could make their players invincible / invisible if they really want to play the game like that

.
Nice job by the way.
Posted: Mon May 12, 2003 8:27 pm
by Sgt.Pepper
Thanks for the compliment, but I got to admit that it was through the various replies that you've given me either on this forum or TMT. I was really proud of myself when I finally got it to work. Now I'm thinking that it could be used for map glitches, and combine that with a multiple trigger, it could be interesting.
Found a use for it
Posted: Fri Jul 25, 2003 7:08 pm
by IvanTheTerrible
I'm using the script to make a standard map smaller...basically placing the trigger over the spawn points I want to relocate. Thanks for the script.
Posted: Sat Sep 13, 2003 10:05 am
by Whatever You Say I Am
How can I add message so that every time a player been teleported he/she will see the message?
BTW nice script.

Posted: Sat Sep 13, 2003 2:53 pm
by jv_map
Add this line:
local.player iprint "message here" 1 // 1 means bold, 0 means orange
where local.player is the player entity concerned.
Btw welcome to .map WYSIA

Posted: Sat Sep 13, 2003 11:19 pm
by Whatever You Say I Am
I havent try yours yet! but this is what I did
[/code] local.player iprint "message"
Its not working! Do I really need 1 or 0 in the end?
Thanks for your warm welcome, I feel all warm already

Posted: Sat Sep 13, 2003 11:49 pm
by The Jackal
It will not work just like that. You gotta setup a thread that triggers the message print.
Kinda like:
Code: Select all
_teleprint:
level waittill spawn
// setup your trigger location
local.myteleloc = ( 890 1220 1399 ) // this is where my tele trigger is located.
thread telecheck local.myteleloc 50 // 50 is the radius around the origin
telecheck local.origin local.radius
while(1)
{
wait .2
for(local.i = 1; local.i < $player.size+1;local.i++)
{
if(vector_within local.myteleloc $player[local.i].origin local.radius && $player[local.i].dmteam != "spectator" && $player[local.i].health > 0)
{
$player[local.i] iprint "You Are Now Teleporting To XYZ location. Thanks for using NYC Cab Service"
}
}
wait 1
}
end
This is not tested. Just wanted to give you an idea. Naturally you gotta call the script from the map script file.
Posted: Sun Sep 14, 2003 1:13 am
by Whatever You Say I Am
lol Jackal, nice NYC Cab Service.
Thanks.
Its make sence now!

Posted: Sun Sep 14, 2003 2:29 am
by The Jackal
Oh I forgot this. Your player is gonna be in that teleport trigger for at least 2 seconds. So you might wanna increase the last wait time before the script loops again. Otherwise the player will see the message prints 2 or more times.
Posted: Mon Sep 15, 2003 1:50 pm
by Sgt.Pepper
This is how I eventually used it for a map fix on DV. It can be quite amusing.
//Teleport Trigger
local.tele = spawn trigger_teleport
local.tele target tele
local.tele.origin = ( -2644.00 1572.00 539.00 )
local.tele setsize ( -360.00 -32.00 -15.00 ) ( 150.00 32.00 64.00 )
local.tele wait 0.00
local.tele delay 0
//Teleport dest
local.teledest = spawn func_teleportdest
local.teledest targetname tele
local.teledest.origin = ( 27.00 -923.00 600.00 )
local.teledest setsize ( -32.00 -32.00 -4.00 ) ( 32.00 32.00 8.00 )
//Hurt Fall trig box
local.pain = spawn trigger_multiple
local.pain.origin = ( -27.00 -923.00 500.00 )
local.pain setsize ( -250.00 -150.00 -0.00 ) ( 250.00 150.00 8.00 )
local.pain setthread thread
level waittill spawn
thread:
local.player = parm.other
//local.player damage local.player 1000 local.player (0 0 0) (0 0 0) (0 0 0) 0 0 2 0
local.player stufftext "say Hey! Look at me! I'm trying to get under the map, but PMOH has it patched so I die! I'm such a nOOb."
end
Posted: Mon Oct 27, 2003 3:06 am
by yuppicide
Where can you get under the map on Destroyed Village?! I'd like to apply that fix also. When you make a script such as a teleport where do I put all that script text?!
Posted: Sat Apr 10, 2004 2:12 pm
by Cobra {sfx}
I had a prob with this bit...
thread:
local.player = parm.other
//local.player damage local.player 1000 local.player (0 0 0) (0 0 0) (0 0 0) 0 0 2 0
local.player stufftext "say Hey! Look at me! I'm trying to get under the map, but PMOH has it patched so I die! I'm such a nOOb."
end
... it keeps printing down the screen - tried a wait command etc still does it-how i get it to say it just once?
main
Posted: Sat Apr 10, 2004 2:42 pm
by tltrude
"main:" is the first thread in the script and it ends with the word "end" after "level waittill spawn". But, you have inserted a second thread inside the "main" thread. It should look like this.
======================
level waittill spawn
end
thread:
local.player = parm.other
//local.player damage local.player 1000 local.player (0 0 0) (0 0 0) (0 0 0) 0 0 2 0
local.player stufftext "say Hey! Look at me! I'm trying to get under the map, but PMOH has it patched so I die! I'm such a nOOb."
end
======================
It will keep running the thread over and over while a player is in the trigger. This is because the trigger has a "setthread" which runs the thread everytime the trigger fires (every .2 seconds). So, you need to delay the trigger from firing untill the player is gone.
//Hurt Fall trig box
local.pain = spawn trigger_multiple
local.pain.origin = ( -27.00 -923.00 500.00 )
local.pain setsize ( -250.00 -150.00 -0.00 ) ( 250.00 150.00 8.00 )
local.pain wait 9.5
local.pain setthread thread
Another way would be to just move the trigger up, so the player only fall through it and not into it.
Re: Teleporting Through Scripting
Posted: Mon Apr 26, 2004 5:54 pm
by WarTech
Sgt.Pepper wrote:Well, I managed to add a teleport in a stock map through scripting. I did it more or less to see if it was possible, and if I could do it.
I can't really see any practical use for it, perhaps it can make Malta not so big. It could be used maliciously by a server admin to give the advantage in an obj/TOW map, but it can also be used in anti-cheat. If a mod feels that it could be used for cheating then delete my link.
Anyway, the map is Crossroads and the trigger box is at the east end surrounded by crates. It will take you to the west side of the map. The crates are poorly placed, I only added them in quickly.
Seems to only work in SH, so add it to your mainta.
http://members.rogers.com/sgt.pepper/im ... letest.pk3
Hi there guys:
I am actually using the script and it works great in Spearhead. Now you guys maybe aware that I have been working on a mod that allows me to use all the single player maps as multiplayers. Well in a one or two maps the original single spawn point keeps coming enable even after I have disable it. So I got around it by placing the tele on that coordinate and spawning the player to my coordinate, and it works just fine. Now I would like to make it better but have not been able to pull it off. So I need you GURUS help.
I would like to have the tele identify the players as Allies or Axis and tele them to a predetermine coor that will be addressed to each team. Can it be done? If so show me how. Thanks
Example of what I am trying but not sure now to make it work.
//Teleport Trigger
local.tele = spawn trigger_teleport
local.tele target tele
local.tele.origin = ( -2644.00 1572.00 539.00 )
local.tele setsize ( -360.00 -32.00 -15.00 ) ( 150.00 32.00 64.00 )
local.tele wait 0.00
local.tele delay 0
thread destinations
end
destinations:
if(local.p==allies)
{
thread tele1
}
else
if(local.p==axis)
{
thread tele2
}
end
tele1:
//Teleport dest 1 Allies
local.teledest = spawn func_teleportdest
local.teledest targetname tele
local.teledest.origin = ( 27.00 -923.00 600.00 )
local.teledest setsize ( -32.00 -32.00 -4.00 ) ( 32.00 32.00 8.00 )
end
tele2:
//Teleport dest 2 Axis
local.teledest = spawn func_teleportdest
local.teledest targetname tele
local.teledest.origin = ( 217.00 -9223.00 6100.00 )
local.teledest setsize ( -32.00 -32.00 -4.00 ) ( 32.00 32.00 8.00 )
end
If it can be done then it will give us a tool that can be use do drop a sigle portal in a map where it can be use to rederect players to their appropriate area. Sort of like Quake does in the arena type games.
Thanks guys for you knowledge and help.
<TWZ>WarTech