Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help me with sit poseballs

Antoinette Jayaram
Registered User
Join date: 7 Jul 2008
Posts: 7
11-23-2008 01:30
Since I have no clue how scripting works, I bought a full perm multiposeball to link to
my furniture. Two things happening now.
First, once linked, the chair(for example) I made, now gets the name of the poseball and
the poseball creator as the chair's creator as well.
How to prevent this?
Second, it still keeps showing the wrong sit animation.

Anyone who knows, please help...
This is the script hat is in the poseball
I also have simple sitscripts myself but dont know how that works...

////////////////////////////////////////////////////////////////////////////////////////////////////
//// Poseball / Sit script - A bit more complex and failsave sit-script for poseballs and furniture
//// ©2007 by Will Oppewall - All rights reserved
//// This script may not be sold or given away to third persons with MODIFY permissions.
//// This script is sold without any warranties!
////////////////////////////////////////////////////////////////////////////////////////////////////
// CONFIG SECTION
// Sit Position relative to the ball
// this may never be a ZERO_VECTOR (<0,0,0>;)
vector POSITION=<0.0,0.0,0.2>;
// Rotation of the avatar on the sitposition
vector ROTAT = <0,0,-90>;
// color of the hover-text
string textcolor = "255,255,255";
// intense of the hover-text (alpha-value) between 0.0 and 1.0
float textintense = 1.0;
// text of the hover-text when free
string freetext = "";
// text of the hover-text when occupied
string occtext = "";
// Sit text in pie menu
string pietext = "Sit";
// Automatically search for an animation in the poseball by setting animation to "" - the first found animation will be used then
// To enable a specified animation out of the prims inventory you can enter the name of the animation
string animation = ""; // auto search

////////////////////////////////////////////////////////////////////////////////////////////////////
//// PROGRAM PART
//// DO NOT CHANGE SOMETHING BELOW THIS LINE, EXCEPT YOU KNOW WHAT YOU'RE DOING!!!
////////////////////////////////////////////////////////////////////////////////////////////////////
// GHV - Global Helper Variables -> you should never change their values!
vector textrgb; // rgb value converted to color vector
key avatar; // avatar sitting on poseball

////////////////////////////////////////////////////////////////////////////////////////////////////
//// FUNCTION SECTION
init() { // Initialize poseball on rez or script-start
list rgb = llCSV2List(textcolor);
string tdum = "<"+(string) (llList2Float(rgb,0)*(1.0/255.0))+","+(string) (llList2Float(rgb,1)*(1.0/255.0))+","+(string) (llList2Float(rgb,2)*(1.0/255.0))+">";
textrgb = (vector) tdum;
ROTAT *= DEG_TO_RAD;
rotation quat = llEuler2Rot(ROTAT);
llSitTarget(POSITION, quat);
if (pietext != "";) {
llSetSitText(pietext);
}
llSetText(freetext, textrgb, textintense);
avatar = NULL_KEY;
if (animation == "";) { // If no animation is specified use the first animation that can be found in the content
animation = llGetInventoryName(INVENTORY_ANIMATION, 0);
}
if (animation == "";) {animation = "sit_ground";} // Fallback animation that will be used if no animation is found
free();
}
////
start_animation(integer who) {
if (llGetAgentSize(avatar) == ZERO_VECTOR) {llUnSit(avatar);free();return;}
if (avatar != NULL_KEY) {
llStartAnimation(animation); // Start animation
occupied(); // Set poseball occupied
llSetTimerEvent(10);
}
}
////
occupied() { // called when ball gets occupied
llSetAlpha(0.0, ALL_SIDES);
llSetText(occtext, textrgb, textintense);
}
////
free() { // called when ball gets free again
llSetAlpha(1.0, ALL_SIDES);
llSetText(freetext, textrgb, textintense);
avatar = llAvatarOnSitTarget();
}
////
stopAnim() { // stop all animations of the avatar
if (llGetAgentSize(avatar) == ZERO_VECTOR) {return;} // avatar isn't in the sim any more, just quit
list l=llGetAnimationList(avatar); // cleanup animations of avatar - get animationlist
integer mc = llGetListLength(l);
integer k;
for (k=0;k<mc;k++) {
llStopAnimation(llList2Key(l,k)); // Stop all animations of the avatar
llStopAnimation(llList2String(l,k));
}
llStartAnimation("stand_1";);
l=llGetAnimationList(avatar); // cleanup animations of avatar - get animationlist
mc = llGetListLength(l);
for (k=0;k<mc;k++) {
llStopAnimation(llList2Key(l,k)); // Stop all animations of the avatar
llStopAnimation(llList2String(l,k));
}
llSleep(0.5);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
//// STATES SECTIONthan
default { // Default state
on_rez(integer channel) { // Reset script on rez (not script reset)
init();
}
state_entry() { // Reset script on script start (not script reset)
init();
}
changed(integer change) {
if (change != CHANGED_LINK) return; // Check if it was sit on / unsit event - return if not.
avatar = llAvatarOnSitTarget(); // Get key of target avatar
// Here we are, if everything is ok till this point.
if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { // permissions ok/given
if (llGetPermissionsKey() == avatar) { // if avatar is that one we excpected: animate and return
stopAnim(); // Stop all running animations
start_animation(1);
return; // cancel execution
}
} // if permissions not ok we come here
if (avatar != NULL_KEY) { // ensure we are not dealing with an NULL_KEY
llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION); // request permissions of the avatar
free(); // free the poseball
return; // cancel execution
} else {
free(); // dealing with a NULL_KEY - just free the poseball
return; // cancel execution
}
}
run_time_permissions(integer perm) {
llStopAnimation("sit";);
if ((perm & PERMISSION_TRIGGER_ANIMATION) && (llGetPermissionsKey() == avatar)) { //avatar gave permission to animate
stopAnim(); // Stop all running animations
start_animation(2);
}
}
timer() { // When poseball gets occupied, the timer checks if the avatar is still sitting on
if (llAvatarOnSitTarget() == NULL_KEY) { // if avatar left cleanup the poseball
llSetTimerEvent(0);
free();
return;
}
}
}
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
11-23-2008 02:27
From: Antoinette Jayaram
Since I have no clue how scripting works, I bought a full perm multiposeball to link to
my furniture. Two things happening now.
First, once linked, the chair(for example) I made, now gets the name of the poseball and
the poseball creator as the chair's creator as well.
How to prevent this?
Second, it still keeps showing the wrong sit animation.

Anyone who knows, please help...
This is the script hat is in the poseball

Make your own ball, name it the way you want it, put in the script and the animation(s) you want, then link it. That should do the trick. I must admit I did not read the script, so I don't know if it has special demands on name and description, but I doubt that.
Good luck:)
_____________________
From Studio Dora
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
11-23-2008 06:33
Or easier still, when linking, select the poseball first and your chair second, so one of your chair prims becomes the root prim.

As a builder, you'll need to learn and understand what "root prim" means and how to control it (it's the last one you select when linking). Otherwise, as you add prims to your object, its name and properties will change. Also, some scripts need to be in, or not to be in, the root prim.

Find out more about this in the builders' forum.
ab Vanmoer
Registered User
Join date: 28 Nov 2006
Posts: 131
11-23-2008 08:24
From: Antoinette Jayaram

..
I bought a full perm multiposeball ...
This is the script that is in the poseball
......
//// ©2007 by Will Oppewall - All rights reserved
//// This script may not be sold or given away to third persons with MODIFY permissions.
......

I think posting the script in a public forum could be construed as giving it away with MODIFY permission.
In this case you really should have queried the creator, or phrased your question here without posting the script.
ZeeScarlet Zenovka
Registered User
Join date: 11 Jul 2007
Posts: 26
11-23-2008 12:00
I use a sit target system myself....no need for poseballs :)

Its really easy..you just put a copy of the anim in the item you want the sit to be in and in the balls you'll be using for positioning. You put the script "setter" in the prim with the anim.....you move the ball until you are in position and then click the prim.

It spams the script you'll need in open chat. Copy and paste and you're good to go without poseballs..

its full perm..IM me in game if you want a copy
Osprey Therian
I want capslocklock
Join date: 6 Jul 2004
Posts: 5,049
11-23-2008 12:22
Buying something full-perm to use in your furniture doesn't mean the creator's intention was that the script should be given out freely.
You are supposed to change the next-owner perms to what the creator has specified.
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
11-24-2008 09:21
From: ab Vanmoer
I think posting the script in a public forum could be construed as giving it away with MODIFY permission.
In this case you really should have queried the creator, or phrased your question here without posting the script.


Correct!

Antoinette, please delete the code in your post ASAP. You're in violation of the sales agreement as commented in the script.