PDA

View Full Version : Light surrounding link



cbailey78
10-25-2006, 01:29 AM
I would like a FF combo script that light would surround link like in LTTP in dark rooms. all you would have is a bunch of black tiles with a hole in the center. assign a script that the FF combo follows link's movement.

Saffith
10-25-2006, 02:37 AM
The script itself isn't too hard. This should be enough:

const int X_OFFSET=248;
const int Y_OFFSET=80;

ffc script Darkness
{
void run()
{
while(true)
{
this->X=Link->X-X_OFFSET;
this->Y=Link->Y-Y_OFFSET;
Waitframe();
}
}
}
The X and Y offsets would be how far Link is from the top-left corner of the FFC.

The problem is, FFCs don't appear until after the screen stops scrolling, so the screen would be visible while Link was still walking into it. You might be able to get around that by using a solid black overhead layer that instantly cycles to invisibility, but I'm not certain that would do it. Even if that works, I think the screen would light back up when Link started walking to the next. The carry-over flag might solve both problems, but I'm not at all certain about that.

cbailey78
10-26-2006, 05:37 PM
Thanks! I'll try that!

cbailey78
10-27-2006, 02:56 AM
Once I import that script, It gave me an error message saying "Unable to parse instruction 1 from script filename.txt The error was: Invalid instruction.. The command was (int) (X_OFFSET=248,)

Any ideas why?

Saffith
10-27-2006, 08:39 PM
Don't use Import FF Script; use Compile ZScript.

cbailey78
10-27-2006, 10:12 PM
OK, Thanks!

Saffith
10-28-2006, 01:54 AM
Come to think of it, the way tile width and height work, I'm pretty sure it'd take at least two screen-wide FFCs moving together to make this work.
Unfortunately, it turns out you can't have FFCs that large - tile width and height are capped at 4 (I'd've mentioned it before, but I just found out myself (http://www.armageddongames.net/showthread.php?p=1097992#post1097992)). That means you need at least 12 of them to cover the 16*11 tile screen. If you want Link to be able to move anywhere near the corners, it'll take 48, since you basically have to cover an entire screen in each diagonal direction. You're only allowed to have 32 FFCs, so you can't do it that way. It'd require a more complex script, one which moves FFCs around so that the screen is always covered. That's a lot harder to do than just following Link, especially considering the language doesn't (currently) let you create arrays.
I'm sorry to say it, but I don't think you'll be able to do this right now.