Aller au contenu

Photo

Nw_c2_Herbivore


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
YeOlde

YeOlde
  • Members
  • 37 messages
Hello!

I am trying to figure out how to get the NW_c2_Herbivore script to function properly. Inside the script, there is a line that says:

 SetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE); //Creature will flee those that close within 7m if they are not friends.

This doesn't seem to work, or I may misunderstand the function of the script. Does it mean that if a (as a non hostile PC character) comes closer than 7m, the creature will flee?

Edit: I figure the animal will flee only if I attack it. I tried NW_c2_omnivore on another creature, and the Omnivore creature seem to use the nw_flag_ambient_animations, while nw_c2_herbivore does not.

Thanks!

Modifié par YeOlde, 26 novembre 2011 - 08:43 .


#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
The way it is written you would have to be an enemy and not attacking the target.  It is handled by DetermineSpecialBehavior(); in nw_i0_generic.
 
The code snipet of the herberbor is.

else if(GetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE))
    {
        if(!GetIsObjectValid(GetAttemptedAttackTarget()) &&
           !GetIsObjectValid(GetAttemptedSpellTarget()) &&
           !GetIsObjectValid(GetAttackTarget()))
        {
            if(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 6.0)
            {
                if(!GetIsFriend(oTarget))
                {
                    if(GetLevelByclass(class_TYPE_DRUID, oTarget) == 0 && GetLevelByclass(class_TYPE_RANGER, oTarget) == 0)
                    {
                        TalentFlee(oTarget);
                    }
                }
            }
        }
        else if(!IsInConversation(OBJECT_SELF))
        {
            ClearActions(CLEAR_NW_I0_GENERIC_DetermineSpecialBehavior2);
            ActionRandomWalk();
            return;
        }
    }

#3
YeOlde

YeOlde
  • Members
  • 37 messages
Hey and yeah, I figured that one out. But I can't figure out why the Herbivore doesn't use the random walk when the Omnivore does :/

#4
henesua

henesua
  • Members
  • 3 883 messages
Depends on the situation for the herbivore. Usually the herbivore runs away.

BTW - I use similar behavior for Commoners. Rather than attack their enemies, they are likely to run away. I think its a good way to go. I'm tired of seeing defenseless children running to attack the trolls that enter town.

#5
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
<trying to...>

But, if I read that correctly, *any* levels in druid or ranger (regardless off animal empathy skill) would prevent the herbivore from running...

And it is <= 6.0 meters, not less than 7 (minor point, but it bugs me)

<...stay neutral>

#6
henesua

henesua
  • Members
  • 3 883 messages
Rolo, Its very easy to make those adjustments. I changed the scripts on Vives to use the animal empathy skill. And I think someone prior to me had done that as well. Although by the time I got my hands on teh code the herbivore scripts had been wiped. Anyway... the point is that it is easy to do.

#7
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
<feeling a bit...>

henesua wrote...
Rolo, Its very easy to make those adjustments. I changed the scripts on Vives to use the animal empathy skill. And I think someone prior to me had done that as well. Although by the time I got my hands on teh code the herbivore scripts had been wiped. Anyway... the point is that it is easy to do.

Understood. I'm just wondering if I'm the only one who thinks the bioware include was... sloppy :-P

<...crochety>

#8
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

Rolo Kipp wrote...

<feeling a bit...>

henesua wrote...
Rolo, Its very easy to make those adjustments. I changed the scripts on Vives to use the animal empathy skill. And I think someone prior to me had done that as well. Although by the time I got my hands on teh code the herbivore scripts had been wiped. Anyway... the point is that it is easy to do.

Understood. I'm just wondering if I'm the only one who thinks the bioware include was... sloppy :-P

<...crochety>


Just a copy paste error, In my opinion.  The OMNIVORE has a <8.0   on the range.   So they just grabed the wrong number from the script.   

#9
wyldhunt1

wyldhunt1
  • Members
  • 246 messages
Years ago, one of the first things I did was replace the entire script. I still refuse to use it to this day. The entire thing is a cheap kludge full of bad and half finished code... At least, I hope it was half finished. If that was the finished product, some programmer must have been very new when they made it.