Target Functions
TargetEnemy
Sets NPC's enemy as target object
Syntax
TargetEnemy 1
-- Sets NPC's enemy as target object
TargetPlayer
Sets Player as target object
Syntax
TargetPlayer 1
-- Sets Player as target object
TargetCaller
Sets Event's caller as target object
Syntax
TargetCaller 1
-- Sets Event's caller as target object
TargetItem
Sets item in NPC's hand as target object
🆙🪽 Postal III Ultrapatch-only feature
- Works with Players
- Can be used to get the active weapon
Syntax
TargetItem 1
-- Sets item in NPC's hand as target object
TargetVehicle
Sets named Vehicle as target object
Note
Caller must be a Driver NPC
Syntax
TargetVehicle [entity name]
-- Sets named Vehicle as target object
TargetVehicle null
-- Resets Driver's entry point
Example
// (from ai_mission_mc.p3s)
st_return_to_vehicle
{
group Neutral
patterns
{
pt_default:ignore_ext_events
{
actions
{
SetAttr "OnSegway 0"
TargetVehicle vehicle_driver_exit
MoveToTarget true,0.5
Repeat 3
}
events
{
OnTargetReach "EnterVehicle 1"
OnEnteredVehicle "Pattern pt_vehicle"
}
}
}
}
TargetHostage
Unused Postal3Script function.
Sets Hostage as target object.
- Caller must be the Player
- Player must have active Hostage
Note
Syntax
TargetHostage 1
-- Sets Hostage as target object
TargetCrosshair
Unused Postal3Script function (Leftover from Dog School).
Sets Laserpen's dot as target object.
Warning
Will fail if Player isn't using Laserpen.
Syntax
TargetCrosshair 1
-- Sets Laserpen's dot as target object