Proc:Ambient Messages Slider

From SlothMUD Wiki
Revision as of 23:02, 19 May 2018 by Teker (Talk | contribs)

Jump to: navigation, search

Overview

The ambient_messages 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. This procedure can only be added to areas.

This procedure manages a single integer state value that ranges from 0 to MAX, where MAX is defined by the builder. Each game hour, the procedure runs and makes a random roll to see if the state changes. If the roll is successful, there is a 50% chance the state value will be decrermented by 1 (if the current state value is greater than 0) and a 50% chance the state value will be incremented by 1 (if the current state value is less than MAX). Then an appropriate message is displayed. The builder can also configure messages for when the state does not change.

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
INITIAL_STATE 0 The initial state value. It can not be larger than MAX.
CHANGE_CHANCE 66 The percentage chance that the state value will change in a given hour. If a successful change roll is made, a second roll will occur to determine if the state should decrement or increment.
INDOOR_MSG_0_UNCHANGED No message. The message that is displayed to players in the area that are indoors when the state is 0 and the change roll fails (ie the state value does not change). Similarly builders can configure INDOOR_MSG_1_UNCHANGED for state value 1, all the way up to whatever MAX state value they would like.
INDOOR_MSG_0_FROM_1 No message. The message that is displayed to players in the area that are indoors when the state changes from 1 to 0. Similarly builders can configure INDOOR_MSG_1_FROM_0 or INDOOR_MSG_1_FROM_2, all the way up to whatever MAX state value they would like.
OUTDOOR_MSG_0_UNCHANGED No message. The message that is displayed to players in the area that are outdoors when the state is 0 and the change roll fails (ie the state value does not change). Similarly builders can configure OUTDOOR_MSG_1_UNCHANGED for state value 1, all the way up to whatever MAX state value they would like.
OUTDOOR_MSG_0_FROM_1 No message. The message that is displayed to players in the area that are outdoors when the state changes from 1 to 0. Similarly builders can configure OUTDOOR_MSG_1_FROM_0 or OUTDOOR_MSG_1_FROM_2, all the way up to whatever MAX state value they would like.
MAX Automatically computed This value is the maximum state value that the procedure will use. It is not a variable set by the builder - rather it is computed by looking at the configured INDOOR_MSG_XXX and OUTDOOR_MSG_XXX values.


Sample