Cyde042 Posted October 16, 2014 Share Posted October 16, 2014 I did check the apiexamples, but I didn't find the answer there, or at least didn't make it out.function PerdBrain:OnStart() local clock = GetClock() local root = PriorityNode( { WhileNode( function() return self.inst.components.health.takingfiredamage end, "OnFire", Panic(self.inst)), WhileNode(function() return clock and not clock:IsDay() end, "IsNight", DoAction(self.inst, GoHomeAction, "Go Home", true )), DoAction(self.inst, EatFoodAction, "Eat Food"), RunAway(self.inst, "scarytoprey", SEE_PLAYER_DIST, STOP_RUN_DIST), --I want to override this line DoAction(self.inst, PickBerriesAction, "Pick Berries", true), Wander(self.inst, HomePos, MAX_WANDER_DIST), }, .25) self.bt = BT(self.inst, root)endHow do I access the node and edit the specified line via modmain? Link to comment https://forums.kleientertainment.com/forums/topic/42170-how-to-manage-a-brain/ Share on other sites More sharing options...
_Q_ Posted October 16, 2014 Share Posted October 16, 2014 I did check the apiexamples, but I didn't find the answer there, or at least didn't make it out.function PerdBrain:OnStart() local clock = GetClock() local root = PriorityNode( { WhileNode( function() return self.inst.components.health.takingfiredamage end, "OnFire", Panic(self.inst)), WhileNode(function() return clock and not clock:IsDay() end, "IsNight", DoAction(self.inst, GoHomeAction, "Go Home", true )), DoAction(self.inst, EatFoodAction, "Eat Food"), RunAway(self.inst, "scarytoprey", SEE_PLAYER_DIST, STOP_RUN_DIST), --I want to override this line DoAction(self.inst, PickBerriesAction, "Pick Berries", true), Wander(self.inst, HomePos, MAX_WANDER_DIST), }, .25) self.bt = BT(self.inst, root)endHow do I access the node and edit the specified line via modmain?It is in some api examples, but that is quite complicated to do with mod api. I ended just replacing whole brains with prefab post inits. Link to comment https://forums.kleientertainment.com/forums/topic/42170-how-to-manage-a-brain/#findComment-552459 Share on other sites More sharing options...
Cyde042 Posted October 17, 2014 Author Share Posted October 17, 2014 It is in some api examples, but that is quite complicated to do with mod api. I ended just replacing whole brains with prefab post inits. Would the correct way of doing it be like this? Just so they have the same name?function OnStart() thingsendAddBrainPostInit("perdbrain", OnStart) Link to comment https://forums.kleientertainment.com/forums/topic/42170-how-to-manage-a-brain/#findComment-552791 Share on other sites More sharing options...
_Q_ Posted October 17, 2014 Share Posted October 17, 2014 Would the correct way of doing it be like this? Just so they have the same name?function OnStart() thingsendAddBrainPostInit("perdbrain", OnStart) You just make prefab postinit of the Gobbler itself setting new brain there, and make whole new brain file. Link to comment https://forums.kleientertainment.com/forums/topic/42170-how-to-manage-a-brain/#findComment-552799 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