|
Galdor Fackler
Registered User
Join date: 19 Mar 2006
Posts: 20
|
12-31-2006 18:27
I'm just trying to sit on a prim and have it pop me off on the 2nd floor of my house. other than that my other goal was to make sure that if I moved the house the teleporter would find the new coordinates and funtion correctly. When I sit on the object containing this script it takes me to the new coordintes then it cannon balls me up in space and I'll land in the next sim. Need some guidence please.
key lastAVkey = NULL_KEY; string fltText = "Bedroom"; vector foo;
init() { foo=llGetPos(); llSetSitText("Teleport"); llSetText(fltText, <1,1,1>, 1); llSay(0,(string) foo); // just a visual test to see where my cordinates are. foo.z+=10; llSay(0,(string) foo); // second visual to insure that 10 was added to the z cocordinates llSitTarget(foo,<0,0,0,1>);
}
default { state_entry() { init(); } touch_start(integer i) { init(); } changed(integer change) { key currentAVkey = llAvatarOnSitTarget(); if (currentAVkey != NULL_KEY && lastAVkey == NULL_KEY) { lastAVkey = currentAVkey; if (!(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) llRequestPermissions(currentAVkey,PERMISSION_TRIGGER_ANIMATION); llSleep(0.5); llUnSit(currentAVkey); llStopAnimation("sit"); llResetScript(); } } }
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
12-31-2006 21:34
Hi Galdor You need to subtract the teleporter's position from the target. Rotation will also affect where you go, as the teleporter's rotation will swing the target around. See: http://rpgstats.com/wiki/index.php?title=LlSitTargetfor this code: //Moleculor Satyr's rotational cancel with a tweak -Tateru Nino, and another -BW vector target=<100,100,103.5>; rotation my_rot=llGetRot(); llSitTarget((target - llGetPos()) / my_rot,ZERO_ROTATION / my_rot);
|
|
Galdor Fackler
Registered User
Join date: 19 Mar 2006
Posts: 20
|
12-31-2006 22:41
Thanks Edd44 I'll appreciate the help. you have a happy new years
|
|
Galdor Fackler
Registered User
Join date: 19 Mar 2006
Posts: 20
|
01-01-2007 07:30
Eddy44 darn it still shooting me sideways. Even tried commenting out some llUnSit and llStopAnimation lines and I still go flying, I'll keep plugging away at it thanks.
|
|
Fredericks Hosoi
Registered User
Join date: 29 Aug 2006
Posts: 1
|
01-02-2007 06:40
Try a short sleeping time between arraving and unsitting, e.g. llSleep(0.2) ; llUnsit(avatar) ;
This solved the problem in my elevator...
|
|
GC Continental
Registered User
Join date: 8 Aug 2006
Posts: 17
|
01-02-2007 17:29
If Z of the prim is really pointing up:
default{ on_rez(integer start_param){ llResetScript(); }
state_entry(){ llSitTarget(<0, 0, distto2ndfloor>, ZERO_ROTATION); }
change(integer change){ if(change & CHANGED_LINK){ // note that this fails silently if there's no one sitting on the teleporter // i.e., no av, no error llUnSit(llAvatarOnSitTarget()); } } }
Most teleporters are just squat cylinders, so there shouldn't be any reason why this wouldn't work.
Why do people make scripts so complicated?!??
llSitTarget takes a vector that is *relative* to the current position of the prim, and a rotational vector also relative from the current rotation of the prim. This is the way all of the teleporters in my house work (I have 8 of them... the house fills my 2048 plot). The only problem I will ever have is if I move the teleporter from it's current position. If I move the teleporter along with the rest of the house I will have no problem as long as I keep the house in the same rotation.
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
01-02-2007 23:50
The code you posted shows you not using relative positioning.
Also, check the values in your edit window/more/objects at the bottom left, it should have all the rotationn values. Make sure they are all 0.0! That way you should go straight up in the z direction. I guess this is why most tperers are orbs.
If you still having probs, post your code again together with your tper's rotation values.
|