Jump to content

Adding door and curtain to AVsitter


Tattooshop
 Share

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

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

Recommended Posts

Hello! I am trying to add a door and curtains to the AVsitter script's touch_end event, everything works, but when I click the curtains a menu pops up, this does not happen with the door. what is the problem?


And how to make a curtain / door part clickable only for an owner? It’s clear that I need to check  if (llDetectedKey(0) == llGetOwner()), but after that the menu stopped appearing at all (Obviously I put it in the wrong place).

And is it possible to combine these two toggles into one?

:)

    touch_end(integer llRequestPermissions)
    {
        integer prim = llDetectedLinkNumber(0);

        if (prim == 3)
        {
            llTriggerSound(CURTAIN_SOUND, VOL);
            if (toggle1)
            {
                toggle1 = FALSE;
                llSetLinkPrimitiveParamsFast(CURTAINS_PRIM, [18, 0, < 0.0, 0.0, 0.0 >, 0.6,
                34, CURTAINS_PRIM_2, 18, 0, < 0.0, 0.0, 0.0 >, 0.6,
                34, CURTAINS_PRIM_3, 18, 0, < 0.0, 0.0, 0.0 >, 0.6]);            
            }
            else
            {
                toggle1 = TRUE;                
                llSetLinkPrimitiveParamsFast(CURTAINS_PRIM, [18, 0, < 1.0, 1.0, 1.0 >, 1.0,
                34, CURTAINS_PRIM_2, 18, 0, < 1.0, 1.0, 1.0 >, 1.0,
                34, CURTAINS_PRIM_3, 18, 0, < 1.0, 1.0, 1.0 >, 1.0]);
            }
        }

        if (prim == 42)
        {
            llTriggerSound(DOOR_SOUND, VOL);
            if (toggle2)
            {
                toggle2 = FALSE;
                llSetLinkPrimitiveParamsFast(DOOR_PRIM, [PRIM_POS_LOCAL, llList2Vector(llGetLinkPrimitiveParams(DOOR_PRIM, [PRIM_POS_LOCAL]), 0) + DOOR_OFFSET_LEFT]);
            }

            else
            {
                toggle2 = TRUE;
                llSetLinkPrimitiveParamsFast(DOOR_PRIM, [PRIM_POS_LOCAL, llList2Vector(llGetLinkPrimitiveParams(DOOR_PRIM, [PRIM_POS_LOCAL]), 0) + DOOR_OFFSET_RIGHT]);
            }
        }

        else
        {
            if ((!(gF | N)) & gE < 3)
            {
                llMessageLinked(((integer) - 1), 90005, "", llDetectedKey(0));
            }
        }
    }

 

Link to comment
Share on other sites

lol I simply used else if and it started to work normally! :D

 

But still how to add owner check here?

I added a check but the menu now does not appear when I click it. how to make the check be for doors and curtains but not for the menu itself?

 

and is it possible to make two toggles in one?

:)

    touch_end(integer llRequestPermissions)
    {
        integer prim = llDetectedLinkNumber(0);
        if (llDetectedKey(0) == llGetOwner())
        {

        if (prim == 3)
        {
            llTriggerSound(CURTAIN_SOUND, VOL);
            if (run1)
            {
                run1 = FALSE;
                llSetLinkPrimitiveParamsFast(CURTAINS_PRIM, [18, 0, < 0.0, 0.0, 0.0 >, 0.6,
                34, CURTAINS_PRIM_2, 18, 0, < 0.0, 0.0, 0.0 >, 0.6,
                34, CURTAINS_PRIM_3, 18, 0, < 0.0, 0.0, 0.0 >, 0.6]);            
            }
            else
            {
                run1 = TRUE;                
                llSetLinkPrimitiveParamsFast(CURTAINS_PRIM, [18, 0, < 1.0, 1.0, 1.0 >, 1.0,
                34, CURTAINS_PRIM_2, 18, 0, < 1.0, 1.0, 1.0 >, 1.0,
                34, CURTAINS_PRIM_3, 18, 0, < 1.0, 1.0, 1.0 >, 1.0]);
            }
        }

        else if (prim == 42)
        {
            llTriggerSound(DOOR_SOUND, VOL);
            if (run2)
            {
                run2 = FALSE;
                llSetLinkPrimitiveParamsFast(DOOR_PRIM, [PRIM_POS_LOCAL, llList2Vector(llGetLinkPrimitiveParams(DOOR_PRIM, [PRIM_POS_LOCAL]), 0) + DOOR_OFFSET_LEFT]);
            }

            else
            {
                run2 = TRUE;
                llSetLinkPrimitiveParamsFast(DOOR_PRIM, [PRIM_POS_LOCAL, llList2Vector(llGetLinkPrimitiveParams(DOOR_PRIM, [PRIM_POS_LOCAL]), 0) + DOOR_OFFSET_RIGHT]);
            }
        }
        }

        else
        {
            if ((!(gF | N)) & gE < 3)
            {
                llMessageLinked(((integer) - 1), 90005, "", llDetectedKey(0));
            }
        }
    }

 

 

Edited by Tattooshop
  • Thanks 1
Link to comment
Share on other sites

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