Monso06 Posted December 6, 2018 Share Posted December 6, 2018 (edited) Hello! I published a simple mod to tweak the game's response to equipping an item. The previously equipped item, instead of being sent to the first available slot, is swapped directly into the same slot. This should help managing multiple hats (or weapons, but often hats) without them making a mess in your inventory. Here is the page: https://steamcommunity.com/sharedfiles/filedetails/?id=1583310358 Edited December 6, 2018 by Monso06 Link to comment Share on other sites More sharing options...
Monso06 Posted December 6, 2018 Author Share Posted December 6, 2018 Damn, it seems I'm not out of the woods with this mod... It works when I host but not on a public server. Which is weird since it's client only. What could be the issue? Link to comment Share on other sites More sharing options...
Monso06 Posted December 6, 2018 Author Share Posted December 6, 2018 So the problem seems to be that I can't access "components/inventory.lua" client side, and the property item.prevslot that I need to manipulate. Since this property doesn't seem to be defined in other lua such as "components/inventory_replica.lua" (or any other), I'm not sure how to make it work. Anybody has an idea? Link to comment Share on other sites More sharing options...
JohnWatson Posted December 6, 2018 Share Posted December 6, 2018 the majority of components are available only on the server, so you would need to use a 'replica' to manipulate the inventory for example, if you wanted to get the item in the player's hand slot, then you would use the command below: ThePlayer.replica.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) the client doesn't seem to track the previous slot of an item, so you'd have to track it on your own by storing an item's previous slot whenever the player equips an item Link to comment Share on other sites More sharing options...
Monso06 Posted December 6, 2018 Author Share Posted December 6, 2018 Thanks for your answer. I can track the proper slot client side, but I'm not sure what to do with it. There's no way of updating the prevslot property from the replica. Also, what I can't find is how to move an item to that slot manually. It seems there's no way in the replica to move items from one slot to another, without first taking it as the active item. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now