pkmnfrk
07-30-2008, 04:49 PM
Ok, so, like, I've made a custom block-trigger script that will trigger only if the "right" block is placed upon it. If it's right one, then the block is made un-movable, regular block trigger style. If not, then nothing happens, and you can keep pushing. (The ideal behaviour would be that it won't let you push it on to the wrong one at all, but I haven't figured out how to do that yet)
http://zctut.com/zelda006.png
However, my problem is this:
http://zctut.com/zelda007.pnghttp://zctut.com/zelda008.png
http://zctut.com/zelda009.pnghttp://zctut.com/zelda010.png
That's right, the combo that represents the trigger (actually an invisible ffc) is being over written by the under combo!
This isn't an issue for normal block-triggers, since any push-block will do.
The first thing I started with was having the block-trigger graphics be on the FFC itself, instead of a normal combo. This worked fine, except that the FFC covered up the block when it wasn't moving (moving blocks are on Layer 2.5, yes?).
So, then I changed it to what we have now. Different problem, results as described above.
So, I thought about scripting solutions. The script itself is this:
ffc script BlockTrigger {
void run(int cmb, int D, int v) {
int o = 0;
while(true) {
if(Screen->ComboD[ComboAt(this->X, this->Y)] == cmb) {
Screen->D[D] = v;
Screen->ComboF[ComboAt(this->X, this->Y)] = 0;
Screen->ComboI[ComboAt(this->X, this->Y)] = 0;
} else {
Screen->D[D] = o;
}
Waitframe();
}
}
}
I could make it so that it constantly writes the trigger combo to its position until the right block is pushed, but then that would erase incorrect blocks.
So, I guess that I either need to figure out how to prevent the wrong block being pushed onto it, or how to restore the tile to its former glory.
Or, I guess, how to make FFCs appear on Layer 1.
http://zctut.com/zelda006.png
However, my problem is this:
http://zctut.com/zelda007.pnghttp://zctut.com/zelda008.png
http://zctut.com/zelda009.pnghttp://zctut.com/zelda010.png
That's right, the combo that represents the trigger (actually an invisible ffc) is being over written by the under combo!
This isn't an issue for normal block-triggers, since any push-block will do.
The first thing I started with was having the block-trigger graphics be on the FFC itself, instead of a normal combo. This worked fine, except that the FFC covered up the block when it wasn't moving (moving blocks are on Layer 2.5, yes?).
So, then I changed it to what we have now. Different problem, results as described above.
So, I thought about scripting solutions. The script itself is this:
ffc script BlockTrigger {
void run(int cmb, int D, int v) {
int o = 0;
while(true) {
if(Screen->ComboD[ComboAt(this->X, this->Y)] == cmb) {
Screen->D[D] = v;
Screen->ComboF[ComboAt(this->X, this->Y)] = 0;
Screen->ComboI[ComboAt(this->X, this->Y)] = 0;
} else {
Screen->D[D] = o;
}
Waitframe();
}
}
}
I could make it so that it constantly writes the trigger combo to its position until the right block is pushed, but then that would erase incorrect blocks.
So, I guess that I either need to figure out how to prevent the wrong block being pushed onto it, or how to restore the tile to its former glory.
Or, I guess, how to make FFCs appear on Layer 1.