Hi again! Just as the title says... I want my character starts walking when the room starts fading in. I thought it could be possible using player.Walk(x,y,eNoBlock); in the player entres room before fade-in event. But when I test the game it waits till the room has fully faded in to start walking...
Thanks in advance.
Joe.
The default fade-in is a blocking function unfortunately. So you'll need to create your own non-blocking fade function. A solution that's worked well for me is to use a fullscreen GUI with black background color and fading it gradually in rep_exec_always. You can see my code here:
// Main script for module 'FadeNonBlocking'
int fadeintimer;
int fadeouttimer;
float fadetransparency;
float fademodifier;
function FadeInNonBlocking(int time) {
fadetransparency = 0.0;
fadeintimer = time;
fademodifier = IntToFloat(100)/IntToFloat(time);
}
function FadeOutNonBlocking(int time) {
fadetransparency = 100.0;
fadeouttimer = time;
fademodifier = IntToFloat(100)/IntToFloat(time);
}
function repeatedly_execute_always() {
if (fadeintimer > 0) {
fadetransparency = fadetransparency + fademodifier;
if (fadetransparency <= 100.0) gFadetoblack.Transparency = FloatToInt(fadetransparency);
else gFadetoblack.Transparency = 100;
fadeintimer--;
}
else if (fadeouttimer > 0) {
fadetransparency = fadetransparency - fademodifier;
if (fadetransparency >= 0.0) gFadetoblack.Transparency = FloatToInt(fadetransparency);
else gFadetoblack.Transparency = 0;
fadeouttimer--;
}
}
Ok thanks! I was now trying to make some module but yours will be fine.
You could also use the transparency function in the Tween Module (http://"http://www.adventuregamestudio.co.uk/yabb/index.php?topic=38015.0") with that black GUI, or even a black object the size of the screen, which will avoid any rep_ex business entirely.