|
Turgar Nilsson
Registered User
Join date: 5 Oct 2005
Posts: 134
|
06-19-2006 17:13
Hi script gods.....I have a 3 prim object, that has lighting applied, and I would LOVE for it to be invisible during the day, and come into being, as it were, at night.... can anyone suggest how i might achieve this?...many thanks
|
|
BamBam Sachertorte
floral engineer
Join date: 12 Jul 2005
Posts: 228
|
06-19-2006 19:06
Do you mean that you want - Visible but unlit during the day
- Invisible but lit during the day
- Invisible and unlit during the day
?
|
|
Turgar Nilsson
Registered User
Join date: 5 Oct 2005
Posts: 134
|
06-20-2006 01:05
Hiya Bam.... ideally, it would be invisible unlit daytime, and visible, lit, nightime....  thanks Turgar
|
|
Perryn Akami
Registered User
Join date: 16 Jun 2006
Posts: 12
|
06-20-2006 05:29
you better be *really* good at remembering where you park it.........
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
06-20-2006 05:43
You want something along the lines of the following: // Day-night check action script // Performs different actions when it becomes light or dark, checking // every minute.
// Ordinal Malaprop // 2006-06-20
integer daytime() { vector sun = llGetSunDirection(); return (sun.z >= 0.0); }
default { state_entry() { llSetTimerEvent(60.0); if (!daytime()) state night; // insert things to be done in the day e.g. llOwnerSay("I now think it is daytime"); }
timer() { if (!daytime()) state night; }
on_rez(integer p) { llResetScript(); } }
state night { state_entry() { // insert things to be done in the night e.g. llOwnerSay("I now think it is nighttime"); }
timer() { if (daytime()) state default; }
on_rez(integer p) { llResetScript(); } } To make something vanish, use llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES) - to make it appear again use 1.0 instead of 0.0. (Assuming you've not changed the alpha values of any prims in the design manually.) You can use llSetPrimitiveParams to make it emit light or stop it emitting light.
|
|
Ashmuel Gould
Registered User
Join date: 8 Sep 2005
Posts: 40
|
06-20-2006 05:50
Ah, beat me to it Ordinal. I find llGetSunDirection gives good results
|
|
Turgar Nilsson
Registered User
Join date: 5 Oct 2005
Posts: 134
|
06-20-2006 09:05
thanks guys......giving it a go! Turgar
|