For example the power pole/grid has a max value I assume to be 8, one larger then the stock substation. I was going to make a higher area that might provide a larger area with power, but also consume power to do it, but cant go much higher then the reg one.
Adding a limits file, like a cfg file that shows all the limits/max vars of diffrent ones, so can open it up, look up your var, like max_supply_area_distance = 8 so you know not to go over 8
and adding the limits to each "type" for example if you are making a type solar-panel, these are vars usable thier values or max values, so you dont add things that the type dosent support or wont use the way intended, since some items for example thier energy means crafting speed not the energy the consume or produce so you know ahead of time or have a means of figuring out why things dont work as intended
Also easier access to view or modify entity data through the onbuiltentity event give direct access to everything about the newly built entity so if anything is needed by the mod can directly access it by a expanded data path like
Code: Select all
game.onevent(defines.events.onbuiltentity, function(event)
if event.createdentity.name == "somename" then
local newEntityInfo.pos = event.createdentity.pos
local newEntityInfo.something = event.createdentity.something
local newEntityInfo.effectivness = event.createdentity.effectivness
local newEntityInfo.speed = event.createdentity.speed
local newEntityInfo.type = event.createdentity.type
.... use the vars
endend)