Page 1 of 1

[closed] Current tile temperature

Posted: Tue Aug 16, 2016 1:15 am
by aubergine18
The tile temperature is set during map generation, and the API allows us to get that temperature. However...

It would be very desirable to have an additional API call to get current temperature based on time of day (map brightness).

For example, when the sun sets, I would expect temperatures to start dropping, eventually reaching a minimum based on tile elevation, etc. When sun rises, temperatures start to increase, reaching a peak around noon.

While I could code that sort of logic in to a mod, IMO it would be better for the game to provide it so that any mods wanting current tile temperature would get the same results without lots of code duplication. In addition, a mod trying to implement it has to access several values (elevation, brightness, etc) all of which need typecasting to Lua types.

Something like: TileProperties :: current_temperature

The default temperature would still be accessible via TileProperties :: temperature; it's useful to have that as it provides a rough average temperature for a tile.

Re: Current tile temperature

Posted: Tue Aug 16, 2016 5:38 pm
by Rseding91
There is no "current temperature". A tile temperature is used purely to generate data at chunk generation and then never touched again. It doesn't change over time with daytime or any of that.

Re: Current tile temperature

Posted: Tue Aug 16, 2016 6:13 pm
by steinio
@Rseding91: Well maybe the suggestion forum is a better place for this.
Could be placed near weather / seasons.

So if maybe a temperature change during the daytime is implemented, please add a mod interface for that ;)

@aubergine18: Maybe the quickest way would be implementing it by a mod and look how it goes.
There is a mod called Winterio (https://mods.factorio.com/mods/AnonymoScoot/Winterio) which could be took as example for cold/snowy weather,

Greetings steinio

Re: Current tile temperature

Posted: Tue Aug 16, 2016 7:45 pm
by aubergine18
Yup, I'll look at that mod and also MoWeather mod.