Modifying Vanilla Asset to inherit other prototype

Place to get help with not working mods / modding interface.
Post Reply
ghlegend195
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Aug 27, 2023 6:38 am
Contact:

Modifying Vanilla Asset to inherit other prototype

Post by ghlegend195 »

So, first post, and this might be really poorly worded because I don't know what the exact question is, so let me go in a roundabout way and explain what I am trying to accomplish.

I am trying to make a local mod for my friend and I because I really *really* detest fluid logistics but I want flamethrower turrets for a defensive option. To that end, I would like to have the flamethrower turrets take flamethrower ammo (because in my mind, that is the most adjacent ammo type and just makes good sense, would also allow logistics to resupply the turrets, I hope).

My main question is this: how do I go about modifying the flamethrower turrets to behave like an ammo turret and take the flamethrower ammo?

I have tried using data:extend to specify the flamethrower turret from the base game, but I don't know if that is the easiest way for me to modify the vanilla interaction or if I'll need to do additional scripting. I don't know how (or if it's possible) to have the fluid-turret also inherit the ammo-turret prototype, but after reading documentation for hours and hours for what seems like a three-line code fix, I am coming to the forums to ask what I am missing in this.

Any and all help is appreciated. :)

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Modifying Vanilla Asset to inherit other prototype

Post by Klonan »

The way to do it, would be to make a new ammo turret from scratch which takes the flamer fuel, and then use the flamethrower graphics for it

The two types (ammo turret and fluid turret) have quite different logic and prototype definitions, it isn't simple to just change the type and have it all work.

ghlegend195
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Aug 27, 2023 6:38 am
Contact:

Re: Modifying Vanilla Asset to inherit other prototype

Post by ghlegend195 »

Hm, I see. And I presume that it’s a limitation of the game/engine that you cannot have multiple prototypes assigned to the same device. That makes sense, though. Thanks for the quick response. :)

Post Reply

Return to “Modding help”