Spawnpoints as teleport destinations ?
Moderator: Moderators
Spawnpoints as teleport destinations ?
Ehrm... can I use targetnamed spawnpoints as teleport destinations ?
Just checking, as I'll need a sequential destination for a teleport.
Just checking, as I'll need a sequential destination for a teleport.
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
From the top of my head. You can remove the trigger_multiple from the map. Call the following thread like this for each teleporter (the teleporter being a trigger_multiple):
The thread itself:
Should work.
You can modify the script so that it chooses a random spawnpoint as a destination.
Code: Select all
$teleport_trigger thread teleport_setup $your_spawnpointCode: Select all
teleport_setup local.destination:
self.destination = local.destination
local.ent = spawn trigger_multiple origin self.destination.origin
local.ent setsize ( -16 -16 0 ) ( 16 16 96 ) // spawnpoint dimensions
local.ent.occupied = 0
local.ent setthread spawn_occupied_check
while (1)
{
self waittill trigger
local.player = parm.other
self thread safe_teleport local.player
}
end
spawn_occupied_check
local.player = parm.other
while (local.player isTouching self && isAlive(local.player))
{
self.occupied = 1
waitframe
}
self.occupied = 0
end
safe_teleport local.player:
while (local.player isTouching self && isAlive(local.player) && self.destination.occupied)
waitframe
local.player.origin = self.destination.origin
end-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
Thanks guys.
I am looking to steer clear from the telefragging as I personally find it irritating and perhaps even sloppy. But that's just me.
Elgan; I was hoping to use 'normal' spawnpoints as teleport destinations if it could be done at random... however, I don't want to give players the benefit of resetting their health, so I decided (just now) to use separate destinations. Thanks though
The idea behind the testmap is simple but very difficult for me to script... It's one teleport leading into a completely sealed off room. The room is square of shape and in each corner I've placed a teleport leading to a destination somewhere in the map.

The first teleport (which leads into the room) has been placed in an altar with a secret door (I know... lame) After a player has entered this first teleport the door should be closed and locked to prevent additional players entering the altar and/or teleport. (also to prevent telefrags on the teleport destination in the room)
The room itself should only allow one player at a time. Floor, ceiling and the 4 walls are script_objects (placed before the actual structure of the building) which should be 'hidden' from the start until a player enters the room. Besides 'showing' the script_objects, a sound should start playing when a player enters the room.
I've placed a trigger_multiple in the room to check for players. As soon as a player enters one of the 4 available teleports the secret door in the altar should be unlocked, the walls, ceiling and floor of the room should be 'hidden' and the sound stopped.
Although I can get certain parts of this test map scripted I don't have the experience to do this efficiently and cleanly(as short as possible; if & else statements and such...) Seeing Rookie_One's "destination in use? script" made my heart sank into my shoes... I'm still trying to understand it and trying to get it to work at the same time though.
Off course I want the 4 teleport destinations leading out of the room telefrag proof... preferably using an alternative destination if the original one is in use (1 of the 4). But atm I'm stuck working out how I should script the hiding and showing of the script_objects when a player enters the room.
I have some sort of a map standing by, for any of you interested, but for now it's just the bsp and map source (without any script!).

User-Teleport_test.pk3
Btw. I can understand if you guys rather see me struggling on this some more... your right actually, but I planned to thank you guys for the help so far as I felt I wasn't quite ready to post the mapsource, but my reply went on into boredom, so I chose to add the mapsource anyway
I am looking to steer clear from the telefragging as I personally find it irritating and perhaps even sloppy. But that's just me.
Elgan; I was hoping to use 'normal' spawnpoints as teleport destinations if it could be done at random... however, I don't want to give players the benefit of resetting their health, so I decided (just now) to use separate destinations. Thanks though
The idea behind the testmap is simple but very difficult for me to script... It's one teleport leading into a completely sealed off room. The room is square of shape and in each corner I've placed a teleport leading to a destination somewhere in the map.
The first teleport (which leads into the room) has been placed in an altar with a secret door (I know... lame) After a player has entered this first teleport the door should be closed and locked to prevent additional players entering the altar and/or teleport. (also to prevent telefrags on the teleport destination in the room)
The room itself should only allow one player at a time. Floor, ceiling and the 4 walls are script_objects (placed before the actual structure of the building) which should be 'hidden' from the start until a player enters the room. Besides 'showing' the script_objects, a sound should start playing when a player enters the room.
I've placed a trigger_multiple in the room to check for players. As soon as a player enters one of the 4 available teleports the secret door in the altar should be unlocked, the walls, ceiling and floor of the room should be 'hidden' and the sound stopped.
Although I can get certain parts of this test map scripted I don't have the experience to do this efficiently and cleanly(as short as possible; if & else statements and such...) Seeing Rookie_One's "destination in use? script" made my heart sank into my shoes... I'm still trying to understand it and trying to get it to work at the same time though.
Off course I want the 4 teleport destinations leading out of the room telefrag proof... preferably using an alternative destination if the original one is in use (1 of the 4). But atm I'm stuck working out how I should script the hiding and showing of the script_objects when a player enters the room.
I have some sort of a map standing by, for any of you interested, but for now it's just the bsp and map source (without any script!).
User-Teleport_test.pk3
Btw. I can understand if you guys rather see me struggling on this some more... your right actually, but I planned to thank you guys for the help so far as I felt I wasn't quite ready to post the mapsource, but my reply went on into boredom, so I chose to add the mapsource anyway
If you give each of the spawnpoints targetnames and use $alter_spawnpoint_1 disablespawn you can stop other players from spawning at them . If the spawnpoints did have targetnames then you could use thier origins as teleport destinations . That would have to be done in a custom map I don't think you could script that because maps don't have spawnpoints with targetnames in most cases .



