Ludeon Forums

RimWorld => Mods => Releases => Topic started by: falconne on September 10, 2017, 06:16:37 AM

Title: [1.1] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 10, 2017, 06:16:37 AM
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.

(https://i.imgur.com/H9ykVUQ.png)

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 (http://steamcommunity.com/sharedfiles/filedetails/?id=1134165362)
Direct Download (https://github.com/Falconne/AvoidFriendlyFire/releases)



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

Translations:
* Japanese by @Proxyer
* Traditional Chinese by @FantasyMusic
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Kori 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.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 11, 2017, 02:38:14 AM
Quote from: Kori on September 11, 2017, 12:45:33 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.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne 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.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Kori on September 11, 2017, 08:26:54 PM
Quote from: falconne 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.

Thanks for the quick fix, I hope both mods will be compatible. :)
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 13, 2017, 03:57:44 AM
This is now available on the Steam Workshop too
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne 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.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Crow_T 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 :)
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: SpaceDorf on September 14, 2017, 05:01:26 PM
Post to follow :)
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Maeyanie on September 14, 2017, 09:22:20 PM
Quote from: falconne on September 11, 2017, 03:56:41 AM
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.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 14, 2017, 09:28:40 PM
Quote from: Maeyanie on September 14, 2017, 09:22:20 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.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne 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.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne 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.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Maeyanie on September 17, 2017, 11:36:23 PM
Quote from: falconne 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.

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.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Kori on September 17, 2017, 11:46:04 PM
Quote from: falconne 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.

Thank you!
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 17, 2017, 11:56:34 PM
Quote from: Maeyanie on September 17, 2017, 11:36:23 PM
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.

Interesting. In my testing I found that the pawns already do regular rechecks during their warmup to check if they can still see the target. Are you sure the other colonist actually walked into a danger tile? If they were within 4 tiles of the shooter they are not subject to friendly fire.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 20, 2017, 07:12:08 AM
Have just posted an update. Latest version now also protects against friendly fire from miniguns and other weapons with a forced miss radius.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Maeyanie on September 20, 2017, 11:24:06 AM
Quote from: falconne on September 17, 2017, 11:56:34 PM
Interesting. In my testing I found that the pawns already do regular rechecks during their warmup to check if they can still see the target. Are you sure the other colonist actually walked into a danger tile? If they were within 4 tiles of the shooter they are not subject to friendly fire.

It happened when my long-range shooters were taking shots at an enemy while some swordsmen ran up, and one of them almost got shot in the back as she swung at the same target which was getting shot. Was at fairly long range, so definitely not that.

It's possible there was some other factor I didn't notice, though. Maybe she wasn't quite in the line of fire yet and I just misinterpreted what happened, or something. I'll keep an eye out for if I see it happen again.

Edit: The CE version actually seems to not fire even if people are within the 4 tiles. Though, I think it's possible to accidentally shoot someone right in front of you with CE, so that's probably a good thing.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 20, 2017, 04:44:49 PM
Quote from: Maeyanie on September 20, 2017, 11:24:06 AM
It happened when my long-range shooters were taking shots at an enemy while some swordsmen ran up, and one of them almost got shot in the back as she swung at the same target which was getting shot. Was at fairly long range, so definitely not that.

It's possible there was some other factor I didn't notice, though. Maybe she wasn't quite in the line of fire yet and I just misinterpreted what happened, or something. I'll keep an eye out for if I see it happen again.

Edit: The CE version actually seems to not fire even if people are within the 4 tiles. Though, I think it's possible to accidentally shoot someone right in front of you with CE, so that's probably a good thing.

For the long range it's possible at the time the decision to fire the bullet was made the swordsman wasn't quite in the line of fire yet. Keep an eye out anyway and let me know if it happens to be more obvious. Currently vanilla has its own "recheck LoS during warmup" functionality which I've let take care of this. I could add extra checks if necessary but that all adds performance hits so I want to be sure it's necessary.

As for the CE issue, I can't reproduce that. Can you send me a save if you can? Do they take the shot when you disable their FF option?
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Maeyanie on September 23, 2017, 05:56:44 AM
Quote from: falconne on September 20, 2017, 04:44:49 PM
For the long range it's possible at the time the decision to fire the bullet was made the swordsman wasn't quite in the line of fire yet. Keep an eye out anyway and let me know if it happens to be more obvious. Currently vanilla has its own "recheck LoS during warmup" functionality which I've let take care of this. I could add extra checks if necessary but that all adds performance hits so I want to be sure it's necessary.
That is definitely possible. I didn't get a good look at exactly what happened, just saw a shot very nearly hit someone in the back, saw the person stop shooting afterwards, and jumped to conclusions.

Quote from: falconne on September 20, 2017, 04:44:49 PM
As for the CE issue, I can't reproduce that. Can you send me a save if you can? Do they take the shot when you disable their FF option?
At the time I noticed that behaviour, I disabled the FF option and they took the shot... right into the back of a friendly 2 tiles away. I think the friendly they hit was an animal, though, not a person, so maybe they're handled differently by CE. I do have the "avoid shooting animals" option enabled.

It's also possible there was a friendly 4 tiles away who was off to the side or something which I missed, and it's actually working as intended. In the future I'll make a point of taking screenshots to re-analyze stuff later, make sure I'm not wasting your time reporting nonsense.

Edit:
That didn't take as long as I'd hoped, but as promised, this time I come armed with screenshots.
One of my colonists, taking cover behind a rock wall, shot a front-line person in the back. Everyone was stationary, so shouldn't have been any oddness there. The two who were not in cover realized someone was in the way and held fire.
Layout: https://www.dropbox.com/s/14i93clb0hnu5rv/20170923054245_1.jpg
Manual shot from the "in cover" position shows no risk of hitting anything: https://www.dropbox.com/s/un5elpa8qzkjt9g/20170923054326_1.jpg
Manual shot from the "pop out to shoot" position shows what it should: https://www.dropbox.com/s/9wan08ca88ch3si/20170923054330_1.jpg
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 23, 2017, 06:19:24 PM
Great, thanks for the detailed analysis. I should be able be able to set this up in dev mode to investigate. Yes, it looks like the calculation of the fire cone is disrupted by the cover which I hadn't thought about.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 25, 2017, 06:13:25 AM
The above bug has been fixed in the latest update
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 25, 2017, 03:40:16 PM
I introduced a bug in yesterday's update and have just done another update to fix that. Please download again if you are doing so manually. Sorry about that.
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: AngleWyrm on September 30, 2017, 03:36:42 PM
Thanks for the update!
Time to go hunting wabbits

(https://i.pinimg.com/originals/8b/cb/d0/8bcbd014f0f9b8c9615abcb021f0ac9b.jpg)
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on November 23, 2017, 06:00:58 AM
Just updated to B18
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: SpaceDorf on November 23, 2017, 06:57:26 AM
Just downloaded the update  ;D
Title: Re: [A17] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: SpaceDorf on November 23, 2017, 06:57:58 AM
Quote from: AngleWyrm on September 30, 2017, 03:36:42 PM
(https://i.pinimg.com/originals/8b/cb/d0/8bcbd014f0f9b8c9615abcb021f0ac9b.jpg)

can I make this a Mod-Request ?
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on November 24, 2017, 06:28:49 AM
I've just updated with a feature to make the mod more flexible when it comes to 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%.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: warcin on November 24, 2017, 11:30:08 AM
I think there might be some issue with hunting and friendly fire. I don't use CE.  :'(
https://i.imgur.com/SpLWy40.jpg

Edit: I can reproduce this situation, seems that hunter will reposition himself only if someone is in "red danger zone" while starting to shoot. It would be nice if hunter would check for friendly fire after warming up, just before shooting up projectile.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on November 24, 2017, 04:00:02 PM
Quote from: warcin on November 24, 2017, 11:30:08 AM
Edit: I can reproduce this situation, seems that hunter will reposition himself only if someone is in "red danger zone" while starting to shoot. It would be nice if hunter would check for friendly fire after warming up, just before shooting up projectile.

Do you have a save from just before you can reproduce it? The game does recheck the target during warmup every tick, including on the last tick before warmup completes. Someone did report this happening before but I could only assume it was an edge case where the other pawn walked into the fire zone after the warmup phase completed and the launch phase had begun, where it can't be stopped. I'll have another go at reproducing the behaviour, but I've tried to previously and not got it so a save where you know it happens would be good.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: warcin on November 25, 2017, 06:11:06 AM
I overwritten that save sadly, the check seems to work only while drafted, or it's my luck that shooter missed a bit more than red zone would predict, but when I was trying to reproduce that back when I had that save, friendly fire happened like 2 times per ~15 loads. Shooter was not that bad, it might just be situation where colonist walked in red zone just in moment when arrow was shot + pure luck.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Canute on November 25, 2017, 06:49:18 AM
I think the mod only check at the beginning of the aiming phase if some friendly in the way, not when the projectile got launched.
Ofcouse a second check would reduce the friendly fire too, same count for the user not to let other pawn walk in the shooting, and would force to interrupt the shooting (if a second check would added).
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Mst on December 08, 2017, 05:03:16 PM
Sometimes get this report. Anyone knows what it is?
Exception while generating item collection: System.NullReferenceException: Object reference not set to an instance of an object
at AvoidFriendlyFire.Pawn_Kill_Patch.Postfix (Verse.Pawn&) <0x00055>
at (wrapper dynamic-method) Verse.Pawn.Kill_Patch1 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x01ce6>
at (wrapper dynamic-method) Verse.Pawn_HealthTracker.CheckForStateChange_Patch1 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x000cb>
at Verse.Pawn_HealthTracker.AddHediff (Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>) <0x0007c>
at (wrapper dynamic-method) Verse.DamageWorker_AddInjury.FinalizeAndAddInjury_Patch1 (object,Verse.Pawn,Verse.Hediff_Injury,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x000ab>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x001c6>
at Verse.DamageWorker_Scratch.ApplySpecialEffectsToPart (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00454>
at Verse.DamageWorker_AddInjury.ApplyDamageToPart (Verse.DamageInfo,Verse.Pawn,Verse.DamageWorker/DamageResult&) <0x00297>
at Verse.DamageWorker_AddInjury.ApplyToPawn (Verse.DamageInfo,Verse.Pawn) <0x00505>
at Verse.DamageWorker_AddInjury.Apply (Verse.DamageInfo,Verse.Thing) <0x000ae>
at (wrapper dynamic-method) Verse.Thing.TakeDamage_Patch1 (object,Verse.DamageInfo) <0x00275>
at Verse.HealthUtility.DamageUntilDead (Verse.Pawn) <0x00155>
at RimWorld.ItemCollectionGenerator_AncientPodContents.GenerateSlave () <0x00177>
at RimWorld.ItemCollectionGenerator_AncientPodContents.Generate (RimWorld.ItemCollectionGeneratorParams,System.Collections.Generic.List`1<Verse.Thing>) <0x000ea>
at RimWorld.ItemCollectionGenerator.Generate (RimWorld.ItemCollectionGeneratorParams) <0x0007b>

Verse.Log:Error(String)
RimWorld.ItemCollectionGenerator:Generate(ItemCollectionGeneratorParams)
RimWorld.BaseGen.SymbolResolver_AncientCryptosleepCasket:Resolve(ResolveParams)
RimWorld.BaseGen.BaseGen:Resolve(Pair`2)
RimWorld.BaseGen.BaseGen:Generate()
RimWorld.GenStep_ScatterShrines:ScatterAt(IntVec3, Map, Int32)
Verse.GenStep_Scatterer:Generate(Map)
Verse.MapGenerator:GenerateContentsIntoMap(IEnumerable`1, Map)
Verse.MapGenerator:GenerateMap(IntVec3, MapParent, MapGeneratorDef, IEnumerable`1, Action`1)
Verse.Game:InitNewGame()
Verse.Root_Play:<Start>m__1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Vlad0mi3r on December 08, 2017, 07:06:03 PM
Following for next modded run
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: TryB4Buy on December 24, 2017, 02:25:38 AM
Although I get 4 errors on map load, this worked okay until I added rimfire. Now whenever the friendly fire is checked (even without the overlay), right clicking a target drops the frps to around 1.  :o

I'm not exaggerating the 1 fps. Sometimes the game hangs for 4 seconds until the overlay goes away. All I want to do is tell my pawn to fire at the target!  :-\
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on December 24, 2017, 08:28:19 PM
Quote from: TryB4Buy on December 24, 2017, 02:25:38 AM
Although I get 4 errors on map load, this worked okay until I added rimfire. Now whenever the friendly fire is checked (even without the overlay), right clicking a target drops the frps to around 1.  :o

I'm not exaggerating the 1 fps. Sometimes the game hangs for 4 seconds until the overlay goes away. All I want to do is tell my pawn to fire at the target!  :-\

Getting any errors probably indicates a problem, likely due to the use of incompatible mods. I did a quick test adding Rimfire and using a new weapon with FF turned on and it worked fine, so I don't see any obvious problem there.

Maybe you can post your logfile with the errors in it and someone might be able to help. The reason it slows down when there's a problem is because whatever is going wrong is happening during the UI draw phase, causing the game to log an exception with stack trace on every frame of the game.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: TryB4Buy on December 29, 2017, 01:35:00 AM
Just so you know, its reproducible. I can run just fine if I ignore those four errors and don't use friendly fire since it is toggle-able in-game. However, you should know that the slowdown occurs while the game is PAUSED, and only upon right clicking a target with a drafted pause selected (before you select shoot). The crippling lag causes no errors, though.

Shared logs, eh?

Initializing new game with mods Core, HugsLib, UniversalFermenter, AllowDeadMansApparel, AnimalTab, AllowTool, AntiAutoUnload, AreaUnlocker, BillysCaravanFormation, BillysLoadTransportPod, Blueprints, CameraPlus-master, Cheaper Components, CleaningArea, CrashLanding, DD WorkTab, DefensivePositions, Dodging Rebalanced, DryLeaves_b18.1.0, ED-SafeTraps, EdBPrepareCarefully, ExpandedContextMenu, FluffyBreakdowns, FollowMe, Hand Me That Brick, FreshStockpileFilter-master, ICanFixIt, IdleFix, ImpassableMapMaker, Hunting Alert, LongRangePodLauncher, MapReroll, MarvsUghYouGotMe, Mending_easy, Moody, Nandonalt - Set-up Camp, Passive-Coolers-Refuelable-0.18.1.2, PathAvoid, PlantSaver, PowerSwitch, PrepareLanding, QualityBuilder, ReplaceWalls, RF - Configurable Maps, RF - Consolidated Traits, RF - More Trait Slots, RF - Smooth Stone Walls, RotTickFix, RT_Fuse-B18-1.1.1, RuntimeGC, RW_RefugeeStats, static_quality_plus_B18, Super Soil, TableDiner_Simple, TechAdvancing, VGP_Tools, WanderingCaravans [B18], WheresTheGravel, zombieland-master, PetMute, ImprovedWorkbenches, QualityCooldown-1.0, ReverseCommands, RimSearch, TradingSpot, Achtung-Mod-master, Autopsy-master, CustomDeathRandomness, DESurgeries, ED-ReverseCycleCooler, ED-TurretControl, Firefoam Belt, IndustrialRoller, JustIgnoreMePassing-master, Miniaturisation-0.18.0, SameSpot-master, WhileYoureUp, BetterPawnControl, Rimfire Custom Charge Deadeye, HaulToStack, MiningCo. MiningHelmet, MiningCo. MMS, StackXXL, OmniLocator, RT_SolarFlareShield-B18-1.2.2, TickMultiThread, and AvoidFriendlyFire

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Unsupported encoding: 'iso-8859-1,text/plain'

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Exception while generating item collection: System.NullReferenceException: Object reference not set to an instance of an object
at AvoidFriendlyFire.Pawn_Kill_Patch.Postfix (Verse.Pawn&) <0x00055>
at (wrapper dynamic-method) Verse.Pawn.Kill_Patch3 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x01d51>
at CustomDeathRandomness.CheckForStateChangePatch.Prefix (Verse.Pawn_HealthTracker,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x001ea>
at (wrapper dynamic-method) Verse.Pawn_HealthTracker.CheckForStateChange_Patch1 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x00075>
at Verse.Pawn_HealthTracker.AddHediff (Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>) <0x0007c>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,Verse.Hediff_Injury,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00098>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x001c6>
at Verse.DamageWorker_Blunt.ApplySpecialEffectsToPart (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00140>
at Verse.DamageWorker_AddInjury.ApplyDamageToPart (Verse.DamageInfo,Verse.Pawn,Verse.DamageWorker/DamageResult&) <0x00297>
at Verse.DamageWorker_AddInjury.ApplyToPawn (Verse.DamageInfo,Verse.Pawn) <0x00505>
at Verse.DamageWorker_AddInjury.Apply (Verse.DamageInfo,Verse.Thing) <0x000ae>
at Verse.Thing.TakeDamage (Verse.DamageInfo) <0x002b1>
at Verse.HealthUtility.DamageUntilDead (Verse.Pawn) <0x00155>
at RimWorld.ItemCollectionGenerator_AncientPodContents.GenerateSlave () <0x00177>
at RimWorld.ItemCollectionGenerator_AncientPodContents.Generate (RimWorld.ItemCollectionGeneratorParams,System.Collections.Generic.List`1<Verse.Thing>) <0x000ea>
at RimWorld.ItemCollectionGenerator.Generate (RimWorld.ItemCollectionGeneratorParams) <0x0007b>
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: TryB4Buy on December 29, 2017, 01:35:18 AM
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Exception while generating item collection: System.NullReferenceException: Object reference not set to an instance of an object
at AvoidFriendlyFire.Pawn_Kill_Patch.Postfix (Verse.Pawn&) <0x00055>
at (wrapper dynamic-method) Verse.Pawn.Kill_Patch3 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x01d51>
at CustomDeathRandomness.CheckForStateChangePatch.Prefix (Verse.Pawn_HealthTracker,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x001ea>
at (wrapper dynamic-method) Verse.Pawn_HealthTracker.CheckForStateChange_Patch1 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x00075>
at Verse.Pawn_HealthTracker.AddHediff (Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>) <0x0007c>
at Verse.HediffSet.AddDirect (Verse.Hediff,System.Nullable`1<Verse.DamageInfo>) <0x003b4>
at Verse.Pawn_HealthTracker.AddHediff (Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>) <0x00051>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,Verse.Hediff_Injury,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00098>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x001c6>
at Verse.DamageWorker_Stab.ApplySpecialEffectsToPart (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x0018c>
at Verse.DamageWorker_AddInjury.ApplyDamageToPart (Verse.DamageInfo,Verse.Pawn,Verse.DamageWorker/DamageResult&) <0x00297>
at Verse.DamageWorker_AddInjury.ApplyToPawn (Verse.DamageInfo,Verse.Pawn) <0x00505>
at Verse.DamageWorker_AddInjury.Apply (Verse.DamageInfo,Verse.Thing) <0x000ae>
at Verse.Thing.TakeDamage (Verse.DamageInfo) <0x002b1>
at Verse.HealthUtility.DamageUntilDead (Verse.Pawn) <0x00155>
at RimWorld.ItemCollectionGenerator_AncientPodContents.GenerateSlave () <0x00177>
at RimWorld.ItemCollectionGenerator_AncientPodContents.Generate (RimWorld.ItemCollectionGeneratorParams,System.Collections.Generic.List`1<Verse.Thing>) <0x000ea>
at RimWorld.ItemCollectionGenerator.Generate (RimWorld.ItemCollectionGeneratorParams) <0x0007b>


(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Exception while generating item collection: System.NullReferenceException: Object reference not set to an instance of an object
at AvoidFriendlyFire.Pawn_Kill_Patch.Postfix (Verse.Pawn&) <0x00055>
at (wrapper dynamic-method) Verse.Pawn.Kill_Patch3 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x01d51>
at CustomDeathRandomness.CheckForStateChangePatch.Prefix (Verse.Pawn_HealthTracker,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x001ea>
at (wrapper dynamic-method) Verse.Pawn_HealthTracker.CheckForStateChange_Patch1 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x00075>
at Verse.Pawn_HealthTracker.AddHediff (Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>) <0x0007c>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,Verse.Hediff_Injury,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00098>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x001c6>
at Verse.DamageWorker_Blunt.ApplySpecialEffectsToPart (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00140>
at Verse.DamageWorker_AddInjury.ApplyDamageToPart (Verse.DamageInfo,Verse.Pawn,Verse.DamageWorker/DamageResult&) <0x00297>
at Verse.DamageWorker_AddInjury.ApplyToPawn (Verse.DamageInfo,Verse.Pawn) <0x00505>
at Verse.DamageWorker_AddInjury.Apply (Verse.DamageInfo,Verse.Thing) <0x000ae>
at Verse.Thing.TakeDamage (Verse.DamageInfo) <0x002b1>
at Verse.HealthUtility.DamageUntilDead (Verse.Pawn) <0x00155>
at RimWorld.ItemCollectionGenerator_AncientPodContents.GenerateSlave () <0x00177>
at RimWorld.ItemCollectionGenerator_AncientPodContents.Generate (RimWorld.ItemCollectionGeneratorParams,System.Collections.Generic.List`1<Verse.Thing>) <0x000ea>
at RimWorld.ItemCollectionGenerator.Generate (RimWorld.ItemCollectionGeneratorParams) <0x0007b>


(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Exception while generating item collection: System.NullReferenceException: Object reference not set to an instance of an object
at AvoidFriendlyFire.Pawn_Kill_Patch.Postfix (Verse.Pawn&) <0x00055>
at (wrapper dynamic-method) Verse.Pawn.Kill_Patch3 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x01d51>
at CustomDeathRandomness.CheckForStateChangePatch.Prefix (Verse.Pawn_HealthTracker,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x001ea>
at (wrapper dynamic-method) Verse.Pawn_HealthTracker.CheckForStateChange_Patch1 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x00075>
at Verse.Pawn_HealthTracker.AddHediff (Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>) <0x0007c>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,Verse.Hediff_Injury,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00098>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x001c6>
at Verse.DamageWorker_Blunt.ApplySpecialEffectsToPart (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00140>
at Verse.DamageWorker_AddInjury.ApplyDamageToPart (Verse.DamageInfo,Verse.Pawn,Verse.DamageWorker/DamageResult&) <0x00297>
at Verse.DamageWorker_AddInjury.ApplyToPawn (Verse.DamageInfo,Verse.Pawn) <0x00505>
at Verse.DamageWorker_AddInjury.Apply (Verse.DamageInfo,Verse.Thing) <0x000ae>
at Verse.Thing.TakeDamage (Verse.DamageInfo) <0x002b1>
at Verse.HealthUtility.DamageUntilDead (Verse.Pawn) <0x00155>
at RimWorld.ItemCollectionGenerator_AncientPodContents.GenerateSlave () <0x00177>
at RimWorld.ItemCollectionGenerator_AncientPodContents.Generate (RimWorld.ItemCollectionGeneratorParams,System.Collections.Generic.List`1<Verse.Thing>) <0x000ea>
at RimWorld.ItemCollectionGenerator.Generate (RimWorld.ItemCollectionGeneratorParams) <0x0007b>


(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Exception while generating item collection: System.NullReferenceException: Object reference not set to an instance of an object
at AvoidFriendlyFire.Pawn_Kill_Patch.Postfix (Verse.Pawn&) <0x00055>
at (wrapper dynamic-method) Verse.Pawn.Kill_Patch3 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x01d51>
at CustomDeathRandomness.CheckForStateChangePatch.Prefix (Verse.Pawn_HealthTracker,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x001ea>
at (wrapper dynamic-method) Verse.Pawn_HealthTracker.CheckForStateChange_Patch1 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x00075>
at Verse.Pawn_HealthTracker.AddHediff (Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>) <0x0007c>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,Verse.Hediff_Injury,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00098>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x001c6>
at Verse.DamageWorker_Cut.ApplySpecialEffectsToPart (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x004bc>
at Verse.DamageWorker_AddInjury.ApplyDamageToPart (Verse.DamageInfo,Verse.Pawn,Verse.DamageWorker/DamageResult&) <0x00297>
at Verse.DamageWorker_AddInjury.ApplyToPawn (Verse.DamageInfo,Verse.Pawn) <0x00505>
at Verse.DamageWorker_AddInjury.Apply (Verse.DamageInfo,Verse.Thing) <0x000ae>
at Verse.Thing.TakeDamage (Verse.DamageInfo) <0x002b1>
at Verse.HealthUtility.DamageUntilDead (Verse.Pawn) <0x00155>
at RimWorld.ItemCollectionGenerator_AncientPodContents.GenerateSlave () <0x00177>
at RimWorld.ItemCollectionGenerator_AncientPodContents.Generate (RimWorld.ItemCollectionGeneratorParams,System.Collections.Generic.List`1<Verse.Thing>) <0x000ea>
at RimWorld.ItemCollectionGenerator.Generate (RimWorld.ItemCollectionGeneratorParams) <0x0007b>


(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Exception while generating item collection: System.NullReferenceException: Object reference not set to an instance of an object
at AvoidFriendlyFire.Pawn_Kill_Patch.Postfix (Verse.Pawn&) <0x00055>
at (wrapper dynamic-method) Verse.Pawn.Kill_Patch3 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x01d51>
at CustomDeathRandomness.CheckForStateChangePatch.Prefix (Verse.Pawn_HealthTracker,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x001ea>
at (wrapper dynamic-method) Verse.Pawn_HealthTracker.CheckForStateChange_Patch1 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x00075>
at Verse.Pawn_HealthTracker.AddHediff (Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>) <0x0007c>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,Verse.Hediff_Injury,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00098>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x001c6>
at Verse.DamageWorker_Scratch.ApplySpecialEffectsToPart (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00454>
at Verse.DamageWorker_AddInjury.ApplyDamageToPart (Verse.DamageInfo,Verse.Pawn,Verse.DamageWorker/DamageResult&) <0x00297>
at Verse.DamageWorker_AddInjury.ApplyToPawn (Verse.DamageInfo,Verse.Pawn) <0x00505>
at Verse.DamageWorker_AddInjury.Apply (Verse.DamageInfo,Verse.Thing) <0x000ae>
at Verse.Thing.TakeDamage (Verse.DamageInfo) <0x002b1>
at Verse.HealthUtility.DamageUntilDead (Verse.Pawn) <0x00155>
at RimWorld.ItemCollectionGenerator_AncientPodContents.GenerateSlave () <0x00177>
at RimWorld.ItemCollectionGenerator_AncientPodContents.Generate (RimWorld.ItemCollectionGeneratorParams,System.Collections.Generic.List`1<Verse.Thing>) <0x000ea>
at RimWorld.ItemCollectionGenerator.Generate (RimWorld.ItemCollectionGeneratorParams) <0x0007b>


(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Exception while generating item collection: System.NullReferenceException: Object reference not set to an instance of an object
at AvoidFriendlyFire.Pawn_Kill_Patch.Postfix (Verse.Pawn&) <0x00055>
at (wrapper dynamic-method) Verse.Pawn.Kill_Patch3 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x01d51>
at CustomDeathRandomness.CheckForStateChangePatch.Prefix (Verse.Pawn_HealthTracker,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x001ea>
at (wrapper dynamic-method) Verse.Pawn_HealthTracker.CheckForStateChange_Patch1 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x00075>
at Verse.Pawn_HealthTracker.AddHediff (Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>) <0x0007c>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,Verse.Hediff_Injury,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00098>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x001c6>
at Verse.DamageWorker_Scratch.ApplySpecialEffectsToPart (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00454>
at Verse.DamageWorker_AddInjury.ApplyDamageToPart (Verse.DamageInfo,Verse.Pawn,Verse.DamageWorker/DamageResult&) <0x00297>
at Verse.DamageWorker_AddInjury.ApplyToPawn (Verse.DamageInfo,Verse.Pawn) <0x00505>
at Verse.DamageWorker_AddInjury.Apply (Verse.DamageInfo,Verse.Thing) <0x000ae>
at Verse.Thing.TakeDamage (Verse.DamageInfo) <0x002b1>
at Verse.HealthUtility.DamageUntilDead (Verse.Pawn) <0x00155>
at RimWorld.ItemCollectionGenerator_AncientPodContents.GenerateSlave () <0x00177>
at RimWorld.ItemCollectionGenerator_AncientPodContents.Generate (RimWorld.ItemCollectionGeneratorParams,System.Collections.Generic.List`1<Verse.Thing>) <0x000ea>
at RimWorld.ItemCollectionGenerator.Generate (RimWorld.ItemCollectionGeneratorParams) <0x0007b>


(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Exception while generating item collection: System.NullReferenceException: Object reference not set to an instance of an object
at AvoidFriendlyFire.Pawn_Kill_Patch.Postfix (Verse.Pawn&) <0x00055>
at (wrapper dynamic-method) Verse.Pawn.Kill_Patch3 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x01d51>
at CustomDeathRandomness.CheckForStateChangePatch.Prefix (Verse.Pawn_HealthTracker,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x001ea>
at (wrapper dynamic-method) Verse.Pawn_HealthTracker.CheckForStateChange_Patch1 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x00075>
at Verse.Pawn_HealthTracker.AddHediff (Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>) <0x0007c>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,Verse.Hediff_Injury,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00098>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x001c6>
at Verse.DamageWorker_Blunt.ApplySpecialEffectsToPart (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00140>
at Verse.DamageWorker_AddInjury.ApplyDamageToPart (Verse.DamageInfo,Verse.Pawn,Verse.DamageWorker/DamageResult&) <0x00297>
at Verse.DamageWorker_AddInjury.ApplyToPawn (Verse.DamageInfo,Verse.Pawn) <0x00505>
at Verse.DamageWorker_AddInjury.Apply (Verse.DamageInfo,Verse.Thing) <0x000ae>
at Verse.Thing.TakeDamage (Verse.DamageInfo) <0x002b1>
at Verse.HealthUtility.DamageUntilDead (Verse.Pawn) <0x00155>
at RimWorld.ItemCollectionGenerator_AncientPodContents.GenerateSlave () <0x00177>
at RimWorld.ItemCollectionGenerator_AncientPodContents.Generate (RimWorld.ItemCollectionGeneratorParams,System.Collections.Generic.List`1<Verse.Thing>) <0x000ea>
at RimWorld.ItemCollectionGenerator.Generate (RimWorld.ItemCollectionGeneratorParams) <0x0007b>


(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Exception while generating item collection: System.NullReferenceException: Object reference not set to an instance of an object
at AvoidFriendlyFire.Pawn_Kill_Patch.Postfix (Verse.Pawn&) <0x00055>
at (wrapper dynamic-method) Verse.Pawn.Kill_Patch3 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x01d51>
at CustomDeathRandomness.CheckForStateChangePatch.Prefix (Verse.Pawn_HealthTracker,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x001ea>
at (wrapper dynamic-method) Verse.Pawn_HealthTracker.CheckForStateChange_Patch1 (object,System.Nullable`1<Verse.DamageInfo>,Verse.Hediff) <0x00075>
at Verse.Pawn_HealthTracker.AddHediff (Verse.Hediff,Verse.BodyPartRecord,System.Nullable`1<Verse.DamageInfo>) <0x0007c>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,Verse.Hediff_Injury,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00098>
at Verse.DamageWorker_AddInjury.FinalizeAndAddInjury (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x001c6>
at Verse.DamageWorker_Blunt.ApplySpecialEffectsToPart (Verse.Pawn,single,Verse.DamageInfo,Verse.DamageWorker/DamageResult&) <0x00140>
at Verse.DamageWorker_AddInjury.ApplyDamageToPart (Verse.DamageInfo,Verse.Pawn,Verse.DamageWorker/DamageResult&) <0x00297>
at Verse.DamageWorker_AddInjury.ApplyToPawn (Verse.DamageInfo,Verse.Pawn) <0x00505>
at Verse.DamageWorker_AddInjury.Apply (Verse.DamageInfo,Verse.Thing) <0x000ae>
at Verse.Thing.TakeDamage (Verse.DamageInfo) <0x002b1>
at Verse.HealthUtility.DamageUntilDead (Verse.Pawn) <0x00155>
at RimWorld.ItemCollectionGenerator_AncientPodContents.GenerateSlave () <0x00177>
at RimWorld.ItemCollectionGenerator_AncientPodContents.Generate (RimWorld.ItemCollectionGeneratorParams,System.Collections.Generic.List`1<Verse.Thing>) <0x000ea>
at RimWorld.ItemCollectionGenerator.Generate (RimWorld.ItemCollectionGeneratorParams) <0x0007b>
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Canute on December 29, 2017, 03:31:31 AM
Geeeeshhhh TryB4Buy,
Didn't you saw the "shared log" button at the error window, at the down left corner ?
Or don't you know how to post an error log ?
Point 6 at
https://ludeon.com/forums/index.php?topic=513.0

Or at last you could put all these errors into a tag, the "#" icon when you repley.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on December 29, 2017, 04:12:58 AM
Just posted a new update.

I've added a setting in Mod Options 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 new option is off by default.

@TryB4Buy in this update I have added a guard around the area where you're getting a problem. I don't know why it's happening; your stack trace implies the game is generating an ancient danger, but you say you were just right clicking a target, so something weird is going on. Regardless, with this update the problem should go away.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: TryB4Buy on January 05, 2018, 11:33:17 PM
@Canute Sorry about the text dump, but it faster than a pastebin link.

Quote from: falconne on December 29, 2017, 04:12:58 AM@TryB4Buy in this update I have added a guard around the area where you're getting a problem. I don't know why it's happening; your stack trace implies the game is generating an ancient danger, but you say you were just right clicking a target, so something weird is going on. Regardless, with this update the problem should go away.
Sweet. Now that's turn around time! I'm using pretty much every QoL mod that is B18 compatible, so if AFF works for me then it will work for anyone.

I still have a slight frame drop (from another mod) but it could be the other mods like Defense Positions or something. Not sure. I did manage to recreate the massive (sometimes) frame drop, but it throws no errors so I don't know how to troubleshoot it.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on January 06, 2018, 01:14:33 AM
Did you check the output log after your remaining freeze? There should be a repeated stack trace in there.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: TryB4Buy on January 10, 2018, 06:55:05 PM
I don't have any freezes, just lag. And its only upon right clicking. I made sure to come back here after my current campaign ended (Rimworld ran out of pawns to generate, so no raids even via dev menu).

I just went through my whole mod list adding groups of mods at a time to try to isolate it, but I can't. Frustratingly, I think the load order matters in the reproducibility. Of course, this means that after I shook up the order, the lag went away. So, yay.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on January 10, 2018, 07:16:25 PM
If you ever get the lag again after right clicking, that's a good time to save and exit, then grab the output log at that time. I can check if there's anything at the end of the log that might be relevant.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Vlad0mi3r on January 26, 2018, 08:02:47 AM
Ok this feels like it has changed recently, why can I not have animals with a master fired near/at. If I send a boomrat out to fight with a sapper I don't want the home team standing there cheering on the rat I want them to open up and shoot the sapper. If the rat go's BOOM then yay thats the idea.

I think an extra tab needs to be added in order to differentiate or give more options. maybe protect all animals and then an option to protect animals with a master. 

So in short let me shoot the walking IED please I want to be able to set my enemy's on fire again. I can't release an animal without it having a master.

As a side note this is making this mod really hard to use with giddy up. My powered armoured, shield belt wearing, Sword wielding maniacs mounted on their robotic attack bears keep getting in the way of the snipers trying to take their shots. Trust me the bear can take it.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on January 26, 2018, 04:06:59 PM
I will add an option to disable protecting animals with a master. I won't have time to make it configurable in the near future unfortunately.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Vlad0mi3r on January 26, 2018, 10:21:58 PM
Excellent time to kill some more of those stinking mechanoid caterpillars.

Send in the bears!!!!!!



[attachment deleted by admin: too old]
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on March 10, 2018, 06:20:13 AM
Just made a minor update to address a limitation that was noted:

Pet protection can now be turned off in Mod Options if desired. This can be useful when using tamed boomrats as weapons, or with certain mods.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Fatsack on March 10, 2018, 04:26:44 PM
can you make a mod where you can adjust the possible miss area to remove it in a radius from the person shooting up to a certain selectable radius?  So like, if your friendlies are within 3 or 4 tiles in front of you, there is no chance to hit them, but further than that the miss area is still there.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Harry_Dicks on March 10, 2018, 04:46:59 PM
Quote from: falconne on March 10, 2018, 06:20:13 AM
Just made a minor update
Awesome, thank you!

Quote from: Fatsack on March 10, 2018, 04:26:44 PM
can you make a mod where you can adjust the possible miss area to remove it in a radius from the person shooting up to a certain selectable radius?  So like, if your friendlies are within 3 or 4 tiles in front of you, there is no chance to hit them, but further than that the miss area is still there.
If you have a 3x3 square of pawns with ranged attack on, I'm pretty sure they won't hit each other.
Title: Re: [B18] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Vlad0mi3r on March 12, 2018, 05:38:19 PM
Thank you for the update works a treat.
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on August 29, 2018, 07:40:23 AM
Updated to B19. Let me know of any issues, I've only done some brief testing on B19.
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: bigheadzach on September 03, 2018, 01:18:35 AM
Anyone experience an issue with the 19.2 release version unpacking with all files having names equivalent to their path structure?
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 03, 2018, 01:33:01 AM
Quote from: bigheadzach on September 03, 2018, 01:18:35 AM
Anyone experience an issue with the 19.2 release version unpacking with all files having names equivalent to their path structure?

Hmm, what are you seeing? I just double checked the zip and it seems ok.
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Canute on September 03, 2018, 04:06:02 AM
bigheadzach,
let me guess, you download the Master and not the release.
In falconne's github master you can't find any useable mod, you need to download the release version.
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: XeoNovaDan on September 03, 2018, 05:21:08 AM
Hey, so ToWild radius has actually been made dynamic with B19 rather than the old fixed 1.9 cell radius. You can find the values in ShootTuning in Verse.
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 03, 2018, 05:41:07 AM
Quote from: XeoNovaDan on September 03, 2018, 05:21:08 AM
Hey, so ToWild radius has actually been made dynamic with B19 rather than the old fixed 1.9 cell radius. You can find the values in ShootTuning in Verse.

Ah sweet, thanks, I'll fix that
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on September 03, 2018, 06:00:17 AM
Quote from: Canute on September 03, 2018, 04:06:02 AM
bigheadzach,
let me guess, you download the Master and not the release.
In falconne's github master you can't find any useable mod, you need to download the release version.

Oh yeah, I guess I should change this. I just wince at the thought of committing built binaries into source control  :D I assume this is done so people can just do a git pull to update a mod.
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: bigheadzach on September 03, 2018, 10:34:25 AM
Quote from: Canute on September 03, 2018, 04:06:02 AM
bigheadzach,
let me guess, you download the Master and not the release.
In falconne's github master you can't find any useable mod, you need to download the release version.

Actually, it was the release version that did that. Downloading the master and then extracting the actual mod worked for me.
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: ferofax on September 22, 2018, 01:03:56 PM
QuoteOnly 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.

Have the red zone overlay projected and adjust weight for those tiles for undrafted AI pathing to take into account? Like, if someone's aiming, those red zones should be weighted so that pathing through them is unlikely and would force undrafted pawns to path around them. You can also trigger a "soft" mental panic Fleeing for undrafted AI within the line of fire, so they rush out of it.
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: sumghai on October 19, 2018, 04:34:25 PM
falconne, just a heads-up that you may need to change a HugsLib or Harmony method call when updating this mod from B19 to 1.0:


[HugsLib][ERR] AvoidFriendlyFire caused an exception during OnDefsLoaded: System.MissingMethodException: Method not found: 'HugsLib.ModBase.get_HarmonyInst'.
  at HugsLib.HugsLibController.OnDefsLoaded () [0x00000] in <filename unknown>:0
Verse.Log:Error(String, Boolean)
HugsLib.Utils.ModLogger:ReportException(Exception, String, Boolean, String)
HugsLib.HugsLibController:OnDefsLoaded()
HugsLib.HugsLibController:LoadReloadInitialize()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on October 20, 2018, 06:24:48 AM
Quote from: sumghai on October 19, 2018, 04:34:25 PM
falconne, just a heads-up that you may need to change a HugsLib or Harmony method call when updating this mod from B19 to 1.0:


That's odd. I did not get this error. Have you updated HugsLib to the latest version?

Also, this mod's been updated to v1.0 now.
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: sumghai on October 20, 2018, 07:38:23 AM
Quote from: falconne on October 20, 2018, 06:24:48 AMThat's odd. I did not get this error. Have you updated HugsLib to the latest version?

Yes, I was running the latest version of HugsLib (6.0.1) at the time the error occured

Quote from: falconne on October 20, 2018, 06:24:48 AMAlso, this mod's been updated to v1.0 now.

Much appreciated! I can now confirm that the 1.0 release of FF works properly with HugsLib 6.0.1 in RW 1.0.2059.
Title: Re: [1.0] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Jiro on November 08, 2018, 10:30:37 PM
Wait, so will pawns move by themselves if they don't have a shot at the target that won't hit their friends?
Title: Re: [1.0] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on November 09, 2018, 12:29:30 AM
Quote from: 中村ジロ on November 08, 2018, 10:30:37 PM
Wait, so will pawns move by themselves if they don't have a shot at the target that won't hit their friends?

Only while hunting, not while drafted.
Title: Re: [1.0] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: Jiro on November 09, 2018, 08:13:03 AM
Quote from: falconne on November 09, 2018, 12:29:30 AM
Quote from: 中村ジロ on November 08, 2018, 10:30:37 PM
Wait, so will pawns move by themselves if they don't have a shot at the target that won't hit their friends?

Only while hunting, not while drafted.
Is that just due to the nature of drafting? Or can some use of trickery achieve the same thing?
Title: Re: [1.0] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on November 09, 2018, 05:31:47 PM
Quote from: 中村ジロ on November 09, 2018, 08:13:03 AM
Is that just due to the nature of drafting? Or can some use of trickery achieve the same thing?

In the game currently, during combat you have to manually place your pawns; they don't automatically move to go find targets. You would generally position ranged pawns behind cover or in tactical places... and you wouldn't want them moving out of position and into danger on their own. So I think if the mod started doing that it would probably not be a feature you'd really want to use.
Title: Re: [B19] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on March 11, 2019, 04:27:40 AM
Quote from: XeoNovaDan on September 03, 2018, 05:21:08 AM
Hey, so ToWild radius has actually been made dynamic with B19 rather than the old fixed 1.9 cell radius. You can find the values in ShootTuning in Verse.

Latest version now accounts for the larger miss radius
Title: Re: [1.0] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on March 14, 2019, 03:08:27 AM
In the latest update, 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.
Title: Re: [1.0] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: togfox on March 14, 2019, 07:54:52 AM
Has a bug been introduced? Yesterday this was working fine and now shooters won't fire "over" shielded melee pawns. They turned blue - which was great - but they had clear shots (as in clear LOS) except for fully shielded pawns that were engaged.

There were 'friendly' animals mixed up in the combat - would that be a reason to hold fire?

I'll experiment some more ...

Great mod btw!
Title: Re: [1.0] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on March 14, 2019, 03:44:51 PM
Quote from: togfox on March 14, 2019, 07:54:52 AM
Has a bug been introduced? Yesterday this was working fine and now shooters won't fire "over" shielded melee pawns. They turned blue - which was great - but they had clear shots (as in clear LOS) except for fully shielded pawns that were engaged.

There were 'friendly' animals mixed up in the combat - would that be a reason to hold fire?

I'll experiment some more ...

Great mod btw!

I just tested with shielded pawns and that doesn't appear broken, they didn't cause shooters to stop. Friendly animals will if you have that option turned on the mod settings. Unfortunately animals don't change colour as their name is not show on the map by default. You can temporarily turn on labels for all tame animals in the game options and then they will change colour. I will see about making animal names show up regardless if they are blocking shooters.

The previous update increased the miss radius used for low skill shooters as mentioned in my previous post, so maybe your seeing that. If you're used to the old one tile radius you might need to readjust your placements. You can check the shooters actual fore cone by clicking their weapon on the pawn toolbar and hovering over the intended target so you can see if the animals are in the red area.
Title: Re: [1.0] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: togfox on March 14, 2019, 05:45:43 PM
I used attack animals on this occasion so I'll just put it down to that.

Cheers. Loving it.
Title: Re: [1.0] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on March 15, 2019, 06:49:28 AM
Latest update now forces name labels of friendly animals blocking shooters to be shown in green, even if animal labelling is off in game preferences.
Title: Re: [1.1] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: falconne on March 02, 2020, 03:11:59 AM
Updated to 1.1
Title: Re: [1.1] Avoid Friendly Fire (stop shooting when friendlies are in the way)
Post by: agentbad on March 06, 2020, 04:22:25 PM
Great mod. I am curious if this could be extended to turrets as well?