pkmnfrk
03-17-2009, 07:27 PM
If I understand this correctly, we now have a means of inter-object communication. This is awesome! This means we can create (for example) a boss with two heads that act independantly, but can create combo attacks, or something.
There is one tiny thing I would like to ask for, if I may. That is, the ffc->Script variable, which returns the script slot assigned to the FFC. This would allow us to identify an FFC, no matter what slot it's in. This is most useful for carry over FFCs, and FFCs that are "general purpose" (i.e. may be used on more than one screen).
So, we could do something like this:
ffc script Crystal {
int tog;
while(true) {
if(<Link hits me with the sword>) {
tog = (tog + 1) % 2
for(int i = 1; i <= 32; i++) {
ffc f = Screen->LoadFFC(i);
if(f->isValid() && f->Script == 24) {
f->Misc[0] = tog;
}
}
}
}
}
//this script is in slot 24
ffc script Barrier {
void run() {
while(true) {
if(this->Misc[0] == 0) {
//no barrier
} else if (this->Misc[0] == 1) {
//barrier
}
}
}
}
This is just off the top of my head, and the idea needs work, but yeah. It would be awesome.
There is one tiny thing I would like to ask for, if I may. That is, the ffc->Script variable, which returns the script slot assigned to the FFC. This would allow us to identify an FFC, no matter what slot it's in. This is most useful for carry over FFCs, and FFCs that are "general purpose" (i.e. may be used on more than one screen).
So, we could do something like this:
ffc script Crystal {
int tog;
while(true) {
if(<Link hits me with the sword>) {
tog = (tog + 1) % 2
for(int i = 1; i <= 32; i++) {
ffc f = Screen->LoadFFC(i);
if(f->isValid() && f->Script == 24) {
f->Misc[0] = tog;
}
}
}
}
}
//this script is in slot 24
ffc script Barrier {
void run() {
while(true) {
if(this->Misc[0] == 0) {
//no barrier
} else if (this->Misc[0] == 1) {
//barrier
}
}
}
}
This is just off the top of my head, and the idea needs work, but yeah. It would be awesome.