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

Place to get help with not working mods / modding interface.
Post Reply
Dracarias
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Mar 10, 2017 11:56 pm
Contact:

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

Post 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

guy smiley
Burner Inserter
Burner Inserter
Posts: 13
Joined: Mon Aug 21, 2017 7:40 am
Contact:

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

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

User avatar
mat1k
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Sat Dec 22, 2018 8:48 am
Contact:

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

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

Dracarias
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Mar 10, 2017 11:56 pm
Contact:

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

Post 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!

Dracarias
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Mar 10, 2017 11:56 pm
Contact:

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

Post 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!

Post Reply

Return to “Modding help”