[Twinsen] Capsule lifetime isn't changed in UI

This subforum contains all the issues which we already resolved.
Post Reply
Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

[Twinsen] Capsule lifetime isn't changed in UI

Post by Honktown »

If one modifies the force.following_robots_lifetime_modifier, it takes effect but doesn't modify the tooltip, unlike damage, firing rate, etc.
defender.png
defender.png (687.79 KiB) Viewed 2907 times
I have mods! I guess!
Link

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [Twinsen] Capsule lifetime isn't changed in UI

Post by Honktown »

If you want, here's a control.lua to experiment:

Code: Select all

local commands_table = {}

commands_table.follower_lifetime_bonus = {}
commands_table.follower_lifetime_bonus.command = "follower_lifetime_bonus"
commands_table.follower_lifetime_bonus.help = "add or subtract to following_robots_lifetime_bonus. no +/- sets the value, no number prints the value. Value can be decimal"
commands_table.follower_lifetime_bonus.func = function(callback)
  local prm = callback.parameter
  local player_index = callback.player_index
  local value = nil
  local sign = nil

  if prm ~= nil then
--    game.player.print("string passed was " .. prm)
  else
  --  game.player.print("nothing was passed")
  end

  if prm == nil then prm = "" end
  sign = string.match(prm, "^([+-])")
  value = string.match(prm, "^[+-]?([0-9]*%.?[0-9]*)")

  -- the pattern [0-9]*%.?[0-9]* may match none, none, none, producing a successful ""
  if value == nil or value == "" then
    game.player.print("No or invalid value. The current bonus is " .. game.get_player(player_index).force.following_robots_lifetime_modifier)
    return
  end

  --implicitly prm is not nil for this
  if sign == nil then
    game.player.print("setting follower lifetime bonus to " .. value)
    game.get_player(player_index).force.following_robots_lifetime_modifier = tonumber(value)
    game.player.print("Bonus is now: " .. game.get_player(player_index).force.following_robots_lifetime_modifier)
    return
  elseif sign == "+" then
    game.player.print("Adding to bonus")
    game.get_player(player_index).force.following_robots_lifetime_modifier = game.get_player(player_index).force.following_robots_lifetime_modifier + tonumber(value)
    game.player.print("Bonus is now: " .. game.get_player(player_index).force.following_robots_lifetime_modifier)
    return
  elseif sign == "-" then
    game.player.print("Subtracting from bonus")
    game.get_player(player_index).force.following_robots_lifetime_modifier = game.get_player(player_index).force.following_robots_lifetime_modifier - tonumber(value)
    game.player.print("Bonus is now: " .. game.get_player(player_index).force.following_robots_lifetime_modifier)
    return
  end

  -- we should never reach here
  return
end


for _, cmd in pairs(commands_table) do
  commands.add_command(cmd.command, cmd.help, cmd.func)
end
I have mods! I guess!
Link

Twinsen
Factorio Staff
Factorio Staff
Posts: 1330
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: [Twinsen] Capsule lifetime isn't changed in UI

Post by Twinsen »

Fixed in Version: 0.18.0.

Thanks for the report.
Let me know if you notice other issues like this.

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [Twinsen] Capsule lifetime isn't changed in UI

Post by Honktown »

There's a tiny one I noticed, unrelated: (edit: I may not even call it a bug)

Unloading a mod migrates all the items etc, but it doesn't update map data. Not sure if there's a sane way to do it without showing someone an updated version of the map.

The purple/pinkish ore on the left was removed.
themapinquestion.png
themapinquestion.png (37.43 KiB) Viewed 2850 times
I have mods! I guess!
Link

Twinsen
Factorio Staff
Factorio Staff
Posts: 1330
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: [Twinsen] Capsule lifetime isn't changed in UI

Post by Twinsen »

We should have a system for re-charting the map when we think something changed, not sure why it's not happening in this case. Please make a separate bug report about it and someone should look at it.

Post Reply

Return to “Resolved Problems and Bugs”