Jump to content

Niric Moger

Resident
  • Posts

    10
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. // // Credit goes to Vincent Nacon for // http://wiki.secondlife.com/wiki/RegionSitTeleport // I added credit for Vincent Nacon at the top of the script.
  2. //Test to make sure if(llGetPos() != ZERO_VECTOR) { // Adding 0.25 to the z because that is half the size of default prim // This helps keep feet from being buried in ground targetPosition.z = height + 1.25; // destination up or down set with global variable if(sittingAvatar) { vector positionToReturnTo = llGetPos(); llSetRegionPos(targetPosition); llSleep(0.2); llUnSit(sittingAvatar); llSleep(0.2); llSetRegionPos(positionToReturnTo); } } else{llUnSit(sittingAvatar);llRegionSayTo(sittingAvatar,0," unsitting because of ZERO_VECTOR");} Added a check for ZERO_VECTOR and llSleep in strategic spots to make teleport smoother after reading thread mentioned prior.
  3. Rolig Loon wrote: This is a basic sit teleporter, whether you recognize it or not. If the avatar does not sit on the sit target, nothing happens. The one big observation I would offer is that your changed event, as written, will be activated by any change, rather than being triggered only by CHANGED_LINK. So it will be triggered if you add something to its inventory or change its color or size, or even if the sim restarts. Always test if (change & CHANGED_LINK). BTW, I don't think I have seen a WarpPos or PosJump teleporter for ages, and I doubt that they even work now. Scripters have been using llSetRegionPos since it was introduced in 2011 (I think that's the right year). One of my favorites is Dora Gustafson's beauty, which was posted as she developed it in the forums in 2012. You are correct it is a basic sit teleporter. It changes the properies of the prim with llSetClickAction(CLICK_ACTION_SIT); I have updated the description to emphasize this. I have also updated the script to include the if (change & CHANGED_LINK). They might want to change the example for RegionSitTeleport which is where I found the basic example for this script to also include a if (change & CHANGED_LINK). Thank you for pointing out Dora Gustafson's beauty, I am reading this to see if anything should be added to my script to improve it.
  4. Qwalyphi Korpov wrote: You might want to consider using the modern llRegionSayTo in place of the old llSay for messages meant only for the sitting avatar. llRegionSayTo has been added to the script. Nothing bad was meant by saying I couldn’t find a decent script, I just couldn’t find one so I made one.
  5. // Teleport 2014 // Written by Niric Moger // // Credit goes to Vincent Nacon for // http://wiki.secondlife.com/wiki/RegionSitTeleport // // Released into the Public Domain // Sept 2nd 2014 // // Destination Global, taken from an objects x,y,z vector at the destination // note ZERO_VECTOR or <0,0,0> will not work because that is used to test vector targetPosition = <128.0, 128.0, 72.120>; // This is invalid if skybox_mode = TRUE // Skybox Mode Globals, this gets the objects position and only sends user up or down // set skybox_mode = TRUE or skybox_mode = FALSE integer skybox_mode = FALSE; // set to TRUE if you want to only teleport up or down float height = 72.120; // set this to the ground or skybox position // Text Globals string text = ""; // optional floating text on the teleporter, input a space if not used vector text_color = <1.0,1.0,1.0>; // the floating text's color // Security Access Global integer access_mode = 1; // 1 - public; 2 - owner; 3 - group; default { state_entry() { llSetClickAction(CLICK_ACTION_SIT); // Set touch to sit this is very important for this script llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION); llSetText(text,text_color,1.0); } changed(integer change) { if (change & CHANGED_LINK) { key sittingAvatar = llAvatarOnSitTarget(); integer access_granted = FALSE; if (access_mode == 1) access_granted = TRUE; else if (access_mode == 2) { if (sittingAvatar == llGetOwner()) access_granted = TRUE; else { llRegionSayTo(sittingAvatar,0," sorry, owner access only."); llUnSit(sittingAvatar); } } else if (access_mode == 3) { if (llSameGroup(sittingAvatar)) access_granted = TRUE; else { llRegionSayTo(sittingAvatar,0," sorry, group memeber access only."); llUnSit(sittingAvatar); } } if (access_granted) { if (skybox_mode == TRUE) { list details = llGetObjectDetails(sittingAvatar, ([OBJECT_NAME, OBJECT_DESC, OBJECT_POS, OBJECT_ROT, OBJECT_VELOCITY, OBJECT_OWNER, OBJECT_GROUP, OBJECT_CREATOR])); targetPosition = llList2Vector(details,2); } //Test to make sure if(llGetPos() != ZERO_VECTOR) { // Adding 0.25 to the z because that is half the size of default prim // This helps keep feet from being buried in ground targetPosition.z = height + 1.25; // destination up or down set with global variable if(sittingAvatar) { vector positionToReturnTo = llGetPos(); llSetRegionPos(targetPosition); llSleep(0.2); llUnSit(sittingAvatar); llSleep(0.2); llSetRegionPos(positionToReturnTo); } } else{llUnSit(sittingAvatar);llRegionSayTo(sittingAvatar,0," unsitting because of ZERO_VECTOR");} } } } } Here is a script for a group/owner/public teleporter that utilizes the llSetRegionPos function. The function llSetClickAction(CLICK_ACTION_SIT) changes the prim so when it is touched, the avatar sits on the prim, therefore eliminating the need to right click and select sit from the right click menu effectively making this a touch to teleport. To quote LlSetClickAction's CLICK_ACTION_SIT description:"When the prim is touched, the avatar sits upon it" To use as a regular teleporter simply build a prim on the ground where you want to land and get the object's <x,y,z> value and set the value of targetPosition to <x,y,z> of the destination prim. Make sure skybox mode is FALSE if you are using like a regular teleporter. I have added a Skybox mode functionality that has never been implemented as far as I know, when it is set to true it takes the position of the prim that it is in and uses that as the X and Y, while ability to set a custom Z which can be up to 4095 meters up into the sky, or set to go to the ground by taking the Z value from a prim rezzed on the ground. The security feature allows you to set it to public, group or private. If you want everyone to use it set access_mode to 1. If only you want to use it set access_mode to 2. If you want only people to use it from your group set access_mode to 3. Hope this script is useful, please comment on any problems or suggestions with it. Thanks, Niric Moger
×
×
  • Create New...