PDA

View Full Version : FFC Activations



LinktheMaster
06-15-2008, 09:36 AM
I was just wondering when FFC scripts are activated. Are they activated no matter what when Link enters the room, or are they activated on the first instance when their combo is set to something other than combo 0?

The reason I'm asking is because I have a FFC that I want to be bouncing around the screen, but it's only going to be on the screen maybe 1/4 of the time. The rest of the time I want it to be a nice little FFC sitting in the top left corner out of the way. When I need it, I was hoping that simply moving it to the main screen and changing its data to something other than combo 0 would initiate the run method of the FFC.

_L_
06-15-2008, 01:27 PM
Unfortunately!
* When an FFC is deactivated, it cannot be reactivated.
* The run() method is executed only when Link enters the screen (or, if a certain checkbox is checked, just before Link enters the screen.)

ScaryBinary
06-15-2008, 01:37 PM
I think if the Data of the combo is 0, the script won't run at all. So I think you'll have to do something like this:

Have the FFC Data (ID) start out as the ID of some fully transparent combo (I use 1, in the Pure tileset). Or, if you want to see the FFC, position it where you want it and assign it the appropriate ID. Or like you mentioned, move it off the screen somewhere. The important thing is to know what the IDs of the "inactive" and "active" states of the FFC are.

When you need the FFC to be "active", set the ID to the appropriate combo. In your FFC script, check what the ID is...if it's your "inactive" ID, then you don't need to do anything except check to see if the FFC should be "active". If it's the "active" ID, then do whatever it is you need to do.

Maybe something like this in an ffc script:
const int FFC_INACTIVE = 1;
const int FFC_ACTIVE = 230 // ...or whatever.
while(true){
if (this->Data == FFC_ACTIVE){
// ... do your active processing here. You'll need to have a way
// to set the Data to FFC_INACTIVE at the appropriate time.
if (your_inactive_condition_here){
this->Data = FFC_INACTIVE;
}
}
else if (this->Data == FFC_INACTIVE){
// You'll need to have a way to set the Data to FFC_ACTIVE
// at the appropriate time.
if (your_active_condition_here){
this->Data = FFC_ACTIVE;
}
}

// Make sure other Zelda Classic processing gets performed
// while we're in the "infinite" loop...
Waitframe();
}

LinktheMaster
06-16-2008, 07:53 AM
Yeah, I thought of that work around. It's still a bit annoying, but oh well. I noticed that you personally can't even call the run command of ffcs, which sucks too.

Oh well. Thanks for the help. :]