change turret range

Place to get help with not working mods / modding interface.
kongobusinessman
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 18, 2018 12:59 pm
Contact:

change turret range

Post by kongobusinessman »

Hello, is there a way for a casual like me to change the max turret range?
I played around a bit with modifying files of an existing mod and looked some things up but since i dont plan to get into serious modding myself it would be cool if someone could help me here

This is in the mods folder \modname\data-updates.lua

Code: Select all

--weight anx max power adjusted so that additional cargo wagons and fluid wagons will have almost zero impact to acceleration
--adding more forward facing locomotives will not help with acceleration
data.raw["locomotive"]["locomotive"].weight = 5000 
data.raw["locomotive"]["locomotive"].max_speed = 1.5 --646.5km/h
data.raw["locomotive"]["locomotive"].max_power = "1800kW"
data.raw["locomotive"]["locomotive"].max_health = 3000

data.raw["wall"]["stone-wall"].max_health = 2000

data.raw["furnace"]["steel-furnace"].energy_source.emissions = 20

data.raw["turret"]["ammo-turret"].attack_parameters.range = 20
The problem is the last line wouldnt work, i tried all sorts of combinations within [""][""] but i just cant figure it out. somehow i found the value only in \prototype\entities\demo-turrets.lua

is it not possible to change that value like this? Also could someone give me a quick explanation on how you can reliable find the paths for such values because till now i was just kinda guessing for the walls and furnaces...
tysm whoever is willing to help this noob :roll:
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3718
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: change turret range

Post by DaveMcW »

You have the wrong type and name. Check the wiki info box for the correct names.

Code: Select all

data.raw["ammo-turret"]["gun-turret"].attack_parameters.range = 20
The wiki also has a link to the full data.raw table, which is useful for finding property names.
kongobusinessman
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 18, 2018 12:59 pm
Contact:

Re: change turret range

Post by kongobusinessman »

o shit thank you and that index hint is awesome thats gonna help alot :D
i knew it would be something simple im missing but not that it would be that bad lol
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: change turret range

Post by darkfrei »

kongobusinessman wrote: Sun Jan 27, 2019 3:00 am o shit thank you and that index hint is awesome thats gonna help alot :D
i knew it would be something simple im missing but not that it would be that bad lol
Here viewtopic.php?f=135&t=45107 is a mod, that makes whole data.lua as list of properties.
Attachments
info-mod-factorio.png
info-mod-factorio.png (30.9 KiB) Viewed 2186 times
Post Reply

Return to “Modding help”