ACE3 icon indicating copy to clipboard operation
ACE3 copied to clipboard

fnc_addActionToObject Only Adds Root-level Actions

Open voiperr opened this issue 11 years ago • 5 comments

With no modules in an SP mission while pointed at a nearby man, this works:

_action = ['VulcanPinch','Vulcan Pinch','',{_target setDamage 1;},{true}] call ace_interact_menu_fnc_createAction;
[cursorTarget, 0, [], _action] call ace_interact_menu_fnc_addActionToObject;

Doesn't work:

_action = ['VulcanPinch','Vulcan Pinch','',{_target setDamage 1;},{true}] call ace_interact_menu_fnc_createAction;
[cursorTarget, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject;

Culprit:

fnc_addActionToObject modifies an object's GVAR(actions). The only function that uses this is fnc_renderActionPoints, and that's only if the action is at root level. So, any nested actions added to an object don't work.

Also: Self-actions added to player via fnc_addActionToObject don't work at any menu level, but that's debatably a problem; self interactions only respond to player, so using fnc_addActionToClass yields the same result without cross-object conflict. Still, documentation stating that it can't be used with player would be useful.

voiperr avatar May 13 '15 20:05 voiperr

This is currently a stopper to make few things dynamic and object-specific, what happens is the interaction menu with all actions and sub-actions renders correctly but only for about 2-3 seconds, then it simply disappears.

@SilentSpike said he'll take a look when he is done with spectator stuff, but I noticed this issue and thought it would be a good idea to bump it.

jonpas avatar Jul 14 '15 18:07 jonpas

I believe this has been fixed for a long time now, can anyone confirm?

kymckay avatar Dec 15 '15 14:12 kymckay

Looking at my comment back from July 16th in #1862 it has been.

jonpas avatar Dec 15 '15 15:12 jonpas

Let's close it.

nicolasbadano avatar Dec 15 '15 15:12 nicolasbadano

Fairly sure I needed it to work for something I was working on at the time (probably slideshow module), pretty sure it works. :)

jonpas avatar Dec 15 '15 15:12 jonpas