Jump to content

ACE External Interaction does not work on trees

Recommended Posts

I tried to do a Farming system where you have to farm via ACE Interaction on a Item (Tree, Stone).

For testing i use following code: 

_action = ["Test", "Test", "", {hint "Hat geklappt"}, {true}] call ace_interact_menu_fnc_createAction; 
["CUP_jablon", 0, [], _action, true] call ace_interact_menu_fnc_addActionToClass;

This code works on every object classname, except these of trees. 

So there are 3 questions: 
1. How can i make trees also able to get a ACE interaction?
2. How can i set the interaction to specific Objects. maybe via Object init?
3. How can i use object variables instead of object classnames?

Can anyone help me?

Edited by Denniis_CHX45
Link to post
Share on other sites

Hello, does your trees is on the map or the trees are add manualy (mission.sqm / script)? 


the problem with tree was they don't have type name...

You can find some trees looks like this where you are next to a tree: 



_a = nearestTerrainObjects [player, ["Tree"], 100];
_target = _a # 0;

_objectType = typeOf _target;

private _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions";

hint format ["test: %1 \n\n a: %2 \n\n Actions: %3",_objectType,_a,_actionsCfg];


but as you can see, the tree dont give some class and  any ace actions but he is define in the array as terrainObjects.

But if your tree is add manualy on your mission.sqm or on a script, he is define looks like a object (and not terrainobject) and if  it's your case, you can do something like this to add an action to a tree (then you need to do a foreach for example in a serverinit or client init if it's initalize on client?)


private _myobjects = [Object1,Object2]; // is the name of the variable on your map for example

	_action = ["Test1", "Test1", "", {hint "Hat geklappt"}, {true}] call ace_interact_menu_fnc_createAction;

	[_x, 0, ["ACE_MainActions"], _action]call ace_interact_menu_fnc_addActionToObject;

} forEach _myobjects;


and normally your actions is add on some objects.

I'm not really active on the forum, if you need some help or some infos contact me on Discord (Nekro#3408)



Edited by Nekro
give more info
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.