Lucia Sabahi Posted January 9, 2013 Share Posted January 9, 2013 So i've been looking at the wiki with all the Rlv commandsAnd trying to create a script that i can drop into an attachment which will prevent me from touching and detaching itHowever its not going so well as i know ever little about how to script ^^default { state_entry () { Init (); } on_rez(integer start_param) { Init (); } llOwnerSay ("@detach=n"); llOwnerSay ("@touchme=<add>") } If anyone could help me fix it and point out the massive mistakes I have likely made I would be grateful :) Link to comment Share on other sites More sharing options...
Duckie Dickins Posted January 9, 2013 Share Posted January 9, 2013 Maybe it should be more like this default{ on_rez(integer start_param) { llOwnerSay("@detach=n"); llOwnerSay("@touchme=<add>"); }} No idea what you were trying to init. Link to comment Share on other sites More sharing options...
Innula Zenovka Posted January 9, 2013 Share Posted January 9, 2013 It's OK. I didn't know anything about how to script till I started to learn, either. Let's take if from first principles, like what you are trying to do. The rlv command @detach=n is a special command that makes the object from which it is called undetachable. I've not used @touchme, I must confess, but as far as I can see from the RLV api, you use it to create exceptions to a general restriction on touching things. So, for example, you might say integer toggle;default{ state_entry() { // llSay(0, "Hello, Avatar!"); } touch_start(integer total_number) { toggle =!toggle; if(toggle){ llOwnerSay("@touchall=n,touchme=add"); // you can put several commands in one statement but only the first one starts with @ if you do llOwnerSay("can't touch anything but me"); } else{ llOwnerSay("@clear"); llOwnerSay("removed restrictions"); } }} So I suppose you could put something like this together: integer toggle;default{ state_entry() { // llSay(0, "Hello, Avatar!"); } attach(key id){ if(id){//someone's attached me llOwnerSay("@detach=n");//make me undetachable llOwnerSay("@touchall=n");//stop wearer from touching anything except huds llOwnerSay("@touchme=add");//allow wearer to touch me (which she can do anyway, if I'm a hud) toggle = TRUE; } } touch_start(integer total_number) { toggle =!toggle; if(toggle){ llOwnerSay("@touchall=n,touchme=add"); if(llGetAttached()){ llOwnerSay("@detach=n"); } // you can put several commands in one statement but only the first one starts with @ if you do llOwnerSay("can't touch anything but me"); } else{ llOwnerSay("@clear");//remove all restrictions llOwnerSay("removed restrictions"); } }} ETA -- I know this isn't exactly what you asked for, but do you really want something you can't remove with turning off RLV and relogging? I ask because I got thoroughly fed up with having to turn RLV off and on and relog when I was learning RLV the hard way. Link to comment Share on other sites More sharing options...
Lucia Sabahi Posted January 9, 2013 Author Share Posted January 9, 2013 Thanks to both of you, got my script working, the touch me was not needed as i found out the hard you can’t block touch to huds or so it seems. Just one more question, apart from the wiki is there any other sources of info to learn from? Like a tutorial or something? as my google search came up with very little Link to comment Share on other sites More sharing options...
Innula Zenovka Posted January 9, 2013 Share Posted January 9, 2013 Congratulations on getting it working. You are quite correct -- huds are always touchable (that's for safety reasons, to stop RLV traps and things preventing your safewording out with a relay that depends on touches to do that, like Think Kink's). I don't think there are any actual tutorials on RLV scripting, other than answers to questions here and (maybe) SLU. If you join the inworld group RLV Communities, there's usually people there who can answer RLV scripting questions, or the Open Collar R&D group is very helpful, too. Link to comment Share on other sites More sharing options...
Lucia Sabahi Posted January 9, 2013 Author Share Posted January 9, 2013 Thanks again, i got around the touch by simply creating a cover for the hud and linking the two together so they'd attach and move as one, while the touchable scripts are hidden underneath out of reach Link to comment Share on other sites More sharing options...
Recommended Posts
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