creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
Example of a day/night cycle   
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  8/28/2012

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!



My TCR Norns
 
Bifrost

Bifrost
Norway  


  8/28/2012

Wow. That's even something I could manage to do, should the need arise (which I hope it will)... Could the same script be set to change for seasons as well? So that you could have eight images for spring/summer/autumn/winter nights and days? Could one even have mornings and evenings in there?
 
AquaShee

AquaShee
Belgium  


  8/28/2012

You can have as many backgrounds as you like and switch between them anytime you want. :)
There's potential here for more than just seasonal/nocturnal background changes! How about a background that changes with the weather or the amount of vegetation?


The Community Scribble: make (y)our own metaroom!
 


downloads
cobs
adoptions
creaturelink
metarooms
breeds
 
gallery
art
wallpaper
screenshots
graphics
promos
sprites
dev
hack shack
script reservations
dev resources
active projects
dev forum
 
community
links
advice
chat
polls
resources
creatchi
 
forum
bookmarks
general
news
help
development
strangeo
survivor
mycaves
log in
register
lost pw
0 online
creatures caves is your #1 resource for the creatures artificial life game series: creatures, creatures 2, creatures 3, docking station, and the upcoming creatures family.

contact    help    privacy policy    terms & conditions    rules    donate    wiki