Page 1 of 1

Change drone speed/energy per tick/max payload size in mods

Posted: Thu Oct 03, 2019 7:35 am
by Dracarias
Hi
How can i change settings for drones with my mod in others mods?
I tried to do everything myself but could not understand how to do it :|

Here's how I ended up:

Code: Select all

if data.raw.item ["cargo-robot"] and data.raw.item ["cargo-robot-2"] and data.raw.item ["angels-construction-robot"] then
  bobmods.lib.entity.add_speed ("bob-construction-robot-2", 0.3)
  bobmods.lib.entity.add_speed ("bob-construction-robot-3", 0.3)
  bobmods.lib.entity.add_speed ("bob-construction-robot-4", 0.3)
  bobmods.lib.entity.add_speed ("bob-construction-robot-5", 0.3)
  angelsmod.industries.entities.add_speed ("cargo-robot", 0.3)
  angelsmod.industries.entities.add_speed ("cargo-robot-2", 0.3)
  angelsmod.industries.entities.add_speed ("angels-construction-robot", 0.3)
  angelsmod.industries.entities.set_energy_per_tick ("cargo-robot", "0J")
  angelsmod.industries.entities.set_energy_per_tick ("cargo-robot-2", "0J")
  angelsmod.industries.entities.set_energy_per_tick ("angels-construction-robot", "0J")
  angelsmod.industries.entities.set_energy_per_move ("cargo-robot", "0J")
  angelsmod.industries.entities.set_energy_per_move ("cargo-robot-2", "0J")
  angelsmod.industries.entities.set_energy_per_move ("angels-construction-robot", "0J")
end
Help

Re: Change drone speed/energy per tick/max payload size in mods

Posted: Fri Oct 04, 2019 8:45 am
by guy smiley
Hi,
I'm no expert on the mods in question, but the syntax you're using to modify entity properties seems wrong.

Below is some lines from my own mod that alters the vanilla construction robots, so this may serve as a guideline at least, for the general syntax the line should follow, and possibly for the entity table structure as well.

Code: Select all

data.raw["construction-robot"]["construction-robot"].max_energy			=	"15GJ"
data.raw["construction-robot"]["construction-robot"].energy_per_move	=	"0.001J"
data.raw["construction-robot"]["construction-robot"].min_to_charge		=	0.25
data.raw["construction-robot"]["construction-robot"].max_to_charge		=	0.99

data.raw["construction-robot"]["construction-robot"].speed = 6
Hope that helps.

Re: Change drone speed/energy per tick/max payload size in mods

Posted: Fri Oct 04, 2019 7:14 pm
by mat1k
Dracarias wrote: Thu Oct 03, 2019 7:35 am Hi
How can i change settings for drones with my mod in others mods?
I tried to do everything myself but could not understand how to do it :|

Here's how I ended up:

Code: Select all

if data.raw.item ["cargo-robot"] and data.raw.item ["cargo-robot-2"] and data.raw.item ["angels-construction-robot"] then
  bobmods.lib.entity.add_speed ("bob-construction-robot-2", 0.3)
  bobmods.lib.entity.add_speed ("bob-construction-robot-3", 0.3)
  bobmods.lib.entity.add_speed ("bob-construction-robot-4", 0.3)
  bobmods.lib.entity.add_speed ("bob-construction-robot-5", 0.3)
  angelsmod.industries.entities.add_speed ("cargo-robot", 0.3)
  angelsmod.industries.entities.add_speed ("cargo-robot-2", 0.3)
  angelsmod.industries.entities.add_speed ("angels-construction-robot", 0.3)
  angelsmod.industries.entities.set_energy_per_tick ("cargo-robot", "0J")
  angelsmod.industries.entities.set_energy_per_tick ("cargo-robot-2", "0J")
  angelsmod.industries.entities.set_energy_per_tick ("angels-construction-robot", "0J")
  angelsmod.industries.entities.set_energy_per_move ("cargo-robot", "0J")
  angelsmod.industries.entities.set_energy_per_move ("cargo-robot-2", "0J")
  angelsmod.industries.entities.set_energy_per_move ("angels-construction-robot", "0J")
end
Help
Are these the actual values you want? I could probably whip up a mod file to do that for you. But i'd need to know thenames of the 2 mods that introduce these items. They'll need to be set as required mods so they load before the changes.

Re: Change drone speed/energy per tick/max payload size in mods

Posted: Thu Oct 17, 2019 11:55 am
by Dracarias
guy smiley wrote: Fri Oct 04, 2019 8:45 am Hi,
I'm no expert on the mods in question, but the syntax you're using to modify entity properties seems wrong.

Below is some lines from my own mod that alters the vanilla construction robots, so this may serve as a guideline at least, for the general syntax the line should follow, and possibly for the entity table structure as well.

Code: Select all

data.raw["construction-robot"]["construction-robot"].max_energy			=	"15GJ"
data.raw["construction-robot"]["construction-robot"].energy_per_move	=	"0.001J"
data.raw["construction-robot"]["construction-robot"].min_to_charge		=	0.25
data.raw["construction-robot"]["construction-robot"].max_to_charge		=	0.99

data.raw["construction-robot"]["construction-robot"].speed = 6
Hope that helps.
Thanks for help!

Re: Change drone speed/energy per tick/max payload size in mods

Posted: Thu Oct 17, 2019 11:55 am
by Dracarias
mat1k wrote: Fri Oct 04, 2019 7:14 pm
Dracarias wrote: Thu Oct 03, 2019 7:35 am Hi
How can i change settings for drones with my mod in others mods?
I tried to do everything myself but could not understand how to do it :|

Here's how I ended up:

Code: Select all

if data.raw.item ["cargo-robot"] and data.raw.item ["cargo-robot-2"] and data.raw.item ["angels-construction-robot"] then
  bobmods.lib.entity.add_speed ("bob-construction-robot-2", 0.3)
  bobmods.lib.entity.add_speed ("bob-construction-robot-3", 0.3)
  bobmods.lib.entity.add_speed ("bob-construction-robot-4", 0.3)
  bobmods.lib.entity.add_speed ("bob-construction-robot-5", 0.3)
  angelsmod.industries.entities.add_speed ("cargo-robot", 0.3)
  angelsmod.industries.entities.add_speed ("cargo-robot-2", 0.3)
  angelsmod.industries.entities.add_speed ("angels-construction-robot", 0.3)
  angelsmod.industries.entities.set_energy_per_tick ("cargo-robot", "0J")
  angelsmod.industries.entities.set_energy_per_tick ("cargo-robot-2", "0J")
  angelsmod.industries.entities.set_energy_per_tick ("angels-construction-robot", "0J")
  angelsmod.industries.entities.set_energy_per_move ("cargo-robot", "0J")
  angelsmod.industries.entities.set_energy_per_move ("cargo-robot-2", "0J")
  angelsmod.industries.entities.set_energy_per_move ("angels-construction-robot", "0J")
end
Help
Are these the actual values you want? I could probably whip up a mod file to do that for you. But i'd need to know thenames of the 2 mods that introduce these items. They'll need to be set as required mods so they load before the changes.
I solved the problem, thanks!