LuaEntityPrototype::gun

Post Reply
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 334
Joined: Tue Jul 08, 2014 10:06 am
Contact:

LuaEntityPrototype::gun

Post 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.
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: LuaEntityPrototype::gun

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

User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 334
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Re: LuaEntityPrototype::gun

Post 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.
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

Pi-C
Smart Inserter
Smart Inserter
Posts: 1654
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: LuaEntityPrototype::gun

Post 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?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaEntityPrototype::gun

Post by Rseding91 »

Ok, I expanded ::guns to include the artillery ones.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Implemented mod requests”