Getting a script to listen to the object it is in..
|
|
Phryne Cannned
Registered User
Join date: 18 Nov 2006
Posts: 12
|
12-16-2006 11:02
Ok I admitt I usually tend to jump into something with both feet.. now I am over my head. I was trying to play arround with Tefflers Particle system script /15/26/100139/1.htmland i thought gee It would be neat to add a dialog box script to the object thats running the particle system for a quick and easy GUI interface for the variable commands The problem, I cant get the Particle System to respond to the object and since this is the only way I know how to do dialog boxes at the moment.. I am pretty stuck. No matter which I try to use llListen(90,"PST1","",""  ; llListen(90,"PST1",NULL_KEY,""  ; and no matter what channel I choose When my dialog box causes the object to speak ie: PST1:EM go nothing happens. The particle system listens to me, it listens to any avatar, etc etc as permissions are changed, just not to the object, I know I am probably missing something obvious, i just can't figure out what =( any suggestions?
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
12-16-2006 11:05
You may be missing the fact that llDialog doesn't cause the *object* to speak, it causes whoever clicks the buttons to speak. So if you filter for the object's name and/or key it won't hear them.
_____________________
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
|
|
Phryne Cannned
Registered User
Join date: 18 Nov 2006
Posts: 12
|
12-16-2006 11:41
Hmm well i have variables in there for the object, for the owner, for ANYONE that happens to say the right string and nothing =/ with my dialog box set to else if (message == "Glow"  llSay(0, "EM go"  ; else if (message == "Jet"  llSay(0, "EM stop"  ; I get (as wella s anyone else in range) PST1:EM go in green text in the chat history With the following variables in the particle system, STILL nothing happens llListen(0,"",llGetOwner (),""  ; llListen(0,"",NULL_KEY,""  ; llListen(0,"PST1",NULL_KEY,""  ; With these variables above any person can speak "EM go" and get the script to respond, its just the green text coming from the dialog box option that it won't respond to
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
12-16-2006 13:03
From: Phryne Cannned Hmm well i have variables in there for the object, for the owner, for ANYONE that happens to say the right string and nothing =/ with my dialog box set to else if (message == "Glow"  llSay(0, "EM go"  ; else if (message == "Jet"  llSay(0, "EM stop"  ; I get (as wella s anyone else in range) PST1:EM go in green text in the chat history With the following variables in the particle system, STILL nothing happens llListen(0,"",llGetOwner (),""  ; llListen(0,"",NULL_KEY,""  ; llListen(0,"PST1",NULL_KEY,""  ; With these variables above any person can speak "EM go" and get the script to respond, its just the green text coming from the dialog box option that it won't respond to try posting the whole script, in fact both of em and we can take a better look at the problem
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
12-16-2006 13:22
It sounds like you're having the script listen for the response from llDialog, then say commands itself. This won't work, because scripts don't listen to themselves (not that they should really need to anyway). A quick fix would be to change the llDialog buttons so that they are the commands that are needed e.g. instead of "Glow" have the button be "EM go". But it's hard to say without seeing the full script, as Newgate says.
_____________________
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
|
|
Phryne Cannned
Registered User
Join date: 18 Nov 2006
Posts: 12
|
12-16-2006 13:45
gladly, i just dont know how to post the scripts in the extra little boxes here like the other people do and wasnt sure if it was ok to just dump them in the regular text.
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
12-16-2006 13:52
Use the [ php ] and [ /php ] tags (removing the spaces) for the best effect.
_____________________
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
|
|
Phryne Cannned
Registered User
Join date: 18 Nov 2006
Posts: 12
|
12-16-2006 14:07
Basically i have an object, and in the objects inventory i have a "basic dialog box script" , "Particle system script" and a hand full of textures for the particle system to choose. The dialog box scipt is jsut the one found on the Wiki that I tried editing to fit my needs. these are my original settings for the "glow" and "jet" buttons, I had finally just changed them to on and off as the quickest way to see if I had gotten any kind of responce. // when touched, present a dialog
integer CHANNEL = 42; // dialog channel list MENU_MAIN = ["Patterns...", "Density...", "Speed...", "Colours...", "Particles..."]; // the main menu list MENU_PATTERNS = ["Glow", "Jet", "Explode", "Main Menu"]; // a submenu
default { state_entry() { llListen(CHANNEL, "", NULL_KEY, ""); // listen for dialog answers (from multiple users) } touch_start(integer total_number) { llDialog(llDetectedKey(0), "Particle Options", MENU_MAIN, CHANNEL); // present dialog on click } listen(integer channel, string name, key id, string message) { if (llListFindList(MENU_MAIN + MENU_PATTERNS, [message]) != -1) // verify dialog choice { llOwnerSay( name + " picked the option '" + message + "'."); // output the answer if (message == "Patterns...") llDialog(id, "Pick an option!", MENU_PATTERNS, CHANNEL); // present submenu on request else if (message == "Glow") llSay(0, "EM pattern 1"); else if (message == "Jet") llSay(0, "EM pattern 4"); else if (message == "Explode") llSay(0, "EM pattern 2"); else if (message == "Main Menu") llDialog(id, "What do you want to do?", MENU_MAIN, CHANNEL); // present main menu on request to go back // here you have the name and key of the user and can easily verify if they have the permission to use that option or not } else llSay(0, name + " picked invalid option '" + llToLower(message) + "'."); // not a valid dialog choice } }
What I was basically "attempting" to do was take the built in spoken commands of the particle system, and create a dialog box that will allow the variables to be changed with a simple click (eventually in a channel other than 0) to a handful of preset values (ie: hit the colours button and get buttons for red blue green etc that when clicked would give the corosponding text command to the particle system without the end user having to figure out the RGB variables and type them in by hand). In the case above i started with the "pattern" variable in an attempt to get a 1 click particle pattern change. Unfortunately I have very little idea what I am doing. The particle system script is located in its entirety with alot of discription and detail here: /15/26/100139/1.htmlso far the only change i made to it was adding llListen(0,"",NULL_KEY,""  ; llListen(0,"PST1",NULL_KEY,""  ; to the command section in hopes to get it to listen to the text coming from the dialog box
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
12-16-2006 14:17
This works for me. What is the problem?
|
|
Phryne Cannned
Registered User
Join date: 18 Nov 2006
Posts: 12
|
12-16-2006 14:30
when I press the buttons the particle script doesnt respond.
I get the little white sparkles arround my object but it just sits there and continues doing what it was doing rather than changeing variables.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
12-16-2006 15:19
|
|
Phryne Cannned
Registered User
Join date: 18 Nov 2006
Posts: 12
|
12-16-2006 15:46
yup they are lol
that would definately do it then
does the same rule apply if i have a multi-part linked set of prims (for example a wand) and put the dialog box in the bulk of the linked object (the handle) and the particle system in the tip prim would that work? or because it is basically the same object.. probably not...
just include HUD item to control the script is starting to sound like the way to go.
Now to figure out what a HUD is
*** back to the wiki**
thanks again I never caught that in all my reading and thought I was going mad
|
|
Phryne Cannned
Registered User
Join date: 18 Nov 2006
Posts: 12
|
12-16-2006 16:10
Yup
Made a little HUD and it works great now! thanks again everyone for your time, i feel slightly less of a script newb now... just slightly =)
Long way to go, but working on it
|