OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started 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?
-
!alive civil_building
and you need to make sure that civil_building is set using nearestObject ID
-
how do you set it using nearestObject ID?
-
You set the variable in the init.sqf by using the nearestObject command.
-
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:
ObjectiveBuilding = nearestBuilding this;
Then, place down a trigger with the appropriate command:
!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.