Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: FortressCaulfield on Sun 07/07/2024 01:51:09

Title: Game lockup, problems with regions
Post by: FortressCaulfield on Sun 07/07/2024 01:51:09
Sorry if this is a double post, forum seems to be eating posts rn.

1. Having a softlock if a room's rep exec starts playing a scene while I have my inv open. The scene plays up til this command: oPokeonstand.Animate(0, 1, eOnce, eBlock);

But why is rep execute doing anything with inv open though? I thought it paused the game?

2. It seems region scripts are postponed if the character moves onto/off the region as part of another script. So if I move her with KB or mouse it works fine, but if she walks off the region to talk to someone or move to a hotspot view point, the region script doesn't play til after the other script is called.

3. I seem to have mucked up the default text border gui and it only wants to be like 100 pixels. There doesn't seem to be a setting for its dimensions and the height scales fine based on the text. What am I missing?

Thanks in advance
Title: Re: Game lockup, problems with regions
Post by: Khris on Sun 07/07/2024 12:29:51
1. It depends on the inventory GUI's visibility. For instance "Pause Game When Shown" pauses the game while it's visible, "Normal" doesn't.
The regular room_RepExec only runs while the game isn't paused, correct.


2. As described in my recent post about footsteps (https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/how-to-change-footstep-noises-on-different-regions/msg636664252/#msg636664252) you can workaround blocking code not triggering region events.


AGA said the server is on its last legs, so it's a good idea to do Ctrl-A Ctrl-C before hitting the post button in case submitting the post fails.
Title: Re: Game lockup, problems with regions
Post by: Crimson Wizard on Sun 07/07/2024 12:36:10
Quote from: Khris on Sun 07/07/2024 12:29:511. It depends on the inventory GUI's visibility. For instance "Pause Game When Shown" pauses the game while it's visible, "Normal" doesn't.
The regular room_RepExec only runs while the game isn't paused, correct.

Sorry, this is wrong, and I found that this is a quite a common misconception, being a natural expectation (I had it too once).

This may seem strange, but room_RepExec DOES run if game is in "paused" mode set with PauseGame. PauseGame pauses only particular things in game.
I once amended documentation with the precise list, please refer to:
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_General.html#pausegame

If you need to prevent a part of code from executing during pause, use IsGamePaused, for example:
Code (ags) Select
function room_RepExec()
{
    if (IsGamePaused())
        return;
}