Borrowed from Creaturetopia:
Liam wrote:
soliloquy was asking about this in CC chat, so I figured making it public might not be a bad idea.
From Terra Pluvialis, the code is:
**create day/night switcher**
new: simp 3 8 20006 "blnk" 1 0 20
accg 0
attr 16
bhvr 0
**0 = normal day/night
**1 = always day
**2 = always night
setv ov00 0
mvto 41394 32400
setv ov01 gmap posx posy
addb ov01 "junglebg1_unfinished_night"
tick 1
**day/night script
scrp 3 8 20006 9
doif ov00 eq 0 and time eq 3 or time eq 4
scam null -1
bkgd ov01 "junglebg1_unfinished_night" 2
elif ov00 eq 2
scam null -1
bkgd ov01 "junglebg1_unfinished_night" 2
elif ov00 eq 1
scam null -1
bkgd ov01 "junglebg1_unfinished" 2
else
scam null -1
bkgd ov01 "junglebg1_unfinished" 2
endi
endm |
It's very simple. Basically, you need two blk backgrounds, night and day. In the agent creation code for the switcher, you need to add the background that doesn't exist already; in my case, it's the night background.
I've made this so that you can either have it permanently set to day or night, or cycle with the game clock. This should be fairly simple to understand, we're just changing which background the metaroom uses. If you don't understand the CAOS terms, look them up I'd explain them but it's been a long time and I'm not sure I'd correctly explain them!