Aller au contenu

Photo

SOLVED: How do I get an NPC to stop chasing the PC?


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

#1
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
I have an NPC that will chase a PC far from his start point. I don't want him to run that far, so I set a ROAM_DISTANCE of 1. RUBBER_HOME_ENABLED is on.

ROAM_DISTANCE didn't seem to change anything - am I using it wrong?

Thanks!

Modifié par PavelNovotny, 20 mars 2010 - 02:36 .


#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
ROAM_DISTANCE doesn't apply anything unless the value is over 25.0 - it seems likely there is a reason for this.

If you need something smaller, you could try something like this in the spawn event:

[dascript]

                location lRoamLocation = Location(GetArea(OBJECT_SELF),GetPosition(OBJECT_SELF),0.0f);

                SetRoamLocation(OBJECT_SELF, lRoamLocation);
                SetRoamRadius(OBJECT_SELF, fRoamDistance);
[/dascript]

Modifié par Craig Graff, 19 mars 2010 - 11:47 .


#3
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
26 actually worked perfectly! Thanks!