Change font size
It is currently Mon Oct 21, 2019 1:11 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 2 of 2   [ 15 posts ]
Go to page Previous  1, 2
Author Message
 Post subject: Re: Slow iris door script wanted.
PostPosted: Mon Jun 20, 2011 7:42 pm 
Furious Typer

Joined: Tue Oct 28, 2008 4:53 pm
Posts: 172
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.


Top
 Profile  
 
 Post subject: Re: Slow iris door script wanted.
PostPosted: Wed Jan 09, 2019 12:39 pm 
Furious Typer

Joined: Mon Feb 13, 2017 1:53 pm
Posts: 68
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!


Top
 Profile  
 
 Post subject: Re: Slow iris door script wanted.
PostPosted: Wed Jan 09, 2019 10:16 pm 
Furious Typer
User avatar

Joined: Fri Mar 26, 2010 12:11 pm
Posts: 240
Location: Belgium / Brussels
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 ...

_________________
Webmaster @ digitalconcepts.free.fr & digigrids.free.fr


Top
 Profile  
 
 Post subject: Re: Slow iris door script wanted.
PostPosted: Thu Jan 10, 2019 10:05 am 
Furious Typer

Joined: Mon Feb 13, 2017 1:53 pm
Posts: 68
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!


Top
 Profile  
 
 Post subject: Re: Slow iris door script wanted.
PostPosted: Sat Jan 12, 2019 6:17 am 
Furious Typer
User avatar

Joined: Fri Mar 26, 2010 12:11 pm
Posts: 240
Location: Belgium / Brussels
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! :)

_________________
Webmaster @ digitalconcepts.free.fr & digigrids.free.fr


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 2 of 2   [ 15 posts ]
Go to page Previous  1, 2


Who is online

Users browsing this forum: legacy_google [bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net