Jump to content

Trying to Create an Experience, Cant get it to work


BrownBoxStudio
 Share

You are about to reply to a thread that has been inactive for 2898 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

So I am learning how to use experiences because I found out the llTeleportAgent command doesn't work without them. Anyways I wrote this script and it's supposed to ask for experience permissions when collision starts but it does nothing. I'm here as a last resort. I tried looking into how to create experiences but the information is so spread out I don't know where to start. I am sure I missed a step, or two, or a few. Can anyone help me out as to why this script might not work or ask for experience permissions? Any and all help is appreciated, thanks!

 

//Touch to set new coordinates using coodinates tool.

vector teleport_location;
vector facing_direction;

string landmark_name = ""; //change to a landmark name of landmark in objects inventory.

integer channel = -83537678;
integer listen_handle;
integer count = 0;

key teleportee;

list avatars;

default
{
    
    touch_start(integer num_detected)
    {
        if(llDetectedKey(0) == llGetOwner())
        llRegionSay(channel, "sync_location");
        listen_handle = llListen(channel, "", NULL_KEY, "");
    }
    listen(integer channel, string name, key id, string message)
    {
        if (llGetSubString( message, 0, 7) == "location")
        {
            teleport_location = (vector)llGetSubString( message, 8, -1);
            llOwnerSay("New Teleport Location: " + (string)teleport_location);
            count ++;
        }
        else if (llGetSubString( message, 0, 8) == "direction")
        {
            facing_direction = (vector)llGetSubString( message, 9, -1);
            llOwnerSay("New Teleport Direction: " + (string)facing_direction);
            count ++;
        }

        if(count >= 2)
        {
            count = 0;
            llListenRemove(listen_handle);
        }
    }
    collision_start(integer num_detected)
    {
        teleportee = llDetectedKey(0);
        if (llListFindList( avatars, [teleportee]) == -1)
        {
            llRequestExperiencePermissions(teleportee,"");
        }
        else
        {
            llTeleportAgent(teleportee, landmark_name, teleport_location, facing_direction);
        }
    }
    experience_permissions(key agent)
    {
        llTeleportAgent(teleportee, landmark_name, teleport_location, facing_direction);
    }
}

 

 

Link to comment
Share on other sites

That looks like it should work.  So, I assume that you have an Experience or have permission to work as a creator in someone else's Experience.  If so, and if you are in a region where the Experience is live, all you have to do is check the box in the bottom left in your script editor, select the Experience from the drop-down menu, and Save to compile your script in the Experience.

EDIT:  Well, it will almost work.  You will have to trigger llTeleportAgent from inside the experience_permissions event, so that function call from your listen event won't work.  llRequestExperiencePermissions works the same way that llRequestPermissions does, except that permission is granted automatically if the target av is in the Experience.  You still have to request the permission.

Link to comment
Share on other sites

 

The experience checkbox is greyed out and, that I know of, I haven't created an experience for this script to work with. Figured I had missed some steps. How would I go about creating that? Although can I do that on mainland? Otherwise I need to figure out how I can work on someone elses experience as this sim a private sim that I could be working on. 

 

 

Edit: So I acquired an experience key, created my experience, linked the script, but still nothing happens. How I can double check if the region I am in allows experiences? 

Link to comment
Share on other sites


BrownBoxStudio wrote:

I tried looking into how to create experiences but the information is so spread out I don't know where to start. I am sure I missed a step, or two, or a few. Can anyone help me out as to why this script might not work or ask for experience permissions? Any and all help is appreciated, thanks!

 

 I don't really understand what's happening in your collsion_start event.

You run a test, 

        teleportee = llDetectedKey(0);        if (llListFindList( avatars, [teleportee]) == -1)        {            llRequestExperiencePermissions(teleportee,"");        }        else        {            llTeleportAgent(teleportee, landmark_name, teleport_location, facing_direction);        }

but since avatars never gets populated, you are never going to call llRequestExperiencePermissions(teleportee,"").

That would certainly be one reason why it's not working.

You say that you couldn't find information about creating experiences.    Take a look at the Knowledge Base Article,   That covers anything, but you have problems with it,  there are several of us here who can help.

Double-check that the experience is allowed to run on the parcel where you are testing your object.

I find that adding an experience_permissions_denied to my experience scripts helps a lot with debugging:

    experience_permissions_denied(key agent, integer reason)    {        llOwnerSay("Experience permissions failed because "+llGetExperienceErrorMessage(reason));    }
Link to comment
Share on other sites

Oh yea, I removed that whole chunk and just call the experience permissions. It used to be populated then rolig was saying it would auto allow from then on. That chunk was just keeping track of who already allowed so it wouldn't ask them again.

I did my best to read the knowledge base so far. I did manage to create my experience but still not getting it to work, as I mentioned. Although I guess I didn't read close enough as it says how to enable on the land which is what I am stuck at.

Thanks so far, think Im getting. 

 

Link to comment
Share on other sites


BrownBoxStudio wrote:

[ .... ]That chunk was just keeping track of who already allowed so it wouldn't ask them again.
[ .... ]

 

You don't need to do that. Once a person has accepted the Experience, he's in it for all time.  You are asking permissions to force the script to check whether the person is already in the Experience.  If so, the script recognizes that the person is in the Experience and doesn't need to get the person to give permissions again.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2898 days.

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
 Share

×
×
  • Create New...