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
Waypoints & Running NPCs
Débuté par
mr. messiah
, déc. 18 2010 06:31
#1
Posté 18 décembre 2010 - 06:31
#2
Posté 18 décembre 2010 - 10:45
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
Posté 18 décembre 2010 - 11:07
_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
Posté 18 décembre 2010 - 11:29
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
Posté 18 décembre 2010 - 11:52
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





Retour en haut






