OK, let's get right to it.
I downloaded Geoffkhan's sample game, and I noticed a very smart function that he put in there. Apparently he makes a function to make the character face left, right, etc...
So I was like "Dude, I am so ripping this."
So I copied it and then I pasted it in my global script:
Quote
function faceback () {
FaceLocation(GetPlayerCharacter(),160,-1000);
}
function facefront () {
FaceLocation(GetPlayerCharacter(),160,1000);
}
function faceleft () {
FaceLocation(GetPlayerCharacter(),-1000,100);
}
function faceright () {
FaceLocation(GetPlayerCharacter(),1000,100);
}
So then I tried to implement it in my game:
Quote
DisplaySpeech(1, "I'm going to check this out.");
faceright();
I get an "undefined token" error message.
Why is AGS doing this to me? I can't take it! I even copied and pasted it all, it should work!
Where did you paste it? The function has to be defined before it can be used, so make sure you pasted the function definitions near the top of the global script.
yeah, i actually did paste it at the very top of the global script. Thanks, though.
You are using these in a room script, I presume.
And you didn't "import" the functions.
EDIT:
OK, i got help from the master himself. Apperntly, I forgot about the script header...
silly me :-X