Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Would This Be Ignorant?

Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
10-27-2004 15:15
the thread about beating lag (/120/0f/25782/1.html) got me thinkin'....

i'm using llDialog in a script and it's triggered by a click. it needs a listen to be able to hear what the llDialog says but i changed it so the click turns on llListen and the menu choices do llListenRemove when they're done. but....what about the Ignore button? or people logging out in the middle of the menu and such?

my whole point is trying to cut down on lag and server load and such so would it be ignorant to start a timer when i start the listen and if it doesn't hear anything in a couple minutes does llListenRemove anyway? timers are supposedly pretty laggy so would that be as bad as leaving the listen on now and then? or same difference?
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
10-27-2004 17:13
You'd want to combine the use of states with your timer. When you want to ask a question, change to a new state that create the listen, asks the question with llDialog, then has a timer that will change back to an "Idle" state either when the person answers the llDialog questions or the timer times out.
_____________________
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
10-27-2004 18:20
From: Hank Ramos
You'd want to combine the use of states with your timer. When you want to ask a question, change to a new state that create the listen, asks the question with llDialog, then has a timer that will change back to an "Idle" state either when the person answers the llDialog questions or the timer times out.


God, that sounds kludgy. I sure am glad I don't use llDialog.
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
10-27-2004 19:02
Hank does that close the llDialog menu or something? why not something like.....

(not a real script)
touch_start() {
llListen();
llDialog();
llSetTimerEvent(180);
}

timer() {
llListenRemove();
llSetTimerEvent(0);
}

the menu would still sit up there on their screen but i'm willing to assume if they haven't done anything with it in three minutes they aren't going to mind that it doesn't work anymore. i just don't see what the advantage of using another state is here. enlighten me?
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
10-27-2004 19:07
It is , but it isn't, if your use to setting up lissons it's quite easy to make a dialog. Instead of needing the user to type "/23 save". The user just click a button "save". And the script types it for them.

llInstantMessage(0, "Would you like to save? (/22 'Save','No'";)
vs
llDialogBox(22, "Would you like to save?", ["Save","No"])

But what's really anoying. 8 chars max. 4 buttons, No text input fields, no images.
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
10-27-2004 19:14
llInstantMessage(userID, "Would you like to save? ('/22 Save','/22 No'";)
vs
llDialog(userID, "Would you like to save?", ["Save","No"], 22)

Well it may not be the way people would like, but it's no more complicated then a text based input. All that changes is a single line. Before the user would have had to type "/22 Save". But now the user can click ones and the script types it for them. But if they like they can still type '22 Save'.

But what's really annoying. 8 chars max. 4 buttons, No text input fields, no images.

btw is the lesson remove, and or timer remove necessary? I know it would be 'good' coding to include both, but when the scripts defaults back to it's old state, wouldn't the script remove both the lisson and the timer automatically?
Apotheus Silverman
I write code.
Join date: 17 Nov 2003
Posts: 416
10-28-2004 10:06
From: Kurt Zidane
btw is the lesson remove, and or timer remove necessary? I know it would be 'good' coding to include both, but when the scripts defaults back to it's old state, wouldn't the script remove both the lisson and the timer automatically?


If you're using states, then yes the timer and listen are removed automatically. Many times it is not possible or practical to use seperate states for llDialog() handling due to other things going on in a script, in which case you need to llListRemove() and llSetTimerEvent(0.0) manually.
_____________________
Apotheus Silverman
Shop SL on the web - SLExchange.com

Visit Abbotts Aerodrome for gobs of flying fun.