Repair Turret

by Klonan

Adds Repair Turrets

Content
1 year, 3 months ago
0.17 - 1.1
84.8K
Combat Logistic network

b turrets do not repair damage unless they witness the damage

4 years ago

I think it is a bug since construction bots do not work like this.

I put rail and turret near rails. I drive a train into rail covered by turret. I stop and get out and damage train manually. turrets repair it. It works like this.

non-working case: I put rails and turret near rails. I damage the train far away (not near turrets area). then I drive train into turret area. turrets do not repair the damage until I damage the train manually within the covered area. train can stop or move, does not matter.

turrets only repair if they "witness" damage. they ignore the damage but also warn about missing bots (the icon about missing bots show up) if a damage entity enters its covered area.

4 years ago

Hmm, yea I changed it in that way, so that entities are only checked one time, and I assume they don't move

I will think about a fix for it

4 years ago

Ok I made a new release, they will check moving things every 5 seconds to see if they are damaged and if they have now moved into range of a repair turret.

4 years ago

I just tried it now, I got an error unfortunately on map load. I shall try to repro it if it is related to other mods.

Error while running event Repair_Turret::on_tick (ID 0)
Repair_Turret/script/repair_turret.lua:497: attempt to index field 'moving_entity_buckets' (a nil value)
stack traceback:
Repair_Turret/script/repair_turret.lua:497: in function 'check_moving_entity_repair'
Repair_Turret/script/repair_turret.lua:533: in function 'handler'
core/lualib/event_handler.lua:44: in function <core/lualib/event_handler.lua:42>

4 years ago

on a fresh map it works, existing map give above error (map related I suppose).

this time there is another issue (not a problem), unexpected side effect I suppose. turrets cannot repair train because it is too fast and they miss it always. train has to stop otherwise it shall not repair. I can live with that though.

thanks for your time and fix.

4 years ago

whoops, had the migration in the wrong place, should be fixed on existing maps now

New response