[UI] Friendly Fire Warning - v1.7

Distribute and discuss mods that are functional.
User avatar
kartoFlane
Posts: 1479
Joined: Mon Jan 14, 2013 10:20 pm

[UI] Friendly Fire Warning - v1.7

Postby kartoFlane » Thu May 17, 2018 12:41 pm

About

Ever shot your mechs without meaning to? Or caused bump damage that you didn't notice? This mod is for you.

Every time you try to execute an attack that would cause friendly fire - either directly or indirectly - this mod will show a dialog window asking you to confirm your targeting decision.

The mod currently detects the following forms of friendly fire, customizable by mod options:
  • Direct damage to friendly pawns or buildings
  • Indirect damage via push (pushing a friendly into obstacle; causing another unit to bump into a friendly or building)
  • Destroying the Time Pod
  • Non-damaging attacks removing Shield
  • Non-damaging attacks applying ACID, Fire, Frozen, or Smoke
  • Pushing a friendly causing a negative effect: Fire, ACID, Smoke tiles, pushing non-Massive pawns into water, pushing non-Flying pawns into holes
Environmental (and other) effects not included.

Image


Download

Download link: [ Version 1.7 ]

This mod requires mod loader version 2.3.5 or higher.


Known Issues

  • Attacks performed by confirming friendly fire don't make the Reset Turn button clickable.
  • Aftrer dismissing the window, game thinks the mouse cursor is in the old position until you move the mouse. This is a limitation of the modded UI system, and can't be fixed at the moment.

Changelog

Code: Select all

Version 1.7
- Fixed undo-move bug abuse
- Weapons can now define 'kf_FFW_GetFriendlyFireSkillEffect' function to return a different SkillEffect to FriendlyFireWarning.
  Useful for very complex weapons that require a lot of hacks to get the game to display the correct preview.

Version 1.6
- Weapons can now define `kf_FFW_Ignore` field and set it to `true` to cause the weapon to never be checked for friendly fire.
- Weapons can now define `kf_FFW_IsFriendlyFire` function to implement a customized check for whether the skill will result in friendly fire.

Version 1.5.3
- Even more fixes to modApiExt

Version 1.5.2
- Minor fixes in underlying modApiExt

Version 1.5.1
- Minor fixes in underlying modApiExt

Version 1.5
- The warning dialog now shows reasons why the attempted action is considered as friendly fire. (can be disabled in options)
- Fixed an issue where upgraded weapons sometimes wouldn't be processed correctly for friendly fire.
- Fire warning will not be shown if the pawn is shielded, immune to fire, or frozen.
- Freeze warning will not be shown if the pawn is shielded.
- Smoke warning will not be shown if the pawn is immune to smoke.
- Fire, ACID, Smoke, and Freeze warnings will no longer be shown if the pawn is already afflicted by that status.
- Damage warning now takes Armor and ACID into account.
- Added warning when pushing non-Massive pawn into water.
- Added warning when pushing non-Flying pawn into a hole.
- Added warning when pushing a pawn onto a Fire tile. (same exceptions as direct application of Fire status)
- Added warning when pushing a pawn onto an ACID tile.
- Added warning when pushing a pawn onto a Smoke tile.
- Added warning when the attack would destroy the Time Pod. (via direct damage, or pushing a hostile)
- Various warnings now take pilot skills into account.

Version 1.4
- Added sound when the warning dialog is shown
- Fixed a bug that prevented the warning from being shown in some cases (hovering over a tile and selecting weapon with a hotkey, then clicking)
- Friendly fire warning can now trigger on damage to buildings (configurable)

Version 1.3
- Friendly fire via push warning no longer triggers on pawns that cannot be pushed (eg. train, dam, etc.)
- Updated modApiExt to version 1.11

Version 1.2
- Fixed crash when trying to repair
- Fixed crash when misclicking outside of a weapon's targeting area with some weapons

Version 1.1
- Friendly fire warning should no longer trigger on self-damage

Version 1.0
- Initial release
Last edited by kartoFlane on Thu Jan 02, 2020 12:43 am, edited 14 times in total.
Superluminal2 - a ship editor for FTL
User avatar
Blue_Tree
Posts: 21
Joined: Thu Jan 18, 2018 5:18 pm

Re: [UI] Friendly Fire Warning

Postby Blue_Tree » Thu May 17, 2018 7:43 pm

Is there a way to disable the ui when we use weapon that do self-damage ? Because it's quickly annoying with the Hazardous Mechs and I don't want to disable the mod because it's always useful when you missclick
User avatar
kartoFlane
Posts: 1479
Joined: Mon Jan 14, 2013 10:20 pm

Re: [UI] Friendly Fire Warning - v1.1

Postby kartoFlane » Fri May 18, 2018 4:50 pm

Done and done! Not sure if it'll work perfectly, so do let me know if it doesn't work as expected.
Superluminal2 - a ship editor for FTL
User avatar
kartoFlane
Posts: 1479
Joined: Mon Jan 14, 2013 10:20 pm

Re: [UI] Friendly Fire Warning - v1.4

Postby kartoFlane » Tue Jun 26, 2018 6:42 pm

Updated to version 1.4. Changes:
  • Added sound when the warning dialog is shown
  • Fixed a bug that prevented the warning from being shown in some cases (hovering over a tile and selecting weapon with a hotkey, then clicking)
  • Friendly fire warning can now trigger on damage to buildings (configurable)
Superluminal2 - a ship editor for FTL
User avatar
kartoFlane
Posts: 1479
Joined: Mon Jan 14, 2013 10:20 pm

Re: [UI] Friendly Fire Warning - v1.5

Postby kartoFlane » Sun Aug 19, 2018 11:32 am

Released version 1.5. Plenty of changes:

  • The warning dialog now shows reasons why the attempted action is considered as friendly fire. (can be disabled in options)
  • Fixed an issue where upgraded weapons sometimes wouldn't be processed correctly for friendly fire.
  • Fire warning will not be shown if the pawn is shielded, immune to fire, or frozen.
  • Freeze warning will not be shown if the pawn is shielded.
  • Smoke warning will not be shown if the pawn is immune to smoke.
  • Fire, ACID, Smoke, and Freeze warnings will no longer be shown if the pawn is already afflicted by that status.
  • Damage warning now takes Armor and ACID into account.
  • Added warning when pushing non-Massive pawn into water.
  • Added warning when pushing non-Flying pawn into a hole.
  • Added warning when pushing a pawn onto a Fire tile. (same exceptions as direct application of Fire status)
  • Added warning when pushing a pawn onto an ACID tile.
  • Added warning when pushing a pawn onto a Smoke tile.
  • Added warning when the attack would destroy the Time Pod. (via direct damage, or pushing a hostile)
  • Various warnings now take pilot skills into account.
Superluminal2 - a ship editor for FTL
User avatar
kartoFlane
Posts: 1479
Joined: Mon Jan 14, 2013 10:20 pm

Re: [UI] Friendly Fire Warning - v1.7

Postby kartoFlane » Thu Jan 02, 2020 12:41 am

So for some reason I had a new version of this mod sitting on my hard drive that I somehow forgot to release. It includes a fix for the undo-abuse bug, so it's fairly significant... Also some convenience features to play nice with other mods, like marking a weapon as ignorable for purposes of friendly fire, or custom SkillEffect for purposes of friendly-fire checks.

Code: Select all

Version 1.7
- Fixed undo-move bug abuse
- Weapons can now define 'kf_FFW_GetFriendlyFireSkillEffect' function to return a different SkillEffect to FriendlyFireWarning.
  Useful for very complex weapons that require a lot of hacks to get the game to display the correct preview.

Version 1.6
- Weapons can now define `kf_FFW_Ignore` field and set it to `true` to cause the weapon to never be checked for friendly fire.
- Weapons can now define `kf_FFW_IsFriendlyFire` function to implement a customized check for whether the skill will result in friendly fire.
Superluminal2 - a ship editor for FTL

Who is online

Users browsing this forum: No registered users and 4 guests