Difference between revisions of "MUDL:Construct"
From SlothMUD Wiki
(Created page with " __TOC__ = Overview = This MUDL function gets called when: * The room containing the MUDL procedure is created (boot) * The mobile containing the MUDL procedure is created *...") |
(→Command Syntax) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
This MUDL function gets called when: | This MUDL function gets called when: | ||
* The room containing the MUDL procedure is created (boot) | * The room containing the MUDL procedure is created (boot) | ||
+ | * The area containing the MUDL procedure is created (boot) | ||
* The mobile containing the MUDL procedure is created | * The mobile containing the MUDL procedure is created | ||
* The procedure's PROC_ENABLED value is set to a non-zero value. | * The procedure's PROC_ENABLED value is set to a non-zero value. | ||
This is the perfect spot to initialize variables in the MUDL script. For mobiles, the constructor is called after the mobile is placed in a room. | This is the perfect spot to initialize variables in the MUDL script. For mobiles, the constructor is called after the mobile is placed in a room. | ||
− | |||
= Command Syntax = | = Command Syntax = | ||
<pre> | <pre> | ||
− | addproc <room|mobile| | + | addproc <room|mobile|area> mudl |
− | setproc <room|mobile| | + | setproc <room|mobile|area> ## construct |
</pre> | </pre> | ||
− | |||
= Global Variables = | = Global Variables = | ||
Line 34: | Line 33: | ||
| The object that the MUDL script is attached to. This value is null if the script is attached to a room or mobile. | | The object that the MUDL script is attached to. This value is null if the script is attached to a room or mobile. | ||
|- | |- | ||
− | | % | + | | %room |
| Room | | Room | ||
− | | The 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 and the entry point does not involve a command or player action. |
|- | |- | ||
+ | | %area | ||
+ | | Area | ||
+ | | The area (zone) in the game where the script is being run. | ||
+ | |- | ||
+ | | %parent | ||
+ | | Character or Object or Room or Area | ||
+ | | The in-game element that the MUDL script is attached to. It will be identical to one of %c, %o, %room, or %area. | ||
+ | |- | ||
+ | | %procedure_index | ||
+ | | Integer | ||
+ | | The index of the current MUDL procedure on the %parent variable. | ||
|} | |} | ||
− | |||
= Return Values = | = Return Values = |
Latest revision as of 23:53, 19 November 2018
Overview
This MUDL function gets called when:
- The room containing the MUDL procedure is created (boot)
- The area containing the MUDL procedure is created (boot)
- The mobile containing the MUDL procedure is created
- The procedure's PROC_ENABLED value is set to a non-zero value.
This is the perfect spot to initialize variables in the MUDL script. For mobiles, the constructor is called after the mobile is placed in a room.
Command Syntax
addproc <room|mobile|area> mudl setproc <room|mobile|area> ## construct
Global Variables
The following global variables are available:
Name | Type | Description |
---|---|---|
%c | Character | The mobile that the MUDL script is attached to. This value is null if the script is attached to a room or object. |
%o | Object | The object that the MUDL script is attached to. This value is null if the script is attached to a room or mobile. |
%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 and the entry point does not involve a command or player action. |
%area | Area | The area (zone) in the game where the script is being run. |
%parent | Character or Object or Room or Area | The in-game element that the MUDL script is attached to. It will be identical to one of %c, %o, %room, or %area. |
%procedure_index | Integer | The index of the current MUDL procedure on the %parent variable. |
Return Values
The constructor's return value is ignored.