Difference between revisions of "MUDL:Every zone reset"
From SlothMUD Wiki
(Created page with " __TOC__ = Overview = This MUDL function gets called for each room in a zone when it is reset. = Command Syntax = <pre> addproc room mudl setproc room ## every_zone_reset...") |
|||
| (3 intermediate revisions by the same user not shown) | |||
| Line 4: | Line 4: | ||
= Overview = | = Overview = | ||
| − | This MUDL function gets called for each room in | + | This MUDL function gets called for each room in an area/zone when it is reset. Then it is called on the area. |
| Line 12: | Line 12: | ||
addproc room mudl | addproc room mudl | ||
setproc room ## every_zone_reset | setproc room ## every_zone_reset | ||
| + | |||
| + | addproc area mudl | ||
| + | setproc area ## every_zone_reset | ||
</pre> | </pre> | ||
| + | |||
= Global Variables = | = Global Variables = | ||
| Line 20: | Line 24: | ||
! Name !! Type !! Description | ! Name !! Type !! Description | ||
|- | |- | ||
| − | | % | + | | %room |
| Room | | Room | ||
| − | | The room that the MUDL script is attached to. | + | | The room in the game where the script is being run. This value may be null if the script is attached to an area. |
| + | |- | ||
| + | | %area | ||
| + | | Area | ||
| + | | The area (zone) in the game where the script is being run. | ||
| + | |- | ||
| + | | %parent | ||
| + | | Room or Area | ||
| + | | The in-game element that the MUDL script is attached to. It will be identical to one of %room or %area. | ||
| + | |- | ||
| + | | %procedure_index | ||
| + | | Integer | ||
| + | | The index of the current MUDL procedure on the %parent variable. | ||
|} | |} | ||
| Line 33: | Line 49: | ||
= Triggered Scripts = | = Triggered Scripts = | ||
| − | + | Zone resets trigger events in the following order: | |
| + | # Zone commands are executed on the rooms in the area. | ||
| + | # Every_zone_reset scripts are triggered for each room. | ||
| + | # Every_zone_reset scripts are triggered on the area. | ||
| Line 40: | Line 59: | ||
<pre> | <pre> | ||
addproc room mudl | addproc room mudl | ||
| − | setproc | + | setproc room 0 every_zone_reset |
msg_room(%r, 'ZONE RESET!') | msg_room(%r, 'ZONE RESET!') | ||
Latest revision as of 16:54, 18 May 2017
Contents
Overview
This MUDL function gets called for each room in an area/zone when it is reset. Then it is called on the area.
Command Syntax
addproc room mudl setproc room ## every_zone_reset addproc area mudl setproc area ## every_zone_reset
Global Variables
The following global variables are available:
| Name | Type | Description |
|---|---|---|
| %room | Room | The room in the game where the script is being run. This value may be null if the script is attached to an area. |
| %area | Area | The area (zone) in the game where the script is being run. |
| %parent | Room or Area | The in-game element that the MUDL script is attached to. It will be identical to one of %room or %area. |
| %procedure_index | Integer | The index of the current MUDL procedure on the %parent variable. |
Return Values
The return value from this function is ignored.
Triggered Scripts
Zone resets trigger events in the following order:
- Zone commands are executed on the rooms in the area.
- Every_zone_reset scripts are triggered for each room.
- Every_zone_reset scripts are triggered on the area.
Example
addproc room mudl setproc room 0 every_zone_reset msg_room(%r, 'ZONE RESET!') @ setproc room 0 PROC_ENABLED 1 compile