Skip to content

Server: Commands

Mark Eliasen edited this page Feb 11, 2018 · 1 revision

Data Commands File

The commands data file (./game/data(.new)/commands.json) contains a list of all commands available to the player, default modifiers for each command and a description.

Commands

Each commands in the file, is defined by the command itself (without parameters), and contains an object which stores the description of the command, and the default modifiers for the command.

In this case, we will use the /heal command as our example, as it's got everything a command would potentially need:

"/heal": {
    "description": "Regain health. Costs {cost} per {heal_amount} point(s) of health to heal. Usage: /heal <points-to-heal>",
    "modifiers": {
        "cost": 10,
        "heal_amount": 5
    }
}

Composition

Each command is an object defined by the command itself, as they key. Using the example above, the key would be /heal.

Each command object contain the follow details:

  • description: The description of the command. You can use the {modifier_key} syntax in your descriptions, to insert details like cost or heal amount into the description.
  • modifiers: (optional) If a command has modifiers associated, like a cost or similar which is used in the command code itself, you can define them here. There values can be overwritten wherever the command is assigned, like in NPCs and Structures. (see relevant sections for more info).

Clone this wiki locally