Jump to content

Advice on sensor events?


Virrera
 Share

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

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

Recommended Posts

Can you do a multi state change for texture remapping off a sensor event to create a slide show that only plays when it detects avatars in range?

Can I nest state_entries with set timer events?

Thanks for any advice, trying not to make a mess!

Link to comment
Share on other sites

personally i think states are best avoided :P

 use flags?

i.e. your sensor detects an Avatar....

integer inRange;     // used as a boolean flag

state_entry()
    {  llSensorRepeat("", "", AGENT_BY_LEGACY_NAME, 10.0, PI, 30.0);
    }
    sensor(integer num_detected)
    {  inRange = TRUE;

    }

    no_sensor()
     {  inRange = FALSE;
     }

  timer()

  { if( inRange)   // if the flag is TRUE

    { // start slideshow

    }

  }

 __________________________

 if you need multiple timers, have the timer set to 1 second, and use counters

for each event you need.

ex: one timer needs to fire every 30 seconds, one needs to fire every  5 seconds

integer 30SecTimer;

integer 5SecTimer;

++30SecTimer;   // will add 1 to this counter every second, when it hits 30,

 do your 30 second event and reset it to zero

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3284 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...