Broken Herbivores

Maybe someone can take a look at this an see why herbivores do nothing but stand there. The white stag has the variable X2_L_SPAWN_USE_AMBIENT = 1 set on it which should make it play mobile ambient animations. Both the stag and the spawning deer use nw_c2_herbivore as their OnSpawn which sets the herbivore behavior state on them. However, I don’t think the DetermineSpecialBehavior function in nw_i0_generic called from nw_c2_default1 is working for the herbivore behavior.

broken_herbivores.7z (4.9 KB)

FYI, the omnivore behavior state works as intended.

I’m not sure if this helps or only adds to the mystery. I have pigs and cows with the nw_c2_herbivore as their OnSpawn but no variables at all. And yet they both wander around the farmyard. Go figure.

Yeah, TinyGiant over on Discord figured out what was wrong. Seems the herbivore code needed to match up with the omnivore code. Then all I had to do was swap out the DetermineCombatRound for TalentFlee.

I was testing the AI with bats and deer.

EDIT - @Grymlorde just did a test with cows in a module with no custom scripts. Stock NWN - no CC, no overrides, nothing in /development folder, no userpatch loaded haks. Cows just stand still. You sure your nw_c2_herbivore or nw_c2_default1 isn’t modified?

I also did learn that X2_L_SPAWN_USE_AMBIENT won’t be checked by anything using the herbivore or omnivore AI because its not included in that block of code. That check is part of the next block of code.

@Pstemarie - Yes, you’re correct. I’m using the nw_c2_default1 from Project Q as well as most of TonyK’s AI. And I created a vanilla module with cows and modified a boar to make it an herbivore. The cows played their immobile animation whereas the boar just stood there. Sorry for red herring. I know better than that.

I did take a look at Q’s nw_c2_default1 and it only addresses combat. So that just means that somewhere in TonyK’s AI are the herbivores defaulting to mobile (wandering) animations.

@Pstemarie - Attached is the set of modified scripts that my herbivores use. I couldn’t figure out where it is giving them mobile animations. You’ll probably have better luck.
cowscripts.7z (68.0 KB)