Page 1 of 1

avoid telefragg

Posted: Thu Sep 23, 2004 4:46 pm
by agentmad007
Hi all ,

In my map the players go through a tunnel , in order to be teleported in a place.

i have a teleport_trigger "setthread" "voyage_forward", and target to a script_origin that glue the player.


well from my previousscript i have it :

Code: Select all


voyage_forward:<===== setthread from a trigger_teleport

local.gateuser = parm.other
wait .01
local.gateuser playsound vortex
//local.gateuser freezeplayer
local.gateuser physics_off
local.mover = spawn script_model model "fx/dummy.tik"
local.mover.origin =  local.gateuser.origin
local.gateuser glue local.mover
local.mover time 2
local.mover moveto $t1
local.mover waitmove
local.gateuser unglue local.mover
local.mover remove
local.gateuser tele $egypt_destination
//local.gateuser releaseplayer
local.gateuser physics_on


end

but the problem is that i have the players telefragging if they teleport together .

The best solutions will be to multispawn the players , by creating several tunnels , and several func_teleportdest .

Right , now i need your scripting knowledge , because i only know how to move the objects plz......


my trigger_teleport "setthread" voyage_forward , have to spawn the players alternatively in each tunnel.

Tom trude talked about a counter , something like local.player count ++ , if that ring a bell to someone , i thanks him a lot !

Greetings

Posted: Thu Sep 23, 2004 8:44 pm
by Master-Of-Fungus-Foo-D
err is it really that hard?

Code: Select all

voyage_wait:
$voyage_forward waittill triggered
$voyage_forward nottriggerable
wait 10
right right?

telefrag

Posted: Thu Sep 23, 2004 8:46 pm
by tltrude
Do they telefrag in the tunnel or at $egypt_destination?

fungus - voyage_forward is a thread, not a trigger targetname. He wants the players to be able to step through the stargate at the same time, just like the show on TV. And, his stargate is only open for 15 seconds. He also does not want the players to see eachother while in the tunnel and that is why he wants two or more tunnels.

Posted: Fri Sep 24, 2004 1:34 am
by agentmad007
i get stuck and telefragged twice at egypt_destination .

the tunnel look ok .

Posted: Fri Sep 24, 2004 6:45 am
by Grassy
Hi there, interesting scenario :)
Is this

Code: Select all

local.gateuser physics_off 
the same as;

Code: Select all

local.gateuser nodamage
I have never turned off physics before so dont know a player can still be killed by telefrag or not.
How about this then?

Code: Select all

for (local.gateuser=1; local.gateuser <=$player.size; local.gateuser++)
{
 if ($player[local.gateuser] isTouching $trigger_teleport)
 //add the rest of your thread here
}
Err.... :roll: I dunno if it will work exactly as above, but the idea is to assign a variable id to each player that is touching your trigger.
Bodger JV ?? am I on the right track? Lets help him out. :)

Posted: Fri Sep 24, 2004 9:01 am
by bdbodger
You could also just use a trigger_multiple to teleport the players from script and in that script you teleport them to the location of several other triggers . While a player is touching one of those triggers then your script will not tele anyone to that location .

Code: Select all

setthread to tele_porter $endtrigger's are trigger_multiples

tele_porter:

local.player = parm.other

for(local.i=1;local.i <= $endtrigger.size;local.i++)
{
	if($endtrigger[local.i].isused != 1)
	{
		local.player thread tele_player $endtrigger[local.i]
		end
	}
}
end

tele_player local.spot:

self tele local.spot.origin

local.spot.isused = 1

while(self is touching local.spot)
waitframe

local.spot.isused = 0

end

	

Posted: Fri Sep 24, 2004 11:22 am
by agentmad007
uah ....i read it 5 times , its like if you speak chinese with me lol .

in your script , i see only one trigger_multiple and a setthread .

trigger_multipe= "targetname" "endtrigger" "setthread" "tele_porter", and

this trigger_multiple should replace my

trigger_teleport "setthread" "voyage_forward".Well , i think until here , i understand.

However, i dont understand where the local.player will be teleported ? i dont see any other targetnames on your script , and i dont know what should be these entites also ( script_origin or func_teleportdest?????))


Is this script teleport local.player in different locations after going through the trigger_multiple ?

Sorry for all these questions, i am a noob with arreys .and script too

Posted: Fri Sep 24, 2004 9:43 pm
by bdbodger
the $endtrigger's are trigger_multiples you make several of them in the area that you want to teleport to . The script sets them as used when a player is teleported to them and sets them as unused when that player is no longer touching them . This lets your script know when it is safe to teleport another player to them . In fact maybe you should use setthread with them to set them as in use when a player is touching them . You use the setthread tele_porter on the start trigger_multiple what ever name you want to give to that one is up to you . I have to go to work now but later I can rewrite it to make the $endtrigger's detect when any player is touching them so the first trigger won't teleport any players to them when they are in use .

Posted: Fri Sep 24, 2004 10:49 pm
by agentmad007
ok thanks for informations :D

tunnel

Posted: Sat Sep 25, 2004 3:17 am
by tltrude
I think Bdbodger's idea is for the trigger in the tunnel that sends players to the final destination gate. What he is saying is to have several trigger_multiples at the destination gate, all named "endtrigger". The script will index them and send players to the ones that are not occupied. The center of each end trigger is where the player's feet will end up.

The same idea could be used to send players from the start gate to different tunnels. Although it may not be needed if you are not having telefrag problems in the tunnel.

Posted: Sat Sep 25, 2004 11:26 am
by agentmad007
Yes i understand now ...

But i have a question again

Code: Select all

self tele local.spot.origin 
where is defined the origin of teleportation ? I mean how the engine now that this script have to teleport my player to the $egypt_destination , but in different locations ?

Posted: Sat Sep 25, 2004 11:35 am
by agentmad007
Yes i understand now ...

But i have a question again

Code: Select all

self tele local.spot.origin 
where is defined the origin of teleportation ? I mean how the engine now that this script have to teleport my player to the $egypt_destination , but in different locations ?

local.spot

Posted: Sat Sep 25, 2004 12:03 pm
by tltrude
The "local.spot" is set by this line.

local.player thread tele_player $endtrigger[local.i]

So, "$endtrigger[local.i]" becomes local.spot in the tele_player thread. Your "$egypt_destination" will need to be replaced by 4-6 triggers named "endtrigger".