[Klonan] [15.20] robots_battery_modifier doesn't increase energy max

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Dustine
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Tue Mar 31, 2015 4:52 pm
Contact:

[Klonan] [15.20] robots_battery_modifier doesn't increase energy max

Post by Dustine »

It seems that LuaForces::worker_robots_battery_modifier is restricted by max_energy and only affects the initial energy for when a robot entity is spawned, which if intended behaviour (seems so, but...) leads to some really weird behaviour. As in (replication steps):
  1. Start a brand new world (no mods needed, vanilla is enough to replicate)
  2. Run the following to increase a robot's storage from 1.5MJ to 3MJ (+100%)

    Code: Select all

    /c game.player.force.worker_robots_battery_modifier = 1
  3. Spawn a construction-robot (without any roboport around) and select it (notice it'll most likely be at 2.9MJ)
  4. Run the following to attempt to charge a bot to its initial charge

    Code: Select all

    /c game.player.selected.energy = 3000000
  5. Notice that the robot's charge instantly drained to 1.4MJ (1.5MJ with some idle drain)
This is troublesome because if any mod or script tries to change a bot's energy, it won't be able to make it resume its initial levels and instead be constrained by max_energy, leading to potential energy losses as above. I didn't add a savegame as this can be quickly replicated on the sandbox, hope that's okay.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Klonan] [15.20] robots_battery_modifier doesn't increase energy max

Post by Rseding91 »

Thanks, this should be fixed for the next version of 0.15.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Dustine
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Tue Mar 31, 2015 4:52 pm
Contact:

Re: [Klonan] [15.20] robots_battery_modifier doesn't increase energy max

Post by Dustine »

Rseding91 wrote:Thanks, this should be fixed for the next version of 0.15.
Thank you so much for the quick fix!

Post Reply

Return to “Resolved Problems and Bugs”