Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Simple Multianimation script to use with llDialog

Drizzt Naumova
Teh Foxeh DJ
Join date: 9 Oct 2005
Posts: 116
07-07-2006 00:55
Greetings :)

Have been trying to create a multi animation chair script that would be compliant with llDialog. Like say while sitting you can click the seat and it brings up the menu to change animations that are in the contents of the object. I know that it would have to be a sit script that would listen on the dialog's specified channel or linked message, but can't seem to get it to work right. Anyone got a script that would do that? I know how to use llDialog, its the multianimation script part thats got me confuzzled :P Heck even at this point a simple click to change animation would work. Has given me a headache for a several hours trying to get it right :rolleyes:

Thanks in advance

~Drizzt~
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
07-07-2006 05:07
From: Drizzt Naumova
Heck even at this point a simple click to change animation would work. Has given me a headache for a several hours trying to get it right :rolleyes:

Well, you simply ave to stop the current animation and start a new one... what _is_ the hard part? ^^;;
CODE

integer current_pose; // index to animation in the object inventory that's being played

touch_start( integer ContactsTotal ) {

if( !( llGetPermissions() & PERMISSION_TRIGGER_ANIMATION ) ) { return; }

llStopAnimation( llGetInventoryName( INVENTORY_ANIMATION, current_pose ) );
++current_pose;
if( current_pose >= llGetInventoryNumber( INVENTORY_ANIMATION ) ) { current_pose = 0; }
llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, current_pose ) );
}

note this presumes item is already playing some pose and current_pose variable is set accordingly... normally you'd do that initialization part after permissions are granted when avatar sits on your object.
Drizzt Naumova
Teh Foxeh DJ
Join date: 9 Oct 2005
Posts: 116
07-07-2006 08:18
hehe, thanks. just been a long morning here :P really appreciate the help :)

*edit* needed to add a default in there. Also couldn't get it to work with me. Am I doing something wrong?
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
07-07-2006 08:46
I just put together something like this . . . if you want to use a dialog, you can fill a list by reading all the animations in inventory, then use the list as choices for a dialog.

On mine, I brought up the list when one first sits down, then can bring up the animation menu dialog by voice command. But you could also use a touch_start event, check for sitting avatar, then bring up the dialog, I suppose.

Hope that helps.

Baron H.

PS. If you are interested in an already-written script, contact me and we can discuss it.