scripting:introduction_to_events
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| scripting:introduction_to_events [2012/03/23 01:27] – mit | scripting:introduction_to_events [2025/05/28 16:34] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ~~NOTOC~~ | ||
| ===== Event Scripting Overview ===== | ===== Event Scripting Overview ===== | ||
| - | + | Events are triggered on your world server when various things happen - for instance, a ' | |
| - | You can control events on your world server by script through the file '' | + | |
| - | + | ||
| - | <note tip> | + | |
| - | After making any changes to any of your script files you will need to use the command.. | + | |
| - | < | + | |
| - | *reloadscript | + | |
| - | </ | + | |
| - | .. for the changes to take effect | + | |
| - | </ | + | |
| ===== Event Script Example ===== | ===== Event Script Example ===== | ||
| - | Heres an example of an event script file.. | + | Here' |
| - | <codedoc> | + | <code> |
| Event( " | Event( " | ||
| { | { | ||
| - | *command=say built building 3 | + | *say |
| - | *command=grantcash | + | *grantcash |
| } | } | ||
| - | Event( " | + | Event( " |
| { | { | ||
| - | *command=say used the kudos item | + | *say |
| - | *command=grantkudos | + | *grantkudos |
| - | *command=resetpos | + | *resetpos |
| } | } | ||
| - | </codedoc> | + | </code> |
| + | |||
| + | This file defines 2 events. In the example above, whenever a player (' | ||
| + | < | ||
| + | *say Bob built building 3 | ||
| + | *grantcash Bob 400 | ||
| + | </ | ||
| + | would be entered - the say message will appear in red for all players and ' | ||
| + | |||
| + | As well as triggering server commands from script, you can add logic, store persistent (per-player and global) values that can be accessed from other script events, call functions and set timers for events to occur later. | ||
| + | ===== Events Reference Links ===== | ||
| + | |||
| + | For a full list of events, check the [[scripting: | ||
| - | This file defines 2 events. In the example above, whenever | + | For a full list of all the '*' commands |
| - | < | + | |
| - | *say Mit built building 3 | + | |
| - | *grantcash Mit 400 | + | |
| - | </ | + | |
| - | would be entered - the say message will appear in red for all players | + | |
| - | + | ===== Next section ===== | |
| + | * Go to [[scripting: | ||
scripting/introduction_to_events.1332466023.txt.gz · Last modified: (external edit)
