Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

New puzzle

LordJason Kiesler
imperfection inventor.
Join date: 30 May 2004
Posts: 215
09-02-2005 02:19
CODE
integer asd = -1;
integer some_integer = -456;
integer some_integers_Friend;
integer some_integer2 = -4567;
integer some_integer2s_Friend;
integer some_integer3 = -45678;
integer some_integer3s_Friend;
key owner;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
integer asdf;
integer asdfg;
list asdfgh = [0, 7];
list asdfghj = [3, 24];
list asdfghjk = [5, 96];
list asdfghjkl = [7, 384];
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
list L1 = ["link", "fill", "up", "your", "hearts"];
list L2 = ["so", "you", "can", "shoot"];
list L3 = ["your", "sword", "with", "power"];
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//integer something_index;
integer index1;
integer index2;
integer index3;
integer no_name_stride = 4;
list no_name_data = [
0, 0, 0, 100,
0, 0, 0, 100,
0, 0, 0, 100,
0, 0, 0, 100,
0, 0, 0, 100,
0, 0, 0, 100,
0, 0, 0, 100
];
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
integer important_data_stride = 8;
list important_data = [
0.0, 2.0, 1.5, 1.5, 0.0, 0.5, 0.5, 10.0,
0.0, 0.0, 2.0, 2.0, 0.5, 0.5, 0.5, 10.0,
0.5, 0.0, 0.0, 1.5, 0.5, 1.5, 0.5, 10.0,
1.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 10.0,
0.5, 0.5, 2.0, 0.5, 0.0, 0.5, 0.5, 10.0,
0.0, 0.5, 0.0, 0.5, 1.5, 0.0, 2.0, 10.0,
0.5, 0.0, 2.0, 1.5, 0.5, 0.0, 0.0, 10.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10.0
];
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
default{
state_entry(){
llSay(0, (string)llGetFreeMemory());
}
link_message(integer sender, integer channel, string message, key id){
//
}
}



A LOT of things have been removed, and renamed but the question is, Why wont this compile?

It just gives a simple syntax error, And there is none.
The first guess was perhaps Memory, and if you remove one integer, it will compile. "And say there is over 10000 bytes free."
Of corse adding that one extra integer decleration back in shouldnt take over 10000 bytes of memory, But the script wont compile.
BUT then you can put 11 copys of the lists into an already global declerations monstor particle script for example and it will still compile.

OR you could remove an integer to get it to compile. Then declare one of the lists as []; to start with, then assign the values in state_entry, then it will act as if there is a syntax error again.

Im not sure what all of this means.
_____________________
"no, my alt is clean on crashing any sims"
Torne Kavanagh
Registered User
Join date: 23 Jun 2005
Posts: 11
09-02-2005 06:43
The compiler limits the number of items you can have in a list declaration, whether you do it at variable declaration time or in state_entry, or anywhere. The wiki claims the limit is 72, but it seems to actually be lower than that, possibly it's based on total byte size, not number of items.. certainly I've hit the limit with lists with only 50 or so elements where some of them were vectors..

Try splitting the list:
list important_data_1 = [ half the items ];
list important_data_2 = [ the other half ];
list important_data = important_data_1 + important_data_2;

The wiki page on lists has more info, perhaps; basically there is no limit on how long a list can be, when the script is running, other than the available memory, but a single list written in the code using [ ] can only be a certain length.