There's a localised_description field, which makes it possible to set the description programmatically during the data phase:bobingabout wrote:Yes, it would be possible to do that. someone actually mentioned it to me the other day, but I didn't make a note of it.
Number, no, because you can change it, and reading that into the locale isn't easy, if even possible in the description, but I can slap a simple "Tier 4" as a description of a pipe.
I added the following to locale:
Code: Select all
[entity-description]
bob-pipe-to-ground=Max distance: __1__
Code: Select all
function bobmods.logistics.set_pipe_distance(pipe, level)
if data.raw["pipe-to-ground"][pipe] then
for index, connection in pairs(data.raw["pipe-to-ground"][pipe].fluid_box.pipe_connections) do
if connection.max_underground_distance then
local distance = bobmods.logistics.pipe_distance(level)
data.raw["pipe-to-ground"][pipe].fluid_box.pipe_connections[index].max_underground_distance = distance
data.raw["pipe-to-ground"][pipe].localised_description = {"entity-description.bob-pipe-to-ground", distance}
end
end
end
end

Which also shows that you haven't quite gotten to adjusting recipe costs to match underground distance.
