Jump to content

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.

Edited by GalloViking

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?

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!

Edited by GalloViking

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