Water Turret

by Pi-C

This mod provides an early game Water thrower that does minimal damage but slows down the enemies (use steam for extra damage!) and an advanced turret for extinguishing fires (use "Hardened pipes" to give it extra resistances!).

Content
4 years ago
0.17 - 1.1
6.36K
Combat

b [Fixed] lead_target_for_projectile_speed missing

4 years ago

The turret isn't leading its targets and missing completely all its shots. I checked the code and the lead_target_for_projectile_speed is commented out. It's just wasting water (limited resource for me) like this, nothing gets hit at all. Except my power poles and walls and things, which take damage from the water and which then triggers my bots to fly out and repair things. Unlike the enemy, which don't really take damage from water even in the unlikely scenario that they get hit.

4 years ago
(updated 4 years ago)

Thanks, you're right! That was already in the first version of the mod, which I inherited, so I just ignored it apparently. :-)

I'll definitely need to do some major rework of the mod. Until then, anybody who likes to fix that locally, edit line 479 of prototypes/entity.lua so that it looks like this:

lead_target_for_projectile_speed = 0.2* 0.75 * 1.5,

About powerpoles etc. taking damage: that shouldn't happen! I'll look into that as well.

4 years ago

... nothing gets hit at all. Except my power poles and walls and things, which take damage from the water ...

That's kind of a stupid bug. Please change this block (lines 966-976 in control.lua)

    ------------------------------------------------------------------------------------
    -- Return if wrong entity was attacked
    if turret and
       -- Water turret damaged something else than fire dummy
       (turret.name == WT.water_turret_name and entity.name ~= WT.fire_dummy_name) or
       -- Steam turret damaged fire dummy
       (turret.name == WT.steam_turret_name and entity.name == WT.fire_dummy_name) then

        turret.shooting_target = {nil}
        return
    end

by commenting out the "return". Does that work? Not at home right now, so I can't try it at the moment.

New response