PDA

View Full Version : Waitdraw()



Joe123
06-07-2008, 03:27 AM
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?

Gleeok
06-07-2008, 03:50 AM
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:

Joe123
06-07-2008, 04:04 AM
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.

The_Amaster
06-07-2008, 09:40 AM
Maybe if you want the global not to apply to that screen you counter it with the FFC script? :shrug:

Joe123
06-07-2008, 09:58 AM
Perhaps.

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

The_Amaster
06-07-2008, 11:09 AM
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...

beefster09
06-07-2008, 12:10 PM
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.

jman2050
06-10-2008, 09:53 PM
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.

Joe123
06-14-2008, 05:31 AM
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!

LinktheMaster
07-06-2008, 01:26 PM
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?

Joe123
07-06-2008, 01:45 PM
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.