Jump to content
  • 0
Sign in to follow this  
Sarrah12

touch script to play animation

Question

  • 0

You don't need a script for that, although you could write one.  All you need to do is select your prim with your edit tool (right click and select EDIT).  Then, on the General page, look for the drop-down menu that says "On click ..." and select "Sit on Object".  That will change the default action for your object so that you automatically "sit" when you touch it.  

The exact words for "On click ..." and "Sit on Object" vary from one viewer to another, but you should be able to see what I mean once you open your edit tool.  :smileywink:

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

You don't need a script for that, although you could write one.  All you need to do is select your prim with your edit tool (right click and select EDIT).  Then, on the General page, look for the drop-down menu that says "On click ..." and select "Sit on Object".  That will change the default action for your object so that you automatically "sit" when you touch it.  

The exact words for "On click ..." and "Sit on Object" vary from one viewer to another, but you should be able to see what I mean once you open your edit tool.  :smileywink:

Share this post


Link to post
Share on other sites
  • 0

Thank you for your help but I meant click on "touch" option instead of "sit" option in order to start another animation. for example i click on "touch" and my avatar starts dancing. something like that

Share this post


Link to post
Share on other sites
  • 0

Thank you for your help but I meant click on "touch" option instead of "sit" option in order to start another animation. for example i click on "touch" and my avatar starts dancing. something like that

Share this post


Link to post
Share on other sites
  • 0

That's how you start animations in dance balls. You have to "sit" on the object with the script in it, even if it doesn't look like you are sitting. The dance animation immediately replaces the default sit animation. If you write a script that allows animation with the "touch" option but does not require the person to sit, then it requires you to go through the extra step of asking the person for permission to animate and then wait for a reply. Some complex dance machines do that. I sell one like that, in fact.

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

hello, can you please tell me what's wrong with this script?

string animation;

string text = "touch more";

vector target = <-0.5,0,0>;// 0.5 wayy down in the ground,-0.6 left side of ball , 4..behind the ball

vector rot = <0,0,180>;

list MENU_MAIN = ["Default", "Male", "Female", "More..."]; // the main menu

list MENU_2 = ["Dance", "BB", "CC" , "...Back"]; // menu 2

string msg = "Please make a choice:";

key ToucherID;

integer CHANNEL; // dialog channel

integer listen_id;

float Timeout=20.0;

integer handle;

integer on = FALSE;

integer spaz = 0;

integer trap = 0;

key agent;

 

 

 

default{

on_rez(integer start)

{

llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);

animation = llGetInventoryName(INVENTORY_ANIMATION,0);

llListen(3,"",llGetOwner(),"");

}

 

/

 

 

touch_start(integer total_number)

{

llOwnerSay("Listener Turned On");

integer handle = llListen(CHANNEL, "",agent, ""); // listen for dialog answers

llListenControl(handle, TRUE); // ...enable listen

integer perm = llGetPermissions();

llDialog(llDetectedKey(0), "What do you want to do?", MENU_MAIN, CHANNEL); // present dialog on click

}

 

run_time_permissions(integer perm)

{

if (perm & PERMISSION_TRIGGER_ANIMATION)

{

llStartAnimation(animation);

}

}

 

 

listen(integer CHANNEL, string name, key id, string message)

{

if (llListFindList(MENU_MAIN + MENU_2, [message]) != -1) // verify dialog choice

 

{

// llOwnerSay(name + " picked the option '" + message + "'."); // output the answer

if (message == "More...")

llDialog(id, "Pick an option!", MENU_2, CHANNEL); // present submenu on request

else if (message == "...Back")

llDialog(id, "What do you want to do?", MENU_MAIN, CHANNEL); // present main menu on request to go back

 

 

else if (message == "female")

{

 

integer perm = llGetPermissions();

if (perm & PERMISSION_TRIGGER_ANIMATION)

{

if (llToUpper(message) == "OFF")

{

llStopAnimation(animation);

}

else if (llToUpper(message) == "ON")

{

// setup_pose();

llStartAnimation(animation);

}

 

}

}

 

 

}

 

 

}

 

timer()

{

llSetTimerEvent(0);

llOwnerSay("Listener Turned Off");

llListenControl(handle, FALSE);

}

}

Share this post


Link to post
Share on other sites
  • 0

Well, the most obvious answer is that "message" can't have two values at once. It's either equal to "female" or it's equal to "ON". It can't be both at the same time.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...