Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Bulldozer Poseball

Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
06-06-2006 16:18
Something that's got on my nerves a bit - sitting on a poseball and getting a wrong/mangled pose because the poseball is clashing with my AO, so I have to turn it off. It's only a minor annoyance, but I looked for a way around it anyway. The following simple "bulldozer poseball" will not be affected by most AO's I've tried:

CODE

string ani_name = "sleep"; // Put name of animation here
key sitter;

default
{
state_entry()
{
llSetSitText("Animate");
llSetAlpha(1.0,ALL_SIDES);
llSitTarget(<0,0,0.1>,llGetRot());
llSetText(ani_name,<1,1,1>,1.0);
}

changed(integer thechange) {
if (thechange & CHANGED_LINK) {
key now = llAvatarOnSitTarget();
if (now != NULL_KEY) {
llRequestPermissions(llAvatarOnSitTarget(),PERMISSION_TRIGGER_ANIMATION);
sitter = now;
} else {
llStopAnimation(ani_name); // Remove if this causes error in some SL vers
llSay(-8888,((string)sitter)+"booton");
llSetAlpha(1.0,ALL_SIDES);
llSetText(ani_name,<1,1,1>,1.0);
}
}
}

run_time_permissions(integer perms) {
if (perms & PERMISSION_TRIGGER_ANIMATION) {
llSetAlpha(0.0,ALL_SIDES);
llSetText("",<1,1,1>,1);
llSay(-8888,((string)sitter)+"bootoff"); // Lockmeister AO disable signal
llSleep(0.3); // Wait for AO to detect state and start its animation
list n = llGetAnimationList(sitter); // Stop all animations on avatar
integer t;
for (t=0; t<llGetListLength(n); t++) llStopAnimation(llList2Key(n,t));
llStartAnimation(ani_name); // Run our own animation
}
}

}
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
06-06-2006 21:24
/15/83/112151/1.html
_____________________
i've got nothing. ;)
Yiffy Yaffle
Purple SpiritWolf Mystic
Join date: 22 Oct 2004
Posts: 2,802
06-07-2006 13:09
Just tried it. Works like a charm. I was a little iffy at first by reading its name. I thought it might terraform my land. O.o Good Work ^.^
_____________________