Jump to content
  • 0

touch script to play animation


Sarrah12
 Share

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

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

Question

Hello,

 

I just needed help with a simple script. I have a "slow dance" animation. Usually i put a sitting script in the prim with the "slow dance" animation. So whenever i click on "sit", the avatar starts dancing. But how can u change the script such that when i click on "touch", the avatar starts slow dancing.  I can't seem to find a script for the "touch" option anywhere.

 

Thank you,

Sarrah

Link to comment
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:

Link to comment
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
Link to comment
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);

}

}

Link to comment
Share on other sites

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