Page 1 of 1

[Rseding] [0.17.69] Enemy combat bots gui show damage based on player force modifiers.

Posted: Sat Sep 28, 2019 6:48 pm
by TheKid0z
Steps

1. Set enemy and player damage modifiers

Code: Select all

/c game.print(game.forces.enemy.set_ammo_damage_modifier('combat-robot-laser',0))

Code: Select all

/c game.print(game.forces.player.set_ammo_damage_modifier('combat-robot-laser',-.2))
2. Spawn a Combat bot - In this case, il be using a distractor.

Code: Select all

/c local ent = game.surfaces[1].create_entity{name = "assembling-machine-1", position = {15, 3}, force = game.forces.enemy, recipe = "iron-stick"}; game.print(ent.surface.create_entity{name = "distractor", position = {15,3}, target = ent, force  = ent.force,speed=1}.force.get_ammo_damage_modifier('combat-robot-laser'));
3. The above command prints the enemy damage modifier which is 0 but the GUI shows player values. The actual damage they do is according to their own force value, its just visual.
Screenshot (148).png
Screenshot (148).png (3.7 MiB) Viewed 2744 times
4. This is similar for All 3 combat robots - defender, distractor, destroyer. It doesn't matter how the bots were created ie. - using a capsule / directly.

5. Affected modifiers - bullet, combat-robot-laser, combat-robot-beam

Re: [Rseding] [0.17.69] Enemy combat bots gui show damage based on player force modifiers.

Posted: Tue Oct 01, 2019 9:30 pm
by Rseding91
Thanks for the report. I don't have a solution to this at the moment.

The entire description system (tooltip system) was not built with showing not-your-forces stuff in mind. The tooltip you're seeing is a hybrid of live information from the entity itself - which isn't on your force - and from the description system using your force. The description system has no concept of "this is actually a description of an an entity that's not owned by me, that might be friendly, enemy, neutral, or other) and so this is where the issue comes from.

I don't consider it worth the time and code bloat it would take to go and re-work the entire description system to account for this when PvP Factorio is an after-thought. I'll mention this to the guy working on re-doing the styles for tooltips to see if he wants to try to account for this but I doubt he will want to.

Re: [Rseding] [0.17.69] Enemy combat bots gui show damage based on player force modifiers.

Posted: Tue Oct 01, 2019 9:48 pm
by Bilka
Thanks for the report, fixed for the next version.