Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

3d radar system?

Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-10-2007 06:48
Clue #1 =

if (findlist = -1)

Clue #2 =

http://www.cheesefactory.us/lslwm/binary.htm

Clue #3 =

Logical/Equality

:rolleyes:
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-10-2007 07:05
Also you don't have to declare these as strings:

avList += [(string)avKey];
test = [(string)avKey];

Just do it like this:

avList += avKey;
test = avKey;

Well actually you don't want to add to the list that way. Look here for the memory efficient way to add to lists:

http://www.cheesefactory.us/lslwm/list.htm

ie: avList = (avList=[]) + avList + avKey;

Then the next problem is that you are adding the key to the list before you are checking if it is already in the list. Check to see if it is there and then if it isn't, add it to the list right before or after you rez the ball.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-10-2007 07:53
no but you do need to typcast to list

avList = (avList=[]) + avList + (list)avKey;

;)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-10-2007 08:50
From: Void Singer
no but you do need to typcast to list

avList = (avList=[]) + avList + (list)avKey;

;)

Yep, you are right but I was curious because it will work like I entered it so I did a quick comparison, touching each 4 times:

CODE

list avList;
integer findlist;

default
{
touch_start(integer total_number)
{
key avKey = llDetectedKey(0);
avList = (avList=[]) + avList + [avKey];
findlist = llListFindList(avList, [avKey]);
if (findlist > -1)
{
llOwnerSay((string)llGetFreeMemory());
}
}
}

returns:
8:47] in brackets: 15695
[8:47] in brackets: 15647
[8:47] in brackets: 15599
[8:47] in brackets: 15551
CODE

list avList;
integer findlist;

default
{
touch_start(integer total_number)
{
key avKey = llDetectedKey(0);
avList = (avList=[]) + avList + avKey;
findlist = llListFindList(avList, [avKey]);
if (findlist > -1)
{
llOwnerSay((string)llGetFreeMemory());
}
}
}

returns:
[8:47] no typecast: 15702
[8:47] no typecast: 15654
[8:47] no typecast: 15606
[8:47] no typecast: 15558
CODE

list avList;
integer findlist;

default
{
touch_start(integer total_number)
{
key avKey = llDetectedKey(0);
avList = (avList=[]) + avList + (list)avKey;
findlist = llListFindList(avList, [avKey]);
if (findlist > -1)
{
llOwnerSay((string)llGetFreeMemory());
}
}
}

returns
[8:47] type cast as list: 15700
[8:47] type cast as list: 15652
[8:47] type cast as list: 15604
[8:47] type cast as list: 15556

Not exactly the results I expected. Guess we need to revisit the memory hack but this seems to be showing that no typecasting may end up being actually more memory efficient.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-10-2007 18:21
More trouble in paradise Aniam. Gonna have to put a for in it to work through the list of keys and rezz the ones not in the list or remove the ones that have left.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
1 2