So, I discovered something interesting with SetCommandable. OnSpellCast at always automatically sets Commandable to true. This means either that behavior has to be edited or another method must be used.
I decided to use another method -- basically detects whether the master has commanded the companion within the last nine seconds (round and a half) and if so the relevant AI scripts simply immediately return.
Currently have this applied to...
OnAttacked
OnHeartbeat
OnPerceived
OnSpellCastAt
OnCombatEnd
OnDialogue
I also set it up for OnDamaged but obviously this is irrelevant for the Animal Companion specifically since it uses the OnAttacked script twice. I may be avoid to avoid returning on some of those scripts but I played it safe as it doesn't seem to hurt anything and all were firing in combat and appear to have the potential to change the behavior of the creature.
This method appears to have solved my issues -- effectively shuts the AI combat decision making down for nine seconds each time the player gives a command and allows a LOT of custom control over the pet.
This can obviously be applied to any henchmen/animal companion/familiar that isn't reliant on spells or other special abilities quite easily. Probably would be possible to script something and tell casters to cast a spell instead of attack. But thought people might find it interesting.
Modifié par MagicalMaster, 28 octobre 2013 - 06:12 .