Jump to content
Sign in to follow this  
callihn

Possible to remove a map object using it's ID?

Recommended Posts

Can't remove it with hideObject, but you can destroy (flatten) it.

(getPos this nearestObject 314) setDamage 1;

Where 314 is the ID of the bush and this is some object on the map you put this into the init field of.

Share this post


Link to post
Share on other sites

Usually a gamelogic as "this" doesn't mean anything in a trigger.

If you wish to use a trigger as the location use this (getPos thistrigger nearestObject 314) setDamage 1;

or name the trigger and use that name instead of thistrigger all one word by the way.

Share this post


Link to post
Share on other sites
Where do you type it in?

The init field of the triggering object, usually a gamelogic, or a trigger as F2k describes above.

Place the gamelogic/trigger close to the object you want destroyed, put the appropriate command in the init field of the gamelogic/trigger.

Share this post


Link to post
Share on other sites

Thanks that helped but i need help with something else.

I have the ID bar gate already on the map, it can be opened and closed by the player while ingame. Is it possible to animate it using the id?

I tried this on a trigger:

(getPos this nearestObject 471333) animate ["Bargate", 1];

Share this post


Link to post
Share on other sites
Thanks that helped but i need help with something else.

I have the ID bar gate already on the map, it can be opened and closed by the player while ingame. Is it possible to animate it using the id?

I tried this on a trigger:

(getPos this nearestObject 471333) animate ["Bargate", 1];

Is the bargate a map object, or an object you placed in the editor?

If you placed it, name the bargate (I'll name it "bargate1"), then in the trigger -

onAct: bargate1 animate ["bargate",0];

onDeact: bargate1 animate ["bargate",1];

I'm not sure it's possible if it's a map object. I haven't been able to find an instance where I can get the ID of one to test it.

Share this post


Link to post
Share on other sites

Its a map object, i can animate the editor one and tried to use the ID from the bargate but with no results.

The one im trying to animate is in the map Napf on the military island if you want to try it

Share this post


Link to post
Share on other sites

Just spent about an hour trying different things, but I can't figure it out. Keep in mind that I'm no master of Arma coding, so my failure doesn't mean it isn't possible.

Share this post


Link to post
Share on other sites

well i'm definitely not better than you xD.

Thanks for the help.

Share this post


Link to post
Share on other sites

Is it possible to use !alive mapobjectID in a trigger condition?

Share this post


Link to post
Share on other sites
Is it possible to use !alive mapobjectID in a trigger condition?

Old thread... but,

You can use the group tool and group a trigger with a map object, like a building. It doesn't work for every little object. But once you've grouped it the trigger changes ACTIVATION to static object. Then you can use not present to fire the trigger if the building gets destroyed.

Share this post


Link to post
Share on other sites
Its a map object, i can animate the editor one and tried to use the ID from the bargate but with no results.

The one im trying to animate is in the map Napf on the military island if you want to try it

Place a 3X10 Trigger over the map bargate, Activation Blufor/Repeatedly/Present-

onAct:

 (getPos thistrigger nearestObject 163575) animate ["Door_1_rot", 1];

onDeact:

 (getPos thistrigger nearestObject 163575) animate ["Door_1_rot", 0];

Note: Replace the 163575 with the map id of your bargate

Share this post


Link to post
Share on other sites
Place a 3X10 Trigger over the map bargate, Activation Blufor/Repeatedly/Present-

onAct:

 (getPos thistrigger nearestObject 163575) animate ["Door_1_rot", 1];

onDeact:

 (getPos thistrigger nearestObject 163575) animate ["Door_1_rot", 0];

Note: Replace the 163575 with the map id of your bargate

That's working, yeah. I spent two days to find right names for animations. Here is a link to my guide about that... Steam Community

Share this post


Link to post
Share on other sites

Has something changed, I thought "Door_1_rot" was for the gates in A3 and "bargate" for A2/OA.

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  

×