GUI | 'Pause game when shown' not pausing char.Say() | [solved-understood]

Started by Nahuel, Sun 02/10/2022 23:48:08

Previous topic - Next topic

Nahuel

Hey there, I cannot find the problem when showing a GUI using Pause game when shown

I though even when using PauseGame(); the dialogues after that where paused and when UnpaseGame(); then will resume. I'm using a GUI, I set the pop style to Pause but still the Character continues to say

GlobalScripts.asc it's a Char function
Code: ags
// ... bla bla bla
gLetter.Visible = true;
cEd.Say("Awesome!");
cEd.Say("That's just incredible!");

Code: ags
function gLetter(GUI *theGui, MouseButton button)
{
  gLetter.Visible = false;
}

Behaviour: The GUI is showed -> The text is displayed (Awesome) -> (That's just incredible) and finally I can click to hide the GUI.

I don't know if that is colliding with tumbleweed template.

Any ideas?

Thanks!
Life isn't a game. Let's develop a life-like-game.

heltenjon

So you want them to say this after the letter has been clicked away? Have you tried simply moving the Say commands to after the letter is made invisible instead of after it's made visible?

Nahuel

Hey @heltenjon thanks for your reply. Yes I tried that but because I was using some global variables to determine that the player showed only 1 time. And before some event and after another I didn't want to re If all those depending on the NPC but ai think it's the easiest way,
Life isn't a game. Let's develop a life-like-game.

Khris

The short answer is that AGS doesn't support pausing the game mid-function.

Developer-level scripting is subject to the main engine loop's behavior, and currently it simply stops advancing the game logic if the game is paused, but only after the current function has finished.
(For the same reason you cannot change the player's room, save the game or start a dialog mid-function; these calls get queued and run as soon as the engine is idle).

It is of course possible to "hard-pause" the game on an engine-level in theory but this way you can no longer directly script your own way to end the pause (because your code won't run at all while the engine is paused).

heltenjon

Quote from: Nahuel on Mon 03/10/2022 07:06:47Hey @heltenjon thanks for your reply. Yes I tried that but because I was using some global variables to determine that the player showed only 1 time. And before some event and after another I didn't want to re If all those depending on the NPC but ai think it's the easiest way,
I'm not really sure if I understood all that, but if you want this message to show only once, after the letter is shown, I would guess you could achieve it by moving the lines there and use DoOnceOnly. If I'm misreading your intent, please disregard. (And if I'm mistaken, I hope the better coders correct me.)

SMF spam blocked by CleanTalk