Jump to content
Jaden Vance

Adding an action from an equipable item

Recommended Posts

Is it possible to add an action from an equipable item, (In my case, a certain backpack) to appear when the item is eqquiped?

Share this post


Link to post
Share on other sites

It is possible. The addAction command has a parameter that only shows the action when the code in the parameter is true. In your case, you would probably use the backpack command in the condition parameter.

Would look something like this:

player addAction 
[
    "<title>", 
    {
        params ["_target", "_caller", "_actionId", "_arguments"];
		// some code...
    },
    [],
    1.5, 
    true, 
    true, 
    "",
    "(backpack _orignalTarget) == 'some_classname'", // _target, _this, _originalTarget
    50,
    false,
    "",
    ""
];

 

Share this post


Link to post
Share on other sites

You can addAction on player (or unit) if he's equipped with a specific backpack.

What's a specific backpack? For example, a backpack you succeed in naming it. For example a backpack object, from 3den, you placed somewhere on the map and name myBackpack ...

Now you can check (in addAction condition) if:  unitBackpack _this == myBackpack

 

  • Like 1

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

×