Jump to content

Change texture depending on time of day?


PrincessKalika
 Share

You are about to reply to a thread that has been inactive for 3382 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello,

does anyone know if there is a lsl script out there that can change  textures on a prim depending on  time of day?

i do not mind if it only works with the day and night of secondlife or if it works with rl time of day, but as hard as i look i cannot find any. i am new to scripting so maybe that is why.

i want one to use to change textures depending on what time of day it is, but havnt found any so far. any of you knowledgeable on the subject or even someone who has seen one available could possibly help me?

thank you for your time in looking at my message, and have a great day eitherway 

Link to comment
Share on other sites

Try this. I adapted it from one I modded to use for boat's running lights depending on day or night. You can change the texture UUIDs and face options to whatever you need.

 

// Day-night check action script// Performs different actions when it becomes light or dark, checking// every minute.// Ordinal Malaprop// 2006-06-20integer daytime(){   vector sun = llGetSunDirection();   return (sun.z >= 0.0);}default{   state_entry()   {       llSetPrimitiveParams([      PRIM_TEXTURE, ALL_SIDES, "650eec6c-7c9c-cf06-2654-5de23057666f",     <1,1,1>,<0,0,0>,0]);      // insert things to be done in the night e.g.      llOwnerSay("Texture 2");   }   timer()   {      if (!daytime()) state night;   }   on_rez(integer p)   {      llResetScript();   }}state night{   state_entry()   {      llSetPrimitiveParams([      PRIM_TEXTURE, ALL_SIDES, "f0805741-f3ce-1ff7-b8f5-ee49f17ac478",     <1,1,1>,<0,0,0>,0]);      // insert things to be done in the night e.g.      llOwnerSay("Texture 1");   }   timer()   {      if (daytime()) state default;   }   on_rez(integer p)   {      llResetScript();   }}

 

Carbon

Link to comment
Share on other sites

Thx Rolig.

I will some day get round to efficiency measures in my script inventory. Your suggestions will help to bring that day forward, but in my defense, for now I just felt I could offer some help to a novice needing something to start out on the scripting learning curve - not that I'm too much further up the curve myself!

:matte-motes-grin:

Carbon

Link to comment
Share on other sites

Curses on my bad cut,copy, and paste!! For completeness if not sophiticated scripting, the working version is as follows:

// Day-night check action script// Performs different actions when it becomes light or dark, checking// every minute.// Ordinal Malaprop// 2006-06-20integer daytime(){   vector sun = llGetSunDirection();   return (sun.z >= 0.0);}default{   state_entry()   {       llSetTimerEvent(60.0);      if (!daytime()) state night;      llSetPrimitiveParams([      PRIM_TEXTURE, ALL_SIDES, "650eec6c-7c9c-cf06-2654-5de23057666f",     <1,1,1>,<0,0,0>,0]);      // insert things to be done in the night e.g.      llOwnerSay("Texture 2");   }   timer()   {      if (!daytime()) state night;   }   on_rez(integer p)   {      llResetScript();   }}state night{   state_entry()   {      llSetPrimitiveParams([      PRIM_TEXTURE, ALL_SIDES, "f0805741-f3ce-1ff7-b8f5-ee49f17ac478",     <1,1,1>,<0,0,0>,0]);      // insert things to be done in the night e.g.      llOwnerSay("Texture 1");   }   timer()   {      if (daytime()) state default;   }   on_rez(integer p)   {      llResetScript();   }}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3382 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...