RimWorld

RimWorld

31 ratings
Turrets Shoot Hunting Predators
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.4, 1.5
File Size
Posted
Updated
444.498 KB
13 Apr @ 3:04pm
14 Apr @ 7:30am
4 Change Notes ( view )

Subscribe to download
Turrets Shoot Hunting Predators

Description


Something that I feel should always have been vanilla behavior. Turrets now target predators hunting your pawns.

Instead of the traditional approach of constantly scanning everything in the map, we make a cache of pawns (animals in this case) that have the predatorHunt job. If the target for that job is a pawn that belongs to your faction, once they are in range of turrets, these will take notice and fire at the animal.

Note: This is different from manhunting animals. Manhunting animals are automatically shot by turrets in vanilla behavior regardless.

This also patches an exception that becomes more common with this mod. Normally, in vanilla, turrets will sometimes not be counted as instigators for the purpose of manhunter chance calculations. Before those calculations happen, this mod will make sure that the instigator is not null nor the instigator's ideologies are null. If one or the other are null, it will return the default calculation value, if not, the original vanilla code will take over.

Warning:

Needs further testing, experimental release.

Incompatibility List

Animals Logic (Has logic to handle this already, but I felt it didn't work at times, which is why I made this patch.)
Their function to shoot hunting predators can be disabled in their mod options, so you can still use all the logic from it alongside this as long as you disable that.
https://steamproxy.net/sharedfiles/filedetails/?id=1098354593

Combat Extended Drastically changes targeting checks. As this hooks into vanilla checks to do what it does, the mod ceases to function.
https://steamproxy.net/workshop/filedetails/?id=2890901044

Any mod that replaces the vanilla turret TryFindNewTarget functions entirely instead of patching them



Credits: Baal Evan from Turret Auto Hunt for idea and code snippet I started developing this on.
12 Comments
Winterwolf 8 May @ 11:33pm 
Nice! Probably something worth adding to the Animal Logic section above. You could be doing yourself out of subscriptions is all. It's a good, logical mod :)
Archie  [author] 8 May @ 11:25pm 
That's already a setting on their side. You can disable it in their mod options.
Winterwolf 8 May @ 10:11pm 
Animals Logic (Has logic to handle this already, but I felt it didn't work at times, which is why I made this patch.)

Is there any way you could add a way to disable Animal Logics turret code if using both mods?
Decimus Magnus 20 Apr @ 1:34pm 
Thank you good sir!
Archie  [author] 20 Apr @ 11:58am 
That would be chicken plucker's security module.
Decimus Magnus 20 Apr @ 11:44am 
What turret mod is that with what looks like rotary cannon turrets pictured in the screenshot?
Emilie Sackenball 17 Apr @ 5:13pm 
@Tawnylure maybe is for "simulating" they being sneaky for make it simple as a feature of the game, yeah is annoying when a important pawn gets "backstabed" but hey at least the game warms you he's coming
Tawnylure 17 Apr @ 4:03am 
Why don't they already??? Hostile animals are just as deadly as hostile factions as unlike hostile factions, you can sometimes just be unaware of one of them attacking your colonist.
sormly500 15 Apr @ 9:54pm 
i thought this was base game the turrets in my game always shoot animals hunting my colonist
The Gaming Archaeologist 14 Apr @ 6:44am 
I have needed this so bad! Especially when colonists are in danger. Otherwise I just end up hunting to cull down the number of predators otherwise my colonists start looking like targets!