Tnx
Turrets range changer mod request
- 
				matryona12
 - Manual Inserter

 - Posts: 2
 - Joined: Thu Apr 30, 2020 6:10 pm
 - Contact:
 
Turrets range changer mod request
Can someone please create mod which would give ability to change turrets range in menu to any value? Or at least make a mod to increase laser and machinegun turret range to twice as in vanilla.
Tnx
			
			
									
									
						Tnx
Re: Turrets range changer mod request
First, you are need the name for your mod. For example "Turret Range Extension".matryona12 wrote: Thu Apr 30, 2020 6:16 pm Can someone please create mod which would give ability to change turrets range in menu to any value? Or at least make a mod to increase laser and machinegun turret range to twice as in vanilla.
Tnx![]()
You are need to create the mod folder (for example "TurretRangeExtension_0.0.1") and prepare the file info.json inside. See: link
example
and:1. The shortest mod, that makes range exactly twice larger than vanilla:
place this code in your mod folder into the file data.lua:
Code: Select all
data.raw["ammo-turret"]["gun-turret"].attack_parameters.range = 2*18 -- default is 18
data.raw["electric-turret"]["laser-turret"].attack_parameters.range = 2*24 -- default is 242. The mod with mod settings:
Create the file settings.lua, paste this code:
Code: Select all
data:extend({
    {
        type = "int-setting",
        name = "gun-turret-range",
        setting_type = "startup",
        minimum_value = 18/3,
        maximum_value = 3*18,
        default_value = 18
    },
    {
        type = "int-setting",
        name = "laser-turret-range",
        setting_type = "startup",
        minimum_value = 24/3,
        maximum_value = 3*24,
        default_value = 24
    }
})Code: Select all
data.raw["ammo-turret"]["gun-turret"].attack_parameters.range = settings.startup["gun-turret-range"].value
data.raw["electric-turret"]["laser-turret"].attack_parameters.range = settings.startup["laser-turret-range"].value/locale/EN/locale.cfg:
Code: Select all
[mod-setting-name]
gun-turret-range=Gun Turret Range
laser-turret-range=Laser Turret rangeCode: Select all
[mod-setting-name]
gun-turret-range=Дальность стрельбы турелей
laser-turret-range=Дальность стрельбы лазерных турелей- 
				matryona12
 - Manual Inserter

 - Posts: 2
 - Joined: Thu Apr 30, 2020 6:10 pm
 - Contact:
 
Re: Turrets range changer mod request
all those explanations from  darkfrei
Thanks a lot, but because of my stupidity i managed to get it working from 100500 try.