poppychips Posted November 4, 2017 Share Posted November 4, 2017 (edited) 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 November 4, 2017 by poppychips Link to comment https://forums.kleientertainment.com/forums/topic/83733-how-to-make-only-catcoons-run-away/ Share on other sites More sharing options...
poppychips Posted November 4, 2017 Author Share Posted November 4, 2017 Bump! (Sorry, this is the only code-heavy thing I have left to do to finish this mod. Any help is appreciated!) Link to comment https://forums.kleientertainment.com/forums/topic/83733-how-to-make-only-catcoons-run-away/#findComment-970629 Share on other sites More sharing options...
spideswine Posted November 4, 2017 Share Posted November 4, 2017 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 Link to comment https://forums.kleientertainment.com/forums/topic/83733-how-to-make-only-catcoons-run-away/#findComment-970648 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now