Jump to content

Hillary Davi

Resident
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Hillary Davi

  1. Thanks to everyone who contributed this is what I Have in the sorta final. I liked the switch idea by Rolig Loon because it allowed reusing the timer since you can only have one timer in a state. Although I still get errors it might be due to the error checking. I am rethinking the are where Lucia Nightfire posted about. Lines: 60 61 and 62: } else if (reason = XP_ERROR_REQUEST_PERM_TIMEOUT || reason = XP_ERROR_NOT_PERMITTED || reason = XP_ERROR_NOT_FOUND) { llInstantMessage(agent, "Please accept the experience or bad things may happen!"); } Might be something there... Here is the final code so far it's working Try it out or post your comments below if you have better ways. There might be a way to make a separate function for the switch and teleports. vector teleportme = <212,150,1000>; string MyObjectName; string textdefault = "Teleport to platform!"; //Begin code string theerror; integer error; key agent; integer type; //this is for the function added to switch on or off globally //this float is needed for the fuction contributed by Rolig Loon float iTouched; default { state_entry() { iTouched = FALSE; MyObjectName = llGetObjectName(); //llVolumeDetect(TRUE); Removed because testing timer instead of using volume detect llSetText(textdefault, <1.0, 1.0, 1.0>, 1.0); } collision_start(integer num) { agent = llDetectedKey(0); type = llDetectedType(0); if (type == (AGENT | ACTIVE) ) // 1 + 2 { llRequestExperiencePermissions(agent, ""); } } //Timer added by Rolig Loon https://community.secondlife.com/profile/796876-rolig-loon/ timer() { llSetTimerEvent(0.0); iTouched = FALSE; } experience_permissions(key agent) { //touch function added and contributed by Rolig Loon https://community.secondlife.com/profile/796876-rolig-loon/ with some tweaks if (iTouched = TRUE) { // Do your TP stuff llSetText(llKey2Name(agent) + " is using the teleporter please wait...", <1.0, 1.0, 1.0>, 1.0); llTeleportAgent(agent, "", teleportme, teleportme); llSetTimerEvent(2.0); // Here's your substitute for a llSleep contributed by Rolig Loon } llSetText(textdefault, <1.0, 1.0, 1.0>, 1.0); } experience_permissions_denied(key agent, integer reason){ string theerror = llGetExperienceErrorMessage((integer)reason); if(reason = XP_ERROR_THROTTLED) { //touch function added and contributed by Rolig Loon https://community.secondlife.com/profile/796876-rolig-loon/ //with some tweaks if (iTouched = TRUE) { llSetTimerEvent(4.0); // Here's your substitute for a llSleep contributed by Rolig Loon } } else if (reason = XP_ERROR_REQUEST_PERM_TIMEOUT || reason = XP_ERROR_NOT_PERMITTED || reason = XP_ERROR_NOT_FOUND) { llInstantMessage(agent, "Please accept the experience or bad things may happen!"); } if(!llAgentInExperience(agent)) { llRequestExperiencePermissions(agent, ""); //llRequestExperiencePermissions(llDetectedKey(0), ""); } } touch_start(integer total_number) { iTouched = TRUE; agent = llDetectedKey(0); type = llDetectedType(0); if (type == (AGENT | ACTIVE) ) // 1 + 2 { llRequestExperiencePermissions(agent, ""); } } }
  2. First, I put the second sleep because I kept getting errors when people touched it continuously. You probably don't need it so comment it out ;D All you need to do is add the // to the line. every time someone calls the touch I also had it do another sleep. The seconds are so small I just figured to keep it there. As the delay was not noticeable. Pick the sleep and just comment out if you don't need. experience_permissions_denied( //Added the test and check if there was a throttle
  3. Not sure did not look into that function deeply but I know it works. Edit- I remember now I think one vector is the location and the other is the offset. I set it this way because if i wanted i can make another variable and change it up quickly. Not sure it's the proper but a nice placeholder. Edit2: The other is vector look at. http://wiki.secondlife.com/wiki/LlTeleportAgent Function: llTeleportAgent( key avatar, string landmark, vector position, vector look_at );
  4. The first post just wanted to share some code to create an experience teleporter. If you feel you can make it better please post it here. The variables on top teleportme is where you want to go on the sim textdefault is the title over head which will automatically be changed and reset I used and read the following articles, Please read the following to understand the code http://wiki.secondlife.com/wiki/LlAgentInExperience https://wiki.secondlife.com/wiki/LlRequestExperiencePermissions https://wiki.secondlife.com/wiki/LlGetExperienceErrorMessage vector teleportme = <212,150,1000>; string MyObjectName; string textdefault = "Teleport to platform!"; //Begin code string theerror; integer error; key agent; integer type; default { state_entry() { MyObjectName = llGetObjectName(); llVolumeDetect(TRUE); llSetText(textdefault, <1.0, 1.0, 1.0>, 1.0); } collision_start(integer num) { agent = llDetectedKey(0); type = llDetectedType(0); if (type == (AGENT | ACTIVE) ) // 1 + 2 { llRequestExperiencePermissions(agent, ""); } } experience_permissions(key agent) { llSetText(llKey2Name(agent) + " is using the teleporter please wait...", <1.0, 1.0, 1.0>, 1.0); llTeleportAgent(agent, "", teleportme, teleportme); llSleep(1); llSetText(textdefault, <1.0, 1.0, 1.0>, 1.0); } experience_permissions_denied(key agent, integer reason){ string theerror = llGetExperienceErrorMessage((integer)reason); if(reason = XP_ERROR_THROTTLED) { llSleep(2); } else if (reason = XP_ERROR_REQUEST_PERM_TIMEOUT || reason = XP_ERROR_NOT_PERMITTED || reason = XP_ERROR_NOT_FOUND) { llInstantMessage(agent, "Please accept the experience or bad things may happen!"); } if(!llAgentInExperience(agent)) { llRequestExperiencePermissions(agent, ""); //llRequestExperiencePermissions(llDetectedKey(0), ""); } } touch_start(integer total_number) { agent = llDetectedKey(0); type = llDetectedType(0); if (type == (AGENT | ACTIVE) ) // 1 + 2 { llRequestExperiencePermissions(agent, ""); } } }
×
×
  • Create New...