|
Development Forum |
 |
| Flowers Opening and Closing? | |
|
 Tea Queen
Laura
    

|
8/16/2013 | |
How would one code a plant so that its blooms open and close periodically, to mimic how real flowers behave?
Ghosthande, I'm in chat if you want a better idea of what I'm on about! I now have more sprites than the ones I've previously shown you (thanks, DarbyDoo! ).  |
 Prodigal Sock
Ghosthande
    

|
8/16/2013 | 1 |
You would want a timer script with a condition that checks what TIME is... TIME being a (pre-set) variable that keeps track of what time of day it is in your world. Its values are:
0 - dawn
1 - morning
2 - afternoon
3 - evening
4 - night
This is how I made the sunflower from the Dustdevil Grendel pack "follow the sun". The only thing to keep in mind is that you do need a second condition inside the first, to make sure the flower hasn't already animated for that time of day (or it will just open/close in a perpetual loop). You can do this by checking its POSE or setting a variable. 
 |
 Tea Queen
Laura
    

|
8/16/2013 | 1 |
Thank you, Ghosthande! I think attempting this script is going to really test my current level of CAOS knowledge, but be absolutely awesome at the same time. Especially when it's implemented; I always want my agents to be as enjoyable as they possibly can be.  |
 Tea Queen
Laura
    

|
8/19/2013 | |
Another question:
*added 7 steps to the growth process so make number 37, instead of 30, so roses have more time before rotting:
elif ov00 gt 30
*if it's older then 20 ticks, let it rot. Fully rotten frame is 10:
doif pose eq 10
kill targ
endi |
Is there anyway to speed the rotting process up a little? I can provide more code if necessary.  |
 Prodigal Sock
Ghosthande
    

|
8/19/2013 | |
Yes; just change "elif ov00 gt 30" to a higher number.
 |