Jump to content
You are about to reply to a thread that has been inactive for 77 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Posted

I have been working on a script for awhile and all of a sudden I now get syntax errors on very simple operations. I have created a very simple test that duplicates the error I'm getting. Does anyone have any idea what is causing this, maybe a setting somewhere? The example is:

integer a;
a = 1;

default
{
    state_entry()
    {
        llSay(0, "Hello, Avatar!");
    }

    touch_start(integer total_number)
    {
        llSay(0, "Touched.");
    }
}

Line 1, a=1; gives me a syntax error. I get the error for any new code I add to the script which is 272 lines of code. As you can see in the example above, it happens for smaller scripts also.

Thanks, Corban

Posted
1 minute ago, Corbannn said:

Line 1, a=1; gives me a syntax error

You can't do assignment outside of event scope. you either have to do the assignment in the variable declaration, or move it to the state_entry() event:

integer a=1; // fine
// a=2; // error, asignment outside of event scope.
// key owner = llGetOwner(); // error, function execution outside of event scope, would need to be in state_entry()
key owner;
default
{   state_entry()
    {   a=2;
        owner = llGetOwner();
    }
}

 

  • Thanks 1
Posted

Thanks, I appreciated the response. It fixed my problem. Sometimes I get a short in the headset and can't seem to see what's going on. Thanks again.

You are about to reply to a thread that has been inactive for 77 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...