Jump to content

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! :)

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

I'll try to use the code from Lucy's prefab but if it doesnt work I happened to find this block of code on one of the mods I have that does exactly what you said. 

If anyone is wondering from which mod it's from, here's the link to its workshop site https://steamcommunity.com/sharedfiles/filedetails/?id=1710872809

image_2021-12-07_154136.png

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
×
  • Create New...