Jump to content

Making a bee themed custom character (need help with perks)


Recommended Posts

So I am working on making my second custom character for DST. This one is a bit more ambitious than the last character I made since I am hoping to add more character perks than the last. The a lot of the perks I am hoping to include are referenced from other mods that have bee based characters, although I wasn't able to find exactly what I was looking for when digging around the files of those mods.

Some perks I am hoping to add but am having trouble with include:

  • Bees are neutral to the character and will not attack them (possibly hoping to make them follow for a bit but could easily do without)
  • killer bees will not attack the character
  • Is weak in winter/more vulnerable to cold (I may be able to do this one on my own but I'm listing it here for personal tracking)
  • Can't be killed by bees or killer bees
  • Can produce honey by eating certain amount of petals (I saw this feature on another mod and found it really interesting! the character I am creating can generate honey although not through the use of flowers. If anyone has another possible way for the character to generate honey without the need of flowers it would be much appreciated!)
  • Can summon killer bees as followers when attacked with a maximum of 3 (again, saw a similar feature from the mod mentioned above and it would suit the character I am trying to create perfectly if I could implement it)
  • Gets bonus from eating honey based foods, such as honey, honey ham, honey nuggets (this is again based off of the previously mentioned mod)

These are the perks I am hoping to include with the character, if anyone has any advice or know any way of achieving these it would be greatly appreciated! (I'm also relatively new to using notepad + + so I apologise in advance for my lack of knowledge) 

(the mods referenced in the list can be found here --> https://steamcommunity.com/sharedfiles/filedetails/?id=1374558578&searchtext=ozzy , https://steamcommunity.com/sharedfiles/filedetails/?id=1145848156 )

Link to comment
Share on other sites

For the food you can do something like this:

Put this somewhere above your character's master_postinit
local function OnEat(inst, food)
	if food.prefab == "monstermeat" then
		inst.components.hunger:DoDelta(25)   
		inst.components.health:DoDelta(10)
	end
	if food.prefab == "cookedmonstermeat" then
		inst.components.hunger:DoDelta(40)
		inst.components.health:DoDelta(10)
	end
	if food.prefab == "monstermeat_dried" then
		inst.components.hunger:DoDelta(50)   
		inst.components.health:DoDelta(30)
	end	
	if food.prefab == "monsterlasagna" then
		inst.components.hunger:DoDelta(80)  
		inst.components.health:DoDelta(30)
	end
end

-- Put this in your character's master_postinit
inst.components.eater:SetOnEatFn(OnEat)

Obviously, this is just an example using other foods.

If you've found most of these features in other mods, take a look at their code, and figure out how they did it. That's really the best way to learn. Also, if you haven't seen my newcomer post, take a look through it. It'll show you some neat things about how to debug your code and such.

Edited by Ultroman
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...