[slscripters] An oddity

7 views
Skip to first unread message

Chloe Constantine

unread,
Mar 29, 2012, 3:12:54 PM3/29/12
to secondlif...@lists.secondlife.com
I was optimizing some code recently and, in particular, considering compiling it with lsl and mono to see which gives the smaller footprint. (Before you remind me about setting the memory limit in mono the mono compiled script is around 24k (40k free) and the lsl compiled script is around 7k - measured the same way.) The script contains code of the following form:

string a = "...";
string b = "...";                 // where the quoted string is a UUID

list allowed = [a, b];

and then, later, a test

if (llListFindList(allowed, [(string)llGetCreator()]) == -1)

This works in both lsl and mono compiled scripts.

Now, change the type of a and b from string to key and drop the case of llGetCreator from key to string

In a mono compiled script the test evaluates to TRUE (assuming that the script is in a prim created by a or b) and yet to FALSE in lsl compiled scripts.

Is this a known problem? And, if it is, where is the problem?

Many thanks,
Chloe

Martin Fürholz

unread,
Mar 29, 2012, 3:32:44 PM3/29/12
to Chloe Constantine, secondlif...@lists.secondlife.com
For me your script works as expected, whether it's compiled with Mono or not.
 
Tested with:
 
Second Life 3.3.0 (251182) Mar 15 2012 11:29:12 (Second Life Release)
Second Life Server 12.02.24.249991
 
Kind regards,
MartinRJ

 
 -----Ursprüngliche Nachricht-----
Von: secondlifescr...@lists.secondlife.com [mailto:secondlifescr...@lists.secondlife.com] Im Auftrag von Chloe Constantine
Gesendet: Donnerstag, 29. März 2012 21:13
An: secondlif...@lists.secondlife.com
Betreff: [slscripters] An oddity

Martin Fürholz

unread,
Mar 29, 2012, 3:34:48 PM3/29/12
to Chloe Constantine, secondlif...@lists.secondlife.com
Nevermind my last email. Testing again. :)
-----Ursprüngliche Nachricht-----
Von: secondlifescr...@lists.secondlife.com [mailto:secondlifescr...@lists.secondlife.com] Im Auftrag von Chloe Constantine
Gesendet: Donnerstag, 29. März 2012 21:13
An: secondlif...@lists.secondlife.com
Betreff: [slscripters] An oddity

Martin Fürholz

unread,
Mar 29, 2012, 3:43:04 PM3/29/12
to Chloe Constantine, secondlif...@lists.secondlife.com
Alright, there IS some oddity.
 
If you declare "list allowed" at global level there will happen the discrepancy you've mentioned ( TRUE == llListFindList(allowed, [llGetCreator()]) == -1 ) if LSL, ( FALSE == llListFindList(allowed, [llGetCreator()]) == -1 ) if MONO - compiled.
 
But if you declare list allowed = [a,b] inside the touch-event for example, it works the same way for mono and LSL - scripts.
 
Kind regards.
-----Ursprüngliche Nachricht-----
Von: secondlifescr...@lists.secondlife.com [mailto:secondlifescr...@lists.secondlife.com] Im Auftrag von Chloe Constantine
Gesendet: Donnerstag, 29. März 2012 21:13
An: secondlif...@lists.secondlife.com
Betreff: [slscripters] An oddity

Martin Fürholz

unread,
Mar 29, 2012, 4:12:05 PM3/29/12
to Chloe Constantine, secondlif...@lists.secondlife.com
key a = "some valid uuid";
key b = "some valid uuid";
list allowed = [a,b];
default
{
 
}
 
Only if compiled with LSL and if "list allowed" is declared global the list-entries will be of type key.
 
If "list allowed" is declared (or assigned) in an event the list-entries will be of type string.
If "list allowed" is declared (or assigned) in a mono-compiled script the list-entries will be of type string.
-----Ursprüngliche Nachricht-----
Von: secondlifescr...@lists.secondlife.com [mailto:secondlifescr...@lists.secondlife.com] Im Auftrag von Chloe Constantine
Gesendet: Donnerstag, 29. März 2012 21:13
An: secondlif...@lists.secondlife.com
Betreff: [slscripters] An oddity

Martin Fürholz

unread,
Mar 29, 2012, 4:22:36 PM3/29/12
to Chloe Constantine, secondlif...@lists.secondlife.com
-----Ursprüngliche Nachricht-----
Von: secondlifescr...@lists.secondlife.com [mailto:secondlifescr...@lists.secondlife.com] Im Auftrag von Chloe Constantine
Gesendet: Donnerstag, 29. März 2012 21:13
An: secondlif...@lists.secondlife.com
Betreff: [slscripters] An oddity

Reply all
Reply to author
Forward
0 new messages