OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: redmenace on 02 Dec 2005, 21:29:10
-
Is there a way to set a number of lives for respawning in a multiplayer mission? For example, I want it to be so you respawn three times, and then respawn as the bird or whatever.
thanks
-
It is possible to simulate this.
For normal "Respawn at base marker"
Basically run a killed event handler on each player.
At each death have the killed event script increment, or count down a life after each death
If that deatcount reaches your limit, then run a cutscene on the player
or
Using group respawn
have each player in his own group with only 2 ai
Have these ai placed somewhere out of harms way, and have the
disableai "move",
command run on each of these ai so they cannot be called upon to be used by the player
(When he spawns into them he will have normal movement)
Then again using a script run from a killed event handler have this setpos the player back into the game area
___________________________________________________________
The group respawn system
DESCRIPTION.EXT
respawn = group
respawndelay = 1
MISSION EDITOR
For each player, create 1 playable slot and X non playable slots in the same group
Create X many non playable AI as you want respawns
In the non playable slots, place the following code in their init fields
this disableai "move"
and place these two units on an offshore island, out of harms way
Place a gamelogic, (lets name it "teleport") wherever you want the player to setpos too, after respawning
INIT.SQS
tx_spawn = player addEventHandler ["killed", {_this exec "teleport.sqs"}]
TELEPORT.SQS
Player removeEventhandler tx_spawn
@ alive player
player setcaptive true
tx_spawn = player addEventHandler ["killed", {_this exec "teleport.sqs"}]
Player setpos (getpos teleport)
~1
player setcaptive false
exit
-
I'm also using Toadlife's universal multiplayer weapons respawn or whatever the fuck its called. lol.
Is there a way to set a number of respawns in that script by any chance?
-
Did the script not come with instructions?
Planck