Jump to content
  • 0

Chat to run multiple animation scripts on multiple avatars - -help!


kari1sl
 Share

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

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

Question

Chat to run multiple animation scripts on multiple avatars - -help!

I built a HUD to run a selection of animations but these would be better if I could run them through chats. But I can't even get this simple one below to work.
When I touch the object, "sparks fly", so something happens - but I don't get asked permission and chat "/11 kiss" does nothing.
Any help appreciated.


//kiss when chat "/11 kiss"
default
{
touch_start(integer startup)
{llResetScript();}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_TRIGGER_ANIMATION)
 {llListen(11, "","", "");}
else
{llRequestPermissions(llDetectedKey(0), PERMISSION_TRIGGER_ANIMATION);}
}
listen( integer channel, string name, key id, string message )
{
if (message == "kiss")
llStartAnimation("express_kiss");
}
}

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

This question really belongs in the LSL Scripting forum, where you can get suggestions from several scripters, so I suggest reposting it over there.  First, however, here are a few things to think about:

1. The script is doing what you told it to so far.  You told it to reset when you touch it, so it is.  And that's all that it's doing.

2.  A run_time_permissions event is triggered by a llRequestPermissions function call.  It won't start unless you've issued one.  Your function call is inside the run_time_permissions event, where it will never be heard.

3.  In order to hear a chat command, the script has to have a channel opened first.  Your llListen statetment, to open a channel, is inside the run_time_permissions event.  Again, it will never be heard there.

4. A command to llStartAnimation will not work unless PERMISSION_TRIGGER_ANIMATION has been requested and granted first.  That will happen inside the run_time_permissions event, but you requested it in the listen event.  

That should be enough to point you in the right direction for a second try.  Then post THAT try in the LSL Scripting forum.  ;)

BTW, congratulations on joining the ranks of scripters.  It's a wonderful way to experience SL and a good way to stretch your brain too.  Scripting is basically an exercise in practical logic.  Figuring out exactly what you want the script to accomplish, and then thinking through the flow of events that will follow your commands, is 90% of the challenge (and 99% of the fun).

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4156 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...