At the beginning of my game, bombs are a bit crucial and I wanted to make sure the character could get a refill without continuing to load up to the max infinitely. I also wanted to try my hand at scripting, this is my first script.
import "std.zh"
ffc script bomb_refill {
void run() {
itemclass bombclass = LoadItemClass(IC_BOMB);
if ( (Link->X - this->X) <= 16 ) {
if( 0 <= (Link->X - this->X) ) {
if ( (Link->Y - this->Y) <= 16 ) {
if ( 0 <= (Link->Y - this->Y) ) {
if (Link->Item[3]) {
Link->Item[3]=true;
bombclass->Counter[CR_BOMBS]=4;
}
else {
if (bombclass->Counter[CR_BOMBS]<4) {
bombclass->Counter[CR_BOMBS]=4;
}
}
}
}
}
}
}
}However, when I try to compile this, it tells me the signature doesn't match for LoadItemClass(float). I've tried using the const from std.zh, as above; I've tried just typing in 27; and because it mentions it as float, I've also tried typing 0.0027. All return the same error. I've also tried just putting LoadItemClass in everywhere I used 'bombclass', but then it told me it wasn't expecting the arrow. What am I doing wrong? I've looked at some code on the forums, I've read the documentation from the stickied thread, but I don't think I've seen an example specifically of LoadItemClass being used. Although CDawg's enemy HP modifier had similar syntax...
I'd just like to know what I'm missing. I've already gone through a lot correcting errors, and learning all the while. But this one has me stumped.
