Need help resolving issue with turrets

Place to get help with not working mods / modding interface.
Joeykyle88
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Jun 07, 2018 6:52 am
Contact:

Need help resolving issue with turrets

Post by Joeykyle88 »

Part of the mod I'm creating is a new type of turret but I'm having the problem of it destroying other machines if they're in the line of fire, is there any way to make the projectiles it shoots not damage other machines?
I'm a modder, and I make mods, they usually don't work for a while but sometimes they do work, occasionally they work well enough to put on the Factorio mods website

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5221
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Need help resolving issue with turrets

Post by Klonan »

In 0.17 you can set the projectiles to only hit entities of a certain force,
In 0.16 it is not possible

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Need help resolving issue with turrets

Post by eradicator »

Klonan wrote:In 0.17 you can set the projectiles to only hit entities of a certain force,
Is that limited to exactly one force, or are groups allowed? I.e an "all hostile forces" or "all friendly forces" group. (Thinking of multi-team pvp situations)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5221
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Need help resolving issue with turrets

Post by Klonan »

eradicator wrote:
Klonan wrote:In 0.17 you can set the projectiles to only hit entities of a certain force,
Is that limited to exactly one force, or are groups allowed? I.e an "all hostile forces" or "all friendly forces" group. (Thinking of multi-team pvp situations)
As follows:
  • All,
  • Enemy,
  • Ally,
  • Friend,
  • NotFriend,
  • Same,
  • NotSame
If you have a suggestion for more, it is easy to add them

Schallfalke
Fast Inserter
Fast Inserter
Posts: 162
Joined: Sun Oct 28, 2018 7:57 am
Contact:

Re: Need help resolving issue with turrets

Post by Schallfalke »

I guess this is highly-related, so I am not creating a new post asking.

I assume the above is for the projectiles on which entities they are affected, right?

How about for the guns targeting? Is it possible to target "ally"/"friend" only?
I tried to make a heal turret firing negative damage projectiles. It can heal entities, but the turret is not firing at friendly damaged entities. It keeps firing on and healing enemies instead. (I have both force = "ally" lines, seems no effect.)
PS: I made a heal gun firing the same projectile. It can heal any entities (both friendly and enemy).

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5221
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Need help resolving issue with turrets

Post by Klonan »

Schallfalke wrote:
Fri Dec 07, 2018 9:57 pm
How about for the guns targeting? Is it possible to target "ally"/"friend" only?
Unfortunately at the moment this is a hardcoded search, it will only find enemy units

Potentially it can be changed in the future, but its not a priority

Post Reply

Return to “Modding help”