Maris Posted May 6, 2016 Share Posted May 6, 2016 (edited) do local LENGTH = { autumn = 9, winter = 6, spring = 8, summer = 5, } TUNING.AUTUMN_LENGTH = LENGTH.autumn TUNING.WINTER_LENGTH = LENGTH.winter TUNING.SPRING_LENGTH = LENGTH.spring TUNING.SUMMER_LENGTH = LENGTH.summer local function OnSeasonChange(inst, season) local seasonlength = LENGTH[season] w:PushEvent("ms_setseasonlength", { season = season, length = seasonlength or 1, }) end AddPrefabPostInit("world",function(inst) inst:WatchWorldState("season", OnSeasonChange) inst:DoTaskInTime(0,function(inst) for k,v in pairs(LENGTH) do w:PushEvent("ms_setseasonlength", { season = k, length = v or 1, }) end end) end) end Everything works except for Spring. Spring lasts 16 days. Spring ignores my code for some reason. But why? P.S. I missed. It should be in DST subforum. Edited May 6, 2016 by Maris Link to comment Share on other sites More sharing options...
Zillvr Posted May 6, 2016 Share Posted May 6, 2016 @Maris I've moved this thread to DST Mods and Tools from DS Mods and Tools as requested, unless I completely misunderstood. Let me know, cheers. Link to comment Share on other sites More sharing options...
Maris Posted May 6, 2016 Author Share Posted May 6, 2016 (edited) I made some tests: TheWorld:PushEvent("ms_setseasonlength", { season = "autumn", length = 5, }) --Ok. Lenght is really 5 TheWorld:PushEvent("ms_setseasonlength", { season = "winter", length = 10, }) --Ok. Lenght is really 10 TheWorld:PushEvent("ms_setseasonlength", { season = "spring", length = 5, }) --lenght is 10. What? TheWorld:PushEvent("ms_setseasonlength", { season = "spring", length = 10, }) --lenght is 20. What? TheWorld:PushEvent("ms_setseasonlength", { season = "spring", length = 7, }) --lenght is 14. Why?? Seems Spring applies double length. Edited May 6, 2016 by Maris Link to comment Share on other sites More sharing options...
Muche Posted May 6, 2016 Share Posted May 6, 2016 Is your current season spring? If your current season becomes autumn, will the length of spring be correct and the length of autumn be double? components/season|UpdateSeasonMode() seems to do some artificial doubling, so if spring or autumn is the starting season, the temperatures are more friendly. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now