[Request] Need help with my gun turret mod

This is the place to request new mods or give ideas about what could be done.
User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 558
Joined: Wed Jun 01, 2016 5:07 am
Contact:

[Request] Need help with my gun turret mod

Post by thereaverofdarkness »

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.
Last edited by thereaverofdarkness on Mon May 29, 2017 11:10 am, edited 2 times in total.
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [Request] Gun turret upgrade

Post by orzelek »

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.
User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 558
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: [Request] Gun turret upgrade

Post by thereaverofdarkness »

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.
PSS
Burner Inserter
Burner Inserter
Posts: 9
Joined: Tue Feb 12, 2013 8:01 pm
Contact:

Re: [Request] Need help with my gun turret mod

Post by PSS »

I think you need add technology and entity to data (data:extend) as you did with items and recipies.
User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 558
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: [Request] Need help with my gun turret mod

Post by thereaverofdarkness »

PSS wrote:I think you need add technology and entity to data (data:extend) as you did with items and recipies.
I probably needed that, but it hasn't made the mod work.


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")
I'm now trying to get the advanced gun turret to gain damage from the gun turret damage upgrade research. I put in this code into prototypes/technology-updates:

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})
but it isn't doing anything.
PSS
Burner Inserter
Burner Inserter
Posts: 9
Joined: Tue Feb 12, 2013 8:01 pm
Contact:

Re: [Request] Need help with my gun turret mod

Post by PSS »

Add this line to data.lua if you didn't:

Code: Select all

require("prototypes.technology-updates")
User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 558
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: [Request] Need help with my gun turret mod

Post by thereaverofdarkness »

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

Return to “Ideas and Requests For Mods”