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

Messages - beren

#1
D'oh!
I forgot I wanted to try that! Awesome, thanks I'll do that asap and give feedback :)

EDIT: Works now, added the solution to my original post. Thanks a lot! :)
#2
Would it be wise to submit the issue as bug? I still have a feeling I'm missing something, but I can't figure out what :/
Even tried a workaround with a function that always fades in, but it only works "after fadein", hence there's a "blinking effect" when the the function is called, fading in *after* the room was already visible for a brief moment.
#3
The FadeIn and FadeOut speed parameters should be given in game ticks.
Yes, seems like the eEventEnterRoomBeforeFadein ignores the Gloabl script's event handler.
#4
Ashen, yes I did use "instant" as the default transition, but it didn't help. I also tried "fade". Changed those in the "General Settings".
#5
GarageGothic, monkey_05_06, thank you!

I tried to add the code in minor variation to my *global script*, but ran into the following problem I couldn't quite solve:

eEventLeaveRoom works, the screen fades nicely.
eEventEnterRoomBeforeFadein doesn't work, the screen uses the default transition.

I removed all my entries for that room in any room interaction (event), but still the same issue. What am I missing?

The change I did was set the FADE_SPEED to a way lower value, around 2 since everything else fades very quickly on my computer. Strange though. Any idea why that happens?
#6
Thank you! However I guess there might be a workaround with FadeIn(); and FadeOut();, but then I would have to add it to the "Player enters room (Before Fadein)" and "player leaves room" interaction in every room :(
#7
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