PDA

View Full Version : Simple Script - Help Needed



bigjoe
04-13-2007, 10:13 AM
I was looking at this thread (http://www.armageddongames.net/forums/showthread.php?t=94699), and I've decided to start with some simple scripts to get my mind in gear to move on to greater stuff.

This one is supposed to make an FFC move in a rectangle, but it doesn't start the last line of the rectangle. Can anyone help me with it? I know, it's pathetic, but I really cant figure out whats wrong.

Oh yeah, the FFC it has to start at 48,48 for it to work correctly.


EDIT: Fixed the script! I needed to use < and > instead of >= and <=.
Thanks to theplustwo for pointing that out.



ffc script m_rectangle
{
void run()
{
while(true)
{
// This part of the script starts the first line.

while(this->X < 200 && this->Y == 48)
{
this->X++;
Waitframe();
}
//This part of the script starts the second line.

while(this->X == 200 && this->Y < 128)
{
this->Y++;
Waitframe();
}
//This part of the script starts the third line.

while(this->X > 48 && this->Y == 128)
{
this->X--;
Waitframe();
}
//This part of the script starts the fourth line.

while(this->X == 48 && this->Y > 48)
{
this->Y--;
Waitframe();
}
}
}
}