static num_to_collect; func Initialize() { Log("Difficulty = %d", SCENPAR_Difficulty); num_to_collect = SCENPAR_Difficulty; for (var i=0; iCreateContents(Shovel); } func GotNugget() { --num_to_collect; if (num_to_collect == 0) GameCall("Finished"); Sound("UI::Cash"); RemoveObject(); } func Finished() { Log("All nuggets collected!"); GainScenarioAchievement("Done", BoundBy(SCENPAR_Difficulty, 1, 3)); GameOver(); }