(viewtopic.php?f=22&t=7055&start=60#p81445)
well, i ended up creating 2 scripts in order to try and get it to work. The first script uses a timer to start the script, which then is supposed to add 1 to a counter. This counter will be referenced in my other script. I then have a second script, which is started by the same timer, that checked which 'day' it is and changes the sky_box at a specified time.
the problem i am having is that it doesn't work and i have so little experiance with scripts that i have no idea why.
any ideas what i have done wrong?
Script 1 (day counter)
Code: Select all
function DayCount()
if GameMode.getTimeOfDay() == 1.99 then
day_counter.counter:incriment()
else
end
if day_counter.counter:getValue() == 7 then
day_counter.counter:setValue(0)
else
end
end
Code: Select all
function WeatherCycle()
if day_counter.counter:getValue() == 2 and
GameMode.getTimeOfDay() == 0.7 then
weather_forest_day_sky:destroy()
spawn("cemetery_sky",self.go.level,0,0,0,0,"weather_cemetery_sky")
end
if day_counter.counter:getValue() == 4 and
GameMode.getTimeOfDay() == 0.5 then
weather_cemetery_sky:destroy()
spawn("castle_arena_sky",self.go.level,0,0,0,0,"weather_castle_arena_sky")
end
if day_counter.counter:getValue() == 5 and
GameMode.getTimeOfDay() == 1.6 then
weather_castle_arena_sky:destroy()
spawn("cemetery_sky",self.go.level,0,0,0,0,"weather_cemetery_sky")
end
if day_counter.counter:getValue() == 6 and
GameMode.getTimeOfDay() == 0.3 then
weather_cemetery_sky:destroy()
spawn("forest_day_sky",self.go.level,0,0,0,0,"weather_forest_day_sky")
end
end