Closed Noah2610 closed 4 years ago
Don't have functions be defined in separate field, instead just make functions be events.
Config example:
(
events: {
// Function definition is simply an event.
Function("Greet"): Echo("Hello!"),
// Call function with `Call` action.
Interval(1000): Call("Greet"),
},
)
Example usage with custom entity HealthConsumable
and Player
:
https://github.com/Noah2610/deathfloor/commit/7ab2bba8db1acdb7a368885bdaae7b0d0d36335b
Extend events/actions system with functions, for reusable config. Add field
functions
with key/value pairs of function names and action configs. Function actions can be called from any action by its function name.Example config: