Movement Functions

Move

Sets the NPC's movement

Syntax

Move run -- NPC will now run

Move walk -- NPC will now walk

Move true -- NPC is able to move

Move false -- NPC is no longer able to move

Move [walk/run],[angle],[timing],[face_dir/update_dir] -- todo


MoveToLean

Moves the NPC to a lean spot, used for combat

Syntax


// ENEMY DISTANCE (from ai_st_init.p3s)
Const ED_VERY_CLOSE,32
Const ED_CLOSE,160
Const ED_MIDDLE,320
Const ED_FAR,768
Const ED_FURTHER,1280
Const ED_VERY_FAR,2048

// Flags
nearest
nearest_to_target
in_viewcone
visible
notvisible_totarget
far
check_dotproduct
check_onmoving
not_behind_target
safe
area_group

MoveToLean run,[distance_min],[distance_max],[flag1],[flag2],[flag3], ..

Example


// from ai_cashmart.p3s
st_combat_hide
{
    Group Combat
    Patterns
    {
        pt_hide_param
        {
            actions 
            {
                ExecutePattern st_combat_logic.xpt_setAreaGroup
                MoveToLean run,ED_CLOSE,ED_FAR,notvisible_totarget
                Pattern pt_hide_loop
            }
        }
    }
}


MoveToTarget

Forces the NPC to move to it's target

Syntax


// Flags
none
to_target
from_target
target_dir

TODO

The syntax below is not really correct, It's not clear what each argument does just by looking at p3s scripts, it's a rough estimation

MoveToTarget [run/walk/true],[distance_min],[distance_max],[flag]

MoveToTarget [run/walk/true],[distance],[flag]

MoveToTarget [false]


// from ai_mission_sbe.p3s
pt_chase
{
    actions
    {
        TargetEntByName npc_slave
        MoveToTarget run,1
        CheckTarget 1
        Repeat 1
    }
    events
    {
        OnTimer_tChaseSlave "Pattern pt_stop_chase"
    }
}


MoveToTargetLKP

Forces the NPC to move to it's target.

TODO

What does LKP mean? How much different is this from the plain MoveToTarget?

Syntax

MoveToTargetLKP [run/walk/true]