// Two scripts in same prim:<br />
<br />
// Script 1 the switch on off<br />
<br />
// Script name: Rain on off<br />
<br />
integer PLAY_SOUND = TRUE; // TRUE for a click-sound, FALSE for silent.<br />
string SOUND = "64319812-dab1-4e89-b1ca-5fc937b8d94a"; // a click sound<br />
string CONTROLLER_ID = "A"; // see more about CONTROL TEMPLATES at end.<br />
integer mode = 0; // keep track of whether particles are ON(1) or OFF(0).<br />
<br />
default {<br />
touch_start(integer total_number) {<br />
<br />
if ( PLAY_SOUND ) llPlaySound( SOUND, 1.0 ); <br />
<br />
mode = ! mode; // flip on to off, (or off to on).<br />
<br />
llMessageLinked( LINK_SET, mode, CONTROLLER_ID, NULL_KEY ); // send command<br />
<br />
}<br />
<br />
// Listen for other controllers sending ON/OFF commands and remember changes:<br />
<br />
link_message( integer sibling, integer num, string controller_id, key ignore ) {<br />
<br />
if ( controller_id != CONTROLLER_ID ) return; // this message is not for us.<br />
<br />
mode = num;<br />
<br />
}<br />
<br />
}<br />
<br />
// ####################### EOF ##########################<br />
<br />
<br />
// Script 2 the rain<br />
// Script name: Rain<br />
<br />
<br />
integer PLAY_SOUND = TRUE; // TRUE for a click-sound, FALSE for silent.<br />
string SOUND = "64319812-dab1-4e89-b1ca-5fc937b8d94a"; // a click sound<br />
string CONTROLLER_ID = "A"; // see more about CONTROL TEMPLATES at end.<br />
integer mode = 0; // keep track of whether particles are ON(1) or OFF(0).<br />
<br />
default {<br />
<br />
touch_start(integer total_number) {<br />
<br />
if ( PLAY_SOUND ) llPlaySound( SOUND, 1.0 ); <br />
<br />
mode = ! mode; // flip on to off, (or off to on).<br />
<br />
llMessageLinked( LINK_SET, mode, CONTROLLER_ID, NULL_KEY ); // send command<br />
<br />
}<br />
<br />
// Listen for other controllers sending ON/OFF commands and remember changes:<br />
<br />
link_message( integer sibling, integer num, string controller_id, key ignore ) {<br />
<br />
if ( controller_id != CONTROLLER_ID ) return; // this message is not for us.<br />
<br />
mode = num;<br />
}<br />
}<br />
<br />
// ####################### EOF ##########################
Margie: Oh how sad 3 hours ago |
Copper: To the NPC topic. I use NPC at my sim (grid OS version 0.9.2.1), that were coded under OS 0.7.6 and purr like a kitten. So this cant be the NPC "tech". Those NPC have features I also never saw in "new... 5 hours ago |
Lillysparks: Love the grass!! 6 hours ago |
Lillysparks: Cyberglo, you are so cool the way you ended this crash-course in IP basics. "Get a grip" LOL. You must have been around someone who was complaining...this seems oddly specific. Hehe 6 hours ago |
Margie: tried going there but says I'm denied access 6 hours ago |
Luna Lunaria: I really wanted to participate in this one but RL work held me hostage :-P 10 hours ago |
Jupiter Rowland: If you're looking for something, there's a group right here on OSW for that: What Are You Looking For? https://opensimworld.com/groups/1060 11 hours ago |
JaniceHubbenfluff: These are truly wonderful! yesterday |
No comments yet