PDA

View Full Version : How to check if there's a string displayed on the screen?



lucas92
03-02-2009, 08:30 PM
Everything's in the title. How can I know if there is a string displayed on the screen? I've tried that one:


if(Screen->Message(3))
//if message #3 is displayed, then do that code

But it doesn't seem to be a boolean... How can I do it?

pkmnfrk
03-02-2009, 09:25 PM
Screen->Message() displays a message. If there's already a message, it overwrites it.

Are you trying to ensure that Screen->Message() succeeds? (You don't need to, it's guaranteed) Or, do you just want to avoid showing multiple messages? (It won't.)

Perhaps you should investigate the "Messages Freeze All Action" rule, which stops your scripts from running while messages are being drawn (including if the player needs to press A to advance the message)

Edit: To answer the question directly, you can't check to see if there's a string on the screen.

Joe123
03-03-2009, 01:36 PM
Actually, you can!
If you use a string control code to give Link a dummy item at the beginning of your message and another one to remove it at the end, your script can check whether Link has the item - thus letting you know whether there's a message displayed.

'Messages Freeze All Action' is much better though.

lucas92
03-03-2009, 02:11 PM
I didn't thought that the rule was really freezing the script. Oh well, thanks. :)