[SOLVED] Odd Wait for Key Press Problem

XanMag
Here is the code I have for a pretty basic script for 'knock on door'

MakeObjectVisible (grumpy man)
msg ("You knock on the door and wait patiently. In a matter of seconds the door opens a crack. You thought that maybe a brief breeze opened the door because you see no one looking back through the crack. <br/><br/>\"What do you want?\" grumbles a gruff voice. <br/><br/>You step back in surprise.<br/><br/>\"Down here.\" <br/><br/>You look down. About four feet off the ground you see a set of eyes peering back, surrounded by a dark face. The inside of the shanty is too dark to see much more than that.<br/><br/>That is one short guy...")
PrintCentered ("<br/>Please press any key.")
wait {
}
msg ("<br/>After an awkward pause... \"How rude.\" <br/><br/>The grumpy man slams the door in your face.")
MakeObjectInvisible (grumpy man)


I have a 'PrintCentered' message there to press a key because the default color for the built-in 'press a key' is black and so is my background. The problem I have is that when I play, it totally skips the press a key and runs all of that script. When I go to type again, it skips a few letters and begins typing?!? Now... odder yet. When played from the editor, I skip the initial wait for key press as described above, but when I play it online, everything prints and I get the blue 'Continue...' at the bottom of everything!

I type 'knock on door', it runs the whole script skipping the wait script, and it lags two characters when I type my next command in. I did not get the two character space online as I did in the editor.

What's going on with this?

Stumbled on to this... viewtopic.php?f=10&t=5787&p=40120&hilit=key+press#p40120
Is this my problem? If so, the OP says he'll just show command bar and hide command bar before and after the wait for key press. I'd rather not do that and just stick with typing my own "Press any key to continue" text unless that is what is causing the mess up.

Thanks!

Pertex
All Commands, which should happen after the keypress must be within the bracket


PrintCentered ("<br/>Please press any key.")
wait {
msg ("<br/>After an awkward pause... \"How rude.\" <br/><br/>The grumpy man slams the door in your face.")
MakeObjectInvisible (grumpy man)
}

XanMag
It works, but out of curiosity, why would that just randomly happen when I add that script in the GUI? Is it in the series of how things were done? I've never had this happen with 'wait' scripts before. Thanks.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums