Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008140opensim[REGION] Script Functionspublic2017-04-03 11:102017-06-26 03:24
Assigned ToUbitUmarov 
PlatformOperating SystemOperating System Version
Product Versionmaster (dev code) 
Target Versionmaster (dev code)Fixed in Version 
Summary0008140: new Experimental osTeleportObject
DescriptionI added on master, a new experimental function
integer osObjectTeleport(key objectUUID, vector targetPos, rotation rot, int flags)

- objectUUID the id of the linkset to teleport
- targetPos target position
- rot a rotation.
- flags

returns a integer error code:
 - negative the teleport failed
 - Zero means that a teleport to another region was started. result needs to be checked by other means (?)
 - 1 did a local teleport

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

this are can be combined by binary or | as usual

- ThreatLevel(ThreatLevel.Severe, "osTeleportObject")
- if object has scripts, owner must have rights to run scripts on target location
- object owner must have rights to enter ojects on target location
- target location parcel must have enought free prims capacity for the linkset prims
- all avatars siting on the object must have access to target location
- has a cool down time. retries before expire reset it, and tp is ignored with error -2
- the object can not be selected at tp time

note that you need to make sure the object may physical rez on the target position. Any collisions like from rezing inside another object may have ugly results.

teleports to other regions may depend on viewers and may go very wrong.
they can take time, and sitting victims may see ugly things until done

if you have the time to test, let us know the many ways how it does crash your test regions and your prims ;)

code is not final, restrictions are to enforce the normal parcel permissions, to prevent bad use, etc, and are not final.

TagsNo tags attached.
Git Revision or version number
Run ModeStandalone (1 Region)
Physics EngineubODE
Script Engine
Mono VersionNone
Attached Files

- Relationships

-  Notes
BillBlight (developer)
2017-04-03 14:56
edited on: 2017-04-03 15:01


I have tested this, works great, rotation seems to be an issue, I'd have to say it is not working ..

I have tested with physical and non-physical prims both with and without seated avatars .. Did some testing with a small link set.

Other than the rotation it seems to work fine.

nit pick .. Maybe it should have been osTeleportObject, instead of osObjectTeleport to keep with the standard for the other OS tp functions such as osTeleportAvatar
p.s I have dreamed of this function, thank you so much ubit ...

UbitUmarov (administrator)
2017-04-03 15:08

rotation does what? nothing or wrong rotation?
BillBlight (developer)
2017-04-03 15:15

Sorry I should have been more precise, rotation does nothing ...

I just did a video of it , will post a link in a new comment when it uploads
BillBlight (developer)
2017-04-03 15:19 [^] video of results, it works but the saved origin rotation is not being applied on the TP ..
UbitUmarov (administrator)
2017-04-03 15:40

can you show the script?
at least the tp part
BillBlight (developer)
2017-04-03 15:42
edited on: 2017-04-03 15:47

Here it is using this combination ..

vector target =<873.911926, 879.844910, 21.332354>;
rotation rot =<0.000000, 0.000000, 0.000000, 1.000000>;

I can do an llSetRot(rot);

after the tp and it returns to the correct orientation.

UbitUmarov (administrator)
2017-04-03 16:07

your rot means no rotation.
the parameter is not the final rotation, but a rotation applied during the tp
try 0,0,0.707,.707>
objects should arrive rotated 90º around Z relative to orientation bf tp.
a vehicle should have its velocity also rotated
BillBlight (developer)
2017-04-03 16:09

I'll try that but the object started with no rotation, moved it rotated it, and on TP it did not go back to no rotation. But I will test yours ..
BillBlight (developer)
2017-04-03 16:12

tested with

        llSay(0, "Script running");
    touch_start(integer num)
        vector target =<873.911926, 879.844910, 21.332354>;
rotation rot =<0,0,0.707,.707>;

It still stays at whatever rotation it was at before the TP, the rotation is not applied.
UbitUmarov (administrator)
2017-04-03 16:14

ooops yeap bug im doing the orientation rotation only if stop = FALSE
BillBlight (developer)
2017-04-03 16:19
edited on: 2017-04-03 16:21

ahhh Yes tested it with stop = FALSE and that works ... (sucks for a physical object you want to make stop dead though)

So I was always testing with stop = TRUE, due to wanting to use it for physical vehicle auto return ..

My bad I should have done more testing ... Then could have pointed straight at it.

I have faith ...

UbitUmarov (administrator)
2017-04-03 16:59

fixed on master, I hope :)
BillBlight (developer)
2017-04-03 17:04
edited on: 2017-04-03 17:05

ummm Now rotation does not work either way stop true||false .... doubled checked I did pull and compile the master right after your commit ..

I'll pull it again in a few and retry.

BillBlight (developer)
2017-04-03 17:29

Freshly pulled and compiled, TP works but rotation does not seem to want to work if stop is true or false ...

I am using the same script I was using earlier to test.
UbitUmarov (administrator)
2017-04-03 17:32

strange, im teleporting cars on my test region and they do rotate 90º in my test :(
BillBlight (developer)
2017-04-03 17:33

Well let me make a fresh script and try it again .. maybe it is a script cache issue
BillBlight (developer)
2017-04-03 17:39

I think I see the issue .. it is multiplying the rotation, not setting it, every time I trigger the tp it changes the landing rotation just a little .

I can make a video if you like ..

so on each subsequent tp the rotation gets multiplied by the quaternions rather than simply setting them .. That is what it looks like to me.

For instance if I leave the block and do not move it each click sends it to a new rotation.
BillBlight (developer)
2017-04-03 17:42 [^]
UbitUmarov (administrator)
2017-04-03 17:42

can you log at osgrid? easier than chatting here:)
BillBlight (developer)
2017-04-03 17:44

You want to jump to my region I am testing on? Life

That way we can have "real world" look at it ..

If not I can jump in OsGrid ..
BillBlight (developer)
2017-04-03 18:49
edited on: 2017-04-03 18:50

Ok Ubit and I had a slight misunderstanding of the rot.

The rot in the osObjectTeleport is a multiplication of the initial rot, so as to maintain or create your original heading and velocity, when teleporting a moving object.

so if you want to return an object to its base rotation you have to either do some math on some variables or use an llSetRot after the TP ...

This new function seems to be working correctly.

IMHO: It would be better to have it be a set rot rather than a multiplication, as you could always calculate the destination rot. But for maintaining velocities I fully understand where Ubit went with this. Maybe it could be a set rot if stop is TRUE ..

UbitUmarov (administrator)
2017-04-03 18:57

to maintain original orientation(and heading etc) just use <0,0,0,1> or ZERO_ROTATION
UbitUmarov (administrator)
2017-04-03 18:58

forgot to say that if a object is selected the tp will also fail silently
BillBlight (developer)
2017-04-03 18:59
edited on: 2017-04-03 19:00

I did not mean original, I meant origin or home rotation, for instance if you wanted to tp a vehicle back to it's starting point facing the way it originally started out, before you ever started driving it.

BillBlight (developer)
2017-04-03 19:02

For instance, if say you want to TP a race car back to the starting line, after someone crashes it, you would not want it landing at the starting line upside down backwards .
UbitUmarov (administrator)
2017-04-04 06:51

changed the function name to osTeleportObject, and replaced stop argument with flags, updated this mantis description so new readers read updated specs.
it should now be possible to set the final object rotation if flag OSTPOBJ_SETROT is present or add a rotation if not
aiaustin (developer)
2017-04-05 01:52
edited on: 2017-04-05 01:52

@Ubit, in bin/config-include/osslEnable.ini I think you used the old name of the function...

+ Allow_osObjectTeleport = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER

that should be osTeleportObject now I think to match the current function name and the corresponding osTeleportAgent

UbitUmarov (administrator)
2017-04-05 05:56

yeack... fixed
BillBlight (developer)
2017-04-05 22:10

Rotation seems to still be added even with the flag, testing with this script, not as my other script this is affecting an external prim.

    touch_start(integer num)
        key testobj = "5ef963af-b9f9-4dc4-99e9-e0974e95714a";
     osTeleportObject(testobj,<239.162994, 281.208649, 22.711197> , <0.700000, 0.700000, 0.700000, 0.700000>,OSTPOBJ_SETROT);

(I actually thought it was working right in the first two tests but then realized I had left a llSetRot at the bottom of the script)
UbitUmarov (administrator)
2017-04-05 22:30

<0.700000, 0.700000, 0.700000, 0.700000> is not a valid rotation.
if you have trouble with rotations in this form use
rotation rot = llEuler2Rot(...);
for example
rotation rot = llEuler2Rot(,0,0, 45 * DEG_TO_RAD);
to get a rotation of 45º around the z axis.
BillBlight (developer)
2017-04-05 22:34

Ooops that was a typo in the script ..

but that was not the only rotation I tested with, I tested with returning it to
<0.000000, 0.000000, 0.000000, 1.000000> that and ZERO_ROTATION as well ... but I will test again just to be sure ..
BillBlight (developer)
2017-04-05 22:36
edited on: 2017-04-05 22:38


    touch_start(integer num)
        key testobj = "3f821899-2902-4bca-b5b8-cdb138778791";
     osTeleportObject(testobj,<239.162994, 281.208649, 22.711197> , <0,0,0.707,.707>,OSTPOBJ_SETROT);

Every tp it still gets a new rotation , like the rot is still getting added ...

(that top set rot that was there is not actually in my test script, pasted the wrong one again)

BillBlight (developer)
2017-04-05 23:27

Ubit has confirmed with some testing that the rotation is still bugged ..
BillBlight (developer)
2017-04-06 10:31

I would like to confirm , at lest in my testing today, that what we saw last night with the fix, that this latest commit does fix the rotation issue we were seeing. Thank you Ubit.
UbitUmarov (administrator)
2017-04-15 03:07

changed the specifications.
your avatar and objects may now suffer terrible things testing teleport to other regions
UbitUmarov (administrator)
2017-04-15 03:14

totally untested with bullet.
At this point ubOde is a requirement for teleports to other regions.
djphil (reporter)
2017-04-16 01:12
edited on: 2017-04-16 01:16

With the script below, if I click a little too quickly on the box (to perform round trip) the script will hang and the action does not take place.
If I click less quickly then that seems to work fine.
(Tested with ubODE)

key uuid;
integer flipflop;
rotation rotate;

        uuid = llGetKey();
        rotate = llEuler2Rot(<0.0, 33.0, 90.0>*DEG_TO_RAD);

    touch_start(integer number)
        flipflop =! flipflop;
        if (flipflop) osTeleportObject(uuid, <128.0, 128.0, 30.0>, rotate, OSTPOBJ_SETROT);
        else osTeleportObject(uuid, <128.0, 128.0, 25.5>, ZERO_ROTATION, OSTPOBJ_SETROT);

BillBlight (developer)
2017-04-16 07:21
edited on: 2017-04-16 07:23

djphil, from the specs above
"- has a cool down time. retries before expire reset it, and tp is ignored with error -2"

I think that is what you are seeing, since it is all in one script, use two objects and it will work back to back.

djphil (reporter)
2017-04-16 07:27
edited on: 2017-04-16 07:28

Yeah, Ubit told me earlier that there may be 1 second waiting on the same area and up to 30 sec waiting and teleporting to another area.

BillBlight (developer)
2017-04-16 07:30
edited on: 2017-04-16 07:30

Is the TP to other regions enabled in the master? Am I missing the syntax in the specs for that? All I see is a vector?

djphil (reporter)
2017-04-16 07:32

I do not know, i did not try that.
UbitUmarov (administrator)
2017-04-17 04:51

targetPos is the position in region coordinates, ie relative to its reference corner.
if targetPos it is outside the region limits, a search will be made for a region with that point, and if found a kind of tp is tried. It is actually a extension to regions crossing code.

so to teleport to another region you need to know the target position in global coordinates.
ie on the target region you can do for example
vector globalPos = llGetPos() + llGetRegionCorner();
llOwnerSay((String) globalPos);

then on the teleport region script
vector targetPos = globalPos - llGetRegionCorner();
with global Pos the value copied from above.

if this proves to work, a version with the target region as argument name will be added, doing that math for us.
djphil (reporter)
2017-06-26 03:24
edited on: 2017-06-28 16:23

Please, keep in mind.

If new functions are added to opensim but are not added to the opensim wiki, then many users ignore their existence and how they work.

In this case, creating new function loses much of its interest ...

Call for Volunteers

osObjectTeleport @ [^]

Tank you in advance.

- Issue History
Date Modified Username Field Change
2017-04-03 11:10 UbitUmarov New Issue
2017-04-03 11:10 UbitUmarov Status new => assigned
2017-04-03 11:10 UbitUmarov Assigned To => UbitUmarov
2017-04-03 14:56 BillBlight Note Added: 0031678
2017-04-03 15:01 BillBlight Note Edited: 0031678 View Revisions
2017-04-03 15:08 UbitUmarov Note Added: 0031679
2017-04-03 15:15 BillBlight Note Added: 0031680
2017-04-03 15:19 BillBlight Note Added: 0031681
2017-04-03 15:40 UbitUmarov Note Added: 0031682
2017-04-03 15:42 BillBlight Note Added: 0031683
2017-04-03 15:47 BillBlight Note Edited: 0031683 View Revisions
2017-04-03 16:07 UbitUmarov Note Added: 0031684
2017-04-03 16:09 BillBlight Note Added: 0031685
2017-04-03 16:12 BillBlight Note Added: 0031686
2017-04-03 16:14 UbitUmarov Note Added: 0031687
2017-04-03 16:19 BillBlight Note Added: 0031688
2017-04-03 16:21 BillBlight Note Edited: 0031688 View Revisions
2017-04-03 16:59 UbitUmarov Note Added: 0031689
2017-04-03 17:04 BillBlight Note Added: 0031690
2017-04-03 17:05 BillBlight Note Edited: 0031690 View Revisions
2017-04-03 17:05 BillBlight Note Edited: 0031690 View Revisions
2017-04-03 17:29 BillBlight Note Added: 0031691
2017-04-03 17:32 UbitUmarov Note Added: 0031692
2017-04-03 17:33 BillBlight Note Added: 0031693
2017-04-03 17:39 BillBlight Note Added: 0031694
2017-04-03 17:42 BillBlight Note Added: 0031695
2017-04-03 17:42 UbitUmarov Note Added: 0031696
2017-04-03 17:44 BillBlight Note Added: 0031697
2017-04-03 18:49 BillBlight Note Added: 0031698
2017-04-03 18:50 BillBlight Note Edited: 0031698 View Revisions
2017-04-03 18:57 UbitUmarov Note Added: 0031699
2017-04-03 18:58 UbitUmarov Note Added: 0031700
2017-04-03 18:59 BillBlight Note Added: 0031701
2017-04-03 19:00 BillBlight Note Edited: 0031701 View Revisions
2017-04-03 19:02 BillBlight Note Added: 0031702
2017-04-03 19:05 UbitUmarov Description Updated View Revisions
2017-04-04 06:46 UbitUmarov Summary new Experimental osObjectTeleport => new Experimental osTeleportObject
2017-04-04 06:46 UbitUmarov Description Updated View Revisions
2017-04-04 06:51 UbitUmarov Note Added: 0031704
2017-04-05 01:52 aiaustin Note Added: 0031711
2017-04-05 01:52 aiaustin Note Edited: 0031711 View Revisions
2017-04-05 05:56 UbitUmarov Note Added: 0031713
2017-04-05 22:10 BillBlight Note Added: 0031721
2017-04-05 22:30 UbitUmarov Note Added: 0031722
2017-04-05 22:34 BillBlight Note Added: 0031723
2017-04-05 22:36 BillBlight Note Added: 0031724
2017-04-05 22:38 BillBlight Note Edited: 0031724 View Revisions
2017-04-05 23:27 BillBlight Note Added: 0031725
2017-04-06 10:31 BillBlight Note Added: 0031726
2017-04-15 03:05 UbitUmarov Description Updated View Revisions
2017-04-15 03:07 UbitUmarov Note Added: 0031755
2017-04-15 03:14 UbitUmarov Note Added: 0031757
2017-04-15 03:24 UbitUmarov Description Updated View Revisions
2017-04-15 03:26 UbitUmarov Description Updated View Revisions
2017-04-16 01:12 djphil Note Added: 0031766
2017-04-16 01:12 djphil Note Edited: 0031766 View Revisions
2017-04-16 01:13 djphil Note Edited: 0031766 View Revisions
2017-04-16 01:14 djphil Note Edited: 0031766 View Revisions
2017-04-16 01:15 djphil Note Edited: 0031766 View Revisions
2017-04-16 01:16 djphil Note Edited: 0031766 View Revisions
2017-04-16 07:21 BillBlight Note Added: 0031769
2017-04-16 07:23 BillBlight Note Edited: 0031769 View Revisions
2017-04-16 07:27 djphil Note Added: 0031770
2017-04-16 07:27 djphil Note Edited: 0031770 View Revisions
2017-04-16 07:28 djphil Note Edited: 0031770 View Revisions
2017-04-16 07:30 BillBlight Note Added: 0031771
2017-04-16 07:30 BillBlight Note Edited: 0031771 View Revisions
2017-04-16 07:32 djphil Note Added: 0031772
2017-04-17 04:51 UbitUmarov Note Added: 0031774
2017-06-26 03:24 djphil Note Added: 0032079
2017-06-28 16:23 djphil Note Edited: 0032079 View Revisions

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker