RLV tutorials - SLUniverse Forums


Scripting Discuss scripting and programming for SL and other platforms

 
Reply
 
LinkBack Thread Tools Display Modes
Old 06-05-2010, 08:25 AM   #1 (permalink)
Miss Midipenny

*SLU Supporter*
 
Midi Reifsnider's Avatar
Oh Midi.
 
Join Date: Nov 2007
Location: UK
Posts: 3,053
My Mood:
SL Join Date: July 2007
Client: Viewer 3
RLV tutorials

I'm getting into lsl at the moment, and am making good progress (the list thing takes a bit of getting used to, arrays would be so much easier).

I want to have a go at adding some RLV functionality, and have done a fair bit of research into it. I have Dari's Haus scripts to look at, but there is so much in there, I'd like to understand the basics and what is the minimum required to get like one function working so that I could build on that. I would much prefer to be able to write my own scripts, but I'm having real trouble finding any basic starter type tutorials. There is plenty out there to help with RLV from a user perspective, but not a lot from a scripting perspective.

I guess what I'm looking for is something that answers the following questions:
What does an RLV Relay contain, and what MUST it contain as the bare minimum to function?
What does the RLV object script need to function (I've seen the API and understand the commands, but I've got a sort of blank when it comes to how this should be structured so that it talks communicates with the Relay etc)?


Does anyone know of any tutorials or articles out there that might help?
__________________



I have seen the moment of my greatness flicker,
And I have seen the eternal Footman hold my coat, and snicker,
And in short, I was afraid.

The Love Song of J. Alfred Prufrock, T.S. Eliot
Midi Reifsnider is online now   Reply With Quote
Old 06-05-2010, 10:14 AM   #2 (permalink)
SUPER BANNED

*SLU Supporter*
 
Free Xue's Avatar
It's Chinese.
 
Join Date: May 2009
Location: USA! USA! USA!
Posts: 35,533
My Mood:
SL Join Date: May, 2008
Client: V3 w/Starlight
Blog Entries: 10

Awards: 1
Special Achievement in Thread Titling 
Send a message via Skype™ to Free Xue
I know of the documentation on the SL Wiki:

LSL Protocol/Restrained Love Relay/Introduction - Second Life Wiki
LSL Protocol/RestrainedLoveAPI - Second Life Wiki

Beyond that, I haven't seen any serious tutorials or the like online.
Free Xue is offline   Reply With Quote
1 User Said Thanks:
Old 06-05-2010, 10:18 AM   #3 (permalink)
Miss Midipenny

*SLU Supporter*
 
Midi Reifsnider's Avatar
Oh Midi.
 
Join Date: Nov 2007
Location: UK
Posts: 3,053
My Mood:
SL Join Date: July 2007
Client: Viewer 3
yes, thanks, I've read that a couple of times but still have a sort of fuzziness in my head about it
Midi Reifsnider is online now   Reply With Quote
Old 06-05-2010, 11:13 AM   #4 (permalink)
ADOLF HEIGHTLER
 
Imnotgoing Sideways's Avatar
 
Join Date: Jun 2008
Location: Darkly Cute :: Ferguson
Posts: 7,781
My Mood:
SL Join Date: November, 2007
Business: Darkly Cute
Client: NOT the same one I used yesterday... (<.<)
Send a message via Yahoo to Imnotgoing Sideways Send a message via Skype™ to Imnotgoing Sideways
I would just like to know if there's any one way to nicely set up an #RLV folder. I ask two people and get five answers...
__________________
Link
Imnotgoing Sideways is offline   Reply With Quote
Old 06-05-2010, 11:45 AM   #5 (permalink)
Nasty Brit
 
Innula Zenovka's Avatar
Wants *things*
 
Join Date: May 2009
Posts: 9,322
SL Join Date: 17 June 2007
Business: Something Spunky
Quote:
Originally Posted by Imnotgoing Sideways View Post
I would just like to know if there's any one way to nicely set up an #RLV folder. I ask two people and get five answers...
Marine's: Objects sharing tutorial
Marine's: Objects sharing tutorial, part 2
Innula Zenovka is online now   Reply With Quote
2 Users Said Thanks :
Old 06-05-2010, 12:14 PM   #6 (permalink)
ADOLF HEIGHTLER
 
Imnotgoing Sideways's Avatar
 
Join Date: Jun 2008
Location: Darkly Cute :: Ferguson
Posts: 7,781
My Mood:
SL Join Date: November, 2007
Business: Darkly Cute
Client: NOT the same one I used yesterday... (<.<)
Send a message via Yahoo to Imnotgoing Sideways Send a message via Skype™ to Imnotgoing Sideways
Oh, these links are soooooo going to group notices later...
Imnotgoing Sideways is offline   Reply With Quote
Old 06-05-2010, 12:56 PM   #7 (permalink)
Nasty Brit
 
Innula Zenovka's Avatar
Wants *things*
 
Join Date: May 2009
Posts: 9,322
SL Join Date: 17 June 2007
Business: Something Spunky
Quote:
Originally Posted by Midi Reifsnider View Post
I'm getting into lsl at the moment, and am making good progress (the list thing takes a bit of getting used to, arrays would be so much easier).

I want to have a go at adding some RLV functionality, and have done a fair bit of research into it. I have Dari's Haus scripts to look at, but there is so much in there, I'd like to understand the basics and what is the minimum required to get like one function working so that I could build on that. I would much prefer to be able to write my own scripts, but I'm having real trouble finding any basic starter type tutorials. There is plenty out there to help with RLV from a user perspective, but not a lot from a scripting perspective.

I guess what I'm looking for is something that answers the following questions:
What does an RLV Relay contain, and what MUST it contain as the bare minimum to function?
What does the RLV object script need to function (I've seen the API and understand the commands, but I've got a sort of blank when it comes to how this should be structured so that it talks communicates with the Relay etc)?


Does anyone know of any tutorials or articles out there that might help?
I've not see any tutorials, in particular, though this thread in the old scripting tips forum might be some help: http://forums-archive.secondlife.com.../330830/1.html

RLV is really pretty straightforward, once you get the hang of the API. All it is, is making objects do llOwnerSay("@something:"); So if you rez a prim and put in something like,
Code:
default
{
    state_entry()
    {
       llSitTarget(<0.25,0.0,0.5>,ZERO_ROTATION);
    }

    touch_start(integer total_number)
    {
       llOwnerSay("@sit:"+(string)llGetKey()+"=force");
    }
}
it force sits the object's owner on whatever issued the command.

RLV relays work the same way, except the object communicates with the relay, which passes on the message in the form of llOwnerSay.

So if you want to force sit anyone on the prim, and then remove their shirt, they need to be wearing a relay (which listens on -1812221819) -- and the prim, for example, waits for someone to touch it and then says something like
Code:
integer rlvrc =-1812221819;
string cmd_name; //arbitrary name, useful at times so you can identify commands
string victim;

default
{
    state_entry()
    {
       llSitTarget(<0.25,0.0,0.5>,ZERO_ROTATION);
       cmd_name="my command";
    }

    touch_start(integer total_number)
    {
     victim = (string)llDetectedKey(0);
     llSay(rlvrc,cmd_name+","+victim+",@sit:"+(string)llGetKey()+"=force|@remoutfit:shirt=force");
    } 

        
}
Rather than try to use collar scripts to study the commands, I'd suggest going to the Temple of the Collar and grabbing some examples from the R&D Vendor there -- since they're objects that do specific things, it's a lot easier to see what's going on. The group OpenCollar R&D is always very helpful, I've found, when I've got RLV scripting questions even when they're not specifically about the Open Collar products.

ETA -- in answer to your specific questions, don't worry about writing a relay just yet.. you don't need to make one specially and there are plenty of very good free, open source, ones available. All you need to do is remember that your objects need to talk to the relay on -1812221819 and that commands need to follow the format in my example above of arbitrary command name, victim's uuid, and commands -- separated by pipes, if there's more than one command. And if you need a reply from the victim's viewer (e.g. you're checking what clothes they're wearing, or just if they're using RLV in the first place) you have to specify a positive channel on which their viewer must reply.

Last edited by Innula Zenovka; 06-05-2010 at 01:12 PM.
Innula Zenovka is online now   Reply With Quote
1 User Said Thanks:
Old 06-05-2010, 01:04 PM   #8 (permalink)
Miss Midipenny

*SLU Supporter*
 
Midi Reifsnider's Avatar
Oh Midi.
 
Join Date: Nov 2007
Location: UK
Posts: 3,053
My Mood:
SL Join Date: July 2007
Client: Viewer 3
Thankyou so much! This is exactly the sort of help I was looking for - it just seemed like an impossible task to unpick Dari's scripts to get down to the essentials.

I really appreciate the help and will definitely go grab some of the scripts.
Midi Reifsnider is online now   Reply With Quote
Old 06-06-2010, 10:45 PM   #9 (permalink)
*blink*

*SLU Supporter*
 
Soen Eber's Avatar
Yup that's me
 
Join Date: Oct 2009
Location: Minneapolis, Minnesota, USA
Posts: 4,508
My Mood:
Wow, my old RLV post is getting a lot of mileage :-)

What I had in the post to the old forums was my attempt to adhere as close as possible to the recommended standards - its kind of overkill but has a lot of verification, error handling, and handshaking which can be useful if you want a graceful failure recovery. I figured at the time since there wasn't anything previous the code would get ripped a lot and I didn't want to be responsible for having a lot of items out there with buggy code that broke stuff.

For your own stuff just go with Innula's examples and her links.
Soen Eber is offline   Reply With Quote
1 User Said Thanks:
Old 06-07-2010, 11:30 AM   #10 (permalink)
Nasty Brit
 
Innula Zenovka's Avatar
Wants *things*
 
Join Date: May 2009
Posts: 9,322
SL Join Date: 17 June 2007
Business: Something Spunky
Yeah, my two examples were just intended as very basic illustrations of how to use RLV functions to make something happen; I recall being in precisely the same situation as Midi -- I'd read the wiki pages and looked at the OC collar scripts (Dari hadn't full permed hers at the time) and was still completely confused about how I could use RLV commands to do stuff to people. Then someone showed me how to remove shirts and boots and so forth, and things started to fall into place.

But any serious application using RLV has to include error handling -- otherwise the object's inevitably going to break very quickly -- and for that you need to look at Soen's examples and some of the OC objects and toys.
Innula Zenovka is online now   Reply With Quote
1 User Said Thanks:
1 User Agreed:
Reply

Tags
restrained love viewer, rlv, rlv relay

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On