It would be great if the wiring distance of electric poles could be readable from the game.entity_prototypes.
This would allow FARL to use modded poles without having to resort to scanning the entities in data.lua and creating a fake recipe with the distance in it.
Make maximum_wire_distance readable from inside lua
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Make maximum_wire_distance readable from inside lua
can't you use data.raw to access those prototypes? https://wiki.factorio.com/index.php?title=Data.raw
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.
Re: Make maximum_wire_distance readable from inside lua
data.raw isn't accessible from within control.lua, only things provided through http://lua-api.factorio.com/latest/LuaG ... prototypes
Which leads to this ugly piece of code: https://github.com/Choumiko/FARL/blob/m ... -fixes.lua (useless recipe with poles as ingredients and wire distance*10 as ingredient amount
)
Which leads to this ugly piece of code: https://github.com/Choumiko/FARL/blob/m ... -fixes.lua (useless recipe with poles as ingredients and wire distance*10 as ingredient amount

Re: Make maximum_wire_distance readable from inside lua
I thought I added this...
oops.. I guess not. I'll add it tomorrow if I don't forget again.

If you want to get ahold of me I'm almost always on Discord.