|
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
|
12-25-2008 16:34
I tried to write the simplest possible llSitTarget teleport script and had the strangest behavior: When my AV clicked on the (CLICK_ACTION_SIT) prim, sometimes he was put in "FLY" mode (when he wasn't before). Then he zooms back and forth around the sit target location for a few seconds, banging into the walls. Finally the system gave up and dropped him in the wrong position, leaving him in Fly mode. Doesn't happen every time. I fixed the problem by inserting a call to llSleep(0.1); before llUnsit (sort of a generic panacea for fixing lots of other problems) but I don't see why this is necessary. Any explanations? Anybody have a use for a way to force an AV into Fly mode? Here's the script: default { state_entry() { //move the avatar 4 meters in the X direction of the prim llSitTarget(<4.0,0.0,0.0>,<0.0,0.0,0.0,0.0>  ; llSetClickAction(CLICK_ACTION_SIT); //teleports on first touch } //state_entry changed(integer change) { llSleep(0.1); //remove this if you dare llUnSit(llAvatarOnSitTarget()); } //changed }
|
|
Anya Ristow
Vengeance Studio
Join date: 21 Sep 2006
Posts: 1,243
|
12-25-2008 17:33
I had this problem. Someone suggested that perhaps the sit target placed the avatar within a prim, and that I should increase the z-difference. That didn't solve my problem.
I had to add a 1-second sleep before the unsit. Maybe your 0.1 second sleep isn;t enough, and maybe the flying avatar thing is what the comment refers to.
Edit: had I read more carefully I would have noticed that you solved this with the sleep. D'oh!
_____________________
The Vengeance Studio Gadget Store is closed! 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-26-2008 18:39
the reason is pretty much what's stated, in combination with av's being different sizes and the server not doing precise calculations on position (precise timewise, seems they are calculated seperately to the sit position, or perhaps averaged somehow). the av is considered to be intersecting something, and so the server first bumps it out then tries to manuver the av into the position it "should" be in(thus the flying and bumping). the sleep alows the position to update completely so there is no intersection.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
|
how to force an AV into fly mode
12-29-2008 20:41
So if I have the sit position inside a sold object, then this strange behavior will happen every time? So this could be used to create a "fly on touch" prim.
|
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
12-30-2008 00:15
I've noticed that llAvatarOnSitTarget() can occasionally return a NULL_KEY even after the changed event is triggered with CHANGED_LINK. Using llSleep(0.1) at event entry appears to allow the sit target to update far more reliable manner. Perhaps what Void mentioned shows that the whole rest of the codebase doesn't get the message that the avatar is linked until too late. In which case, it would count as a (very long-standing) bug.
_____________________
http://slurl.com/secondlife/Together
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-30-2008 04:27
been around as long as I can remember... wasn't aware of the delay in llAvatarOnSitTarget though
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|