In my game, I have an AI character that patrols a list of waypoints using the patrol with A* in the behavior tree movement pack. In the start of my game, the AI can only access certain areas of a house. Once the player opens up doors to certain areas of the house I then want the AI to be able to now patrol those new areas as well. The goal is to have a list of waypoints that the AI Patrols at the start of the level. Once the player then opens a door, I would like a new waypoint to be added to the list of patrol points.
Since the player can open doors in any order I was thinking the best way to handle this would be using events. Once a door for a certain area is opened I could send off an event that would update the patrol waypoint list by adding the new waypoint to the list of patrol waypoints. I think I know how to execute the event part, but I don't know how to add new waypoints to the patrol list of waypoints. What would be the best way to accomplish something like this?
Also, is there a way I can easily store all of the waypoints I want to add once a certain event takes place inside Behaviour tree?
Thanks!
Since the player can open doors in any order I was thinking the best way to handle this would be using events. Once a door for a certain area is opened I could send off an event that would update the patrol waypoint list by adding the new waypoint to the list of patrol waypoints. I think I know how to execute the event part, but I don't know how to add new waypoints to the patrol list of waypoints. What would be the best way to accomplish something like this?
Also, is there a way I can easily store all of the waypoints I want to add once a certain event takes place inside Behaviour tree?
Thanks!