Home   Help Search Login Register  

Author Topic: in-game respawn choice - can it be done?  (Read 936 times)

0 Members and 1 Guest are viewing this topic.

Phantom

  • Guest
in-game respawn choice - can it be done?
« on: 07 Aug 2003, 17:04:06 »
G'day all. Been off the forums for a few months but I've returned, much to the disgust of a few people.

Anyway, I'm still trying to find a decent idea for a big MP map of mine, and since you can move to multiple bases, i need a way to set the respawn with the rest of your team. so i was wondering if someone's made, or can make a script that let's you alter the respawn point in-game, so that u can be kept with your guys.

please help me.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:in-game respawn choice - can it be done?
« Reply #1 on: 07 Aug 2003, 18:23:00 »
you need a series of markers or gamelogics
and then a
 setpos getpos command
for
@alive player

@ alive player && boolean: Player setpos (getpos "markername")

when a certain stage of the game has been reached, have a trigger or a script create a boolean, lets call those booleans Stage1, Stage2, stage3 etc etc

Boolean is a "True or False" variable

Okay, first thing to do is create a number of markers (In the example we will assume there are 5 stages to your mission) , use empty markers that way you dont have to make them invisible ("empty") in map view
Name them RespawnA  to RespawnE




in your init.sqs enter the following line
[] exec "reinforcements.sqs"

create the following script call it "Reinforements.sqs"

__________________________________________________________________________
;;Reinforcements.sqs"
?!(local player):exit
#START
@ !alive player
@ alive player
?(STAGE5): goto "phase5"
?(STAGE4): goto "phase4"
?(STAGE3): goto "phase3"
?(STAGE2): goto "phase2"
?(STAGE1): goto "phase1"
goto"START"


#PHASE1
Player setpos (getmarkerpos "RespawnA")
goto "START

#PHASE2
Player setpos (getmarkerpos "RespawnB")
goto "START

#PHASE3
Player setpos (getmarkerpos "RespawnC")
goto "START

#PHASE4
Player setpos (getmarkerpos "RespawnD")
goto "START

#PHASE5
Player setpos (getmarkerpos "RespawnE")
goto "START
_______________________________________________________________________
You will then have to create a trigger or a script, preferably run on the server that will declare a boolean, in this case Stage1, or Stage2 or Stage3, or Stage4, or Stage5 and declare it as a public variable

Stage1 = True; Publicvariable "Stage1"

This Boolean needs to be declared when that stage of the mission has been achieved

You then need to place each of your Empy markers called RespawnA etc etc at the place you want your players to appear at after they have respawned

RespawnA at location for respawn when Stage 1 has been achieved




Ok , now you have done that i will try to explain how it works.

Reinforcement script starts running, it looks initially for the Player to be killed, and waits there till he is
Having been killed it then waits for the player to become alive again

When he does, it looks to see what stage the game is at (In reverse order), and when it gets to the latest stage, it simply immediately transports your player from his default respawn to the marker for the stage the game is at

If none of the booleans are true your player will simply respawn as normal and the script will wait for him to die again



Other options you have are
?!(Leader Player):Player setpos (getpos leader player )

this would have all units respawn near their leader,  this is a bit more tricky to do because you will have to create staged respawn areas for the leader anyway
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123