Listens

View: New views
4 Messages — Rating Filter:   Alert me  

Listens

by Domchi Underwood :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Do you remove listens yourself before you change state? What do you consider to be the best practice?


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters

Re: Listens

by Dale Innis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Me, I pretty much never change state.  (It seems like a good idea in
theory, but in practice it's more trouble than it's worth.)

On Wed, Nov 4, 2009 at 8:52 PM, Domchi Underwood
<domchi.underwood@...> wrote:
> Do you remove listens yourself before you change state? What do you consider
> to be the best practice?
>
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
>
>
_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters

Re: Listens

by Kubota Homewood :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Due to the memory restrictions, letting the listens close  
automatically can be a good thing.  One that that state change is good  
for is to put your script into an idle state, one that does not have  
(m)any events.  For example:

        state sleeping {
                state_entry() {
                        llSetScriptState(llGetScriptName(), 0);
                        state wakeup;
                }
        }

If you have event handlers when you do this you will find queued up  
events when you are woken.  In general, I switch states when the type  
of events I need to wait for changes.

        Kubota

        Doing delicate tasks with heavy machinery

On Nov 4, 2009, at 7:52 PM, Dale Innis wrote:

> Me, I pretty much never change state.  (It seems like a good idea in
> theory, but in practice it's more trouble than it's worth.)
>
> On Wed, Nov 4, 2009 at 8:52 PM, Domchi Underwood
> <domchi.underwood@...> wrote:
>> Do you remove listens yourself before you change state? What do you  
>> consider
>> to be the best practice?
>>
>> _______________________________________________
>> Click here to unsubscribe or manage your list subscription:
>> https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
>>
>>
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters

Re: Listens

by Nava Muni :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
You don't need to. Listens close automatically on state change.

"Best practices" is a bit difficult to define as the best practice in one situation may not be the best in another. In general, however, the best "best practice" is, "if you open it, you close it." This is usually the ideal approach to take because not all events that require setup/opening/starting are reset/closed on a state change. However, there are times when speed, code size, or memory limitations dictates what's "best;" you may find it more suitable in such situations to rely on the default "auto-close" behavior available to a few events when making state changes.


From: Domchi Underwood <domchi.underwood@...>
To: Scripters <secondlifescripters@...>
Sent: Wed, November 4, 2009 7:52:27 PM
Subject: Listens

Do you remove listens yourself before you change state? What do you consider to be the best practice?



_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters