Dead Players Teleported?

Post your scripting questions / solutions here

Moderator: Moderators

Virus
Lance Corporal
Posts: 19
Joined: Wed Oct 01, 2003 2:42 am
Location: UK

Dead Players Teleported?

Post by Virus »

Hi, I was wondering if anyone had an idea on how i could make a player teleport to a certain location as soon as he dies?.. ive sorted a teleport script using triggers, But i have no idea how to make it run when he just dies, ... Please help if you can, Heres the teleport script i'am currently using with triggers :

Code: Select all

//Teleport Trigger Setup.
local.trigger = spawn trigger_multiple
local.trigger origin ( -767.41 -1010.15 560.13 )
local.trigger setsize  (0 0 0) (128 128 128)
local.trigger setthread teleport
//Teleport Trigger End

//Start Of Teleport Thread.
teleport:
local.player = parm.other
local.player tele ( -2651.56 -234.88 0.13 )
local.player stufftext ("locationprint 250 250 Teleported!")
local.player dmmessage 0 ("I Have Now Been Teleported!!!")
end
 //End Of Teleport Thread
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post by The Jackal »

I do not see the need for a teleport script. Besides, how will a player enter a trigger if he is dead? :lol:

Code: Select all

main:

thread coroner

level waittill spawn

coroner:

while (1)
{
wait .1
for (local.p = 1; local.p < $player.size+1;local.p++)
{
 if ( $player != "NIL" && $player[local.p].health == 0 )
{
wait .5
 $player[local.p].origin ( -2651.56 -234.88 0.13 )
}
}
wait .1
}
end
Virus
Lance Corporal
Posts: 19
Joined: Wed Oct 01, 2003 2:42 am
Location: UK

Post by Virus »

Hi, thanks for your response. I now can see what you mean.. I ran the script in a map. and recived this error:

bad token:
TOKEN_LEFT_BRACKET:
(

$player[local.p].origin ( -2651.56 -234.88 0.13 ) (maps/obj/obj_team2.scr, 77)
$player[local.p].origin ^

^~^~^ Script file compile error: Couldn't parse 'maps/obj/obj_team2.scr'
ScriptMaster::GetScript: Script 'maps/obj/obj_team2.scr' was not properly loaded
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Virus, explain what you are trying to do... my guess is that you want to re-create the liberation mode of MOH:BT.

If this is the case you should not use teleportation.
Instead:
1) Place spawn points as usual in the map.
2) Place spawn points in the jail.
3) At map start: the jail spawns should be disabled.
4) After say, 5-10 seconds: Enable the jail spawns and disable the regular spawns.
5) Done.

Hope I understand you correctly...
Admin .MAP Forums
Image
Head above heels.
Virus
Lance Corporal
Posts: 19
Joined: Wed Oct 01, 2003 2:42 am
Location: UK

Post by Virus »

Yeh!!.. you got it in one! , Wow .. thanks i never thought of that. I was going to wait till the player had 0 health, Give him 100 health and teleport him into the jail. But that ways much easier. Am i right in thinking this will work? .. give the spawn points a targetname..

$axisspawn1 disablespawn

$axisspawn1 enablespawn

Im not quite sure if i got that right. Just want to check.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

That looks right
Admin .MAP Forums
Image
Head above heels.
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

i fyou have a late comer, they have a chance of being locked up, not saying that that isn't a bad thing though :D
hope this helps, prob not cos it's all foreign 2 me :-/
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

nuggets wrote:i fyou have a late comer, they have a chance of being locked up, not saying that that isn't a bad thing though :D
That made absolutely no sense whatsoever nuggets.
What are you trying to say? :shock:
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I read it as follows:

When a player joins later he will spawn in jail, but that is a good thing in fact :D

But, I may be wrong here... he may also mean:

When a player joins later he will spawn in jail which is a bad thing :D

But that leads to a contradiction with the smiley :?

Hmpf never mind... better wait for nuggets' response :)
Image
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

Well, the script syntax is right. The spawner logic is about as good as it will get. I've tried a lot with that in my hybrid maps and it's a pain in the butt. I have issues with 'starting' spawns myself in that they don't always turn off when they should. Don't know why. I have, however, gotten the progressive spawn system to work great with the syntax you used and other supporting logic of when a switch can be thrown to enable/disable spawners.

My suggestion would be to have the starting spawners turn off or be removed within 30 seconds or so. You need to judge how quickly players can make their initial spawn into your map and manage to stay alive until all players make their first spawn.... Late comers, say two minutes into a round, would automatically end up staring 'in-jail'. That would be the easy way. There may be script logic that would calculate when a player joins vs. where they spawn, but is it worth it to you?
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

ok i've read it 3 times and it makes perfect sense to me, which it should as i wrote it, but just to clarify the misinformed

JV you are absolutely right, in the 1st presumption

the question about the contradiction depends on which chair your sitting in...
if your the player, then getting locked up for being late is bad :( so unhappy face
but if your the scripter, then getting a player locked up for being late is good, as you've achieved what you've set out to do :D so smiley face

hope my response was worth the wait and all discrepencies have been cleared up now :D (smiley face again, as i think i've answered the question)
hope this helps, prob not cos it's all foreign 2 me :-/
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Well I stumbled over this part ;) :
not saying that that isn't a bad thing though
If it isn't a bad thing, it's probably a good thing. So obviously you were not saying it is a good thing :?
Image
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post by The Jackal »

OK He used a double negative in that quote you made JV.
He said/ wrote:not saying
Meaning: He is saying this it NOT the case.
Then he said/ wrote:...that that isn't..
Meaning: Is Not a bad thing but a good thing.

Therefore. Its can be rephrased to say:
I would say/ wrote:This can be a good thing
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

If I were a control freak, I'd tell you to stay on topic... but as I find these WAY off topic discussions often more interesting than the original topics:

I won't not avoid to not un-tell you off.

:D

( I have no idea if that was a correct statement :twisted: )
Admin .MAP Forums
Image
Head above heels.
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

lol, well i'm glad that none of it's unsorted now :D

but as for the that that, the 1st that is to say the next item of topic is the one being referred to, and the 2nd that is the topic that has been previously mentioned

that is just a method of transgression, where it will move what part of a sentence needed into a place it is desired so it won't need to be re-written :)
hope this helps, prob not cos it's all foreign 2 me :-/
Post Reply