osgrid.org
https://forums.osgrid.org/

Slow iris door script wanted.
https://forums.osgrid.org/viewtopic.php?f=5&t=3340
Page 2 of 2

Author:  Marlon Wulluf [ Mon Jun 20, 2011 7:42 pm ]
Post subject:  Re: Slow iris door script wanted.

As a suggestion, being that the button sends a message to the blades, why not remove the touch events in each blade.

[Addendum]
For some reason, the iris door only works horizontal, weird things happen when operated vertical.

Author:  marshall genord [ Wed Jan 09, 2019 12:39 pm ]
Post subject:  Re: Slow iris door script wanted.

Thanks for this beautiful script.
It works nicely.

I'm referring to this post: https://forums.osgrid.org/viewtopic.php?p=14645#p14645
Only one problem is there when I use it:

When colliding with the "touchpad" the door doesn't remain open,
but keeps closing and opening alternately without stopping.

Colliding or un-colliding again doesn't change this behaviour.

Any ideas?
Thanks!

Author:  dj phil [ Wed Jan 09, 2019 10:16 pm ]
Post subject:  Re: Slow iris door script wanted.

When the collision starts with the avatar, the script adds the avatar to a list.
When the collision ends, the script removes the avatar from the list and if the list is empty only, it closes the door.

What happens if the list is not empty, well he does not close the door ...
That could be the problem, I have not tested ...

Author:  marshall genord [ Thu Jan 10, 2019 10:05 am ]
Post subject:  Re: Slow iris door script wanted.

Thanks for your help!
I haven't really been able to fix that issue,
so instead I've adjusted a simple on-off-switch that I got from somebody else.
That seems to be sufficient for my needs.
I added it below for possible future users:

{L_CODE}:
//Simple remote door switch adapted from Adelle Fitzgerald. Use as you like but please keep this header.

integer channel = 14; //Set this to the same channel as your door
integer closed;

default
{
    state_entry()
    {
    }
   
    touch_start(integer num)
    {
        if (!closed)
        {
            closed = TRUE;
            llRegionSay(channel, "open");
        }
        else
        {
            closed = FALSE;
            llRegionSay(channel, "close");
        }
    }
}


Thanks very much, again!

Author:  dj phil [ Sat Jan 12, 2019 6:17 am ]
Post subject:  Re: Slow iris door script wanted.

I watched the detection and collision script again and noticed some errors.
Sorry, I did not watch well the first time.

I made a new script for the iris to have a more beautiful and adjustable movement.
I have also revisited the collider that corrects these errors but also strengthens a little.

Iris Door v0.1 by djphil (CC-BY-NC-SA 4.0)
{L_CODE}:
// Iris Door v0.1 by djphil (CC-BY-NC-SA 4.0)

integer canal = -123456789;
float amount = 0.05;
float speed = 0.1;
integer ecoute;
float hollow;

default
{
    state_entry()
    {
        llListenRemove(ecoute);
        ecoute = llListen(canal, "", "", "");
    }

    listen(integer channel, string name, key id, string message)
    {
        if (message == "open")
        {
            while (hollow < 1.0 + amount)
            {
                llSetLinkPrimitiveParamsFast(LINK_THIS, [
                    PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_CIRCLE,
                    <0.0, 1.0, 0.0>, hollow, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>
                ]);
                hollow += amount;
                llSleep(speed);
            }
        }

        else if (message == "close")
        {
            while (hollow > 0.0 - amount)
            {
                llSetLinkPrimitiveParamsFast(LINK_THIS, [
                    PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_CIRCLE,
                    <0.0, 1.0, 0.0>, hollow, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>
                ]);
                hollow -= amount;
                llSleep(speed);
            }
        }
    }
}
Collider v0.1 by djphil (CC-BY-NC-SA 4.0)
{L_CODE}:
// Collider v0.1 by djphil (CC-BY-NC-SA 4.0)

integer canal = -123456789;
list avatars;

default
{
    state_entry()
    {
        llSetAlpha(0.0, ALL_SIDES);
        llVolumeDetect(TRUE);
    }

    on_rez(integer param)
    {
        llResetScript();
    }

    collision_start(integer n)
    {
        integer i;

        for (i = 0; i < n; ++i)
        {
            key k = llDetectedKey(i);

            if (llGetAgentSize(k) != ZERO_VECTOR)
            {
                if (!~llListFindList(avatars, [k]))
                {
                    avatars += [k];

                    if (llGetListLength(avatars) == 1)
                    {
                        llSay(canal, "open");
                    }
                }   
            }
        }
    }

    collision_end(integer n)
    {
        integer i;

        for (i = 0; i < n; ++i)
        {
            integer index = llListFindList(avatars, [llDetectedKey(i)]);

            if (~index)
            {
                avatars = llDeleteSubList(avatars, index, index);
            }
        }

        if (avatars == []) 
        {
            llSay(canal, "close");   
        }
    }
}
Enjoy! :)

Page 2 of 2 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/