Page 1 of 1

LuaEntityPrototype::gun

Posted: Sun Jul 26, 2020 2:27 pm
by LuziferSenpai
It would be nice to beable to read the gun of a artillery turret or normal turret, because I didnt found ANY way todo that in script.

Re: LuaEntityPrototype::gun

Posted: Mon Jul 27, 2020 5:30 pm
by orzelek
Are you looking for this:
https://lua-api.factorio.com/latest/Lua ... ack_result
?

Edit:
Looking at this I don't think that turrets have more information. I'm not sure how to get damage for laser turret in runtime from prorotype data. On gun turrets you might be able to grab ammo from inventory slot and use that to calculate damage.

Re: LuaEntityPrototype::gun

Posted: Mon Oct 19, 2020 11:53 am
by LuziferSenpai
So any Update to this?
orzelek wrote: Mon Jul 27, 2020 5:30 pm Are you looking for this:
https://lua-api.factorio.com/latest/Lua ... ack_result
?

Edit:
Looking at this I don't think that turrets have more information. I'm not sure how to get damage for laser turret in runtime from prorotype data. On gun turrets you might be able to grab ammo from inventory slot and use that to calculate damage.
No, not possible because I dont need the dmg, but I need the prototype itself.

Re: LuaEntityPrototype::gun

Posted: Mon Oct 19, 2020 12:15 pm
by Pi-C
LuziferSenpai wrote: Mon Oct 19, 2020 11:53 am So any Update to this?
orzelek wrote: Mon Jul 27, 2020 5:30 pm Are you looking for this:
https://lua-api.factorio.com/latest/Lua ... ack_result
?

Edit:
Looking at this I don't think that turrets have more information. I'm not sure how to get damage for laser turret in runtime from prorotype data. On gun turrets you might be able to grab ammo from inventory slot and use that to calculate damage.
No, not possible because I dont need the dmg, but I need the prototype itself.
You mean something like game.entity_prototypes or entity.prototype?

Re: LuaEntityPrototype::gun

Posted: Tue Oct 20, 2020 10:01 pm
by Rseding91
Ok, I expanded ::guns to include the artillery ones.