Adventure Game Studio

AGS Development => Editor Development => Topic started by: Phemar on Sat 11/05/2013 09:03:12

Title: [Bug?] SkipUntilCharacterStops disabled with repeatedly_execute
Post by: Phemar on Sat 11/05/2013 09:03:12
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 Sat 11/05/2013 17:44:05
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 Sun 12/05/2013 09:18:49
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 (ags) Select

function on_key_press (eKeyCode keycode) {
 
  if (Queue.Playing()) {     // If an interaction is playing
   
    if (keycode == eKeySpace) {
     
      if (oSpeech.Valid) {    // If speech is currently displayed
       
        if (t == p)   // If it's the last command in the series of commands for the interaction
          Queue.Stop (eQueue_Reset);  // Stop the interaction
         
        else {
          Queue.Stop (eQueue_DontReset);  // Skip the current line of speech
          Queue.Resume ();
      } }
     
      ClaimEvent ();
   
    }
   
    if (keycode == eKeyEscape) {
      if (player.Moving)
        SkipUntilCharacterStops (player.ID);  // If the move command is part of a scripted command
      else {
        Queue.Stop();  // Stop the current interaction
        ClaimEvent ();
    } }
 
  }
 
  else if (keycode == eKeyEscape)
    SkipUntilCharacterStops  (player.ID);  // If the move command is a mouse command
}
Title: Re: [Bug?] SkipUntilCharacterStops disabled with repeatedly_execute
Post by: Crimson Wizard on Sun 12/05/2013 14:53: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 Sun 12/05/2013 16:26:12
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 Sun 12/05/2013 16:30:59
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 Sun 13/01/2019 16:30:38
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)