Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Hidden in plain sight

Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
01-16-2007 12:07
I submit the following snip-it of code for your review...

CODE
	if (llListFindList (MENU_BLUES, [message]) != -1 & message != "Back to Groups")
llMessageLinked(LINK_SET, Bouquet_Area, llList2String(UUID_BLUES, llListFindList (MENU_BLUES, [message])),NULL_KEY);


Basically if the value in message is found in a list (MENU_BLUES) and if the value of message is not equal to the text string, "Back to Groups" then I want to send a link message to all prims in the object.

I have verified that value in the variable "message." I have inserted llSay commands just before this condition to display the result of the llListFindList function. The left side of the "AND" is true as is the right side of the "AND." However...

...the llMessageLinked command is not getting executed because in the scripts in the other prims I have llSay commands that display that processing has progressed to the child prims.

I have kept the same condition and replaced the "THEN" part with an llSay just displaying a literal to let me know the condition evaluated as TRUE and that works fine. I just cannot get the llMessageLinked command to execute.

Does anyone have any clues what I'm overlooking? This should be very straightforward and I'm certain I'm just not seeing the obvious so I would definitely appreciate additional sets of eyes verifying what I'm doing.

Thanks!
Bartiloux
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
01-16-2007 12:18
http://www.lslwiki.com/lslwiki/wakka.php?wakka=boolean

Notice the value for the AND operator :D
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
01-16-2007 12:34
From what I've been reading in the WIKI, you use '&&' when you are doing Boolean comparisions and '&' when doing bitwise comparisions. I've tried both and neither seems to be working.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
01-16-2007 13:03
...it feels Boolean to me. :p

Anyhows... so, in the other prims you have something like this?

CODE
link_message(integer sender_num, integer num, string str, key id)
{
llOwnerSay(str);
}
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
01-16-2007 13:10
Yes, exactly, and that llSay does not get executed. For what it's worth, when I am at that portion of processing, via a little built-in menu system, I see white dots encircling the prim that contains this code.
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
01-16-2007 13:17
From: Bartiloux Desmoulins
From what I've been reading in the WIKI, you use '&&' when you are doing Boolean comparisions and '&' when doing bitwise comparisions. I've tried both and neither seems to be working.

If you want to say "if this is true and that is true", use &&.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
01-16-2007 13:30
That is a butt ugly way to code up anything unless you really really have to!!!!!
I assume you think you are saving memory and possibly speed?

You say it works if you put an llSay in?
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
01-16-2007 13:36
How would you code it to make it prettier?? ;-)


But, yes, when you replace the llMessageLinked with a llSay, the llSay does get executed. So it appears something is out of kilter with the llMessageLinked statement?
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
01-16-2007 13:42
From: Bartiloux Desmoulins
How would you code it to make it prettier?? ;-)

For starters, don't call llStuff more than you have to.. Also, don't do stuff like [message] a lot as it'll create a new list each time. If you need to use it more than once, create it once and reuse it.
CODE

integer position = llListFindList (MENU_BLUES, [message]);
if (position != -1 && message != "Back to Groups")
{
string bluesStr = llList2String(UUID_BLUES, position);
llMessageLinked(LINK_SET, Bouquet_Area, bluesStr, NULL_KEY);
}
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
01-16-2007 13:48
From: Bartiloux Desmoulins
How would you code it to make it prettier?? ;-)


But, yes, when you replace the llMessageLinked with a llSay, the llSay does get executed. So it appears something is out of kilter with the llMessageLinked statement?


I'd do it like this
CODE

integer selection = llListFindList(MENU_BLUES, [message]);
if( (selection != -1) && (message != "Back to Groups"))
llMessageLinked(LINK_SET, Bouquet_Area, llList2String(UUID_BLUES, selection),NULL_KEY);


LOL, Seems like Meade beat me to it.
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
01-16-2007 13:51
From: Newgate Ludd
LOL, Seems like Meade beat me to it.

But I had to edit typos out twice.. :)
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
01-16-2007 13:52
Breaking it up and assigning separate variable was going to be my next step. I'm going to see if maybe this makes the difference that will get the llMessageLinked statement executed.

Also, thank you for the feedback related to LSL efficiencies. That type of information is hard to come by and I definitely appreciate it.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
01-16-2007 13:56
From: Bartiloux Desmoulins
Breaking it up and assigning separate variable was going to be my next step. I'm going to see if maybe this makes the difference that will get the llMessageLinked statement executed.

Also, thank you for the feedback related to LSL efficiencies. That type of information is hard to come by and I definitely appreciate it.


Read Strife's Post
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
01-16-2007 14:26
Okay... I used Mead's formatting and added an llSay(0,"Inside the IF";) within the braces of the "then" part of the condition. I fired up the script and got the display from the llSay inside the IF, but it doesnt' look like it's getting to the child prim because I am not seeing the output from the llSay in the child prim.
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
01-16-2007 14:29
From: Bartiloux Desmoulins
Yes, exactly, and that llSay does not get executed. For what it's worth, when I am at that portion of processing, via a little built-in menu system, I see white dots encircling the prim that contains this code.

From: Bartiloux Desmoulins
...I am not seeing the output from the llSay in the child prim.

Maybe I'm mis-reading something but these two statements sound like they conflict..
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
01-16-2007 14:56
Both of those posts are referencing an llSay that I have in the child prims to let me know that control has passed to the child via the llMessageLinked function. Even switching to the easier to read format the child prim is remaining quiet, leading me to believe there's something wrong with the message linking.


I put an llSay inside the IF of the parent prim, in the code that you helped me clean up, and that llSay does indeed get executed. So... the if is trapping the proper condition, the llSay is getting executed, it should be falling to the llMessageLinked command and then executing the llSay in the child prim, but I see no output from the child prim.
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
01-16-2007 15:49
I think Meade thought you were saying you saw the white dots circling the child prim...
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
01-16-2007 15:56
Ahhh... no. The appear to circle the parent prim for a few seconds.
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
01-16-2007 16:01
Could it be something as simple as the script being set to 'not running' in the child prim? Or being in a state that doesn't have a link message handler? Or being stuck in a loop in some other event handler, so it never gets to process new events from the queue? Or sitting in a long llSleep?

Just a few ideas off the top of my head :)
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
01-16-2007 16:16
Hmmm... I like the "set to not running" idea, because that is, indeed, how it appears to be behaving. How do I check this? I don't recall seeing that option anywhere.
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
01-16-2007 16:37
When you open up the script, there's a checkbox near the bottom of the window. Also, the main Tools menu has 'set all scripts running/not running' commands.
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
01-16-2007 19:06
Okay... one last question and I will quit bothering all you nice people out there in Script Forum Land. What in the world would cause the "RUNNING" check box on a script to get unchecked???

Ziggy's suggestion ended up being the reason the scripts in my child prims were not being executed. The check box on all the child prim scripts was unchecked.

Thank you to each and every one of you that helped me get to the bottom of this. I learned quite a bit all along the way. From the beginning, with my subject line "hidden in plain sight," I knew the answer was going to be something dumb that I probably did. Such is the plight of a newbie, I suppose.

Thanks again. You all are the best!!!

Bartiloux
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
01-16-2007 22:04
A compilation or a run time error, or a manual untick will stop scripts from being set running.
Edison Swain
Registered User
Join date: 7 Dec 2006
Posts: 51
01-17-2007 01:37
I've actually noticed, on a couple of different occasions, that when I add a new script to an object that already has at least one script in it, the new script will be set to "not running" by default. It's happened to me maybe 10 or 12 times, (and is annoying as hell!) but I've never noticed a pattern of when it happens or what I might be doing differently.

I keep trying to notice if/when it happens, to find out a cause - it may be a small bug or it may be something I'm not noticing.
Zi Ree
Mrrrew!
Join date: 25 Feb 2006
Posts: 723
01-17-2007 05:00
If you drag & drop a script by CTRL drop into a prim rather than dragging it into the object's contents, it ends up "not running".
_____________________
Zi!

(SuSE Linux 10.2, Kernel 2.6.13-15, AMD64 3200+, 2GB RAM, NVidia GeForce 7800GS 512MB (AGP), KDE 3.5.5, Second Life 1.13.1 (6) alpha soon beta thingie)

Blog: http://ziree.wordpress.com/ - QAvimator: http://qavimator.org

Second Life Linux Users Group IRC Channel: irc.freenode.org #secondlifelug
1 2