Aisuu wrote:Sorry to jumping into your topic. But I have difficulty with brains too.
I need to script monster to patroll. For example going in circle, or from left to right guarding something. Then, as soon as monster see party, he go after them and forget patrolling
![Smile :)](./images/smilies/icon_e_smile.gif)
I also need to create neutral monster. Completely ignoring party, but become aggressive after party attack it.
Sounds like you want it to do some complicated stuff. All I can say is the way it works is you have to "override" a monster's default behavior in the onThink() hook and you need to keep having it override on every thought trigger. OnThink() is called multiple times before an action is made. It is called a ton. As soon as you stop telling the monster what to do in onThink() he will go back to his default behavior, whatever that may be (must depend on the specific BrainComponent)
I have found out the hard way that some Brain commands simply will not work for all but certain monsters. The trickster is by far the most advanced. But I believe all monsters will respond to turn commands, guard, move, flee, move toward party, etc... They also respond to seek() which tells him to go to a certain square or goTo() which tells him to go to an object as long as it is on the same level.