Creating Commands
Creating commands in Emberhunt is really easy.
Just follow these steps, and you will have your own command in no time.
The file name should be <command name>.gd
.
This is optional. The descriptions are displayed by the help
command, so if you're not the only one who's going to use that command, adding descriptions is a good idea.
Just add this to your file, and change the text however you want:
var _short_description = "this is displayed next to the command name when you simple type help"
var _description = """this is displayed when you type help <this command>.
This should be an extended version, with usage examples, etc."""
This is the main ingredient.
You will need to define a function, with a name identical to the command name.
func <command name>(args = [], server = null):
As you can see, the function takes 2 arguments: args
, which is an array of the arguments used when executing this command, and server
which is the server object, if you want to read/write something.
Inside the function, you can do whatever you want, and what you return
will be printed to the logs.
Note: do not use print()
as it will only print to the logs, without sending the output back to the commands executioner.
This is the technical documentation of the game Emberhunt.
All contributions are very appreciated.
The game's content wiki is being worked on.