Yamajac Posted May 3, 2015 Share Posted May 3, 2015 I'm trying to make a mod that fixes molebrain's running into walls all the time, but I can't seem to modify the DoAction that tells them to make a new home. If I use the exact same code, but use it to change a WhileNode instead of a DoAction, it works perfectly, but DoAction nodes seem to be quite substantially different from WhileNodes. So how do I change what a DoAction node does? Link to comment Share on other sites More sharing options...
Blueberrys Posted May 3, 2015 Share Posted May 3, 2015 @Yamajac How are you attempting to modify the node? Are you sure it's even accessing the correct node?You can see how DoAction works in "..\scripts\\behaviours\doaction.lua". The parent class BehaviourNode is in "..\scripts\behaviourtree.lua". Link to comment Share on other sites More sharing options...
Seiai Posted May 3, 2015 Share Posted May 3, 2015 well, a Whilenode is just a node that keeps doin a subnode, als long as a condition is met, a doaction node on the other hand is a node that does an action. if u want to study the code, Whilenode is in behaviourtree.lua and doaction is in doaction.lua. the problem with them hitting the walls is probably, that they dont use intelligent pathing, when they try to do an action via doaction. they however use intelligent pathing with other behaviours, like the follow.lua behaviour. so u could probably just program a behaviour that is similiar to the follow-behaviour, but which lets him move to the nearest home, and then, when he is next to it, just let him do the regular GoHomeAction. Link to comment Share on other sites More sharing options...
Yamajac Posted May 4, 2015 Author Share Posted May 4, 2015 I did manage to figure it out. A WhileNode function is accessed by node.fn, while a DoAction node function is in node.getactionfn. I didn't notice that, and assumed that any node's function would be in node.fn. I've currently fixed the issue by making them set up a new home directly where they are, but the plan for the future is to just make them wander for a bit, and then set up a home wherever they end up. But I'm gonna figure out how to do that tomorrow. I've got a couple other things I wanna work on today. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.