Aller au contenu

Photo

Waypoints & Running NPCs


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

#1
mr. messiah

mr. messiah
  • Members
  • 3 messages
hi folks,

After searching the interwebs for hours for a solution I'm gonna post my little problem here.
What I'm trying to achieve is that my NPCs run along several waypoints and not walk slowly paced. However after looking for several hours into the matter I couldn't find any function related to waypoints which could toggle the run mode. If any one here knows an answer please tell.

regards 

#2
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Maybe use Scripted Waypoints (see sticky). When they arrive at a WP, do something like ActionForceMoveToObject() to send them to the next WP. I think that function has a parameter that toggles walk/run.

#3
mr. messiah

mr. messiah
  • Members
  • 3 messages

_Knightmare_ wrote...

Maybe use Scripted Waypoints (see sticky). When they arrive at a WP, do something like ActionForceMoveToObject() to send them to the next WP. I think that function has a parameter that toggles walk/run.


Well, i thought about that. However GetCurrentWayPoint() returns an int as data. ActionMoveToObject() on the other hand needs an object for the destination waypoint as a parameter. Any ideas how to get the object of the "next" WP?

#4
JasonNH

JasonNH
  • Members
  • 237 messages
Have you tried either using SetMovementRateFactor() or applying an effect from EffectMovementSpeedIncrease()?  I suppose it might be that the animations don't line up with the speed increases you are looking for though.

Modifié par JasonNH, 18 décembre 2010 - 11:30 .


#5
mr. messiah

mr. messiah
  • Members
  • 3 messages

JasonNH wrote...

Have you tried either using SetMovementRateFactor() or applying an effect from EffectMovementSpeedIncrease()?  I suppose it might be that the animations don't line up with the speed increases you are looking for though.


Jep, it looks rather funny and isn't really what I'm looking for. But I think i got it now:

int iCurrentWP = GetCurrentWP();
int iNextWP = iCurrentWP + 1;
string sNextWP =  IntToString(iNextWP);

object oNextWP = GetObjectByTag( "WP_X_" + sNextWP);

ActionMoveToObject(oNextWP, TRUE); // true because of always run toggle