Multiple Animation Script Required
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
03-23-2007 05:51
From JR's problem found another bug taht I fixed (insert deity of choice) knows how long agao but seems to have crept back in. The dataserver was incrementing the linecounter after having already requested the next line, so it would always request line 0 twice. The modificed dataserver event handler below corrects this and also caters for blank lines (JR's other problem.) dataserver(key queryid, string data) { //Check to make sure this is the request we are making. //Remember that when data comes back from the dataserver, //it goes to *all* scripts in your prim. //So you have to make sure this is the data you want, and //not data coming from some other script. if (dataRequestID) { llSetTimerEvent(0); //If we haven't reached the end of the file if (data != EOF) { ++lineCounter; dataRequestID = llGetNotecardLine(notecardName, lineCounter); llSetTimerEvent(10);
// Each line is of the form // Name,Animation if(llGetSubString(data, 0,0) != ";") { list ldata = llParseString2List(data, [","], [""]); string name = llList2String(ldata, 0); string anim = llList2String(ldata, 1); integer itemtype = llGetInventoryType(anim); if(INVENTORY_ANIMATION == itemtype) { MENU = (MENU = []) + MENU + name; ANIMS = (ANIMS = []) + ANIMS + anim; } else if(llStringLength(name) > 0) { llOwnerSay("Error - " + name + " (" + anim + ") Not an Animation."); } } } else { llSetTimerEvent(0); state Running; } } }
|
|
Solomon Devoix
Used Register
Join date: 22 Aug 2006
Posts: 496
|
03-31-2007 19:04
This has been an extremely helpful thread, as I set out to do something like this just today... then thought "Why reinvent the wheel if what I need already exists... and I can always tweak it to my own purposes..."  I do have a question, though. I went ahead and scripted a rudimentary dance pole script anyhow, to try and get the "only group members can use it" type thing. But I must be doing something wrong... because lookig at the llDetectedGroup, I can only use that in an event like "touch" -- and that won't work. Is there any way to check the group of the avatar who right-clicks and sits on the pole?
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
04-01-2007 01:03
From: Solomon Devoix This has been an extremely helpful thread, as I set out to do something like this just today... then thought "Why reinvent the wheel if what I need already exists... and I can always tweak it to my own purposes..."  I do have a question, though. I went ahead and scripted a rudimentary dance pole script anyhow, to try and get the "only group members can use it" type thing. But I must be doing something wrong... because lookig at the llDetectedGroup, I can only use that in an event like "touch" -- and that won't work. Is there any way to check the group of the avatar who right-clicks and sits on the pole? integer llSameGroup(key id);
|
|
AnnMarie Coronet
Registered User
Join date: 20 Nov 2006
Posts: 39
|
04-01-2007 01:15
I see Newgate got there before me  When the script checks the key of the sitting avatar, do something like this:- if(!llSameGroup(avatar)) { llWhisper(0, "Check your active group tag if you believe you should be able to use this."); llUnSit(avatar); return; }
where avatar is the key previously collected from llAvatarOnSitTarget() Then set the object's Group to the group you want to be able to use this (no need to deed it, just set the Group).
|
|
Solomon Devoix
Used Register
Join date: 22 Aug 2006
Posts: 496
|
04-01-2007 02:47
Okay, I feel like slapping myself now... it never occured to me to save the avatar key registered from the sit and use that in the llSameGroup function...
[sigh]
Thanks, guys...
|
|
JR Laszlo
Registered User
Join date: 29 Dec 2006
Posts: 8
|
Almost there
04-06-2007 18:53
Got the group use to work with one minor glitch. from a fresh reset when the avatar chooses sit or dance in this case it works great. the menu opens and if you choose a dance from the menu and you are not a group member it unsits them. after that firts time of unsitting a non group avatar though they can choose to sit again and they start dancing by default and the menu pops open and if they choose a dance it will then unsit them but if they hit ignore they keep dancing the dafault dance. I put the group use piece in as was suggested in a prior post. // -------------------------- // Set the next animation available as the active one PlayAnimation(integer number) { // Get the name of the animation new_animation_name = llList2String(ANIMS,number); // Get the key of the avatar on the stand (or if none is present) avatar = llAvatarOnSitTarget(); if (avatar != NULL_KEY) // Is avatar is still posing, if so then.. { llStopAnimation(animation_name); // Stop current animation llStartAnimation(new_animation_name); // Start next animation } // Set the new animation name as the current animation_name = new_animation_name; if(!llSameGroup(avatar)) { llWhisper(0, "Group Dancers Only Please."  ; llUnSit(avatar); return; } } to the untrained eye it appers to be because the first thing the script asks for is the get animation and that it needs to check for group use first before starting the animation. Can it be rearranged? Pardon my terminology. and lastly once an avatar is dancing and touches the table the menu does not reappear so they can change woithout standing up and resitting. Thanks again
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
04-07-2007 00:59
You're puting the group check in the wrong place JR. PlayAnimation is only called after the avatar has chosen an animation. Your group check should be in the changed event.
|
|
Zanduar Ceawlin
Registered User
Join date: 23 Apr 2007
Posts: 14
|
Another Note CArd problem
06-20-2007 23:29
I loaded about 5 defult dances into an object i was toying with & it shot out this:
[23:18] Object: Error - House () Not an Animation. [23:18] Object: Error - boogie () Not an Animation. [23:18] Object: Error - ButtShake () Not an Animation. [23:18] Object: Error - PrivDance () Not an Animation. [23:18] Object: Error - SlowLap () Not an Animation. [23:18] Object: Error - Smooth () Not an Animation. [23:18] Object: New Script Loaded - 0 Avaliable.
ok i know these are dances, but what the heck?
my note card is just a simple list no extra lines.. did i do something wrong?
help¿
ok i had to reread here.. i'll fix it & see what happends..
Ok here's a reminder beore doing anythign READ ALL of the posts.. geeze I had a space too many inthe notecard.. WOW nice code!!! adn I'll adjust the code for hight as well.
Now all i want toknow is howto put "Dance" as a right click option instead of sit..? thx
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-21-2007 01:32
From: Zanduar Ceawlin Now all i want toknow is howto put "Dance" as a right click option instead of sit..? thx
llSetSitText("Dance"  ;
|
|
Zanduar Ceawlin
Registered User
Join date: 23 Apr 2007
Posts: 14
|
thanks
06-21-2007 13:23
From: Qie Niangao llSetSitText("Dance"  ; That simple & it took me a few to figure out where to put it too.. yes i am that new to this..lol
|
|
Zanduar Ceawlin
Registered User
Join date: 23 Apr 2007
Posts: 14
|
lost
06-25-2007 16:31
Ok here's one for ya.. I am running this script perfectly, put it in a new table i made & now the dancer works fine, BUT when i hit stand up, they are floating ABOVRE the table about 1M andi can't find anywhere in this code to adjust for this?? help? Thanks again..!
|
|
Jomm Grut
Registered User
Join date: 20 Apr 2007
Posts: 1
|
06-28-2007 12:06
From: Newgate Ludd Your group check should be in the changed event.
First of all great script, but i'm having problems to find the right location in the script for the group check, think I've tried it almost everywhere an avatar gets checked. Can anyone put an example here please with the right place in the script, Thanks.
|