Turning Functions
Turn
Changes the NPC's angle (from -360 to 360)
Syntax
Turn [integer]
-- Increases angle
Turn -[integer]
-- Decreases angle
Turn [integer]:[integer]
-- Randomizes angle
Example
// from ai_mission_sbe.p3s
pt_turn_left
{
actions
{
Move false
SetAttr "CornerType CORNER_RIGHT"
Turn -90
Wait 1
Pattern pt_move
}
}
pt_turn_right
{
actions
{
Move false
SetAttr "CornerType CORNER_LEFT"
Turn 90
Wait 1
Pattern pt_move
}
}
TurnSpeed
Sets the NPC's turning speed
Note
The default turning speed is 90
Syntax
TurnSpeed idle,[integer]
-- Sets idle speed
TurnSpeed turn,[integer]
-- Sets turn speed
TurnSpeed walk,[integer]
-- Sets walk speed
TurnSpeed run,[integer]
-- Sets run speed
TurnSpeed attack,[integer]
-- Sets attack speed
TurnSpeed default,[integer]
-- Sets default speed
Example
// from ai_st1_common.p3s
TurnSpeed turn,15
TurnSpeed idle,15
TurnSpeed run,15
TurnSpeed walk,15
TurnSpeed attack,15
TurnSpeed default,15