Skwizzy / SPT-LootingBots

AI Looting mod for Singleplayer Tarkov
https://hub.sp-tarkov.com/files/file/1096-looting-bots/#overview
32 stars 10 forks source link

Add Interop Capability #97

Closed dwesterwick closed 7 months ago

dwesterwick commented 9 months ago

Please add interop capability so other mods like Questing Bots can instruct bots to search for loot immediately after something happens (i.e. they reach a quest location).

As an example, Drakia included something like this to SAIN: https://github.com/DrakiaXYZ/SAIN/blob/release/Plugin/SAINInterop.cs. By doing it this way, I didn't need to add SAIN as a hard dependency; it would be used if people had SAIN, and otherwise it would be ignored.

I can try to get this working and send you a PR if I'm successful.

dwesterwick commented 9 months ago

I got this working in my fork, but it doesn't work exactly as intended. If the bot isn't in any danger, it respects the interop command perfectly. However, SAIN's brain layer is pretty aggressive, so it frequently takes priority of yours. Increasing the brain-layer priorities for your layers isn't a good idea because that will have many other side impacts. I think my next approach will be trying to reset the parameters SAIN monitors, but that will require a lot of testing. What are your thoughts?

dwesterwick commented 9 months ago

I was able to get everything working reasonably well with some changes to SAIN. I'll do more testing, make sure Drakia (or Solarint) are OK with the SAIN changes, and then send you a PR.

Skwizzy commented 9 months ago

Sorry I’ve been out of the country for the past week with limited Wi-Fi access. Will be back home on Monday. I like your proposal of having a mechanism to allow other mods to trigger a loot scan/set some active lootable. I’ll take a look at your fork when I get back to the states

dwesterwick commented 9 months ago

No worries! I'm going to do a little more testing this weekend and should hopefully send you a PR by Monday.

dwesterwick commented 9 months ago

I opened PR #98 for this. Please let me know if you have any questions or want me to change anything.

Skwizzy commented 9 months ago

Thanks again for the PR, pretty cool to see all the AI mods working together. Merged into the dev branch (3.7.1), I'll publish a new version next week after I finish up some changes I have