Jump to content

Recommended Posts

So I'm making a dog character, and I only have one more "perk" to program in (well, scaring away catcoons isn't really a beneficial thing unless you hate them; but I needed to balance her out a bit). To put it simply, I want catcoons to run away from her and impossible for her to befriend. I've used code that alters when/if creatures notice/run away from the character before, but it was altering how close the character must be before the mob "sees" them. Is there a way I could repurpose this code and add some more to reach the goal I stated before, or would I have to use all new code? (sorry if this was a little wordy. tl;dr I want to make catcoons afraid of the character I'm making.)

Edited by poppychips

well this seems relevant to your first question:

as to the second, the test is in .components.trader.test

so just do the(written in more or less pesudocode)

local old test= inst.components.trader.test

function newtest(...)

if inst:HasTag("Dog")

return false

else

oldtest(inst)

end

inst.components.trader.test=newtest

 

AddPrefabpostinit("catcoon", 'the thing I've written above should be written as a function and called here')

 

Should probably work

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