Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Dialogs.. one for owner.. one for everyone else

Koneko Nori
Registered User
Join date: 15 Jun 2006
Posts: 3
01-13-2007 11:49
hi

im trying to make a touchable item for use in an RP role, i have scripted out the basic display dialog that appears when I the owner touches the item but as part of the RP role it requires a different set of responses for others that wish to touch it

as i wish to be as open in my question as possible, to hopefully get some open answers i am scripting a door lock, in the style of a security lock (in RP only, no complex scripting to actually unlock the door via it) so i would like for the owner to be able to just click it, open up a dialog window and have them presented with "lock" "enter code" "test" for example, which i have done and it works well

but now i would like to know how to present a seperate dialog menu for others when it is touched, with menu options such as "Hack" "Random" etc so that when pressed it displays that they are "<name> begins to hack the door lock" or "<name> punches the keys randomly in hope of unlocking the door"

im not that new to scripting but if im right this is getting into ID's now and thats somewhere i havent tried before. if someone could please give me a hand it would be great

please note i have tried looking on the wiki, if i knew what exactly i was looking for i might be able to find the answer, if anyone can point me in the right direction or be kind enough to show a small example of how this is done i'd be very greatful

thanks all

bye
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
01-13-2007 12:05
You can filter the touch events based on the key of who touched it (this will almost always be the first person to touch, so you can get their key using llDetectedKey(0)).

CODE

touch_start(integer n)
{
key id = llDetectedKey(0);
if (id == llGetOwner()) {
// launch "owner options" dialog
llDialog(id, "Owner options", ["Lock", "Enter Code", "Test"], YOUR_CONTROL_CHANNEL);
}
else {
// launch "everyone else" dialog
llDialog(id, "Options", ["Hack", "Random"], YOUR_CONTROL_CHANNEL);
}
}

(That is a rather basic dialog implementation, but I am concentrating here on the touch request filtering.)
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names