LuaSurface::get_tileproperties

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
Rseding91
Factorio Staff
Factorio Staff
Posts: 13247
Joined: Wed Jun 11, 2014 5:23 am
Contact:

LuaSurface::get_tileproperties

Post 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 :)
If you want to get ahold of me I'm almost always on Discord.

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1194
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: LuaSurface::get_tileproperties

Post 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. ;)

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: LuaSurface::get_tileproperties

Post 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.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13247
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaSurface::get_tileproperties

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: LuaSurface::get_tileproperties

Post 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).
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13247
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaSurface::get_tileproperties

Post 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
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding discussion”