Proc:Ambient Messages Random (room)

From SlothMUD Wiki
Jump to: navigation, search

Overview

The ambient_messages_random procedure allows builders to create custom messages that display on the game hour. These messages have no effect on game play and can be used to substitute for custom climate messages or just add to the flavor of a particular room. There is another slightly different procedure by the same name that can be added to areas.

The builder defines a number of asleep and awake messages and each game hour a random roll is done (0 to MAX) and one of the messages is chosen to be displayed. The number of asleep and awake messages may be different. The "first" asleep message is defined in ASLEEP_MSG_0 and the "first" awake message is defined in AWAKE_MSG_0.

Note that to turn off normal climate messages, you need to set the climate to none via "SETAREA <area #> CLIMATE NONE". Sky messages such as sunrise and sunset can be disabled via "SETAREA <area #> HIDE_SKY YES".

Here is a list of keys that the procedure will use:

Key Default Description
ASLEEP_MSG_0 No message. The message that is displayed to players in the area that are asleep if the random roll results in 0. Additional messages would be defined in ASLEEP_MSG_1, ASLEEP_MSG_2, and so on.
AWAKE_MSG_0 No message. The message that is displayed to players in the area that are awake if the random roll results in 0. Additional messages would be defined in AWAKE_MSG_1, AWAKE_MSG_2, and so on.


Sample

This sample has 4 random strings (including one empty string).

setproc area 1 AWAKE_MSG_0 Message 0
setproc area 1 AWAKE_MSG_1 Message 1
setproc area 1 AWAKE_MSG_3 Message 3
setproc area 1 PROC_ENABLED 1

Note that the MAX value for awake messages is 3, so the random roll will be from 0 to 3. If 2 is rolled, there is no value, so nothing is displayed. There are no strings defined for asleep players, so they will never receive a message from this procedure.