Adventure Game Studio | Forums

AGS Development => Editor Development => Topic started by: Phemar on 11 May 2013, 09:03

Title: [Bug?] SkipUntilCharacterStops disabled with repeatedly_execute
Post by: Phemar on 11 May 2013, 09:03
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.
Title: Re: [Bug?] SkipUntilCharacterStops disabled with repeatedly_execute
Post by: Crimson Wizard on 11 May 2013, 17:44
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?
Title: Re: [Bug?] SkipUntilCharacterStops disabled with repeatedly_execute
Post by: Phemar on 12 May 2013, 09:18
Sorry Crimson, I'm using the latest release - build 3.2.1.111. I call SkipUntilCharacterStops from inside a module's on_key_press.

Eg.
Code: Adventure Game Studio
  1. function on_key_press (eKeyCode keycode) {
  2.  
  3.   if (Queue.Playing()) {     // If an interaction is playing
  4.    
  5.     if (keycode == eKeySpace) {
  6.      
  7.       if (oSpeech.Valid) {    // If speech is currently displayed
  8.        
  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
  11.          
  12.         else {
  13.           Queue.Stop (eQueue_DontReset);  // Skip the current line of speech
  14.           Queue.Resume ();
  15.       } }
  16.      
  17.       ClaimEvent ();
  18.    
  19.     }
  20.    
  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.     } }
  28.  
  29.   }
  30.  
  31.   else if (keycode == eKeyEscape)
  32.     SkipUntilCharacterStops  (player.ID);  // If the move command is a mouse command
  33. }
Title: Re: [Bug?] SkipUntilCharacterStops disabled with repeatedly_execute
Post by: Crimson Wizard on 12 May 2013, 14:53
Manual sais:

Quote
SkipUntilCharacterStops(CHARID)

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.
Title: Re: [Bug?] SkipUntilCharacterStops disabled with repeatedly_execute
Post by: Phemar on 12 May 2013, 16:26
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.
Title: Re: [Bug?] SkipUntilCharacterStops disabled with repeatedly_execute
Post by: Crimson Wizard on 12 May 2013, 16:30
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.
Title: Re: [Bug?] SkipUntilCharacterStops disabled with repeatedly_execute
Post by: eri0o on 13 Jan 2019, 16:30
I know this infinitely old, but has anyone ever encountered this bug yet? I am trying to implement double click  (https://www.adventuregamestudio.co.uk/forums/index.php?topic=53226.0) to teleport a character to the destination using SkipUntilCharacterStops, but it doesn't work at all. (using 3.4.1.15)