Question about Agent.SetAIBehaviorValues

Users who are viewing this thread

Hello everyone. My question is: what's the meaning of each parameter of Agent.SetAIBehaviorValues? I find that this method is called after giving orders such as movement, shield wall, etc.
I guess this method is used to tell the agent whether it should attack the enemy or stay where it should be, whether it should use melee or ranged weapon, etc.
But the parameter name of this method is stuff like "y1", "x2", "y2", etc. It's hard to figure out the meaning.
I tried to test them in custom battle and found that the last parameter may be used to determine the weight of the behavior. If the last param of GoToPos is higher than last param of other behavior, the soldier will go to the position and stay there, and will not move to enemies nearby, which is the case of shield wall command. If the last parameter of Melee is higher than others, the solider will use melee weapon and charge to the enemy, ignoring where it should go.
However, it becomes complicated when I test the other parameters and I cannot figure it out in the end.
Any helps? Does anyone know which developer is related to this code so that I can start a conversation with him?
PS: I'm developing RTS Camera and trying to implement "charge to a specific formation". Player will be able to choose a formation and give an order to attack a formation by clicking a soldier in the enemy formation. This method is important to make this feature useful.
 
Last edited:
Back
Top Bottom