OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Coyote on 12 Nov 2010, 00:59:58

Title: !(Alive ID?)
Post by: Coyote on 12 Nov 2010, 00:59:58
Searched around, and couldnt find anything on it, but if my victory condition / objective was to destroy a civie (pre-existing) building, what would one enter in the condition field?
Title: Re: !(Alive ID?)
Post by: i0n0s on 12 Nov 2010, 02:47:24
!alive civil_building

and you need to make sure that civil_building is set using nearestObject ID
Title: Re: !(Alive ID?)
Post by: Coyote on 12 Nov 2010, 05:03:04
how do you set it using nearestObject ID?
Title: Re: !(Alive ID?)
Post by: i0n0s on 12 Nov 2010, 18:36:41
You set the variable in the init.sqf by using the nearestObject command.
Title: Re: !(Alive ID?)
Post by: Wolfrug on 13 Nov 2010, 09:23:43
Ahem,


Well, perhaps stuff could be explained a little better and more here, actually. Okay, so: to grab the "object" of a pre-existing building on the map, you can either use its ID number (as seen when 'Display IDs' is on), or use a command like nearestBuilding (http://www.ofpec.com/COMREF/index.php?action=details&id=228&game=All). Using nearestBuilding, you could do it like this:

1) Place down a game logic right on top of the building in question. In its init field, write something like:

Code: [Select]
ObjectiveBuilding = nearestBuilding this;
Then, place down a trigger with the appropriate command:

Code: [Select]
!alive ObjectiveBuilding
Now try to blow up the building and see if it managed to "pick up" the correct building with the command :) (add a hint or something to the trigger).

Should work!

Wolfrug out.