OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: xCIA_BlackThorn on 23 May 2005, 03:22:54

Title: Respawn a Static Object instantly...?
Post by: xCIA_BlackThorn on 23 May 2005, 03:22:54
Respawning a Static Object instantly after it is detroyed is what I want to do. I am unsure as to what to use for spawning, as all the other spawning scripts i've seen are for Vehicles and Units.
Title: Re:Respawn a Static Object instantly...?
Post by: bedges on 23 May 2005, 09:57:36
add a 'killed' event handler to the object to sense when it's 'dead'. make it something like this:

Code: [Select]
object_name addeventhandler ["killed","{[_this] exec "instant_respawn.sqs"}]

then copy/paste this:

Code: [Select]
;instant respawn

_what = _this select 0
_x = getpos _what select 0
_y = getpos _what select 1

_obj = "object" camcreate [_x,_y]

exit


save that as "instant_respawn.sqs".

that should work, assuming you know the camcreate 'name' of the static object you're trying to respawn.
Title: Re:Respawn a Static Object instantly...?
Post by: xCIA_BlackThorn on 24 May 2005, 06:43:19
Thanks bedges.   This has help alot, my mission is gonna be a unique one i hope.

keep up the good work.