Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

limit to global variables

Danielz Shackle
Registered User
Join date: 30 Apr 2006
Posts: 100
05-16-2006 14:55
for some reason whenever ive tried to add another variablea t the top of my script it keeps getting sytax errors. i think i have about 14 right now. Is there a limit?
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
05-16-2006 15:07
Only memory issues.

It may be something silly like missing a semi-colon, redeclaring a variable name, misspelling its variable type, or trying to assign it a function derived value (vector start=llGetPos(); for example WON'T work for a global).
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
05-16-2006 15:49
I often use this online checker. This is so awesome. :)
_____________________
:) Seagel Neville :)
Danielz Shackle
Registered User
Join date: 30 Apr 2006
Posts: 100
05-16-2006 20:35
ive checked all those issues. everything is entered correctly and there are nor repteats. whenever i add another variable now, it actually jumps to a list i have later in script, and says error there, but if i take the variable off the op, the list is fine. And there is no repeats or things missing, checked all that
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
05-16-2006 21:05
I checked the following script at the lslint. And I got 20 "never used" warnings but not syntax errors. It is certain that this issue has nothing to do with the limitation of list.
CODE
list l01;
list l02;
list l03;
list l04;
list l05;
list l06;
list l07;
list l08;
list l09;
list l10;
list l11;
list l12;
list l13;
list l14;
list l15;
list l16;
list l17;
list l18;
list l19;
list l20;

default
{
state_entry()
{
llSay(0, "Hello Avatar");
}
}
_____________________
:) Seagel Neville :)
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-16-2006 21:27
Post the code in question and maybe we can give you more of an idea why it is happening.
Jigsaw Partridge
A man of parts
Join date: 3 Apr 2005
Posts: 69
05-16-2006 21:39
Danielz, I have encountered this sort of issue as well - usually if you try re-arranging your code, for example by moving some 'globals' to 'locals' if you are able, or vice versa, or even just moving functions around randomly, the problem disappears. I assume there is some sort of stack or complexity limit being reached within the LSL compiler itself.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
05-16-2006 23:49
If it's a list there's a limit shown in paragraph 4 of 72 items that can be included in the global declaration which could be causing it. The work around is to write two (or more) lists and join them together. Internally the vm will work with longer lists.

If that doesn't work could you post the script and/or the error message - just the globals bit should do.
Archanox Underthorn
Registered User
Join date: 20 May 2003
Posts: 168
05-17-2006 10:04
Just in case those didn't fix it, you can't set global variables with function calls in the global section.

ie- rotation globalrot = llGetRot(); would not work if you put it in the globals section

you would have to define rotation globalrot; at the top, and then in state_entry() do : globalrot = llGetRot()
_____________________
Archatek

Home to some of the highest quality katanas and other blades available in SL. Co-creator of the Samurai Island Combat System, one of the best melee combat systems available, come check it out!

___________________