Jump to content
Sign in to follow this  
craptakular

activate trigger when open a door on a metal container?

Recommended Posts

How can you activate a trigger when you open a door on a metal container?

This trigger only to be activated once.

Share this post


Link to post
Share on other sites

I'd start off by turning on the ID system up top and placing down a gamelogic above the metal container. In that, write the following:

container = (getposATL this) nearestobject ID;

ID is obviously the ID of the metal container. You'll have to zoom in really close to see. After you've done that, place your trigger, activation whatever you like, and condition is the following:

(metalcontainer doorPhase "") == 1;

Leave it like that for now. Now the doorPhase cmd takes an animation, which you don't know yet. To check, set up a second trigger - put activation to Radio Alpha. In the On Act write this:

hint format ["%1",cursorTarget];

Go ingame and aim at the metal container you want to have. Execute the trigger by pressing 0-0-1. You'll see a classname pop up in the top right. Press ESC and go into your Config Viewer (Config in ESC menu). Navigate down to CfgVehicles, looking for the classname (it always starts with Land_). Once you found it, double click on the entry in the config. You'll see a list pop up, stuff like AnimationSources etc. AnimationSources is where you want to go. The top two will always be the doors. The most common name is "Door_1_source". Once you found the name of the door animation, insert it into the string you left blank in the other trigger. (To copy the Door animation name, click on it, it'll appear in the bottom).

Sorry if this is a bit complicated. If you want to make it easier, I suggest you try (metalcontainer doorPhase "Door_1_source") == 1; as condition in the original trigger.

Share this post


Link to post
Share on other sites

Hi, thanks for posting,

I don't seem to have an ID for the Container I placed in the editor, it is a a Cargo Container (Short, Military Green)

Share this post


Link to post
Share on other sites

container named c1

Trigger

Activation: anyone once

Cond: ((c1 animationPhase 'Door_1_rot') >= 0.5 || (c1 animationPhase 'Door_2_rot') >= 0.5)

onAct: hint "c1 door open";

onDeac: hint "c1 door closed";

Condition is in the config viewer under user actions

(there is no ID for editor placed objects)

Edited by Falsche9

Share this post


Link to post
Share on other sites

There should be an ID right ontop of the container. You'll need that to name it. Alternatively, where is the container you're trying to interact with?

Share this post


Link to post
Share on other sites

superb it works, many thanks guys.

---------- Post added at 17:10 ---------- Previous post was at 17:09 ----------

There should be an ID right ontop of the container. You'll need that to name it. Alternatively, where is the container you're trying to interact with?

I dont think it works on placed objects?

Share this post


Link to post
Share on other sites

Oh, placed objects. Yeah, if you just placed it, just name it in the name field. But for pre-placed objects, use the ID system.

Share this post


Link to post
Share on other sites
Oh, placed objects. Yeah, if you just placed it, just name it in the name field. But for pre-placed objects, use the ID system.

Sorry if I wasn't clear, I didn't intend to waste your time :)

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  

×