**Language / Langue :** [[fr:txt:actions|FR]] | **EN**
====== Custom actions (.txt format) ======
Custom actions add freely named commands to your scenario. The player then types ''actionname target''.
===== Declaration =====
An action goes either in the exit list of a room (**local** action) or after the last ''*****'' (**global** action):
action:target|condition(s)|effect|OK text|KO text
* ''action'' - the command verb (for example ''open'', ''combine'', ''inspect'')
* ''target'' - the specific target (''door'', ''chest'') or ''all'' to accept anything
* ''condition'' - required objects or variables (or ''null'')
* ''effect'' - variable change, object added, using the same syntax as a 997 event
* ''OK text'' / ''KO text'' - messages shown when the condition is met or not
The player then types ''open door'', ''combine herb'', and so on.
===== The all target =====
With ''all'', the command accepts any target. The variable ''action_cible'' holds what the player typed, and ''action_cible_ok'' holds the **last valid target**. These names stay in French: they are reserved variables of the engine.
inspect:all|null|null|You look closely at «action_cible».|Nothing of interest here.
===== Priority and multiple conditions =====
* The same ''action:target'' can be declared several times with different conditions. The first one whose conditions are met is executed.
* **Local** actions are tested before **global** ones.
* If no condition is met, the KO text of the last line is shown.
===== Full example =====
open:chest|key|null|You open the chest with the key!|You need a key.
open:chest|null|null|The chest is locked.|null
break:all|null|null|You strike «action_cible» with all your strength!|null