-
Notifications
You must be signed in to change notification settings - Fork 0
KAI_MoveTowards()
inkoalawetrust edited this page May 4, 2023
·
5 revisions
KAI_MoveTowards ([Vector3 TargetPos, Double DetourFactor = 1.0, Double AngleLimit = 10, Int ChaseFlags = 0, Int Flags = 0])
- TargetPos: The Vector3 coordinate that the actor should move towards.
- DetourFactor: How much the actor is allowed to move around an obstacle after hitting one, before beginning to head towards TargetPos again. Actors take 16 to 32 steps by default, this is a multiplier for that. Default is 1.0.
- AngleLimit: How wide of a turn in degrees the actor can take per step. A value of 0 makes the actor take instant 180 degree turns. Default is 10.
- ChaseFlags: What flags from A_Chase should the function use ? Supports CHF_DONTMOVE, CHF_NODIRECTIONTURN, CHF_NORANDOMTURN, and CHF_STOPIFBLOCKED.
- Flags:
- KMT_CHASEGOAL: If the caller has a goal pointer, and the bChaseGoal flag on. It will follow the goal instead of the TargetPos.
- None
Makes the NPC move to TargetPos. This is THE main movement function for KAI NPCs, all other built-in functions use this to move, and are basically wrappers for it. The function also supports the +CANTLEAVEFLOORPIC flag, treating sectors with different floor textures as obstacles.
This Pinky does nothing besides follow the first enemy it sees and play it's active sound.
Class FollowerPinky : KAI_Creature
{
Default
{
Health 150;
PainChance 180;
Speed 10;
Radius 30;
Height 56;
Mass 400;
Monster;
+FLOORCLIP
SeeSound "demon/sight";
AttackSound "demon/melee";
PainSound "demon/pain";
DeathSound "demon/death";
ActiveSound "demon/active";
Obituary "$OB_DEMONHIT";
Tag "$FN_DEMON";
}
States
{
Spawn:
SARG AB 10 A_Look;
Loop;
See:
SARG AABBCCDD 2 Fast
{
If (Target)
KAI_MoveTowards(Target.Pos,detourfactor:0.5);
KAI_Chase_HandleActiveSound(0);
}
Loop;
}
}
- Home
- Features
- Classes
- Functions
- Guides