Page 1 of 1

Digging in

Posted: Sat May 24, 2014 5:20 am
by Schmendrick
This is a question that I suspect I'm going to have to ask the devs and hope for a response, but I figured I'd ask here first.

Is there a resource anywhere for the contents/structure of the userdata for entities? Specifically, I'm hoping to get at the "energy remaining from a unit of fuel" value of a boiler, but is this documented/available anywhere for any of the entities?

Re: Digging in

Posted: Sat May 24, 2014 10:13 pm
by JamesOFarrell
Check here:

https://forums.factorio.com/wiki/inde ... Lua/Entity

"energy

Writable since 0.7.2.

Energy stored in the entity (Heat in furnace, energy stored in electrical devices etc.)

nil for entities that don't have the concept of energy stored inside.

game.player.print("Machine energy: " .. game.player.selected.energy .. "J")
game.player.selected.energy = 3000"