Proc:Ambient Messages Slider

From WikiName
Jump to: navigation, search

Overview

The ambient_messages_slider 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

This sample generates messages for a jingling chain. As the state value increases toward MAX (in this case 3) the sound of the chain gets louder.

setproc area 0 CHANGE_CHANCE 66

setproc area 0 INDOOR_MSG_1_FROM_0 You start to hear a jingling chain in the distance.
setproc area 0 INDOOR_MSG_2_FROM_1 The sound of the jingling chain seems to be getting closer.
setproc area 0 INDOOR_MSG_3_FROM_2 The sound of the jingling chain seems to be coming from right in front of you!

setproc area 0 INDOOR_MSG_3_UNCHANGED The loud jingling of the chain seems to be coming from right behind you!

setproc area 0 INDOOR_MSG_2_FROM_3 The jingling of the chain seems to move away from you.
setproc area 0 INDOOR_MSG_1_FROM_2 The sound of the jingling chain grows quieter.
setproc area 0 INDOOR_MSG_0_FROM_1 The sound of the jingling chain disappears into the distance.