Jump to content

Menu driven sit animations for my chairs


Jacki Silverfall
 Share

You are about to reply to a thread that has been inactive for 3453 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

There are a number of 'standard', free, animation-menu scripts around.  Probably the most widely used is MLP2, although it's generally for couples' poses so not so practical for you.  nPose is another engine you might care to investigate as it is more flexible in a number of ways.

People tend to think of these as scripts for 'sex beds' and similar furniture but they're really neutral - you can use any animations with (almost) any script and name and structure menus/sub-menus as required for whatever you're making.

All that said, if you want 12 or fewer options in a menu with no sub-menus (as you said) then it's a very simple script, so shout back if you want a public-domain version

Link to comment
Share on other sites

:-D  You know, pretty much every single thing I have learned in SL has been monumentally difficult for me, even the things that most find very simple; I had Perfect Sitter a year before I sat down and finallyy figured it out; I almost had a breakdown getting MLP to work.

But from what I have heard, nPose is very good and worth learning (I may even do it someday). If I were starting out now I would just learn that.

Link to comment
Share on other sites

This script is pretty full-function but won't adjust the avatar's position for different animations.  For that you need a notecard-reader too and recorded sit positions/rotations per script.  If you're going that far then it's far better to use the tried-and-tested nPose.  As I said before, although nPose and others are 'standard' that in no way means the animations or menu-choices have to be.  Those are entirely up to the way you configure them.

To use this script set the sit-position at the top so it fits your build, put it in the root-prim of your build and add the required animations to that prim's contents.  When someone sits they will be given the menu.  They can change the animation later by touching again (while still sat).

vector SitTarget = <0.0, 0.0, 0.1>;	// <== You'll have to work out sitting position for each buildrotation SitRot = ZERO_ROTATION;	// <== and the rotation for the avatarlist Anims = [];integer ChannelMenu = -1;integer Listener = 0;key Sitter = NULL_KEY;GetAnims(){	// Function to read animations in contents	Anims = [];	integer Counter = llGetInventoryNumber(INVENTORY_ANIMATION);	while(Counter--) Anims += llGetInventoryName(INVENTORY_ANIMATION, Counter);	Anims = llListSort(Anims, 1, TRUE);}Menu(){	// Function to show animation menu to sitter	if(Sitter != NULL_KEY){		ChannelMenu = -(integer) (llFrand(1000000.0) + 1);		Listener = llListen(ChannelMenu, "", Sitter, "");		llDialog(Sitter, "Please select an animation", Anims, ChannelMenu);		llSetTimerEvent(20.0);	}}MenuOff(){	// Function to disable menu (after selection or timeout)	if(Listener){		llListenRemove(Listener);		Listener = 0;		llSetTimerEvent(0.0);	}}StopAll(){	// Function to stop all running animations	if(Sitter != NULL_KEY){		list Running = llGetAnimationList(Sitter);		integer Counter = llGetListLength(Running);		while(Counter--) llStopAnimation(llList2Key(Running, Counter));	}}default {	changed(integer Change){		if(Change & CHANGED_INVENTORY){			// Get list of animations in contents			GetAnims();		}		if(Change & CHANGED_LINK){			if(llAvatarOnSitTarget() == NULL_KEY){				// The sitter stood up - stop any animation that was running on them and clear the sitter				StopAll();				Sitter = NULL_KEY;			}else{				// Someone sat down - ask for animation permission				llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);			}		}	}	listen(integer ChannelIn, string FromName, key FromID, string Message){		if((ChannelIn == ChannelMenu) && (FromID == Sitter)){			// Menu response from the sitter - disable the menu, stop any current animations and play the selected one			MenuOff();			StopAll();			if(llListFindList(Anims, [Message]) > -1){				llStartAnimation(Message);			}		}	}	run_time_permissions(integer Granted){		if(Granted & PERMISSION_TRIGGER_ANIMATION){			// Record the avatar for whom animations are allowed.  Show them the animations menu			Sitter = llAvatarOnSitTarget();			Menu();		}	}	state_entry(){		// Set sit-target and read list of animations in contents		llSitTarget(SitTarget, SitRot);		GetAnims();	}	timer(){		// Menu time-out to reduce lag		MenuOff();	}	touch_end(integer HowMany){		// Show the menu, if touched by the sitter		if(llDetectedKey(0) == Sitter) Menu();	}}

 

Link to comment
Share on other sites

Personally, I'd go with nPose. There are a few reasons why..(and it's not the only product that offers these benefits)

1-It's free (that's usually it's first appeal, lol)

2-You can adjust exactly how the av should sit with each animation, so you don't have to worry about making sure your sits are closely related, so the av sits correctly for each pose. Not sitting right annoys some people, quite a bit, and might turn them off your products in the future.

3-You can use it as a learning tool (my primary reason for getting it)

4-Though it sounds complicated, even when reading the instructions, it's really not. Once you've used it a couple times, it's easy as heck to set up and go. It actually functions an awful lot like many of it's competing products, except you can see how this one works. (kinda goes hand in hand with #3)

5-No silly poseballs-well for folks who think they're silly anyway, this is a plus.

Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...
  • 1 year later...
You are about to reply to a thread that has been inactive for 3453 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...