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
3 years ago
0.17 - 1.1
5.66K
Combat

b [Fixed?] Bug Acid Splash and Error loading mod

3 years ago

I can't play with this mod anymore sadly. First of all the Error Message:
"Failed to load mods: WaterTurret/data-final-fixes.lua:198: attempt to index field'?'(a nil value) stack traceback: WaterTurret/data-final-fixes.lua.198: in main chunk"

So what happen was, that because of the mod my atillery and also personal laser started firing at acid splashes, which in return (with atillery) destroyed my turrets that got spit on, which is uhm not good for my defense line.
After I noticed this (way too late) I did 2 things, first I unchecked the "clean acid" mark and after that I updated another mod (ammo loader).
Now I can't load you mod anymore since the error message appears and I have to disable it.

I really enjoy the waterturret especially since they don't damage walls anymore now, sadly I can't seem to find a solution to making it work again.

Thanks for your attention and this cool mod you made :)

3 years ago

Hi!

I can't play with this mod anymore sadly. First of all the Error Message:
"Failed to load mods: WaterTurret/data-final-fixes.lua:198: attempt to index field'?'(a nil value) stack traceback: WaterTurret/data-final-fixes.lua.198: in main chunk"

Sorry for the crash! But it's easily fixed: Unpack the mod and open data-final-fixes.lua with any editor you like. Look for this:

------------------------------------------------------------------------------------
--                         Set resistances for acid dummy                         --
------------------------------------------------------------------------------------

This block causes the crash. Just put

if data.raw[WT.dummy_type][WT.acid_dummy_name] then

before the first line of code in this block and

end

after the last line.

So what happen was, that because of the mod my atillery and also personal laser started firing at acid splashes, which in return (with atillery) destroyed my turrets that got spit on, which is uhm not good for my defense line.

Oh, darn! I've noticed something similar before, where my gun turrets attacked the fire dummies (they couldn't hurt them, but were locked on the target) while enemies killed the water turrets. I'll need to check this for the acid dummies as well…

After I noticed this (way too late) I did 2 things, first I unchecked the "clean acid" mark and after that I updated another mod (ammo loader).
Now I can't load you mod anymore since the error message appears and I have to disable it.

I really enjoy the waterturret especially since they don't damage walls anymore now, sadly I can't seem to find a solution to making it work again.

Thanks for your attention and this cool mod you made :)

With the fix shown above, you should be able to load the game again even if cleaning acid is disabled. I'll upload a fix once I've figured out how to best prevent the other turrets from fighting acid. There must be something wrong with the target masks …

Anyway, thanks for the report!

3 years ago

So what happen was, that because of the mod my atillery and also personal laser started firing at acid splashes, which in return (with atillery) destroyed my turrets that got spit on, which is uhm not good for my defense line.

I've finally figured out why artillery turrets tried to put out fire: The wiki describes that artillery turrets "only target enemy structures (spawners and worms), not mobile units (biters and spitters)". On reading further, it seems that's only valid for vanilla games in single-player. The dummies I use to mark acid and fire are simple-entity-with-force prototypes, and a simple-entity-with-force is considered a military structure. Do you play in multiplayer mode? If so, perhaps you could try if artillery turrets target laser turrets or radars of players from another force. They should because these are military structures as well.

Using another prototype for the dummies is the obvious solution. I'll give simple-entity-with-owner a chance, as it has been recommended by both Bilka (one of the developers) and Deadlock (author of "Industrial Revolution"). With some luck, I'll get the fix out over the weekend.

3 years ago

Hey,
Thanks for your replies, I just saw them now,

I reinstalled your mod, changed the code as you said and now it works again, thanks a lot!

The game mode I play in is actually single player, so that shouldn't apply I think, but maybe the acid splash is considered an enemy structure regardless of the mode ? Sadly I don't know anything about coding so I probably can't give good suggestions.

Thanks again and have a nice day :)

3 years ago

Hey there it's me again.
So I played again after the hotfix and it seems that the turrets don't attack acid anymore, but fire ist also attacked, so I had to take the mod out again sadly.
Is there a simple way to stop all turrets shooting at fire/acid ? I mainly use the water turret as a defense tool so I would be fine with that.
have a nice day

3 years ago
(updated 3 years ago)

Is there a simple way to stop all turrets shooting at fire/acid ? I mainly use the water turret as a defense tool so I would be fine with that.
I've made the dummies combat-bots again for the next version. This way, they aren't a military structure and won't be attacked by artillery. There also was a real bug where I messed up the ignore/attack target masks of turrets and worms. That was the reason why normal gun turrets etc. would also target dummies (which they couldn't hurt or kill, so they would be locked on their target until the dummies expired). This is also fixed for the next version.

PLDs and spidertrons have the same issue. However, just like artillery turrets they don't have target masks, so I don't see a way yet to prevent them from targeting the dummies. I've made an interface request, but there has been no response yet. No idea what to do about this.

I guess I'll upload soonish. Lots of changes for the next version (and it seems I've really cut down on performance this time), the only thing apart from the missing target masks that still bothers me is the balancing of the fluid recipes. But that's a rather minor thing which can be fixed later on -- not such a game breaker as the other bugs.

3 years ago

Please try version 1.0.2!

3 years ago
(updated 3 years ago)

Hey there,
Thanks for your time to respond me every time, I will check out the new version just now :)
If I don't write back here expect that there was no problem anymore hehe.
Cheers!

P.S. about the balancing, yeah true that shouldn't be too big of a deal to balance some day, since it's not that urgent :)

3 years ago

Sadly my personal laser turrets started attacking every acid puddle again (which all were on flame for some reason)
I updated to the newest version and didn't change anything else. I wish I could help out somehow, but again I don't know anything about modding ^^

If I understood the last post of the creators correctly there should be more target mask, maybe that will help.

Have a nice day !

3 years ago
(updated 3 years ago)

Sadly my personal laser turrets started attacking every acid puddle again

Hi! Just to make sure we don't mean different things: Personal laser defense is what starts attacking acid? Then it's exactly the target mask thing I can't do anything about.

every acid puddle again (which all were on flame for some reason)

That's really a bug on my end! I've only come up with the idea that the turrets should also clean up acid puddles because, internally, they also are based on the fire prototype. So, if acid is to be cleaned up, the acid puddles are marked with a different dummy, which is just a copy of the fire dummy, but with a different trigger_target_mask, so I can set steam turrets to attack acid dummies, but to ignore fire dummies.

The fire you see on acid is not really a fire, but just a fire animation doing no damage at all. I made that because people complained that the turrets would shoot at empty ground. But fires are tricky: In the beginning, you'll see flames. When the flames are gone, the fire still is there for some time (but without flames), and the dummies will be removed only if the total time_to_live of a fire (i.e. flame-period + burned_patch period) is over, of if the dummy has been destroyed. So the flame animation is just a visual indicator that there still is a fire.

Things to do: Let the dummies do fire damage to anything coming near them. Remove the fire animation of acid dummies. I'll add this for 1.0.3.

If I understood the last post of the creators correctly there should be more target mask, maybe that will help.

Where did you read that? I've read FFF-363 and the list of upcoming changes again right now, but I didn't see anything there about target masks (collision masks were mentioned somewhere, but that's something different).

I updated to the newest version and didn't change anything else. I wish I could help out somehow, but again I don't know anything about modding ^^

Nothing to worry about! Reporting bugs and pointing out where things go wrong does help a lot! :-)

Have a nice day !

Thanks, same to you! I'll try to fix the acid-has-fire issue this week. However, my RL job will require more of my time than usual for a while, so no promises that I'll really get it done on time …

3 years ago

Hey there, thanks again for your response :-)

I checked on that save again and yes glady it's "only" the personal laser defense and nothing else (at it's not least normal laser turrets/bullet turrets and artillery) I must have misunderstood the target mask problem to be gone with the newest version, that's why I mentioned it again.

That the fire isn't real I already noticed. I was just confused. if it should be that way, but it doesn't bother in anyway (now they are just flaming acid spitters haha).

Ah okay I thought the collision masks would help in some way, since they made the spidertron move out of the way, but yeah makes sence that it doesn't help here, because it's another mask.

Glad to help out just reporting these bugs, I can imagine it being a lot of work so thanks again for your effort and don't worry about time at all (at least not for me) I play this game very irregulary anyways. I hope you are doing fine in your RL job, that's more important hehe

3 years ago

I have a suggestion, is it possible to make the acid and fire extingishable only if there is a turret in range ?
Because that would at least solve the problem of personal lasers shooting at acid when running through enemy camps

3 years ago
(updated 3 years ago)

No, that's not possible. Fires are not really extinguishable, but they spawn dummies that can be killed. In order to make them a proper target, I must assign them a trigger_target_mask, add that as attack_target_mask to my turrets and as ignore_target to all other turrets. All these things affect prototypes, so they happen during the data stage and can't be changed later on during the game.

We already had what you suggested in the first version of the mod I've made with a control script. Actually, it worked the other way around, but it amounts to the same thing: Check all turrets in regular intervals, check if there are fires in range that should be damaged, create the dummy, and target it. This is slow (because the turrets will have to wait their turn before searching for fires), and I have to do a search for each turret all the time, which is expensive in terms of UPS. The way it works now, I don't need to search for fires at all: It's the game that creates the fires and dummies, and its the game that lets the turrets look for a suitable target -- so the game does all the heavy work, and the mod has just to keep fires and dummies in sync (destroy dummies if their fire has expired, or remove fires if their dummies have been killed), adjust damage amounts (e.g. do additional damage for hotter steam), and exchange turrets (although they look the same, water turrets can only shoot water, so another entity is needed when they are connected to steam; the same thing applies to fire extinguisher turrets shooting water or extinguisher fluid).

I'm quite glad I've finally got there after a long journey of trial and error, and it really seems to be the best way to handle it (other mods use the same technique, as I noticed after I'd figured out how to spawn the dummies automatically). The only problem is that artillery turrets, PLD, and spidertron act differently because they don't have have ignore_target_mask and attack_target_mask. So we have to convince the devs that they should add this -- pushing this thread may or may not help to get their attention.

3 years ago

That the fire isn't real I already noticed. I was just confused. if it should be that way, but it doesn't bother in anyway (now they are just flaming acid spitters haha).

The fire is for real now (version 1.0.3), and there shouldn't be fire on acid splashes anymore. Thanks again for pointing out this issue! :-D

3 years ago

Acide spash are target by laser (in armor)
rocket on spidertron
and by gun (on charater auto aim)

2 years ago
(updated 2 years ago)

observation:
it seems that with water turret: personal laser defence shoots poison spots with higher priority than critters. That is unpractical when in an enemy hive shooting poison and not critters.
(maybe it is the combination with a bunch of other mods. But it is solved when I turn this mod off. That's too bad. I liked it early game with steam power.
Kind regards

2 years ago
(updated 2 years ago)

@Fr_Dae

Acide spash are target by laser (in armor)
rocket on spidertron

That's a known issue, same as with artillery.

and by gun (on charater auto aim)

Oh, I didn't notice that yet!

@alby8:

it seems that with water turret: personal laser defence shoots poison spots with higher priority than critters. That is unpractical when in an enemy hive shooting poison and not critters.
(maybe it is the combination with a bunch of other mods.

Known issue. It has nothing to do with other mods, but with limitations of Factorio.

I've already made a modding interface request about this about 6 months ago. So far, there's been no response by the devs. Also, I've not come up with a work-around. The only thing to do may be adding an option to disable the fire-extinguishing feature. This way, you could turn it on until some problematic tech (PLD/artillery/spidertron) has been researched. Unfortunately, it's not possible to make this option a player setting (which could be changed directly) because it requires changes to some prototypes. Thus, toggling the option would restart the game. That's not only ripping out half the features, but doing it with bare hands -- not even in an elegant way. :-D

4 months ago

Any update on this? Getting quite annoying having turrets dumping thousands of extra magazines and being distracted by indestructible fire/acid pools...

New response