Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Agnetha on Tue 01/04/2025 16:31:53

Title: Make screen transition faster?
Post by: Agnetha on Tue 01/04/2025 16:31:53
Hey guys I'm using the BlackBoxOut transition to change rooms but is there a way to make it a little faster so it doesn't impede on the player as much? I've tried a few things like chatgpt and the manual but its only for fadein/out that most of it seems to be based off. Thank you for any advice x
Title: Re: Make screen transition faster?
Post by: Khris on Tue 01/04/2025 18:44:46
These transitions are hardcoded and cannot be changed. You would have to write a faster one yourself. You can do this using a screen-sized GUI and a screen-sized DynamicSprite set as its BackgroundGraphic.

(Also, ChatGPT is not suitable to help with AGS programming.)
Title: Re: Make screen transition faster?
Post by: Crimson Wizard on Tue 01/04/2025 19:47:58
Following trick seems to work:

Code (ags) Select
function on_event(int event, int data)
{
  // increase game speed just before transition-out begins
  if (event == eEventLeaveRoom)
  {
    SetGameSpeed(500); // valid values are 10-1000
  }
  // restore game speed right after transition-in ends
  if (event == eEventEnterRoomAfterFadein)
  {
    SetGameSpeed(40); // set to whatever your normal game speed is
  }
}

on_event topic in the manual:
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Event.html#on_event
SetGameSpeed:
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_General.html#setgamespeed
Title: Re: Make screen transition faster?
Post by: Agnetha on Wed 02/04/2025 01:54:46
Quote from: Khris on Tue 01/04/2025 18:44:46These transitions are hardcoded and cannot be changed. You would have to write a faster one yourself. You can do this using a screen-sized GUI and a screen-sized DynamicSprite set as its BackgroundGraphic.

(Also, ChatGPT is not suitable to help with AGS programming.)

Oh bummer i'll give that a try thank you x
Title: Re: Make screen transition faster?
Post by: Agnetha on Wed 02/04/2025 01:58:26
Quote from: Crimson Wizard on Tue 01/04/2025 19:47:58Following trick seems to work:

Code (ags) Select
function on_event(int event, int data)
{
  // increase game speed just before transition-out begins
  if (event == eEventLeaveRoom)
  {
    SetGameSpeed(500); // valid values are 10-1000
  }
  // restore game speed right after transition-in ends
  if (event == eEventEnterRoomAfterFadein)
  {
    SetGameSpeed(40); // set to whatever your normal game speed is
  }
}

on_event topic in the manual:
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Event.html#on_event
SetGameSpeed:
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_General.html#setgamespeed

That worked! thank you so much Crimson x