BKGD

BKGD is a CAOS command and function that returns or sets the current background image for a given metaroom.

Command
Syntax: BKGD metaroom_ID(integer) background(string) transition(integer)

Changes the background of the given metaroom. 'Background' is the background's file name; transition is as for META - 0 for no transition effect, 1 for a horizontal flip effect, 1 for a burst effect. The background must have been specified with ADDB or ADDM first.

Function
Syntax: BKGD metaroom_ID(integer)

Returns the current background of the given metaroom as a string.

Example
BKGD can be used by metarooms to change backgrounds - for a day/night cycle, for example, or to have backgrounds for different seasons. This is seen in rooms like Terra Pluvialis and the Desert Ruins.

Example code from the Desert Ruins background switching script: new: simp 3 8 50734 "blnk" 1 0 20 accg 0 attr 16 bhvr 0 mvto 22250 94072 setv ov01 gmap posx posy tick 1

scrp 3 8 50734 9 doif time eq 4 and bkgd ov01 eq "desert-wasteland-finished-daytime" scam null -1 bkgd ov01 "desert-wasteland-finished-nighttime" 2 elif time eq 0 and bkgd ov01 eq "desert-wasteland-finished-nighttime" scam null -1 bkgd ov01 "desert-wasteland-finished-daytime" 2 endi endm
 * day/night script