Jump to content

[need help] Object from hud should play a gesture


Walter Fanwood
 Share

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

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

Recommended Posts

Well yea that pretty much my problem and i tried a lot but nothing worked

 

It sounds easy but i guess im just to dump to understand it XD

 

So i wana click a object, as sample a button in a hud i create, which activates a simple gesture which NORMAL activates if you use the comment

 

"/4heal self"

 

(you might can see where i wana use it lol)

 

Its not really a "gesture", since its a chat comment the user have to make that the Button script from the Hud button reacts but as i said i want that it also reacts by clicking it with another script in it (coz i need this script SOLO for something else maybe)

 

but i guess if i create a gesture which will write that down in the chat if this possible than the button can active the gesture...well yea i guess i kinda need that script.

EDIT: Yea i made a gesture which runs on the comment "/4heal self" but i still need that the object if you click it USES this gesture since it only works if i write down the comment and not by clicking the button....

So i really need some help, thank you in advance!

 

 

If it helps, here the Script i use which the gesture active:

key target;
integer ready = TRUE;
key owner;
integer listening;
integer cooldown    = 25;
integer QUERYchan   = -156535255;
integer HEALcost    = -25;
integer APIchan     = -956535255;


default
{
    state_entry()
    {
        owner = llGetOwner();
        llListen(4,"",owner,"");
    }
    
    timer()
    {
        llSetTimerEvent(0);
        ready = TRUE;
        llOwnerSay("BANDAGE ready");
    }
    
    attach(key id)
    {
        if(id != NULL_KEY)
        {
            llResetScript();
        }
    }
    
    listen(integer chan, string name, key id, string msg)
    {
        if(chan == QUERYchan)
        {
            list data = llCSV2List(msg);
            if(llList2Key(data,0) == owner)
            {
                if(llList2Integer(data,3) >= -HEALcost)
                {
                    llTriggerSound("c4db9967-7986-1e49-9dee-c0775ae74b49",1.0);
                    llSetTimerEvent(cooldown);
                    ready = FALSE;
                    llOwnerSay("Aiding "+llKey2Name(target)+"...");
                    llWhisper(APIchan,(string)owner + " )( AP )( "+(string)HEALcost+" )( first aid kit");
                    llSay(APIchan,(string)target + " )( HEAL )( 30 )( "+llKey2Name(owner));
                    llListenRemove(listening);
                }
                else
                {
                    llOwnerSay("Not enough AP to aid!");
                }
            }
        }
        
        else
        {
            if(ready == TRUE)
            {
            if(msg == "heal self")
            {
                target = owner;
                listening = llListen(QUERYchan,"","","");
                llWhisper(APIchan,(string)owner + " )( QUERY");
            }
            }
            else
            {
                llOwnerSay("Not ready for that...");
            }
        }
    }
    
    sensor(integer number)
    {
        target = llDetectedKey(0);
        listening = llListen(QUERYchan,"","","");
        llWhisper(APIchan,(string)owner + " )( QUERY");
    }
}
Link to comment
Share on other sites


BrownBoxStudio wrote:

Can't scripts trigger gestures with chat commands? I guess that's not technically the script playing the gesture but it is the same effect. 

Nope.

A gesture can trigger a script (via a text command & listen) but not the other way around. Gestures are processed as part of the agent before chat is sent to local and 'immitating' the chat triggers via anything that isn't the agent (scripts, nearby objects, other agents) wouldn't be tested to trigger the gesture.

I agree with Nova, OP is SOL.

Link to comment
Share on other sites

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