Jump to content

How to make a custom item undroppable?


Recommended Posts

Hi so I want to make like 2 custom items for my character mod, but I want them to never be able to leave his inventory. I've seen mods that make things not be able to be unequipped but I want it to be able to be switched out for other stuff, I just don't want other characters using the weapon.

Any help would be appreciated! :)

Link to comment
Share on other sites

Making them undroppable is an extremity of a solution, and a more moderate solution would be to make other people not be able to pick them up. Recall that there is a base-game item that has this property, Lucy the Axe, and if you look inside the prefab file, you'll see that it listens for the on-put-in-inventory event, and then checks whether the pickupguy is its owner, if it is not its owner, it will then make the pickupguy drop it after 0 seconds. If you would like to opt for the extreme solution, you will have to override multiple functions in the inventory component. Since sometimes an item isn't "dropped" per se, for example when it is moved from an inventory to a container. This would also lend itself to certain exploits, for example, placing this undroppable item in the first slot of the inventory as a frog defense.

Edited by Bad Willow
  • Thanks 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...