Home   Help Search Login Register  

Author Topic: Respawn a Static Object instantly...?  (Read 500 times)

0 Members and 1 Guest are viewing this topic.

xCIA_BlackThorn

  • Guest
Respawn a Static Object instantly...?
« 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.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Respawn a Static Object instantly...?
« Reply #1 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.
« Last Edit: 23 May 2005, 09:58:22 by bedges »

xCIA_BlackThorn

  • Guest
Re:Respawn a Static Object instantly...?
« Reply #2 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.
« Last Edit: 24 May 2005, 06:43:51 by xCIA_BlackThorn »