Commands can take an arbitrary number of required parameters followed by an arbitrary number of optional ones, however their order cannot be altered. All commands must have a return value.
In addition to the examples you can find in orx's code itself, here are a couple of examples:
Also note that the example with no params, as written above, would trigger an assert in debug versions. I just fixed that in orx tonight.
You can either sync to the latest code (or get the next nightly build), or pass a dummy non-NULL value for the parameter list (it won't be read anyway).
Comments
Commands can take an arbitrary number of required parameters followed by an arbitrary number of optional ones, however their order cannot be altered. All commands must have a return value.
In addition to the examples you can find in orx's code itself, here are a couple of examples:
- No parameters, returning a bool
Note it's not mandatory to have a command formatted as "Module.Command", but it's more consistent with all the commands already shipping with orx.
- 2 required string parameters, 1 optional float one, returning a string
And here are examples for the functions themselves:
You can either sync to the latest code (or get the next nightly build), or pass a dummy non-NULL value for the parameter list (it won't be read anyway).
Thanks so much for the quick reply.
Your examples were just what I needed to understand how to define the functions.
Don't hesitate if you have any other questions.