avoid telefragg

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

avoid telefragg

Post 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
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post 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?
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

telefrag

Post 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.
Tom Trude,

Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

i get stuck and telefragged twice at egypt_destination .

the tunnel look ok .
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post 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. :)
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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

	
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post 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
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

ok thanks for informations :D
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

tunnel

Post 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.
Tom Trude,

Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post 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 ?
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post 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 ?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

local.spot

Post 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".
Tom Trude,

Image
Post Reply