legraf: Never tried to mod Star Ruler 2, freevryheid, but generally I'd suspect that your function is too likely to miss the moment, and get skipped.
A safer bet (and I'm assuming get_gameTime() returns seconds) is to set a temporary variable to gameTime, then wait as follows:
if (get_gameTime() - yourTempVar >= 30) [
pause();
set yourTempVar = get_gameTime();
]
(obviously I don't know the precise formatting/commands and haven't checked, but the above should be clear enough)
Thanks legraf, got it to work!
[code]
int gt = get_gameTime();
if (gt % 30 == 0 && !flagged) {
flagged = true;
pause();
}
if (gt % 31 == 0 && flagged) {
flagged = false;
}
[/code]
Had to add a flag as the function is called multiple times within a second. Multiple calls to pause() causes it to pause, unpause, pause, etc
My next mod is adjusting autoexplore so scouts don't have to stop before moving on to next star. Should keep em alive longer :)