hi, i want to move clouds in background even when the dialogue is running, i did like this
function room_RepExec()
{
if (IsTimerExpired(4)){ocloud.X=ocloud.X - 1;SetTimer(4, 20);}
if (IsTimerExpired(5)){ocloud1.X=ocloud1.X - 1;SetTimer(5, 20);}
}
but doesn't work during dialogue, the clouds stop moving :( i tried also with object.move but the speed is too much fast
any suggestion?
For this you need to activate "Run game loops while dialog options are displayed". You'll find it in General Settings.
Then you need to add the function repeatedly_execute_always() manually to the script and add those cloud moving lines there
function repeatedly_execute_always()
{
if (IsTimerExpired(4)) {
ocloud.X=ocloud.X - 1;
SetTimer(4, 20);
}
if (IsTimerExpired(5)) {
ocloud1.X=ocloud1.X - 1;
SetTimer(5, 20);
}
}
Quote from: abstauber on Sun 07/12/2014 22:02:03
For this you need to activate "Run game loops while dialog options are displayed". You'll find it in General Settings.
Then you need to add the function repeatedly_execute_always() manually to the script and add those cloud moving lines there
function repeatedly_execute_always()
{
if (IsTimerExpired(4)) {
ocloud.X=ocloud.X - 1;
SetTimer(4, 20);
}
if (IsTimerExpired(5)) {
ocloud1.X=ocloud1.X - 1;
SetTimer(5, 20);
}
}
Great :) i didn't know it can be added to room script i read about it but i thought it was obsolete.
works fine
Btw:
ocloud1.X = ocloud1.X - 1;
can be shortened to:
ocloud1.X -= 1;
// or just
ocloud1.X --;