边缘世界 RimWorld

边缘世界 RimWorld

93 个评价
Turrets Shoot Hunting Predators
   
奖励
收藏
已收藏
取消收藏
Mod, 1.4, 1.5, 1.6
文件大小
发表于
更新日期
450.866 KB
2024 年 4 月 13 日 下午 3:04
9 月 8 日 下午 12:15
6 项改动说明 ( 查看 )

订阅以下载
Turrets Shoot Hunting Predators

描述


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

As of 1.6, Hugslib is NO LONGER required.
For versions below 1.6, Hugslib is still required!!!

How it works:

The mod now directly uses a harmony postfix patch to change the TryFindNewTarget method for turrets, adding an operation at the very end of the line if there is already not a valid target, in order to maximize compatibility with other mods.

After that, it gets animal pawns that pass basic checks when turrets are looking for targets and checks if they have the predator hunt job, then checks for a few more things such as visibility, fog, etc before giving the go ahead.

This mod ALSO fixes the error of a turret firing at an animal causing an ideology instigation error, a vanilla problem.

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://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1098354593

Combat Extended Drastically changes targeting checks. As this hooks into vanilla checks to do what it does, this mod ceases to function.
https://psteamcommunity.yuanyoumao.com/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.
24 条留言
Archie  [作者] 9 月 8 日 下午 12:26 
I ran quite a few dev quicktests on maps with a lot of animals and a lot of turrets and the performance hit is seemingly completely negligible (used Dubs' analyzer for profiling) so this new method should be fine!
Let me know if anything goes wrong and I can revert to the previous method.
Archie  [作者] 9 月 8 日 下午 12:24 
Hugslib requirement REMOVED for 1.6.
Versions below 1.6 still require Hugslib.
Pheace 7 月 13 日 上午 8:34 
Thanks for trying anyway. Agreed performance is a crucial thing here.
Archie  [作者] 7 月 13 日 上午 8:31 
I tried, but unfortunately I need to hook into a function that hugslib has that is called whenever a map is loaded. That's when the cache of predators that are manhunting gets repopulated. I could simply do away with the cache approach but the performance impact would be heavier, I feel.

And given how turrets already cause a decent performance impact by default if you have too many of them, I'm worried doing this could be a problem.
Pheace 7 月 13 日 上午 8:00 
Thanks for the update. Any chance hugslib requirement could be removed?
Archie  [作者] 7 月 11 日 上午 10:08 
Update out. Either wait for the official hugslib to be updated or use the community fork that is already updated for 1.6. Happy hunting!
Archie  [作者] 7 月 4 日 下午 5:25 
When 1.6 comes out. :bfengineer:
thorman123456789 7 月 4 日 下午 12:40 
1.6 please?
Archie  [作者] 2024 年 12 月 14 日 下午 8:16 
Also I do not remember what adds those walls but they were reinforced walls.
Archie  [作者] 2024 年 12 月 14 日 下午 8:16 
I unfortunately don't think I can. CE has its own patches that replace the TryFindNewTarger function and depends on its own functionality, sorry chief.