lozersneeze Posted January 18, 2015 Share Posted January 18, 2015 I hope it's okay that I made a new thread since it's sort of a different request, but if not I will happily delete it and continue my other thread. That being said, I managed to get the code for the sanity perk near koalefants to work... Next on my list is to make koalefants follow when the character is wearing the hat I created. The hat is already in game and currently only gives a sanity boost (which I can remove), but how would I go about scripting it so the koalefant will follow when she's wearing the hat? I was thinking something along the lines of how the Spider Hat works, where the spiders will follow and attack whatever you attack, but doesn't perish. Any help would be great Meanwhile, I'm going to go butcher some codes to see if I can figure it out myself Link to comment https://forums.kleientertainment.com/forums/topic/49362-help-request-how-to-make-koalefants-follow/ Share on other sites More sharing options...
lozersneeze Posted January 19, 2015 Author Share Posted January 19, 2015 So far I've had no success, only errors. If anyone has any advice on how to code this, I would greatly appreciate it I have every other aspect of the character done and I'd love to give it to my friend! Link to comment https://forums.kleientertainment.com/forums/topic/49362-help-request-how-to-make-koalefants-follow/#findComment-603746 Share on other sites More sharing options...
DarkXero Posted January 19, 2015 Share Posted January 19, 2015 You are going to have to modify the koalefant.lua, adding:inst:AddComponent("follower")Then, copy the spider hat spider() in hats.lua, with all its functions (spider_enable, spider_update, ...), and rename "spider" for "koalefant" (possibly removing other things like AddTag("monster") so other things don't attack you). Lastly you will have to edit the koalefant brain to add:Follow(self.inst, function() return self.inst.components.follower.leader end, MIN_FOLLOW_DIST, TARGET_FOLLOW_DIST, MAX_FOLLOW_DIST)But I'm not sure how to edit a brain without overriding the entire file. Link to comment https://forums.kleientertainment.com/forums/topic/49362-help-request-how-to-make-koalefants-follow/#findComment-603809 Share on other sites More sharing options...
lozersneeze Posted January 19, 2015 Author Share Posted January 19, 2015 (edited) You are going to have to modify the koalefant.lua, adding:inst:AddComponent("follower")Then, copy the spider hat spider() in hats.lua, with all its functions (spider_enable, spider_update, ...), and rename "spider" for "koalefant" (possibly removing other things like AddTag("monster") so other things don't attack you). Lastly you will have to edit the koalefant brain to add:Follow(self.inst, function() return self.inst.components.follower.leader end, MIN_FOLLOW_DIST, TARGET_FOLLOW_DIST, MAX_FOLLOW_DIST)But I'm not sure how to edit a brain without overriding the entire file. Thank you so much for the response. I have a couple questions, if you don't mind! Am I adding the spider hat from the hats.lua to the koalefant.lua? Or to the hat that I've already created? I just tried adding the spider hat thing to the hat I've already created and the koalefant still runs away. I'll include my files here so hopefully someone can tell me what I'm doing wrong (which is probably a lot, since I have no idea what I'm doing). Please, feel free to pull this apart and tell me I'm an idiot lol koalefantbrain.luaaza_hat.luakoalefant.lua Edited January 19, 2015 by lozersneeze Link to comment https://forums.kleientertainment.com/forums/topic/49362-help-request-how-to-make-koalefants-follow/#findComment-603829 Share on other sites More sharing options...
lozersneeze Posted January 21, 2015 Author Share Posted January 21, 2015 I've still been unable to get this to work. Any help would be greatly appreciated Link to comment https://forums.kleientertainment.com/forums/topic/49362-help-request-how-to-make-koalefants-follow/#findComment-604332 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