Author Topic: [Bug?] SkipUntilCharacterStops disabled with repeatedly_execute  (Read 1576 times)

I don't know if this is a bug or if I did something wrong (I don't think so?), but it seems that whenever I place any code in my room's repeatedly_execute function (it can be any code, from one line to a 100 lines) then SkipUntilCharacterStops is disabled.

I originally discovered this while keeping the text on an overlay updated (for debugging purposes). The problem seemed to resolve itself after I removed the offending lines (all of them!) from repeatedly_execute.

Phemar, since we have so many versions of AGS, including versions in development, please state which version you are using.

(And I am asking this to anyone reading this: if you are going to report a bug, first thing tell which version of AGS you are using, so that we will at least know where to start looking).

Second question, where do you call SkipUntilCharacterStops from?

Sorry Crimson, I'm using the latest release - build I call SkipUntilCharacterStops from inside a module's on_key_press.

Code: Adventure Game Studio
  1. function on_key_press (eKeyCode keycode) {
  3.   if (Queue.Playing()) {     // If an interaction is playing
  5.     if (keycode == eKeySpace) {
  7.       if (oSpeech.Valid) {    // If speech is currently displayed
  9.         if (t == p)   // If it's the last command in the series of commands for the interaction
  10.           Queue.Stop (eQueue_Reset);  // Stop the interaction
  12.         else {
  13.           Queue.Stop (eQueue_DontReset);  // Skip the current line of speech
  14.           Queue.Resume ();
  15.       } }
  17.       ClaimEvent ();
  19.     }
  21.     if (keycode == eKeyEscape) {
  22.       if (player.Moving)
  23.         SkipUntilCharacterStops (player.ID);  // If the move command is part of a scripted command
  24.       else {
  25.         Queue.Stop();  // Stop the current interaction
  26.         ClaimEvent ();
  27.     } }
  29.   }
  31.   else if (keycode == eKeyEscape)
  32.     SkipUntilCharacterStops  (player.ID);  // If the move command is a mouse command
  33. }
« Last Edit: 12 May 2013, 09:24 by Phemar »

Manual sais:


Skips through the game until the specified character stops walking, a blocking script runs, or a message box is displayed.

I put few random math operations (like int a = 10 + 10) into repeatedly_execute and that seem to work fine.
Then I made gui toggle its visibility off and on there, and skip stopped working.

Hmmm. I've designed my game in such a way that not a single blocking command is called throughout the entire script. As you might be able to tell from the example I posted above, I've basically written my own scripting engine in AGS. It can run any command non-blocking, such as character.Say and Wait etc.
The downside to this is that it's a little bit slower (only one command per game loop), but the effect on gameplay is worth it.

The only command I had in repeatedly_execute was Overlay.SetText, which shouldn't stop SkipUntilCharacterStops, should it? It's not blocking, it's not a message box and nor does toggle a GUI.

Oh well.

I too think it's a bit strange. I am going to check the engine code more. I am not sure why setting gui property is counted as blocking in this case.


I know this infinitely old, but has anyone ever encountered this bug yet? I am trying to implement double click to teleport a character to the destination using SkipUntilCharacterStops, but it doesn't work at all. (using
« Last Edit: 13 Jan 2019, 17:03 by eri0o »