Proper Switching & Auto Re-Equip Client Mod

If you liked this item, please rate it up on Steam Workshop page.

Author: kurozawa

Last revision: 13 Aug, 2022 at 03:58 UTC

File size: 393.89 KB

On Steam Workshop

Description:
This is a Client Mod

It works when joining other servers or hosting your own DST server with caves.
For compatibility when hosting Don’t Starve Alone mod/cave-less worlds, it becomes a server mod that affects only the host.

It aims to make equipment switching more intuitive & consistent

Remember how many times your dark sword went to some slot you didn’t expect it to go to when switching to your cane? It usually happens when you’re switching between more than 2 items, like when your dark sword breaks and you equip another from a different slot (and many other cases). This mod attempts to solve both problems by automatically doing two things: re-equipping extra weapons when broken/out of ammo and correcting prevslots when needed (i.e. maintaining 2-2-2 as cane-darksword-cane). With this, equip switching will reliably make both items exchange places, instead of the unequipped sometimes going to slot 13 or somewhere on the left. I also limited this auto prevslot correction to the player’s inventory and backpack, so you wouldn’t accidentally leave your cane in a chest of tools for example.

Special Thanks to the Following:

w00tyd00d – for helping me fix and finally understand some bugs related to global scopes and Lua environments, when no one else was helping in the forums
Rebelleliously aka lili – for always being there for me, for supporting me in what I do and what I love, for being my partner, and for creating this project’s logo

If you like the mod, consider giving a thumbs up

I’m hoping Klei would notice and consider making this a default feature. Client mods have latency limitations, while prevslot correction would only need around 5 lines of code in the game’s inventory script.

Source Code:

https://github.com/kurozawa6/dst-proper-switching-and-auto-re-equip
Please leave a comment or reach out to me for suggestions or any bugs you encounter. I hope you have a nice day~

Latest Patch Notes:

v1.5 : Updated mod name+description & notes for Klei
v1.4 : Slingshot now auto-reloads +safeties from crash
-auto reload idea by M A X W E L L G A M I N G

Known Issues

*Possible crash in Cave-less servers/DS Alone mod when using Brightshade/Void items or dropping Spiders as Webber (but normal Don’t Starve Together servers have NO problems from my tests).
-The code is different for DS Alone mod/servers WITHOUT caves and I have yet to test.