Adding menu actions
Advanced Roleplay Environment supports modular menu actions. This means you can easily add menu actions or edit them accordingly.
Adding menu actions
In order to add a menu actionswe just need to add the menu action inside the menu actions file and configure the properties accordingly.
Adding the action
Since all infusion are saved inside script/entities/actions.lua
, we will open this file. This should look like this:
Now we will select our category and just copy a action from above and edit it to our needs so it should look like this (In this example I've selected the category "carry"):
Configuring the menu action
There are many options available for us to configure the menu action perfectly to our needs.
Option | Description | Example |
---|---|---|
name | This property is a string and contains the unique name of the action which should be unique. |
|
cooldown | This property is a number and contains the value of how long the action takes to perform this action via the ui. |
|
animation | This property is a table and contains the animation that will be played upon executing the action.
|
|
hideOnSelf | This property is a boolean and sets if the action should be only shown on other players or should also be shown on the local player. |
|
exclusiveBodyParts | This property is a table that contains exclusive body parts the action should be shown on. (If not defined, the action will be shown on all body parts) |
|
log | This property is a function that will be executed and the return value will be added to the log of the player. This function must return a string. |
|
condition | This property is a function that will be executed to check if the function should be shown or not. This function must return true or false. |
|
action | This property is a function that will be executed when the action has been clicked. The function must have call the callback function that will be passed to the log function. |
|
Adding the translation
Since the translation is missing it will look weird inside the ui. So we need to add it in our locale files. So we open our locale file (example: languages/en.json) and copy 'n' paste just an other entry and edit the values accordingly. So it should look like this if added like above:
Last updated