Add radius_visualisation_specification to scripting api

User avatar
micromario
Fast Inserter
Fast Inserter
Posts: 114
Joined: Thu Apr 05, 2018 11:53 am
Contact:

Add radius_visualisation_specification to scripting api

Post by micromario »

Currently we have this value for entity prototypes:

Code: Select all

radius_visualisation_specification = {
    sprite = {
      filename = '__base__/graphics/entity/electric-mining-drill/electric-mining-drill-radius-visualization.png',
      width = 10,
      height = 10
    },
    distance = 12.5,
    offset = {0, -16}
  }
However, it cannot be read during runtime.
Could it be added to LuaEntityPrototype?

I have a scripted mining drill that uses this property, and would rather not hardcode the range in two places.
Honktown
Smart Inserter
Smart Inserter
Posts: 1045
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: Add radius_visualisation_specification to scripting api

Post by Honktown »

A file can be required in two different stages, though of course it will not be the same as if the file required twice in the same stage. I use a 'constants' kind of file for that. It won't match if another mod changes that value of yours (in data), but that'd be something to resolve with them (dependency, data-final-fixes check, asking them not to, etc).
I have mods! I guess!
Link
Rseding91
Factorio Staff
Factorio Staff
Posts: 14591
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add radius_visualisation_specification to scripting api

Post by Rseding91 »

Ok, I've added this for the next 1.1. release. The value you're looking for is actually already exposed specifically for the mining drill as: https://lua-api.factorio.com/latest/cla ... ill_radius but generic access still allows reading those values for things that don't have purpose-built uses for the radius.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Implemented mod requests”