Proc:Ambient Messages Random (area)

From WikiName
Revision as of 20:26, 28 January 2019 by Teker (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 area. There is another slightly different procedure by the same name that can be added to rooms.

The builder defines a number of indoor and outdoor 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 indoor and outdoor messages may be different. The "first" indoor message is defined in INDOOR_MSG_0 and the "first" outdoor message is defined in OUTDOOR_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
INDOOR_MSG_0 No message. The message that is displayed to players in the area that are indoors if the random roll results in 0. Additional messages would be defined in INDOOR_MSG_1, INDOOR_MSG_2, and so on.
OUTDOOR_MSG_0 No message. The message that is displayed to players in the area that are outdoors if the random roll results in 0. Additional messages would be defined in OUTDOOR_MSG_1, OUTDOOR_MSG_2, and so on.


Sample

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

setproc area 1 OUTDOOR_MSG_0 Message 0
setproc area 1 OUTDOOR_MSG_1 Message 1
setproc area 1 OUTDOOR_MSG_3 Message 3
setproc area 1 PROC_ENABLED 1

Note that the MAX value for outdoor 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 indoor players, so they will never receive a message from this procedure.