Ludeon Forums

Ludeon Forums

  • November 13, 2019, 02:26:20 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 5

Author Topic: [1.0] Avoid Friendly Fire (stop shooting when friendlies are in the way)  (Read 31646 times)

falconne

  • Colonist
  • ***
  • Posts: 142
  • Refugee
    • View Profile

This mod should hopefully alleviate some of the micromanagement needed to stop ranged colonists shooting friendlies, without changing the way friendly fire works in the game or reducing its potency.

Colonists who have the Avoid Friendly Fire option enabled will not take a shot if the projectile's path could hit a friendly or neutral pawn (taking into account miss radius). Drafted colonists will look for a target with a clean shot (or wait if there isn't one), while hunters will reposition themselves.

Usage
Any colonist with an appropriate weapon will show an “Avoid Friendly Fire” toggle button when they are selected (which is On by default; you can toggle it off for individual colonists). With this On their AI will automatically do the right thing.

If you manually try to force a drafted colonist who is set to avoid friendly fire to shoot an enemy with a friendly in the way, you will see a "Cannot hit target" message as you would if LoS was blocked.

Shooters who are being blocked by friendlies (but would otherwise have a target) will have their name on the map and in the Colonist Bar be written in cyan. Likewise, the first friendly blocking any shooter will show up in green.

There is a setting in the Mod Options screen to always enable 'Avoid FF' status on a pawn when it's undrafted. If you tend to disable the 'Avoid FF' setting on pawns during combat, using this option will ensure it is always turned back on again before the next combat. This option is off by default.



Shield Belts
Shooters will not worry about pawns wearing a shield belt with at least 10% power standing in the line of fire, so you can still use shielded infantry to attack while ranged troops continue to fire over them from behind. If the shield drops below 10% power while the pawn is still subject to friendly fire, then the shooters will stop. They will resume shooting after the shield gets above 10%.

Targeting Overlay
If you use the game’s manual targeting button (the one with the B hotkey that then shows the weapons range), you will see a red overlay that appears from the shooter to where you point the mouse (see image). This overlay shows the potential “fire cone” from a standard ranged weapon in the game, from the shooter to a target under the mouse (miss radius depends on weapon and shooter skill). Any pawn within the red overlay could potentially be hit. This is purely a visual aid for planning and can be disabled from the Mod Settings menu if you don’t like it. Note that pawns within 4 tiles of the shooter do not receive friendly fire, so the overlay does not mark them red and the mod takes this into account when deciding if a shooter should stop. In the example image the shooter on the top right will not shoot the pirate on the bottom left because the colonist "Flip" could potentially get hit.

Animals
By default the mod will also take into account animals with an assigned master and protect them from friendly fire, so you should be able to use and release trained animals without them getting shot. In the Mod Settings you can disable this, or expand it to include all tamed colony animals, such as livestock, but this is off by default as it could be annoying and cause performance issues on slower machines.

Downloads
Steam Workshop
Direct Download



Notes

This can be added to an existing save.

This mod is compatible with the Combat Extended mod, however the more complex fire trajectory in CE may mean this mod may not be 100% effective at very long ranges.

Current Limitations
  • Does not protect against friendly fire from explosive weapons such as grenades or rockets. They will be used as normal and you will need to micromanage them as before.
  • Will protect neutral pawns on your map, but not animals owned by them. E.g., if there are traders around during a raid, your colonists will avoid hitting them but not watch out for their animals. Should be fixed in the future.
  • Only affects the AI of your colonists. Does not prevent the computer controlled factions shooting their own troops; that’s a hard problem.
  • Only affects the AI of shooters, who will stop shooting when someone gets in the way. Nothing is done to stop undrafted pawns from wandering into the middle of battle; again a harder problem to solve.

Translations:
* Japanese by @Proxyer
* Traditional Chinese by @FantasyMusic
« Last Edit: March 14, 2019, 03:09:22 AM by falconne »
Logged

Kori

  • Colonist
  • ***
  • Posts: 538
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #1 on: September 11, 2017, 12:45:33 AM »

Looks very useful, is it compatible with CE?


edit: Not sure if this is a mod conflict, but when starting a new colony with this mod enabled, you won't be able to see any UI info elements on the landing site selection screen and changing a once selected spot is not possible anymore.
This occurs only on the landing site screen, the world view of existing games works fine.
« Last Edit: September 11, 2017, 01:37:55 AM by Kori »
Logged

falconne

  • Colonist
  • ***
  • Posts: 142
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #2 on: September 11, 2017, 02:38:14 AM »

Not sure if this is a mod conflict, but when starting a new colony with this mod enabled, you won't be able to see any UI info elements on the landing site selection screen and changing a once selected spot is not possible anymore.
This occurs only on the landing site screen, the world view of existing games works fine.

Thanks, I will look into that now.
« Last Edit: September 11, 2017, 03:12:33 AM by falconne »
Logged

falconne

  • Colonist
  • ***
  • Posts: 142
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #3 on: September 11, 2017, 03:56:41 AM »

I've fixed the bug on the landing site selection screen and the download link has been updated to the new version.

I'm not sure if this would be compatible with Combat Extended. This mod assumes all regular ranged weapons use a one tile miss radius. I will have to see if CE make that larger or variable for each weapon. Other than that there should be no reason for incompatibility, so long as CE uses Harmony patching and does not overwrite vanilla code this mod depends on.
Logged

Kori

  • Colonist
  • ***
  • Posts: 538
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #4 on: September 11, 2017, 08:26:54 PM »

I've fixed the bug on the landing site selection screen and the download link has been updated to the new version.

I'm not sure if this would be compatible with Combat Extended. This mod assumes all regular ranged weapons use a one tile miss radius. I will have to see if CE make that larger or variable for each weapon. Other than that there should be no reason for incompatibility, so long as CE uses Harmony patching and does not overwrite vanilla code this mod depends on.

Thanks for the quick fix, I hope both mods will be compatible. :)
Logged

falconne

  • Colonist
  • ***
  • Posts: 142
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #5 on: September 13, 2017, 03:57:44 AM »

This is now available on the Steam Workshop too
Logged

falconne

  • Colonist
  • ***
  • Posts: 142
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #6 on: September 14, 2017, 05:48:52 AM »

Just published a new version that fixes a bug where the FF toggle button for a selected pawn does not go away when an Architecture toolbox is opened. Please update if you have manually downloaded the mod.
Logged

Crow_T

  • Colonist
  • ***
  • Posts: 271
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #7 on: September 14, 2017, 04:57:41 PM »

Can't wait to try this out, thanks for making this! I noticed on the Reddit thread earlier that some people wanted exceptions, eg bloodlust trait will ignore this and fire away as usual. Making trigger happy ignore this would make some sense as well if you decide to go that route. Either way making pawns smarter is always good :)
Logged
(regarding dead man's apparel)
"I think, at the very least, the buff should go away for jackets so long as you're wearing the former owner's skin as a shirt."
-Condaddy20

SpaceDorf

  • Transcendent
  • *****
  • Posts: 4032
  • Secretly Captain Obvious
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #8 on: September 14, 2017, 05:01:26 PM »

Post to follow :)
Logged
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

Maeyanie

  • Drifter
  • **
  • Posts: 29
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #9 on: September 14, 2017, 09:22:20 PM »

I'm not sure if this would be compatible with Combat Extended. This mod assumes all regular ranged weapons use a one tile miss radius. I will have to see if CE make that larger or variable for each weapon. Other than that there should be no reason for incompatibility, so long as CE uses Harmony patching and does not overwrite vanilla code this mod depends on.

I tried it with CE, figuring if the 1-tile miss radius assumption wasn't ideal, it would still help with the worst cases. Unfortunately it didn't seem to work at all, the FF button didn't even show up on CE-enabled weapons.
Logged

falconne

  • Colonist
  • ***
  • Posts: 142
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #10 on: September 14, 2017, 09:28:40 PM »

I tried it with CE, figuring if the 1-tile miss radius assumption wasn't ideal, it would still help with the worst cases. Unfortunately it didn't seem to work at all, the FF button didn't even show up on CE-enabled weapons.

Yes based on the reply they posted they've done a change to vanilla that at the moment makes it impossible fo rmy mod to work with it. I have to post a follow up question with a possible workaround.
Logged

falconne

  • Colonist
  • ***
  • Posts: 142
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #11 on: September 16, 2017, 06:36:07 AM »

Latest version should now be compatible with Combat Extended. If you are trying this mod with that one, please observe the colonists during a raid and let me know if they aren't behaving right.
Logged

falconne

  • Colonist
  • ***
  • Posts: 142
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #12 on: September 17, 2017, 03:16:26 AM »

Just fixed a bug where colonists were not putting out fires when friendlies are standing next to them (it seems putting out fires is considered an attack).

Please update if you are using the manual download.
Logged

Maeyanie

  • Drifter
  • **
  • Posts: 29
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #13 on: September 17, 2017, 11:36:23 PM »

Latest version should now be compatible with Combat Extended. If you are trying this mod with that one, please observe the colonists during a raid and let me know if they aren't behaving right.

Seems to work. Only minor problem I noticed in testing was if a colonist is already aiming for a shot, they won't cancel it if someone moves in the way by the time they fire.

Not sure if it's possible to do a second check before firing, but even if not, it's way better than vanilla behaviour.
Logged

Kori

  • Colonist
  • ***
  • Posts: 538
  • Refugee
    • View Profile
Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
« Reply #14 on: September 17, 2017, 11:46:04 PM »

Latest version should now be compatible with Combat Extended. If you are trying this mod with that one, please observe the colonists during a raid and let me know if they aren't behaving right.

Thank you!
Logged
Pages: [1] 2 3 ... 5