Jump to content

Recommended Posts

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 by Maris
Link to comment
Share on other sites

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 by Maris
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...