Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripting remote controls

Maxim Mistwallow
Registered User
Join date: 8 Sep 2008
Posts: 10
09-21-2008 02:34
Hello everybody!
I'm merely a humble newbie trying to implement some ideas and I need some help.
I'm especially interested in looking through remote control scripts. The ones which allow, for instance, to change the light colour of a lightsource from a remote control box (seen that in SL). Could you please recommend some free such scripts for research, if there are any?
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
09-21-2008 02:52
What I can suggest, is looking in the wiki. This is a great little script to build your first time out.

You'll need to know the following things:

llListen
llSetPrimitiveParams
llSay

And you can use the following events

touch
listen

The trick to getting a listen to "hear" a remote control, is kind of complex, so I'll post that here for you. You could put this in the "state entry" in the light.

llListen(channel, "", NULL_KEY, "";);

and then later in ths "listen" event, put this line on top.

if (llGetOwnerKey(id) != llGetOwner()) return;

"return" is the lsl version of "end" or "goback". What this little line is saying, is "if the KEY(UUID) of the owner, of the speaker.. is NOT the same as the KEY(UUID) of the owner of the prim holding THIS script.. stop.

Basically what happens, is that if you own the light, and you own the switch.. Then these two will match, and it won't quit out. It's nice also that YOU own YOURSELF.. so if you were to speak the command on "channel", then the light would respond as if you were the remote control.

But this "filter" will keep your friend's lightswitch from messing up the light.

LSL Wiki's
http://wiki.secondlife.com/wiki/LSL_Portal
http://slhomepage.com/lsl/HomePage.htm
http://rpgstats.com/wiki/index.php?title=Main_Page
http://www.lslwiki.net/lslwiki/wakka.php?wakka=HomePage
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Maxim Mistwallow
Registered User
Join date: 8 Sep 2008
Posts: 10
09-21-2008 05:22
Thank you very much, especially for llSetPrimitiveParams! I was wondering which function controls those parameters and could not find the answer. :)
Maxim Mistwallow
Registered User
Join date: 8 Sep 2008
Posts: 10
09-22-2008 10:42
Great! It worked! :)

I would also like to learn to script - don't know how to call it - a multiple selection menus. So that you could press your remote and get a few buttons with options to select from.
How do you call that stuff in SL? I'm having difficulties finding sample scripts because I have no idea what to look for... *blushes*
Faust Vollmar
llSetAgentSanity(FALSE);
Join date: 3 Feb 2007
Posts: 87
09-22-2008 11:27
That one would be llDialog.

http://wiki.secondlife.com/wiki/LlDialog

It would work essentially the same way as the chat based one would, as when someone responds to a dialog they automatically speak the text of the dialog option on the channel specified in the llDialog call rather than any kind of dialog_responce event.

Dialog has the 12 options limitation, and unfortunately I don't really know how to play with the multiple pages thing.
Maxim Mistwallow
Registered User
Join date: 8 Sep 2008
Posts: 10
09-23-2008 07:58
Thank you very much!
Maxim Mistwallow
Registered User
Join date: 8 Sep 2008
Posts: 10
09-27-2008 02:29
Another question. How to turn off the 'dancing' particles which appear every time when scripts work?
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
09-27-2008 02:38
you can't really, but as far as i know, those are only for when it speaks
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369