OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: penguinman on 21 Dec 2004, 18:44:31

Title: spawning for single player
Post by: penguinman on 21 Dec 2004, 18:44:31
is there any way to script spawning just like in mp but for single player,

it would be good for base defending and stuff
Title: Re:spawning for single player
Post by: THobson on 21 Dec 2004, 19:06:53
Try setting the individuals you want to respawn as 'playable', and then doing the relevant stuff in description.ext, then save it as a single player mission

I seem to remember having a problem once when I did that and all the playable units just kept coming back to life.  That was not what I wanted then
Title: Re:spawning for single player
Post by: Lean Bear on 23 Dec 2004, 18:16:58
You can respawn any object in the game just as easily in SP as in MP. (But I don't know about the player himself).

Check the Ed depot - there are loads of resources on scripting respawning in SP as well as MP. You should be able to get the basic idea from the MP respawn scripts anyway.
Title: Re:spawning for single player
Post by: StonedSoldier on 13 Jan 2005, 16:25:55
try using onplayerkilled.sqs which automatically fires up when the player dies,

onplayerkilled.sqs
~10
player setdammage 0.0
exit
Title: Re:spawning for single player
Post by: macguba on 13 Jan 2005, 19:23:30
IIRC that doesn't work:   for the script to start the player must be dead and the mission is over.   You will see the player unit jump back to life, but you won't be able to control it.
Title: Re:spawning for single player
Post by: StonedSoldier on 13 Jan 2005, 23:17:17
my mistake