|
Lilyanah Demar
Working to make SL my RL
Join date: 15 Apr 2006
Posts: 212
|
04-18-2007 13:22
Before I bug a scriptor with this question was wondering if it was even possible.
I would like to make a set of street lamps that are off during the day, dim at sunset, full blast at midnight, dim at sunrise, and then start all over again...all according to the SL clock.
now to add a twist...what if the lamps weren't glow but oil lamps with flame animations or particles. Could those do the same? ((ie. off, small flame, full flame, small flame, off...))
Is any of this even possible do you think?
|
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
04-18-2007 13:24
It's possible...and very easy. I scripted something very similar for the streetlamps in Karamoon.
You'll want to look at the various time-functions on the LSL Wiki and just call different particle, texture, or lighting configurations based on the time.
_____________________
--AeonVox--Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
|
|
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
|
04-19-2007 04:23
This has been brought up before and if I recall correctly the sun's movement is susceptible to changes with regards to the SL clock. During normal operation there are 4 sun/moon cycles per day with the sun:moon ratio of 3:1 i.e. 4 hour cycles with 3 hours of sun and 1hour of moon. These cycles may not correspond to the o'clock and so you(/your scripter/anyone reading this and interested in making their own) should check the suns position in the sky using llGetSunDirection(). llGetSunDirection() returns a vector which is the normalised position of the sun (with the moon being the opposite). We can use this to find when the sun is very near the horizon and setting or rising which can in turn be used to reset your timers to the 4hour cycle. I'll see if I can dig up the old SunDirection thread. Edit: Other useful threads: Advice on working with Sun PositionSun TrackingEdit Edit: I hadn't seen llGetTimeOfDay before but this looks like it could be exactly what you're looking for. It'll give you the number of seconds since the sun reached midnight position (although it is reset when the sim is so it would be innacurate until the next midnight after a sim restart).
_____________________
www.nandnerd.info http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum
|