OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Ryu on 03 Jan 2004, 05:04:44

Title: not alive object
Post by: Ryu on 03 Jan 2004, 05:04:44
Can anyone tell how to use "not alive (id)"
It works for units I place on map but not on buildings already on map.

Thanks
Title: Re:not alive object
Post by: PicVert on 03 Jan 2004, 05:48:27
I think you cannot check the houses already on map but may be by using somthing to check nearestobject or nearestbuilding commands??

Untested it so take a look ;)
Title: Re:not alive object
Post by: Ryu on 03 Jan 2004, 08:28:35
I want it to check if a bridge has been destroyed. I saw it somewhere but....
Title: Re:not alive object
Post by: Artak on 03 Jan 2004, 13:45:51
!alive object id
That should do it.
Title: Re:not alive object
Post by: Terox on 03 Jan 2004, 14:36:04
Use
?(getdammage object *****):
To find out what damage a bridge section has suffered

Damage to an object ranges from "0" no damage to "1" Fully damaged
The example below looks at all the object numbers of the bridge sections for the Nogova bridge
If any section receives any damage it repairs all sections

If you have created bridge sections using an addon, then give each bridge section a name, so the scriopt lines would look like the following

?(getdammage XXXX):
where "XXXX" is the name you gave the object


Modify the script which you can run from the Init.sqs using the line
[] exec "Bridgerepair.sqs"


Code: [Select]
;Bridgerepair.sqs
#Start
~5
?(getdammage object 167669 > 0.1):goto "Repair"
?(getdammage object 167792 > 0.1):goto "Repair"
?(getdammage object 167793 > 0.1):goto "Repair"
?(getdammage object 167794 > 0.1):goto "Repair"
?(getdammage object 167795 > 0.1):goto "Repair"
?(getdammage object 167797 > 0.1):goto "Repair"
goto "START"

#Repair
~1
object 167669 setdammage 0
object 167792 setdammage 0
object 167793 setdammage 0
object 167794 setdammage 0
object 167795 setdammage 0
object 167797 setdammage 0
goto "START"
Title: Re:not alive object
Post by: Ryu on 03 Jan 2004, 16:52:36
great respons guys, thanks