Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Waitdraw()

10 replies · 3,820 views · Started 07 June 2008

void Waitdraw()

Temporarily halts execution of the current script until after the other game processing is done, but before the screen is rendered.

What is the purpose of this function?

I believe the order of scripts goes item->ffc(1,2,3....32)->Global. So I'm assuming if you stuck a Waitdraw(); in ffc(1), it would be the last script to be executed, instead of the first ffc script to be executed.

..I think. :eyebrow:

Well, I'm assuming it's:
item->ffc(1,2,3....32)->Global->Game Processing->Functions declared after Waitdraw(), but I'm just asking where it might be useful.

Perhaps.

If I wanted to stop the global script just on one screen though, I'd use a global boolean.

Eh, the only thing I can really think of is if a script that ran after the FFC messed with it, and so you wanted it to run last...

I've used it before. It's pretty nice if you want to lock Link's direction.

This is the order of stuff. (i'm pretty sure):
Stuff before a Waitdraw()->built in game processing->Stuff after Waitdraw()->The actual sprites get drawn.

Normally a global script runs before engine processing. If you wanted to, say, correct Link's position manually via scripting, you would be correcting his position in the PREVIOUS frame, which had already been drawn by the time you actually mess with it. By correcting his position after using Waitdraw(), you ensure that you change Link's position to what you want it to be before the screen is drawn.

That's just an example, but you get the idea I hope.

Yes!
Actually, I do want to use that.

Would I still put Waitframe aswell?
Or just Waitdraw and then end the loop?

I'm assuming I need both?

EDIT:
Yay, I do need to use both, and it does work!
Wooo!

Sorry to revive this, but I was wondering...

Does the Waitdraw() function only really come in handy for Global scripts, or are there other instances when it'll be needed?

Depends what you wanna do really.
If you want to make Link continue facing in a certain direction after moving, or stop an enemy from moving around like crazy when you're trying to keep its coordinates constant, it's great.
I'm sure there are plenty of other uses, I don't see why it'd be restricted to global scripts only.

Might be hard to find a useful application in an item script though, I dunno.