Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Multiple sit targets

Princess Medici
sad panda
Join date: 1 Mar 2004
Posts: 416
07-25-2004 19:33
I'm having trouble with having multiple animated sit targets in a linked set. I have one script in each prim that I want to have a sit target in, and everything works fine until everything is linked up.

I get this message: Script trying to stop animations but PERMISSION_TRIGGER_ANIMATION permission not set

Any ideas on how to fix this?
Sensual Casanova
Spoiled Brat
Join date: 28 Feb 2004
Posts: 4,807
07-25-2004 20:11
Pick it up and set it back out.. That has happen to me a few times, and it seemed to fix it.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
07-25-2004 23:45
after you stop the animation do you reset the script and make it so the stop code can't be accessed again until someone sits?

the issue is that when ever someone stands up or sits a changed event is triggered in every prim. A single sit target item would have it set so that when no one is sitting on the object it runs the stop animation code and resets. With a multiple sit target item you need to check if someone was sitting to start with. If not then the stop animation code shouldn't be run or it will try to run animation commands on a person that may or may not be in the sim. Basicly you need to keep track if someone is sitting.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Princess Medici
sad panda
Join date: 1 Mar 2004
Posts: 416
07-26-2004 14:43
That makes sense Strife, and I thought I had covered that, but I'm probably missing something since I'm new to scripting. My code looks something like this:

default
{
state_entry()
{
llSitTarget(<0.5, 0.0, 0.0>, ZERO_ROTATION);
}

changed(integer change)
{
if (change & CHANGED_LINK)
{
key user = llAvatarOnSitTarget();
if (user)
{
llRequestPermissions(user, PERMISSION_TRIGGER_ANIMATION);
}
else
{
llStopAnimation();
llResetScript();
}
}
}
run_time_permissions(integer perms)
{
if (perms != PERMISSION_TRIGGER_ANIMATION)
{
llResetScript();
}
else
{
llStartAnimation();
}
}
}


I'm sure something is wrong because I still get the error, any help on what to do to fix this would be much appreciated!
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
07-26-2004 15:09
As you can tell from the error, you also need permission to try and stop an animation, try this:


CODE

[...]
changed(integer change)
{
if (change & CHANGED_LINK)
{
key user = llAvatarOnSitTarget();
if (user)
{
llRequestPermissions(user, PERMISSION_TRIGGER_ANIMATION);
}
else
{
if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)
{
llStopAnimation();
}
llResetScript();
}
}
}
[...]

_____________________
Sarcasm meter:
0 |-----------------------*-| 10
Rating: Awww Jeeze!
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
07-26-2004 21:51
From: someone
Originally posted by Wednesday Grimm
As you can tell from the error, you also need permission to try and stop an animation, try this:

CODE

[...]
changed(integer change)
{
if (change & CHANGED_LINK)
{
key user = llAvatarOnSitTarget();
if (user)
{
llRequestPermissions(user, PERMISSION_TRIGGER_ANIMATION);
}
else
{
if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)
{
llStopAnimation();
}
llResetScript();
}
}
}
[...]



that should work
(i can't read size 1 ~_~)
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
07-27-2004 07:10
what's wrong with size 1?
_____________________
Sarcasm meter:
0 |-----------------------*-| 10
Rating: Awww Jeeze!
Princess Medici
sad panda
Join date: 1 Mar 2004
Posts: 416
07-27-2004 10:05
It makes perfect sense, silly me for not knowing how to do it! Thanks for the help Strife and Wednesday!
Higbee Protagonist
Yggdrai Ranger
Join date: 7 Aug 2003
Posts: 266
07-27-2004 10:22
Well I have an additional question then Wednesday, because I cannot seem to get separate AvatarKeys consistently. Consequently the animations have trouble executing. Would this minor fix also resolve that issue then?
_____________________
Higbee Protagonist

************************
"Even an immobile stone will respond to you
If you approach with love, call out, and talk to it."
- Shinagawa Tetsuzan

http://www.redprometheus.com
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
07-27-2004 10:36
Higbee, you're trying to animate multiple avatars from one script? Sounds challenging.

The documentation (last time I checked) wasn't too clear on the matter, but I think a script can only have permissions enabled for one avatar at a time. Check out llGetPermissionsKey()

Your script may need to remember the key of each avatar that it's animating, and re-request permissions each time you want to start or stop an animation.

I'm not sure though, I've never really played with this, I usually use seperate objects to animate each avatar.
_____________________
Sarcasm meter:
0 |-----------------------*-| 10
Rating: Awww Jeeze!
Higbee Protagonist
Yggdrai Ranger
Join date: 7 Aug 2003
Posts: 266
07-27-2004 10:49
Oh I see so I could create a LIST that collected AVkeys in order to utilize this. Makes sense =) I'll let you know if I get it to work!
_____________________
Higbee Protagonist

************************
"Even an immobile stone will respond to you
If you approach with love, call out, and talk to it."
- Shinagawa Tetsuzan

http://www.redprometheus.com