Jump to content

aaah syntax error!


Ellie Oddenfen
 Share

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

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

Recommended Posts

I'm very new to  scripting. I'm trying to make a script that will have the object become fullbright when you step on it, and then go back to normal when you're not stepping on it. So this is what I have:

default
{
    state_entry()
    {
        //do nothing...
    }

    collision_start(integer x) //when bumped
    {
        llSetPrimitiveParams([
            llSetPrimitiveParams
            ([PRIM_FULLBRIGHT,ALL_SIDES,TRUE]);
           
            }
    collision_end(integer x)
    {
       
        llSetPrimitiveParams([
            ([PRIM_FULLBRIGHT,ALL_SIDES,FALSE]);
     }
}


And when I try to save it it always says (11, 46) : ERROR : SYNTAX ERROR

What the heck is a syntax error and how do I fix it?

Link to comment
Share on other sites

default
{
    state_entry()
    {
        //do nothing...
    }

    collision_start(integer x) //when bumped
    {
        llSetPrimitiveParams
       
            ([PRIM_FULLBRIGHT,ALL_SIDES,TRUE]);
          
            }
    collision_end(integer x)
    {
      
        llSetPrimitiveParams(
           [PRIM_FULLBRIGHT,ALL_SIDES,FALSE]);
     }
}

Link to comment
Share on other sites

It's easier to see the error if you don't split a statement in the middle so that it ends up on separate lines. Here's a more compact version of the corrected script that Osprey just posted.....

default{    collision_start(integer x) //when bumped    {        llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,TRUE]);    }    collision_end(integer x)    {        llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,FALSE]);    }}

 Notice that the state_entry event is no longer there too.  You don't really need it unless you are actually doing something when you enter the state.

In general, a syntax error means that you have mistyped something .... misspelled a word, failed to capitalize something, forgotten to put a semicolon at the end of a statement, miscounted } brackets or parens ......  Unfortunately, the message is too vague to be helpful, which is why it makes sense to do scripting in a good offline editor that has more informative error messages. 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4702 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
 Share

×
×
  • Create New...