|
Lackern Eucken
Registered User
Join date: 16 Jul 2006
Posts: 3
|
10-23-2006 04:50
I get a syntax error in the seond line of the following code:
vector eul = <0,0,45>; //45 degrees around the z-axis, in Euler form eul = eul * DEG_TO_RAD; //convert to radians rotation ROTATION = llEuler2Rot(eul); //convert to quaternion
It's almost a copy from the llEuler2Rot example in the LSLwiki. All very simple but it seems to be wrong. Can anybody see the error?
thanx, Lackern Eucken (a newbie at scripting)
|
|
Flash Ferguson
Registered User
Join date: 8 Aug 2006
Posts: 96
|
10-23-2006 07:49
rotation ROTATION = llEuler2Rot(eul); //convert to quaternion
Probably this, since you're trying to use a reserved keyword as a variable name.
|
|
Lackern Eucken
Registered User
Join date: 16 Jul 2006
Posts: 3
|
10-23-2006 08:57
From: Flash Ferguson rotation ROTATION = llEuler2Rot(eul); //convert to quaternion
Probably this, since you're trying to use a reserved keyword as a variable name. Thanx for the response. Tried an other variable name but doesnt change the error message. The syntax error is in the second line, at the "=". Lackern Eucken.
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
10-23-2006 09:18
It compiles for me.
Can you put the rest of the script up, there's something silly in there... hmm, if this is all above the default statement, it's complaining because you are not directly assigning a global variable, you're trying to code a change to a global you've declared in a "reserved space" where you can only assign, not calculate.
I got it to compile whilst in the state_entry() event with no bother, which is what makes me think you're misusing the declaration space.
ROTATION is not a reserved word btw, rotation is, and the compiler is case sensitive.
|
|
Flash Ferguson
Registered User
Join date: 8 Aug 2006
Posts: 96
|
10-23-2006 09:32
From: Eloise Pasteur ROTATION is not a reserved word btw, rotation is, and the compiler is case sensitive. Didn't catch that. Thanks for clarifying.
|
|
Lackern Eucken
Registered User
Join date: 16 Jul 2006
Posts: 3
|
got it fixed!
10-28-2006 14:06
Thanks for the help!
It turned out I can not do any calculations outside a state_entry or any kind of function or what do you call it. One can only initialize variables...
So i moved all the lines with calculations into the stat_entry part. So the code was ok, but only in the wrong position, like you suggested, Eloise.
I hope I make myself intelligible.
Thanks, Lackern Eucken.
|