Jump to content
Sign in to follow this  
Hutson-16AA-

How do I check the state of an ingame Object?

Recommended Posts

Hello,

I'm trying to make a mission where you have to get to and destroy a bridge - however, I can't work out the code for the trigger - or, more specifically, how to reference the bridge.

I am trying to use:

(damage 4007)>0.999

or

(damage BUILDINGID)>0.999

- However, it seems I'm not able to reference the building ID in this way.

So, does anyone know how I go about setting a trigger to check whether a building or bridge is destroyed?

Thanks in Advance,

Paul Hutson

Share this post


Link to post
Share on other sites

Try:

damage object (objectID) > 0.999

or

!alive object (objectID)

Klavan

Share this post


Link to post
Share on other sites

Try this then:

((damage object 14393) > 0.999)

Replace number 14393 with the proper object ID for the bridge. I've tested this line in OFP and it works fine. It shouldn't be different for ArmA.

Klavan

Share this post


Link to post
Share on other sites

Unfortunately there's quite a big difference as "object" has been replaced with "nearestObject" (changing quite short line to quite long one wink_o.gif )

This should work 100% (as it's even used in campaign for bridge damage detection):

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">damage (position player nearestObject 123456) >= 1

(put inside "Condition" line of trigger and replace 123456 with ID number of bridge/object/building).

Share this post


Link to post
Share on other sites
Unfortunately there's quite a big difference as "object" has been replaced with "nearestObject" (changing quite short line to quite long one  wink_o.gif )

This should work 100% (as it's even used in campaign for bridge damage detection):

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">damage (position player nearestObject 123456) >= 1

(put inside "Condition" line of trigger and replace 123456 with ID number of bridge/object/building).

That works a treat - thank you very much indeed everyone!

Share this post


Link to post
Share on other sites

Uh, that doesnt make much sense, why change it to position player nearestObject 123456, nearest to what? confused_o.gif .

Share this post


Link to post
Share on other sites

Hutson[16AA]: You're welcomed wink_o.gif

Heatseeker: Probably to player's position (?), dunno. I just know that it works this (silly) way smile_o.gif .

Share this post


Link to post
Share on other sites

The object command doesn't exist anymore in ArmA (see here).

It's has to do with the new territory streaming (I guess that means that the engine doesn't really know anything about map objects in the middle of nowhere, unless there's a user-placed object close by it.)

Share this post


Link to post
Share on other sites
The object command doesn't exist anymore in ArmA (see here).

crazy_o.gif I should had read better lol!

Klavan

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×