Jump to content

Recommended Posts

  Hi, so I'm currently working on a character mod and have come to a bit of a halt. I need to make unique consumable potion items that you can craft specifically with said character, but I can't seem to find any tutorials specifically for custom consumable items. Can anyone point me to one? If so that'd be great help, thanks.

Link to comment
https://forums.kleientertainment.com/forums/topic/51145-custom-consumables/
Share on other sites

Alright, lets see here... take a look at spidergland.lua in dontstave/data/scripts/prefabs/spidergland.lua and that will give you an idea on what to do to make a useable item.

 

As for making it craftable for only one character, you could make a new crafting tab for potions or character specific items and look at how the books tab for wickerbottom is implemented for an idea on how to do it. Let me see if I can locate where that is at.

 

What exactly are you wanting the potion to do?

Edited by bigpak

@Darkshard

Make a prefab mod (see prefab portion of these samples) and give it a healer component.

-- In the prefab's create fn, where inst refers to the prefab instanceinst:AddComponent("healer")

For food-like consumables, you would use the edible component instead.

 

Edit: To make it only usable by your character, I think you just need to add the characterspecific component.

inst:AddComponent("characterspecific")inst.components.characterspecific:SetOwner("your_char_prefab")
Edited by Blueberrys

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...