Jump to content

How to remove aggression from catching bees?


Recommended Posts

Greetings fellas, I'm back to work on my beekeeper character and I'm struggling to get a perk done.

Long story short, I want my character to be able to catch bees with a bugnet without getting aggro. I've been looking at the beecommon brain and this function looked promising:
 

local function OnWorked(inst, data)
	OnAttacked(inst, {attacker=data.worker})
end

But no matter how hard I try to add an exception for my character, bees and beehives still attack him.

Any help would be welcome at this point.

Link to comment
Share on other sites

Update!

I have succesfully managed to get it to work like I want it to using this code:

local function OnWorked(inst, data)
    if data.worker and data.worker:HasTag("my_character") then 
		return 
	else 
		OnAttacked(inst, {attacker=data.worker})
	end
end

Thing is, this is a modification I've made directly to the brains/beecommon.lua file. Is there a way to add these changes to my modmain.lua without touching base game file?

Link to comment
Share on other sites

On 12/22/2021 at 1:17 AM, GoldenMistML said:

I don't know if this will work from the get-go, but try adding it to the: "your_character".lua in the prefabs folder! Specifically in the local function!

I've tried and while the game didn't crash, it also doesn't work. Though, it's not very important since I have removed that perk from the character. Thanks for your help nonetheless!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...