OsTeleportObject

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (osObjectTeleport -> osTeleportObject)
(6 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
||permissions=${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
 
||permissions=${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
 
|delay=0
 
|delay=0
|function_syntax=integer osTeleportObject(key objectUUID, vector targetPos, rotation rot, int flags)
+
|function_syntax=integer osTeleportObject(key objectID, vector targetPos, rotation rot, integer flags)
 
|csharp_syntax=
 
|csharp_syntax=
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
Line 19: Line 19:
 
         vector target =<873.911926, 879.844910, 21.332354>;   
 
         vector target =<873.911926, 879.844910, 21.332354>;   
 
         rotation rot =<0,0,0.707,.707>;
 
         rotation rot =<0,0,0.707,.707>;
         osObjectTeleport(llGetKey(),target,rot,1);
+
         osTeleportObject(llGetKey(),target,rot,1);
 
     }
 
     }
 
}
 
}
Line 26: Line 26:
  
 
===== Arguments: =====
 
===== Arguments: =====
* objectUUID the id of the linkset to teleport
+
* objectID the id of the linkset to teleport
 
* targetPos target position in region local coords
 
* targetPos target position in region local coords
  
Line 43: Line 43:
 
* 1 did a local teleport
 
* 1 did a local teleport
  
this can do region crossings if the target position is on another region.
+
This can do region crossings if the target position is on another region.
since target position is in start region local coords, some simple math is needed
+
 
 +
Since target position is in start region local coords, some simple math is needed
  
 
- on the target region, use llgetregioncorner to get its global coords
 
- on the target region, use llgetregioncorner to get its global coords
Line 54: Line 55:
  
 
you may notice that this may work also on regions that are far apart.
 
you may notice that this may work also on regions that are far apart.
 +
 
but since it uses normal regions crossing code the operation is not pretty to see on viewer of sitting avatars, so do avoid it
 
but since it uses normal regions crossing code the operation is not pretty to see on viewer of sitting avatars, so do avoid it
  
Line 66: Line 68:
 
* the object can not be selected at tp time
 
* the object can not be selected at tp time
  
|
+
|additional_info=This function was added in 0.9.0.1}}
}}
+

Revision as of 18:32, 1 February 2019

integer osTeleportObject(key objectID, vector targetPos, rotation rot, integer flags)
...
Arguments:
  • objectID the id of the linkset to teleport
  • targetPos target position in region local coords
  • rot a rotation.
  • flags
Flags:
  • OSTPOBJ_NONE it is just 0
  • OSTPOBJ_STOPATTARRGET object is stopped at destination
  • OSTPOBJ_STOPONFAIL stops at start point if tp fails (still does nothing)
  • OSTPOBJ_SETROT the rotation is the final object rotation, otherwise is a added rotation
Threat Level Severe
Permissions ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Extra Delay 0 seconds
Example(s)
// Example of osTeleportObject
 
default
{
    state_entry()
    {
       llSay(0, "Script running");
    }
    touch_start(integer num)
    {
        // target position in region local coords
        vector target =<873.911926, 879.844910, 21.332354>;  
        rotation rot =<0,0,0.707,.707>;
        osTeleportObject(llGetKey(),target,rot,1);
    }
}
Notes
This function was added in 0.9.0.1
Personal tools
General
About This Wiki