Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llListFindList Problem

Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
03-25-2005 21:08
CODE
list find = (list) llDetectedOwner(0);
integer test = llListFindList(players, find);
if ( test == (-1) )
{
llSay(0, "You must purchase a Suit from the vendor to enter this area. Thankyou.");
llSetTimerEvent(1);
}
else
{
llSetStatus(STATUS_PHANTOM, TRUE);
llSetTimerEvent(2);
}


I'm having trouble with this, it always returns test == -1 . What am I doing wrong?

This is in a collision event with llCollisionFilter(), which doesn't seem to work either.
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
03-25-2005 21:14
Casting a variable as a list never seems to work.

try:

CODE
list find = [llDetectedOwner(0)];
which places the key into a list.
_____________________
Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
Still having trouble.
03-25-2005 21:25
hmm, still doesn't seem to be working. I am passing new list information via llSay() with a listen event as follows;

l
CODE
isten(integer channel, string name, key id, string message)
{
if ( (integer) channel == ##### && (string) name == "LLLLLLLL" )
{
players += [message];
}
}


(Sorry, the channel and name are private. :o )

Could this be a problem?
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
03-25-2005 21:46
You're probably brushing up against list's type-specific functionality. This double-edged sword often confuses people when searching using llListFindList, and extracting via the llList2* functions.

If you inputted the value as a string, dont expect to find it using llListFindList and a key. Keep in mind that the 'message' variable is a string, and the return type of llDetectedOwner is a key. Try casting 'message' to a key before adding it to your list.
==Chris
Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
03-25-2005 22:21
Found a simpler way, thanks for the help anyway. :rolleyes:
Jim Bunderfeld
The Coder
Join date: 1 Mar 2004
Posts: 161
03-26-2005 09:33
From: Douglas Callahan
hmm, still doesn't seem to be working. I am passing new list information via llSay() with a listen event as follows;

l
CODE
isten(integer channel, string name, key id, string message)
{
if ( (integer) channel == ##### && (string) name == "LLLLLLLL" )
{
players += [message];
}
}


(Sorry, the channel and name are private. :o )

Could this be a problem?


Actually it is proven that using

CODE
 players = players + [message];


is actually faster than the += method. Just trying to make your code faster.
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
03-26-2005 16:04
From: Jim Bunderfeld
Actually it is proven that using

CODE
 players = players + [message];


is actually faster than the += method. Just trying to make your code faster.


Where is the evidence for this statement :)
==Chris
Jack Lambert
Registered User
Join date: 4 Jun 2004
Posts: 265
03-26-2005 19:36
Chris,

It's in the "speed" portion of the style guide in the wiki. It's one user's (alleged) test. I am not sure that the mechanics of the test were accurate though... Either way, I doubt it would make a huge difference unless you're doing huge for loops and populating a rather large list.

Personally, half the time I use ++i and half the time I use i++ (during increments) but I almost invariably use += for additions.

As for the original problem, I'd be willing to bet my fortune it has something to do with list typing.

--Jack Lambert
_____________________
----------------------------
Taunt you with a tree filled lot? hahahahahahaha. Griefer trees! Good lord you're a drama queen. Poor poor put upon you.

-Chip Midnight