CODE
import "std.zh"
ffc script cutscenescript
{
void run(int m)
{
while (Link->X == 120 && Link->Y == 120)
{
Screen->Message(m);
}
}
}
That should do the trick. :]
Just note three things:
1. Whenever you have a opening brace ({), you must have a closing brace (}).
2. All commands must have a semi-colon (
unless they are activating a loop, if statement, import, or function. In true C++ there are a few other exceptions, but those are the main ones in ZC.
3. The equal condition is ==. So when you're asking if two things are equal in an if statement or a loop, you must use two equal signs.
Hope that helps.
Edit: Actually, I wasn't paying attention. I was just trying to get the code to compile. Unfortunately that code I just gave won't actually do what you want.
CODE
bool exit = false
while(!exit)
{
if(Link->X >= 112 && Link->X <= 128 && Link->Y >= 112 && Link->Y <= 128)
{
Screen->Message(m);
exit = true;
}
Waitframe();
}
That'll work better. It'll loop until Link goes into that area and gets the message. Also I made it so that the condition isn't quite as picky since that could easily cause some frustration.
Edited by LinktheMaster, 03 August 2008 - 01:00 PM.