Restrict AI movement to AreaClass after entering area
I'm building an app to coincide with a children's book in which the main character at times herds cattle. I've got my cow AI working the way that I would like. The cows reacting to 2 stimuli, running from a whip or coming toward a call, and wandering in their general area and eating otherwise. I'm now trying to implement a pen situation. I have a square pen built with a trigger volume that passes variables to my ai, as well as a navmodifier volume setup that gives a CustomCowPenAreaClass to the ground in the pen. How do I tell my AI to stay in the pen once it has entered? I'm guessing a decorator of some sort to check if its in the pen but I have no idea how to change the characters nav data.
Any help would be greatly appreciated. I can provide screenshots of anyneeded bp's if necessary.
Edit: I assumed this would be an easy issue but it has had me stumped for a few days. I know that I could technically install Rama's Victory Plugin and use the custom move to with filter, but I don't know if I want to install 100+ extra nodes just for area class filtering functionality. Another option I've heard mentioned is using EQS queries, as they might have settings for area class in their filters. EQS is experimental and more complex than I think I need. I just want the cows to stay in the pen.
I thought I had come up with a solution when i remembered seeing Filter Class in the "get point in navigable radius". I tried promoting it to a variable and then setting it off and on based on the CowPen Filter which you can see below. The Blueprint ran and my game worked as usual during testing, but it didn't seem like the Filter was being applied once it entered the pen. :(. I'd super appreciate if anyone could point me in the right direction. I know it's confusing that I named both the area class and the variable that stored the filter class "cowpenfilter", but I don't believe it's affecting functionality.
Fixed it myself. I had thought that the filter class was the cowpenarea I had created with the navmodifier volume. Its actually a navigation filter. I modified as seen below, excluding the main navarea and including the cow pen, now everything works peachy. Hope this can help anyone else who might have a similar situation.
answered Apr 08 '17 at 02:52 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here