Jump to content
rhonin Nissondorf

Experience perms declining

Recommended Posts

Me and a  friend were going to turn her store into a  haunted house for Halloween.   I"ve made a  hud based system  using experience permissions, in the past that worked.  Now it seems like the first time a trap is tripped it works fine. then the  second time  a trap tries to  animate or move the avatar i get   permission not granted  errors. 

I do have the experience set as key and as  parcel properties.

All scripts are under my experience,

All items are  in the landowners  rez group

the experience is one i created a while ago, then applied to my friends sim,

i did use her rez group and store landmark for the edit properties of my experience,

Share this post


Link to post
Share on other sites

When you're writing your script, always treat every instance where you will want to do something that requires permissions as a new instance that requires llRequestExperiencePermissions.  That means putting all of your llStartAnimation statements in an experience_permissions event and then triggering that event explicitly each time you need it.  Don't assume that your script will remember that permissions may have been granted previously.  Especially if the script may be used by several different people, each new person who implicitly grants permissions through the experience will reset whatever permissions the script has received from a previous person.

Share this post


Link to post
Share on other sites

Kay,   i  suppose, i might have heard the expression,   "don't  rely on the auto grant perms of sat on or attached objects", before.   but i've gotten away with it before,  *hangs his head down in shame* .   Thank you  Rolig!!!    there doesn't seem to be alot of any example scripts or huds involving  experiences.    Can anyone recommend a  few simple examples  ,  of  Correct scripting of this relatively new function. not the lslWiki  those pages haven't updated in years.

Share this post


Link to post
Share on other sites

Yeah, there aren't many good examples of scripting in Experiences in the wiki yet.  It's like a lot of things we learn to do with LSL.  Most of the really useful techniques are things we figure out for ourselves over time, and then we're too busy to share them.  I have just found out through practice that I have fewer mysterious errors if I always put actions that require permissions into experience_permissions events.  That includes not only actions that are unique to Experiences, like llSitOnLink or llTeleportAgent, but commonplace actions like llStartAnimation and llAttachToAvatarTemp. I'm not sure why that should be necessary, but it takes care of most situations like the one you ran up against.  I suppose it's LSL's way of shifting the burden of giving permissions from the user to the scripter, making us verify repeatedly that the person really is in the experience and therefore has given permission.

  • Like 1

Share this post


Link to post
Share on other sites

Just to add to what Rolig says, I've found that you can usually get away with testing if(llGetPermissions()&PERMISSION_WHATEVER){do whatever it is} before calling the function that needs the permissions.   Follow it up with else{llRequestExperiencePermissions() if you haven't got the perms.

That forces the script to check and -- as far as I remember from when I tested it, which was when experience permissions first came out, so a while ago -- if the agent is already in the experience, then things work.   I assume that testing if(llAgentInExperience(id)) would have the same effect.

I'm not sure, though, that this helps a great deal (except it probably saves the server a bit of work) since you're still going to have to request experience permissions if the agent isn't in the experience.  

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...