Jump to content
Cigs4

Ace addaction position problem

Recommended Posts

Hello Arma gurus!

I have a question regarding ACE.

I would like to put an action on a gate via eden editor. This action should appear in the ace interaction exactly where the lock on the gate is. For some reason unknown to me, the interaction appears in the center of the gate and not in the lock.
Here's the code I'm using:
 

_action = ["actlock","Lockpick","",{Vrbpick = TRUE; publicVariable "Vrbpick"},{true},{},[], "door_handle_1", 5] call ace_interact_menu_fnc_createAction;
[gate1, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject;


Any help I would really apreciatte.

Share this post


Link to post
Share on other sites
13 hours ago, Cigs4 said:

a gate

 

Which gate?

Share this post


Link to post
Share on other sites

Apologies for the delay. This is the classname:

"Land_PipeFence_03_m_gate_r_F"

Thanks!

Share this post


Link to post
Share on other sites

I think I see what you mean. I can't get the ACE action to appear anywhere other than the default position.

 

I can move an object to the position of the lock (remember this), but the selection array returns []. Weird? I'm intrigued, because I feel I'm going to learn something here.

 

I will say that I think the way to do this is the same way various mods add actions to terrain objects (think water sources in survival mods). Which is to say, when the Interaction menu is opened (in the case of ACE) or perhaps just periodically (in the case of vanilla,) a check is run for objects of a class near enough to interact, a helper object is then attached to each relevant object (remember?), and then an action is attached to each helper. Finally, in the case of ACE, when the interaction menu is closed, all helpers are deleted.

 

It might be worth looking at some mods that do this type of thing. Maybe ask in the Ravage mod topic, or perhaps @haleks can offer some insight here in this one.

  • Thanks 1

Share this post


Link to post
Share on other sites

Yeah I do this all the time using the yellow helper spheres.
Just add the ACE interaction code the the helper sphere, make it invisible and there you have an interaction you can place anywhere. You could even use attachTo to attach the sphere to another object if you needed it to move for some reason. 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you very much, gentlemen. As always, your help is invaluable.

I did exactly that, I chose a small object, I placed it exactly in the lock of the gate (inside it, so it's out of sight), I used the bis_fnc_attachToRelative, to keep it in place and voilá, action available.
 

Thanks again!

Share this post


Link to post
Share on other sites

A bit late but anyways,

The issue is setting

["ACE_MainActions"]

as "Parent path of the new action", forcing the action to be attached to that "ACE_Main...", which is always at the center.

Instead you have to put an empty array, to indicate that it has not parent action

[]

This example below works as intended, placing the new interaction at some height over the object.
 

Quote

_id         = "kt_action";
_text       = kt_str_dig;
_icon       = "a3\ui_f\data\gui\cfg\communicationmenu\defend_ca.paa";
_condition  = { kt_item in items player };
_pos = [ 0, 0, 0.5-(getPosATL _trench)#2 ];
_action = [ _id, _text, _icon, {}, _condition, {},[],_pos,3] call ace_interact_menu_fnc_createAction;
[ _trench, 0, [], _action, true] call ace_interact_menu_fnc_addActionToObject;

 

  • Thanks 2

Share this post


Link to post
Share on other sites

cidkiron, that information is gold!
Thanks a lot! 

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

×