Home   Help Search Login Register  

Author Topic: !(Alive ID?)  (Read 1420 times)

0 Members and 1 Guest are viewing this topic.

Offline Coyote

  • Members
  • *
!(Alive ID?)
« 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?

Offline i0n0s

  • Moderator
  • *****
Re: !(Alive ID?)
« Reply #1 on: 12 Nov 2010, 02:47:24 »
!alive civil_building

and you need to make sure that civil_building is set using nearestObject ID

Offline Coyote

  • Members
  • *
Re: !(Alive ID?)
« Reply #2 on: 12 Nov 2010, 05:03:04 »
how do you set it using nearestObject ID?

Offline i0n0s

  • Moderator
  • *****
Re: !(Alive ID?)
« Reply #3 on: 12 Nov 2010, 18:36:41 »
You set the variable in the init.sqf by using the nearestObject command.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: !(Alive ID?)
« Reply #4 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. 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.
"When 900 years YOU reach, look as good you will not!"