How could I make a complicated script like this?
|
|
Tarien Harbinger
Forest Dweller
Join date: 14 Oct 2005
Posts: 3
|
10-18-2005 19:46
I have an idea for a script, but it's complicated. I haven't a clue how to make something like this, so that is why I ask for advice.
My idea is, when the moon is exactly over a prim, it changes an outer block's transparency from 0 to 40, then shoots a beam made of particles up into the sky. This would go on for about 30 seconds, emitting a bright blue light as it does it. Then the object would begin to glow a faint blueish-green. And when the sun rose, it would change back to full transparency.
I'm not actually ASKING for someone to make this script for me (Though I would be forever grateful if you did..) But if anyone could tell me some of the commands that could be used to check if the moon is over it and all that, I would still be pleased.
Thanks.
|
|
Kermitt Quirk
Registered User
Join date: 4 Sep 2004
Posts: 267
|
10-18-2005 20:10
The key to what you're trying to do is the llGetSunDirection function. I'm not quite sure what you mean by the moon being 'over' your object because if the moon is in the sky, it's always going to be over the object isn't it? Unless you're talking about the moon being in a certain quadrant of the sky in which case you'd be just checking to see if the vector returned by llGetSunDirection is within some specific range. Note that there is no llGetMoonDirection function. In SL the moon is always directly opposite to the sun, so the moon position is just the negative of the vector returned by llGetSunDirection. That's explained in more detail on that wiki page anyway.
|
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
10-18-2005 20:11
That's tough...there is no moon-location tracker. There IS, however, a Sun-direction tracker that you might be able to use: llGetSunDirectionI don't know if there is any relationship between the sun-direction and the moon direction...especially since day effectively lasts 3 hours, while night is only 1 hr. The particle effects are simply particles on event-occurances triggered by your moon-direction.
|
|
Kermitt Quirk
Registered User
Join date: 4 Sep 2004
Posts: 267
|
10-18-2005 20:12
Hehe... looks like we both got to that one at the same moment Kenn 
|
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
10-18-2005 20:17
Hehe...yea...but you did better at explaining the moon-position/sun-position 
|
|
Tateru Nino
Girl Genius
Join date: 13 Sep 2005
Posts: 312
|
10-18-2005 20:20
Ah, a do-it-yourselfer! Yay! There's so much fun in learning! First, you want to look at http://secondlife.com/badgeoI seem to recall someone mentioning that the moon is directly opposite the sun (at present). Therefore if you get the position of the sun, you can work out the position of the moon. You will want to look at the functions: llSetTimerEvent() (under time), llGetSunDirection() (under World), llParticleSystem() (under Particles), and the llSetAlpha() (under primitives) llSetTimerEvent() will allow your script to idle for long periods of time, periodically checking the position of the sun. llSetAlpha() will allow you to set the transparency of a prim, and llParticleSystem() for your beam into the sky (also possibly for glow effects) Experiment, experiment, experiment. Try to reproduce each effect that you want seperately, and only then concentrate on tying them together based on time. Good luck! gambatte kudasai!
|
|
Bertha Horton
Fat w/ Ice Cream
Join date: 19 Sep 2005
Posts: 835
|
10-18-2005 20:26
According to what I read, the moon and sun move independantly, but it would take many years for the moon to overtake the sun (or vice versa) so for a long time it should be considered "opposite" the sun.
|
|
Tateru Nino
Girl Genius
Join date: 13 Sep 2005
Posts: 312
|
10-19-2005 01:28
That matches up with my recollection too, Bertha. That they virtually opposite right now, but one will eventually catch up with the other. Maybe we'll get an eclipse!
|
|
Kermitt Quirk
Registered User
Join date: 4 Sep 2004
Posts: 267
|
10-19-2005 02:10
Now I'm at home I can show you a pic of something I built. I just have one of these on my land in Jarawa (156,105) . Never quite finished it off enough to make it worth selling. It shows the position of the sun and the moon, and also shows "SL" time in hovertext (based on the 3 hour day/1 hour night). I consider this to be proof that the world is flat because of the fact that the sun sets at the exact same moment no matter where you are in SL  Hence the flat representation of Jarawa in the center. The bit Bertha pointed out about them actually being independant I've always found interesting. I also recall reading somewhere that the orbit of the sun and the moon varies a bit as well. One day, when I can sqeeze it in, I'm planning a little project to investigate that a some more too. The general idea would be to record the vectors at regular intervals and send them back to a server with email or xml-rpc. Then u could get the whole lot in a db and easily compare the data. Another cool trick would be to read chunks of the data back into an object like my globe in SL. Then you could playback the sun/moon movement in fast forward leaving particle trails behind and actually see the variation in movement (if there was enough to be able to really see it). Well I'm rambling now. I'll leave you with the pic...
|
|
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
10-19-2005 07:38
There should be some variation in the horizon height of the Sun at zenith, since SL "seasons" are 3 RL days long (1 SL year = 12 RL days).
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|