Jump to content

using controls


Rhiannon Arkin
 Share

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

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

Recommended Posts

Hi 

I'm stuck thinking. 

I am trying to use the control event to trigger animations for a weapon. (left mouse down+ control key). But obviously that takes away the control over the avi. 

Is there a way to have the regular key input plus whatever i want to do by taking away the controls. Like triggering the weapon AND still moving forward as before. ??

thanks


R.

 

Link to comment
Share on other sites

24 minutes ago, Rhiannon Arkin said:

I just found the flag in the llTakeControl command. I had it set to FALSE for the pass_on.

Right.  If that last parameter is TRUE, your normal movements apply.  So you can write something like this ...

default
{
    state_entry()
    {
        llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
    }
    run_time_permissions(integer perm)
    {
        if(PERMISSION_TAKE_CONTROLS & perm)
        {
            llTakeControls(
                            CONTROL_FWD |
                            CONTROL_BACK |
                            CONTROL_LEFT |
                            CONTROL_RIGHT |
                            CONTROL_ROT_LEFT |
                            CONTROL_ROT_RIGHT |
                            CONTROL_UP |
                            CONTROL_DOWN |
                            CONTROL_LBUTTON |
                            CONTROL_ML_LBUTTON ,
                            TRUE, TRUE);
 
        }
    }
    control(key id, integer level, integer edge)
    {
        if( ( CONTROL_LBUTTON & level & edge) || (CONTROL_ML_LBUTTON & level & edge) )
        {
            llOwnerSay("Swing weapon");
        }
    }
}

 

Link to comment
Share on other sites

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