Error (Line 6): PE04: Parse error at '4.'

Started by testingstuff, Mon 07/08/2006 01:18:32

Previous topic - Next topic

testingstuff

test

Ashen

#1
It should be cAge.Animate(...), or at a push character[AGE].Animate(...). AGE is just an internal define you can use instead of the character number (which would make it character 4, I guess), while Chaacter.Animate needs a pointer (the Script-o-name of the character).

Also, you've got a '.' instead of a ',' after the third parameter (Repeat-style, and you might want to use the enum here anyway - the number will WORK, but isn't  eRepeat easier to read?)
I know what you're thinking ... Don't think that.

testingstuff

#2
test

Ashen

#3
Yep, you got it - AGS is case-sensitive, remember.

Like I said, the script name of a character (in this case AGE) is basically an int AGS creates set to the number of the character - since the error seemed to be reading AGE. as 4., (parse error at '4.') I just took a guess that was the character number. The script-o-name (cAge) is a pointer, equivilant to character[AGE], but quicker to type.

If you haven't read it already, you might find the Introduction to Pointers helpful, and they're dealt with in a few threads around the forum.
I know what you're thinking ... Don't think that.

Khris

"AGE" is replaced with the number directly before the script is compiled.
So "AGE.Animate" became "4.Animate" and thus the Compiler reported it couldn't compile "4." That's how Ashen knew the number.

Btw: as soon as you've typed "cag" or "cAG", AGS's auto-complete kicks in, opening a little window allowing you to select the known character cAge. When this happens, just press "." to make AGS write "cAge" and open another window with available functions and properties. This is very useful, I wonder why you don't use this?

edit: Ashen was quicker, posting anyway.

SMF spam blocked by CleanTalk