Potential game breaking bug with 'wait for keypress' function?

Has anyone else had issues when using this?

On several occasions now when uploading and testing my games online the game has completely failed to respond to this function, leaving the player with no option but to restart and try again.

I'd submit a ticket to GitHub but I think Alex has bigger concerns right now.


Anyone, please? I need to know whether I can risk going with these wait for keypress functions or need to find an alternative.


I use it constantly and have never had a problem with it. Are you sure you're using it correctly? Try posting the code or a small section with it in it like...

msg ("")
wait {
   msg ("")
}

Well I don't code, I use the UI, so I can't see how I'm not using it correctly.

I usually use it followed by a move player script, which it turn normally starts with a clear screen script.

I suppose it could be the clear screen causing the problem, but I don't know.

For what it's worth, this is the one that sometimes fails when testing it online.

msg ("Bla bla bla")
wait {
  MoveObject (player, hallway)
}

Where hallway begins with a clear screen script.

Also, getting back to the thread question, if they use your idea, how will the player know they have to press a key to get the next sentence to appear?


if they use your idea, how will the player know they have to press a key to get the next sentence to appear?
When the code reaches the "wait" script a "Continue" button will appear below the text indicating that the players must press any key to continue.

So you do...

ClearScreen
msg ("")
wait {
 msg ("")
}

I use that a lot too, but in the downloaded version. If you're working online it might be different or work differently. For the downloaded version no errors or freezes happen unless you put the scripts in the wrong order...like this, for example...

ClearScreen
msg ("")
wait {
}
msg ("")

If you put them out of order like this then the bottom text will appear before you "Continue" which could be causing the error. You have to make sure the second message is inside of the "wait" especially if you have multiple scripts....for example...

ClearScreen
msg ("")
wait {
 msg ("")
 Clear Screen
 wait {
   msg ("")
  Clear Screen
  msg ("")
 wait {
   msg ("")
}
}
}

the 'clearscreen' Function/Script needs to be before/above your 'msg' Scripts, because it clears the screen faster than the human eye can read the msg, lol:

(notice also how the 'wait' is used prior to a 'ClearScreen', as this pauses the actions, allowing the person to read the message, and then upon hitting a keyboard key, the actions continue, and the screen is cleared)

(so, the pattern is: msg then wait then clearscreen ---and/or--- wait then clearscreen then msg, if you want to have the screen being cleared)

// an example combination/pattern:

(prior text is cleared, and after the entire scripting is done, the scripting's text is cleared --- this is just one example combination/pattern)

ClearScreen
msg ("1")
wait {
  ClearScreen
  msg ("2")
  wait {
    ClearScreen
    msg ("3")
    wait {
      ClearScreen
      msg ("4")
      wait {
        ClearScreen
      }
    }
  }
}

of course, clearing the screen is optional, you don't ahve to do it, depends on various factors and/or your desired game design.


I think OurJud's problem is probably with something else going on possibly in his code either in relation to the 'wait' or not.

We'd really need to see his entire game code, to see if it's a mistake on his/her part with something, or if he/she did find a bug in the quest's underlying coding.


there's a lot of issues when doing looping, as you can't have multiple 'waits', 'show menus', and/or 'get inputs' running at the same time, which happens when looping... Not sure if this is the culprit though for whatever is going wrong for OurJud's code/game.

other possible cause is having out of order scripts / wrong nesting-indenting... which can cause errors too.


I have pretty complicated "waits" and "showmenus" in Apocamorphosis --- and I haven't ever had a bug report of the continues not working in either the online version or the downloaded version. It has to be something conflicting in his game-code as you suggest HK. I can't see anything wrong with what he presented as an example, or the order.

If something is wrong with the code, he may need Pixie, Pertex, Jay, TinFoil or someone else to look as it's beyond my ability x_X Jud has been here far longer than I have!


also, another possibilty... if you alter the underlying code (filter -> show library elements), you can have issues, whether they're accidental (made an error) or unforeseen (you didn't make any mistakes but don't realize that it messes up other stuff or breaks the built-in functionality)


nothing is certain without seeing the entire game code (and even worse, any altered underlying/built-in code), as without doing both of these things, one can't say wheher it's a bug or not. By seeing the entire game code and any altered underlying/built-in code, only then do you eliminate the cause of human (err, NON-Alex-n-co: us users) error, and thus it's then a bug, either Alex-n-co/quest error, or really bad, OS/computer/other-software programmers' error, lol.


I'm reluctant to post my entire code because the issue is with my current game and I don't want to put it out there until it's finished.

One thing I can tell you, is that on the intro screen which uses the wait function, I can mouse click beneath the text and it brings the command cursor up, allowing me to type. I'm guessing that's not normal?


hmm... try to make a new game, without all your UI/effects you've done with your current game, and see if you got any issues with using 'wait'. And if you don't want to publically post your game code, that's completely understandable... just need to find someone and a means of communicating privately, so only that person will see your game code and try to find any mistakes, if there are any.


I think you and Anon are probably on the right track, as I can't say I've ever encountered it before.


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

Support

Forums