Make screen transition faster?

Started by Agnetha, Tue 01/04/2025 16:31:53

Previous topic - Next topic

Agnetha

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

Khris

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.)

Crimson Wizard

#2
Following trick seems to work:

Code: ags
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

Agnetha

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

Agnetha

Quote from: Crimson Wizard on Tue 01/04/2025 19:47:58Following trick seems to work:

Code: ags
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

SMF spam blocked by CleanTalk