Home   Help Search Login Register  

Author Topic: respawn 50m from leader  (Read 1182 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
respawn 50m from leader
« on: 12 Jan 2004, 20:51:58 »
Is there a script for Coop/Team missions (with respawn) , when you die, you respawn about 50 or 100m from the leader, so you don't have to run kilometers to rejoin your teammates.

It's not very realistic; I know, but it's more fun to play.

 
Search or search or search before you ask.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:respawn 50m from leader
« Reply #1 on: 13 Jan 2004, 18:05:42 »
The following will Re locate the player once respawned to the Group Leader
enter the following line into the "INIT.sqs"
[] exec "Respawn.sqs"

and then create the following "RESPAWN.sqs" script


#START
@!alive player
@ alive player
Player setpos (getpos (leader player))
goto "START"


The group leader is a different kettle of fish
To respawn the group leader to the battle, then the best thing to do is create various empty markers, and for different stages of the mission, make a boolean variable become true

like the following

When stage 1 of mission has been completed, then create a boolean as follows

Stageone = true

and the next stage

Stagetwo = true


For each stage place an empty marker,  lets call these markers "StageA" and "StageB"

your respawn script would then look like this


#START
@!alive player
@ alive player
?(Stagetwo): goto "AtStageTwo"
?(Stageone): goto "AtStageOne"
Player setpos (getpos (leader player))
goto "START"


#ATSTAGETWO
Player setpos (getmarkerpos "StageB")
goto "START"

#ATSTAGEONE
Player setpos (getmarkerpos "StageA")
goto "START"


If youn wanted only the group leader to respawn here, then you would have problems everytime a player respawned and the leader was actually in respawn, so the best thing to do is have all players respawn at these markers (Or rather relocate to them after spawning)


If you still insisted on spawning them near the leader then you would have to use the setrelpos command to position them 50m away
« Last Edit: 13 Jan 2004, 18:08:54 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Blanco

  • Former Staff
  • ****
Re:respawn 50m from leader
« Reply #2 on: 13 Jan 2004, 18:22:29 »
thx, Terox

I tried some things and I came up with the same solution.

About the problem with the leader in respawn :
Maybe it can be solved with a

@alive (leader player)

before you setpos the player to make sure the leader's is not in respawn.

Spawning the player 50m behind the leader is a problem because I'm never sure he will be setposed behind him. When the leader is fleeing you will be setposed in the frontline...if you know what I mean.









« Last Edit: 13 Jan 2004, 18:22:58 by Blanco »
Search or search or search before you ask.