Make maximum_wire_distance readable from inside lua

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Make maximum_wire_distance readable from inside lua

Post by Choumiko »

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.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Make maximum_wire_distance readable from inside lua

Post by aubergine18 »

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.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Make maximum_wire_distance readable from inside lua

Post by Choumiko »

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 :lol: )
Rseding91
Factorio Staff
Factorio Staff
Posts: 15997
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Make maximum_wire_distance readable from inside lua

Post by Rseding91 »

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.
Post Reply

Return to “Implemented mod requests”