Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

TWo questions with LLDialog

Krazzora Zaftig
Do you have my marbles?
Join date: 20 Aug 2005
Posts: 649
12-28-2006 10:59
I am working on a dialog menu for a few items and ran across something that is confusing my limited mind.

1) Trying to add an allowed list. Like if a person clicks on it then it will only give access if they are on a notecard list.

2) My dialog always works the first time...but never will come up again once pressed on. Do I need a timer or something and if so can someone give me a clue of design and where. >_<

I do have the script available but kind a nervous about posting it cause I will be using them in items I sell so obviously I don't want to post my entire code.

Thanks in advance.
_____________________
Thraxis Epsilon
Registered User
Join date: 31 Aug 2005
Posts: 211
12-28-2006 11:17
For the allowed user list:

llListFindList is your friend
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
12-28-2006 11:21
1. That has nothing to do with llDialog. If you call llDialog with an av's key, that person will get the dialog. So for an access list, you'll have to read the names off the notecard, and then in the touch_start handler see if the toucher is on the authorized list, and if they're not, then don't call llDialog. Look in the script library or in the Wiki, I'm sure there are some examples of how to read names off a notecard, store them in a list, and check against that.

2. A dialog is not automatically regenerated. Once you click a button, that's the end of that dialog menu. If you want it to keep coming back, then you'll have to keep calling llDialog. The menus which "stay up" - when you click a button, you get the menu again - generally, what you do is call llDialog again in the listen handler. That's because when you receive a listen event and it's on the channel used for the dialog menu, you know someone's pressed the button. This is also how you would implement multiple menus - if the listen handler says the person pressed the Next button, then you call llDialog with a new set of buttons, and so on. Again, check the Wiki and the script library, there should be examples that cover some of this functionality. I know there's a menu library script of some sort, so even if you don't use it, you could look through it and figure out how it works.
Krazzora Zaftig
Do you have my marbles?
Join date: 20 Aug 2005
Posts: 649
12-28-2006 11:47
ok Ziggy thank you for the pointer on the touch_start as that is where I lost focus I was thinking it was more related to the lldialog directly. I'll look into that more with lllistfindlist. As for the second part I guess I am either still confused or not doing somethign right.

The menus all work and function, even the sub menus if say I touched them (or ziggy) but as soon as Phillip touches them it stops working along with all other tries after that.
_____________________
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-28-2006 12:03
Check out the code for some of the door locks that have been previously posted. They cover the allowed list idea.

Without seeing exactly what your code is doing its hard to guess what you are doing wrong, but it sounds as if your are possibly failing to reset the current user id once it fails and thus never allowing a dialog to be displayed.

I have coded the sort of thing you are after, iit was a custom tp, If you would like the code please ask.
Krazzora Zaftig
Do you have my marbles?
Join date: 20 Aug 2005
Posts: 649
12-28-2006 12:31
From: Newgate Ludd
Check out the code for some of the door locks that have been previously posted. They cover the allowed list idea.

Without seeing exactly what your code is doing its hard to guess what you are doing wrong, but it sounds as if your are possibly failing to reset the current user id once it fails and thus never allowing a dialog to be displayed.

I have coded the sort of thing you are after, iit was a custom tp, If you would like the code please ask.


actually I think that is what it is Newgate and i'm trying to figure out why it's not releasing and to resolve it. Funny enough a door is close to what I am doing but NOT just the door. The door is kinda "included" for convience. I'm working on a house control script for a series of houses/partments I am gonna sell. ^_^
_____________________
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
12-28-2006 13:58
Are there several 'clickers' (Agents) involved?

In which case, the llDialog needs to be issued for the appropriate Key id detected each time an Agent touches the object, while the llListen needs to be set for the Key id of all Agents touching the object.

If this is the case then it's probably best to do a: llListen(Channel, "", NULL_KEY, "";);

And then check the name from the Listen Event against your list of allowed Agents: llListFindList(AllowedList, [name]);
Krazzora Zaftig
Do you have my marbles?
Join date: 20 Aug 2005
Posts: 649
12-28-2006 14:03
Pale yes there might be multiple clickers at one time as there will be a rush to control various objects on the structure. Also there is a need ot prevent general public from clicking it but allow owner permitted people to control it.

basicly in essence exactly like Timeless's door script for security MINUS the group need and I can't hardcode the IDs into the script hence the notecard.
_____________________
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
12-28-2006 14:16
Well, I wrote a version of Timeless' door script, with the added functionality of reading names from a notecard. I gave it to a friend to play with, haven't tested it yet. I was thinking of putting it up here after it was somewhat tested, because it seemed like it could be useful for some people, and would be in the spirit in which Timeless Prototype wrote his script.

If you want to play with it, leave me an IM in-game and I'll drop you a copy next time I log on (probably later tonight).
Krazzora Zaftig
Do you have my marbles?
Join date: 20 Aug 2005
Posts: 649
12-28-2006 14:19
I'll definatly do that Ziggy. the scripting code might get to me but it's something I cna play with/look at and try to understand first. Infact I even have a good test for your door *grins evilly* if it works it will be very intersting the impact it could have. ^_^
_____________________
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
01-20-2007 04:38
I'd just like to mention a "gotcha" that caught me out.

In the touch_start event, you may call llDialog using llDetectedKey(0). If you then call llDialog again in the listen event as suggested above, and copy and paste the llDialog call, it won't work. Because llDetectedKey(0) no longer has any value. You need to cache the key in a variable.

Simple, I know, but it's often the simplest things that cause a lot of head-scratching.