Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - beren

#1
How can I set the duration / length of the standard screen transition inside an AGS game?

I am using the Fade in/out transition method. Even if I was scripting, SetScreenTransition(eTransitionFade); and SetNextScreenTransition(eTransitionFade); don't take any additional arguments.
I have searched the board for ScreenTransition length and duration, but couldn't find anything.
Thank you in advance for your answers. :)

ANSWER (Workaround):

This is my workaround answer as suggested by GarageGothic. I extracted it from my more complex "room intro" code, so in case that it doesn't work for you, feel free to contact me via PM.

General Settings:
Set the standard room transition style to "Instant".

Fadein GUI:
Create a new GUI and name the scriptname "Fade" (will be "gFade" then).
The GUI needs to be black (or whichever color you like) and share your game's screen resolution.

Room Custom Property:
Add a new custom property, that way you can enable or disable the fade for each room:
fadein, boolean, fades from black to room

Global Script:
Code: ags


// Ontop of your global script:
function on_event(EventType event, int data) {
  if (event == eEventLeaveRoom) FadeOut(2); // In case you want to fade out, too. Or you can use the same GUI Workaround to do it.
    if (event == eEventEnterRoomBeforeFadein && GetRoomProperty("fadein") == true){	  
      gFade.Visible = true;
      mouse.Visible = false;
    }
    else{
      gFade.Visible = false;
    }
  }
}

// Fade Room in:
function FadeRoomIn() {
  StartCutscene(eSkipESCOnly); // User can use ESC to skip fade
  int vGuiTrans = 0;
  gFade.Transparency = 0;

  while (vGuiTrans < 100){
    vGuiTrans += 5;    
    gFade.Transparency = vGuiTrans;
    Wait (1);
  }

  gFade.Visible = false;
  mouse.Visible = true; // Only if you want to show the mouse at that time
  EndCutscene();
}



Room Interaction:
Add a new run script action for the rooms you want the fade in to happen. Add it to "Player enters room(after fadein)":
Code: ags


  // script for Room: Player enters room (after fadein)
  FadeRoomIn();

SMF spam blocked by CleanTalk