Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llAvatarOnSitTarget() return non key with no sitter

Aztral Aeon
Registered User
Join date: 22 Dec 2007
Posts: 34
04-20-2009 15:09
Hey all.

I'm finding a weird bug and wondering if anyone has found a work around..

If I have a vehicle passenger that gets dropped during a sim crossing, no matter what I do the passenger's seat continues to think someone is sitting there. I run the Eject() function on script reset, but llAvatarOnSitTarget() always thinks the dropped passenger is there.
llGetNumberOfPrims() DOES return the correct link count, but llAvatarOnSitTarget() is wrong, and llUnsit() isn't working. (I cant even unlink, reset, and relink to fix the problem).
Basically, the seat is FUBAR from there on out.

Any advice, work arounds?

Eject()
{
g_kSitter = NULL_KEY;
key kSitter = llAvatarOnSitTarget();
if(kSitter != NULL_KEY)
{
llOwnerSay("sitting on me " + (string)kSitter);
llSleep(1.1);
llUnSit(llAvatarOnSitTarget());
llSleep(1.1);
llSitTarget(<0.0, 0.0, 0.0>, ZERO_ROTATION);
llSleep(1.1);
llOwnerSay("sitting on me still" + (string)llAvatarOnSitTarget());
}
}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
04-20-2009 15:41
You need to define a sit target.

"llSitTarget(<0.0, 0.0, 0.0>, ZERO_ROTATION);" is the same as not having a sit target.

try: llSitTarget(<0.0, 0.0, 0.01>, ZERO_ROTATION);
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Aztral Aeon
Registered User
Join date: 22 Dec 2007
Posts: 34
04-20-2009 15:51
From: Jesse Barnett
You need to define a sit target.

"llSitTarget(<0.0, 0.0, 0.0>, ZERO_ROTATION);" is the same as not having a sit target.

try: llSitTarget(<0.0, 0.0, 0.01>, ZERO_ROTATION);


Hiya. Yup thats done in the state entry right after Eject is called. I call Eject() just to clear everything out.

An update though is that apparently a server reset fixes the problem.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
04-20-2009 16:01
llGetNumberOfPrims() does not need a defined sit target to return the count whiile llAvatarOnSitTarget() does. And this part will not work:

llSitTarget(<0.0, 0.0, 0.0>, ZERO_ROTATION);
llSleep(1.1);
llOwnerSay("sitting on me still" + (string)llAvatarOnSitTarget());

Calling llAvatarOnSitTarget() after you have effectively undefined the sit target. Put a minimal value, in all of the llSitTargets and try it. As foor not being able to stop the script unless you reset the sim, you have the script stuck in an endless loop. But we would need to see the complete script to be able to spot the problem.

BTW If you have a script that is stuck and will not reset or open, set it to not running and then try a reset. Then you can open it and correct the problem.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Aztral Aeon
Registered User
Join date: 22 Dec 2007
Posts: 34
04-20-2009 16:16
Hi Jesse.

I actually found this bug on jira..it is a bug. There were no work-arounds posted (other than delete the offending seat, and rez a new one). Oh and I can in fact reset the script...it doesnt matter - llAvatarOnSitTarget() ALWAYS returns non-null key with no sitter (unless the sim is reset)

http://jira.secondlife.com/browse/VWR-10788

I will try your stop/reset though..this may be a good work-around if it works. Or since adding/deleting a link (supposedly) unsits any avatars, they may be viable also
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
04-20-2009 16:31
CARP!!!! Apologies and see the disclaimer in my sig. I was reading the problem back*sswards and was thinking it was not returning the key. Unfortunately I have a bad habit of skipping ahead and jumping straight to the code.

Sorry about that and I am glad you found the jira on it.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
04-20-2009 18:40
I experienced this a lot a while back, and I generally considered the prim corrupted and rezzed a new copy. I did have some success once by clearing the sit target then dragging the object into another sim, then setting a sit target.

Unfortunately the best way to fix a corrupted prim is by manually shift-copying it, deleting the original and linking in the copy.

If you want to work around it in your script, you could have your changed() event look in the link UUIDs for the avatar reported by llAvatarOnSitTarget(), to confirm they really are sitting. I haven't encountered this since H4 so I can't test it.

This is a good reason to make your no-mod vehicles copiable.

* * *
On a side note... my favorite sim-crossing bug was when I was driving around in a car I was working on, with a friend... we made a NASTY sim crossing... and I lost control of the car. My passenger says "Hey there's another car like yours" which was IMPOSSIBLE because I hadn't given it to anyone. Then I noticed that my controls *were moving the other car*, so I drove it over to face us, and it was empty of course.
The car was a Delorean.
~Boss
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-21-2009 10:33
the rez and relink looks like the only way around it... although...
have you tried something eminently crazy like trying to delink the avatar itself? probably won't work since number of prims gives a correct count, but hey why not?
_____________________
|
| . "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...
| -
Aztral Aeon
Registered User
Join date: 22 Dec 2007
Posts: 34
04-21-2009 13:51
Heyaz.

So far I've tried the stop script/reset/restart trick(didnt work), then I tried linking a generic object and unlinking (also didnt work).

It's seems to me that ONE time while testing my alt passenger ghosted, I landed the ship and when I stood up the chair he was previously in reset correctly. But this has only happened once - usually that seat is fubar :)

From what you guys have said I'm thinking the way to go may be just store the seat objects in a prim, and have a /rebuild command (or something) that deletes the old seats, then rezes and links new ones.

~Az