12.1. Creating and Editing Hooks

The easiest way to create and alter hooks is from the World Editor, the place where all settings of a World are altered (see Chapter 4, Editing a World).

Hook are defined in the Hooks section inside the Automation section. When you open that section, you'll see a list of the defined hooks and some buttons like this:

Figure 12.1. The graphical Hook editor
The graphical Hook editor.

In the top there is a combo box for you to select one of the five events described above. When an event is selected the hooks defined for that event will be listed, and all operations will be done on hooks of that event.

The main part of the window is the list of defined hooks. The columns are as follows:

12.1.1. Adding Hooks

To add a new hook, select the desired event from the Combo Box and press the Add button. This will open a window for you to edit the new hook's parameters:

Figure 12.2. The window to edit hooks
The window to edit hooks.

What can be set represents the columns described above.

When you are finished, press OK and the hook will be added. If you change your mind, press Cancel and the hook will not be added.

To see some things hooks can do, read Section 12.2, “Defining Hooks in the Command Line”. If you want to try the hooks described there, you can create them from the World Editor.

12.1.2. Editing Hooks

To edit a hook, select the event from the combo box, then select the hook to edit in the list by clicking its line in the list (the line will be highlighted), and press the Edit button. A window like the one used for adding hook (see Section 12.1.1, “Adding Hooks”) will be opened, filled with the hook's parameters. Change what you want, and press the OK to commit the changes. If, however, you change you mind, press Cancel and the changes will be not be made, the hook will remain as it was before.

Another shorter way to edit a hook is to double click its line in the list.

It is also possible to change the value of enabled setting directly from the hook list. Make sure that the hook you want to change is selected, and click in the check button. The state will be toggled.

To delete a hook, select it and press the Delete button. You will be asked for confirmation, and can cancel the operation, but once deleted, you cannot recover the hook. If you want, you can disable this confirmation dialog, but if you do so and click the Delete button, the only way to undo your action will be creating the hook again. See Section 4.7, “Advanced”. To delete several hooks at once, select them all and press Delete.

The final thing that needs to be explained with regard to hooks is how to reorder them. Hooks as run from the first one to the last, so in a few cases the order might matter. To move a hook up or down in the list, select it and press the corresponding button.