Useful ACE Functions

ASOR WIKI > ASOR > Script Management > Useful ACE Functions

Ace Menu Items


Ideally these should always be used instead of addActions while we’re using Ace. Child actions can be used as well. See ace_interact_menu_fnc_addActionToObject and ace_interact_menu_fnc_createAction in the function viewer ingame. for more advanced options.


addActionToObject

Insert an ACE action to an object, under a certain config path
  Note: This function is NOT global.
Argument:
  0: Object the action should be assigned to <object>
1: Type of action, 0 for actions, 1 for self-actions <number>
2: Parent path of the new action <array>
3: Action <array>  
Return value:  The entry full path, which can be used to remove the entry, or add children entries <array>. 
Example: [cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToObject; 

createAction

Creates an isolated ACE action Note: This function is NOT global. Argument: 
0: Action name <string> 
1: Name of the action shown in the menu <string> 
2: Icon <string> 
3: Statement <code> 
4: Condition <code> 
5: Insert children code <code> (Optional) 
6: Action parameters <any> (Optional) 
7: Position (Position array, Position code or Selection Name) <array>, <code> or <string> (Optional) 
8: Distance <number> (Optional) 
9: Other parameters <array> (Optional) 
10: Modifier function <code> (Optional)
 Return value: Action <array> Example: ["VulcanPinch","Vulcan Pinch","",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction; 
Public: No 

Full example for ‘addAction’

_objectToAddActionTo = _this;
_actionName = "DoSomething"; //Doesn't really matter.. something unique with no spaces.
_actionText = "Do Something";
_actionIcon = ""; 
_actionCode = { hint "this is called, not spawned"; }; // Code called when action is activated
_actionParams = []; //parameters for _actionCode
_condition = { true }; //condition (like addAction)
_position = [0,0,0]; //or selection name in model or code
_distance = 10; //distance for the action
[_objectToAddActionTo, 0, [], [_actionName,_actionText,"",_actionCode, _condition , {}, _actionParams, _position, _distance] call ace_interact_menu_fnc_createAction] call ace_interact_menu_fnc_addActionToObject;


Ace Progress Bar

Author: commy2, Glowbal, PabstMirror
 
Draw progress bar and execute given function if succesful.
 Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode]
Argument:
 0: NUMBER - Total Time (in game "ACE_time" seconds)
 1: ARRAY - Arguments, passed to condition, fail and finish
 2: CODE or STRING - On Finish: Code called or STRING raised as event.
 3: CODE or STRING - On Failure: Code called or STRING raised as event.
 4: STRING - (Optional) Localized Title
 5: CODE - (Optional) Code to check each frame
 6: ARRAY - (Optional) Exceptions for checking EFUNC(common,canInteractWith)
 
Return value:
 Nothing
 
Example:
 [5, [], {Hint "Finished!"}, {hint "Failure!"}, "My Title"] call ace_common_fnc_progressBar
Category: Tags:
 

Get in touch

ASOR

Talk to us on

MOBILE MENU