[Rseding] [0.17.69] Enemy combat bots gui show damage based on player force modifiers.
Posted: Sat Sep 28, 2019 6:48 pm
Steps
1. Set enemy and player damage modifiers
2. Spawn a Combat bot - In this case, il be using a distractor.
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.
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
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))
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'));
5. Affected modifiers - bullet, combat-robot-laser, combat-robot-beam