PDA

View Full Version : Creating a Waitframe timer.



sps999
01-01-2010, 03:14 AM
I was wondering if there was (and I'm very confident there is) any specific way your really expected to make something for a frame countdown. I've looked at a couple of scripts and have seen something like counter-- and stuff like that, but I couldn't figure it out. To work around that, I used a Random Number.


ffc script Norfair_Room {
void run() {
while(true) {
if (!Link -> Item[17] && (Rand(60) == 30)) { //BAM! There it is.
Link -> HP = Link -> HP - 4;
}
Waitframe();
}
}
}


But I just wanted to kow what the real way to countdown time was. When I tried waitframes(); I would always get a bunch of compiler errors that I didn't feel like trying to figure out, and I couldn't undertstand the counter-- method, so yeah.

Joe123
01-02-2010, 03:12 AM
That's not a timer at all...

All of the in-built functions and those contained within std.zh are capitalised (apart from one that I can think of), so the correct function to call is 'Waitframes();'. Make sure to also ' import "std.zh" ', as Waitframes() is defined in the header file.


ffc script Norfair_Room {
void run() {
while(!Link->Item[17]) {
Waitframes(30);
Link->HP -= 4;
}
}
}

sps999
01-02-2010, 05:01 AM
That's not a timer at all...


Yeah, I knew that, pretty much why I made the post in the first place. I might have been getting the errors because I didn't import std.zh. Thanks a ton.