// Weather and day/night script for Cam1 (arizona) //daytime colour public int Rstart, Gstart, Bstart; public int Rend, Gend, Bend; public int Steps; private int count, Rdiff, Gdiff, Bdiff, Rnow, Gnow, Bnow; trigger delayTrig(every, 10); //change fog every 1 second event startup(CALL_GAMEINIT) { setCampaignNumber(1); setBackgroundFog(TRUE); //set fog on setDepthFog(TRUE); setFogColour(Rstart, Gstart, Bstart); //set fog to start colour Rdiff = Rstart - Rend; Gdiff = Gstart - Gend; Bdiff = Bstart - Bend; playCDAudio(1); setEventTrigger(startup, inactive); } event changeFog(delayTrig) { Rnow = Rstart - (count * Rdiff / Steps); Gnow = Gstart - (count * Gdiff / Steps); Bnow = Bstart - (count * Bdiff / Steps); setFogColour(Rnow, Gnow, Bnow); count = count + 1; if (count > Steps) { //stop change count = 0; setEventTrigger(changeFog, inactive); } }