room transitions - transition speed?

Started by stuh505, Sun 23/05/2004 02:20:08

Previous topic - Next topic

stuh505

I like the fade transition, but it is unbearably slow for me.  Is there any way to adjust the speeds of these transitions?

Eddie Chewbacca

The below code is how to change the speed of the FadeOut function.Ã,  Same goes for FadeIn functions.

FadeOut (int speed)

Fades the screen out to black. SPEED is the speed of the fade, from 1 (slowest) to 64 (instant). You can restore the screen with FadeIn.

Example: FadeOut(30);
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  FadeIn(10);

Only thing I'm not sure of myself, being relatively new to AGS, is if you only need to set this variable once, or if it needs to be done in each room.Ã,  I'd assume you would only need to set it once, so maybe try adding the code in the global script under "game_start", or inÃ,  first room the charcater begins in, under "First Time Player Enters Screen" possibly.Ã,  You can of course change this for each room if you want to.Ã,  If this does not help, then I'll have to leave it to the experts to help you out.Ã, 

Good luck.

Pet Terry

The bigger the resolution of the game, the slower the transition.

EDIT: Also, I think, if the game file size is really big, it slows down the transition.
<SSH> heavy pettering
Screen 7

stuh505

huh? 

I already knew about these functions, but I did not use them because the help file does not say it does that.  the help file says:

QuoteFades the screen out to black. SPEED is the speed of the fade, from 1 (slowest) to 64 (instant). You can restore the screen with FadeIn.
NOTE: This is a blocking function.

Anyway, I just did a small test to see if they ALSO change the default room transition speeds...and they do not.  So, my question stands...

Scorpiorus

Currently, it's not possible to change the fade-in/out transition speed, so yes, you have to workaround it with FadeIn/FadeOut functions.

stuh505

Ah, so in other words,

//header
int FADE_SPEED = xx;

//global
function on_event(LEAVE_ROOM,DATA){
  //PRE: transition type == instant
  FadeOut(FADE_SPEED);
}

function on_event(ENTER_ROOM,DATA){
  //PRE: transition type == instant
  FadeIn(FADE_SPEED);
}

Scorpiorus

Yeah, the only trouble is that the ENTER_ROOM event occurs before the room screen is drawn, therefore you won't see the fade-in transition.

A workaround is to set a flag and check it on the first call of the repeatedly_execute_always:

// main global script

int fade_speed = 1;

int flag = 0;
function on_event(int event, int data) {

   if (event==ENTER_ROOM) {
      flag = 1; // set flag instead of calling FadeIn()
   }
   else if (event==LEAVE_ROOM) {
      FadeOut(fade_speed);
   }

}

function repeatedly_execute_always() {

   if (flag) {
      FadeIn(fade_speed);
      flag = 0; // reset flag
   }

}

stuh505

[chuckle]

ah, what a nuisance  :P

thanks, though.

Scorpiorus

One thing though, it's actually not allowed to run blocking functions from within the repeatedly_execute_always(). But both FadeIn() and FadeOut() work though. :P
So it's either a bug or a new unofficial feature. Hope the last..

SMF spam blocked by CleanTalk