Page 1 of 1

LuaSurface::get_tileproperties

Posted: Thu Dec 01, 2016 10:23 pm
by Rseding91
Does anyone use this function on LuaSurface? I was working on map generation earlier and found it was broken. Before I spend the time to fix it I was wondering if anyone actually uses it or if I could just remove it :)

Re: LuaSurface::get_tileproperties

Posted: Fri Dec 02, 2016 2:19 am
by Mooncat
I don't but I think this guy might have used it: viewtopic.php?f=25&t=30628. Though he seems to be hard to reach.
And aubergine18 might have used it as well. I pm-ed him about this post. ;)

Re: LuaSurface::get_tileproperties

Posted: Sun Dec 04, 2016 8:12 pm
by aubergine18
What aspects of it are broken?

I used it in this sensor mod: https://mods.factorio.com/mods/aubergin ... _elev_temp (0.13 version)

While testing that mod I did notice that there seemed to be no correlation between the tile property values and what was rendered on the map for the most part. Maybe it's mostly based on elevation and the other values have little to no effect?

I'm planning to use it in other mods I've been tinkering with for example height and temperature as buffs for radio signal on a radio mast.

I've also been tinkering with a map overlay during entity placement. For example, on a stone water well entity, I've used a grid of flying-text around the player placing the entity that depicts the amount of water (moisture) for each tile - being able to query tile properties was useful in that respect as it meant I didn't have to worry about creating my own values and storing them. I want placement of the well to have an effect on the amount of water it produces (although I've not yet found a way to alter its production rate that avoids on_tick handler).

I've not tried setting values but was considering something that sets moisture level in an entity that could drain or fill lakes, etc.

I've not thought of any uses for roughness value (yet). I've no idea what tier_from_start is.

Re: LuaSurface::get_tileproperties

Posted: Sun Dec 04, 2016 8:34 pm
by Rseding91
aubergine18 wrote:What aspects of it are broken?
It possibly uses deleted memory depending on how long you wait to use the properties or how much chunk generation is happening.

Re: LuaSurface::get_tileproperties

Posted: Sun Dec 04, 2016 10:23 pm
by aubergine18
Does that issue apply to all the properties of a LuaTileProperties object?

When I was doing the moisture overlay, it seemed to consistently show the same values as I was running round the map - for example, I could return to a previously visited location after several minutes and the overlay would look the same (I wasn't storing the values, I was always pulling from get_tileproperties() in a grid around player location).

Re: LuaSurface::get_tileproperties

Posted: Sun Dec 04, 2016 10:35 pm
by Rseding91
aubergine18 wrote:Does that issue apply to all the properties of a LuaTileProperties object?

When I was doing the moisture overlay, it seemed to consistently show the same values as I was running round the map - for example, I could return to a previously visited location after several minutes and the overlay would look the same (I wasn't storing the values, I was always pulling from get_tileproperties() in a grid around player location).
The values for a given position are always identical for the same map seed. That's the entire point of them :P