• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Need help with checking requirements to use an item(weapon or armor)

morfin

New member
Hello. Is that possible to implement such thing and check minimal requirements to use some item - as example armor or weapon. It can be just level or some specific custom perk which is learned some way(book maybe?)

 
I cant think of an in-game mechanism that stops a player from using an item that they find in the world, but I reckon I've seen that functionality in an overhaul mod somewhere.

If the weapon or item can only be crafted (and not found in the world) it can be gated behind a recipe. The recipe availability can be tied to player level, number zombies killed etc.  or found in the world but found broken and requiring a recipe to fix and use.

cheers

 
Last edited by a moderator:
I cant think of an in-game mechanism that stops a player from using an item that they find in the world, but I reckon I've seen that functionality in an overhaul mod somewhere.

If the weapon or item can only be crafted (and not found in the world) it can be gated behind a recipe. The recipe availability can be tied to player level, number zombies killed etc.  or found in the world but found broken and requiring a recipe to fix and use.

cheers


Well i found out that there is such thing as ItemActionEntryEquip class and it has method called RefreshEnabled which is probably checking can you equip this or not. Maybe it's possible to patch that with Harmony like in this "mod":
https://github.com/dmustanger/7dtd-ServerTools/blob/b53687f3c7df054b13137a5b12c698851a949f42/ServerTools/src/Harmony/Injections.cs#L9

 
Last edited by a moderator:
Back
Top