OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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
-
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
-
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.
-
try using onplayerkilled.sqs which automatically fires up when the player dies,
onplayerkilled.sqs
~10
player setdammage 0.0
exit
-
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.
-
my mistake