IfCanSee
Conditional function which checks if pointer can be seen by the entity.
Postal III Ultrapatch+Angel v1.3.0+ Feature
The following function will only work in Postal III Ultrapatch+Angel v1.3.0 or higher.
Syntax
// Checks if it blocks line of sight
IfCanSee "[target/caller/player] Block begin"
// stub
Block end
// Checks if it blocks line of sight AND if it faces the target
IfCanSee "[target:view/caller:view/player:view] Block begin"
// stub
Block end
Note
This function doesn't support one line execution. It must have Block begin and Block end.
TODO: this should get fixed at some point
Example
// This will check if Player is visible regardless if it's facing it, and goes to a different pattern
pt_playercheck
{
actions
{
TargetPlayer 1
IfCanSee "target Block begin"
Pattern pt_playersee
Block end
Pattern pt_playercheckagain
}
}
// This check will only pass if the entity is facing the player and there's nothing that blocks it's line of sight
pt_playerlos
{
actions
{
TargetPlayer 1
IfCanSee "target:view Block begin"
Pattern pt_attack
Block end
Pattern pt_end
}
}