I want a mod that allows me to research technology to increase gun turret hit points and attack range. Nothing more, just a simple mod to make gun turrets competitive in the late game.
Can someone show me how to build a mod that does this?
I created a mod to add an advanced gun turret but I seem to be missing code and I don't know how to make it work. I copied the gun turret info from the game files and put them into basic mod files and made edits for the advanced gun turret, and the game runs with the mod but nothing changes.
https://mods.factorio.com/mods/thereave ... retUpgrade
Edit: the mod has basic functionality, but the advanced gun turret does not gain damage from gun turret damage research. See post #5.
[Request] Need help with my gun turret mod
- thereaverofdarkness
- Filter Inserter
- Posts: 558
- Joined: Wed Jun 01, 2016 5:07 am
- Contact:
[Request] Need help with my gun turret mod
Last edited by thereaverofdarkness on Mon May 29, 2017 11:10 am, edited 2 times in total.
Re: [Request] Gun turret upgrade
There is no way to do that currently. Modifiers for gun turret hp/range don't exist and they can't be modded in.
Best thing you can get is various Mk versions of gun turret like in bobs warefare.
Best thing you can get is various Mk versions of gun turret like in bobs warefare.
- thereaverofdarkness
- Filter Inserter
- Posts: 558
- Joined: Wed Jun 01, 2016 5:07 am
- Contact:
Re: [Request] Gun turret upgrade
That's what I'm doing. I put that in the mod I started, but I need help to make it work. If you look at the mod, it's pretty clear on the details of how it's supposed to work.
Re: [Request] Need help with my gun turret mod
I think you need add technology and entity to data (data:extend) as you did with items and recipies.
- thereaverofdarkness
- Filter Inserter
- Posts: 558
- Joined: Wed Jun 01, 2016 5:07 am
- Contact:
Re: [Request] Need help with my gun turret mod
I probably needed that, but it hasn't made the mod work.PSS wrote:I think you need add technology and entity to data (data:extend) as you did with items and recipies.
Edit: I got the mod to work! I added a data file with the following lines:
Code: Select all
require("prototypes.items")
require("prototypes.recipies")
require("prototypes.entities")
require("prototypes.technologies")
Code: Select all
table.insert(data.raw.technology["gun-turret-damage-1"].effects,{type = "turret-attack", turret_id = "advanced-gun-turret", modifier = 0.1})
table.insert(data.raw.technology["gun-turret-damage-2"].effects,{type = "turret-attack", turret_id = "advanced-gun-turret", modifier = 0.1})
table.insert(data.raw.technology["gun-turret-damage-3"].effects,{type = "turret-attack", turret_id = "advanced-gun-turret", modifier = 0.2})
table.insert(data.raw.technology["gun-turret-damage-4"].effects,{type = "turret-attack", turret_id = "advanced-gun-turret", modifier = 0.2})
table.insert(data.raw.technology["gun-turret-damage-5"].effects,{type = "turret-attack", turret_id = "advanced-gun-turret", modifier = 0.2})
table.insert(data.raw.technology["gun-turret-damage-6"].effects,{type = "turret-attack", turret_id = "advanced-gun-turret", modifier = 0.4})
table.insert(data.raw.technology["gun-turret-damage-7"].effects,{type = "turret-attack", turret_id = "advanced-gun-turret", modifier = 0.7})
Re: [Request] Need help with my gun turret mod
Add this line to data.lua if you didn't:
Code: Select all
require("prototypes.technology-updates")
- thereaverofdarkness
- Filter Inserter
- Posts: 558
- Joined: Wed Jun 01, 2016 5:07 am
- Contact:
Re: [Request] Need help with my gun turret mod
It worked! I don't know why I missed that.
Thanks!
The turrets still don't automatically have the damage upgrade if you researched it before the mod was installed.
Thanks!
The turrets still don't automatically have the damage upgrade if you researched it before the mod was installed.