Author: Robert Dionian
Posted: 2/11/2024
Problem:
Boss attack would randomly repeat itself after turn ended. If the bosses AOE attack ran, it would attack and then move, or not move, it was random, I wanted the boss to remain in one spot if the AOE attack ran. Another issue I had was if the AOE attack was not called first the boss would go through the normal attack move then the AOE would randomly run, and if that happened than it could get stuck in an endless loop of attacking. The problem was the selector that decides whose turn it is and if the boss can use its AOE attack was running to fast.
Solution:
I fixed this by adding another selector with the bosses AOE attack node locked behind a decorator with a bool that gets set in the service if based off of a percentage. I also added a decorator with a bool that has to be set to the branch of the tree that runs the normal attack with a bool that gets set to false if the AOE attack is being used that way the boss can not do the AOE attack and then move. To solve the selector reevaluating whose turn it is to often I just increased the amount of time between the selector running.
Did you like this post? Tell us