Debugging

Normally the game doesn't print out any errors, you need to have the
developer 1 and p3_fsm_spew 1 console commands enabled.
Doesn't require full game restart, only map change.

Scrolling around in the console should show you which script are loaded and what lines have errors if there are any, like here so:

p3_fsm_spew 1

If you want to print out your own debug messages, you'll have to settle for doing EntFireInput on the point_clientcommand entity in the map by doing EntFireInput pcc,Command: echo yourmessagehere in p3s.
Here's an example:

pt_mypattern
{
    actions
    {
        // do stuff
        EntFireInput pcc,Command:echo pattern is pt_mypattern
        State st_start
    }
}


Visual Debugging

With npc_fsminfo you can display an NPC's attributes with values, timers, events, last executed action, and many more:
You should point at an NPC before executing it.

npc_fsminfo

Here are a list of console commands that can be used in combination with that:

// Related to P3S debugging
p3_npc_show_mp
p3_npc_draw_target
p3_squad_debug
p3_npc_draw_squad_relations
p3_range_debug

// Specifically for npc_fsminfo
npc_show_memslots (default is 1)
npc_show_attr (default is 1)
npc_show_events (default is 0)
npc_show_actions (default is 1)
npc_show_timers (default is 0)
npc_show_ea_attr (default is 0)


External Execution / Help Guide

With p3_fsm_execute or p3_fsm_execute_ex you can execute any Postal3Script function for the Player or an NPC with name externally.
Same rules apply here for P3S limitations!

It will also display EVERY Postal3Script function you can use in a script file, so it is extremely useful.

Must have p3_fsm_spew 1 enabled to display use examples!

Note:
Sometimes the console commands will not do anything, if that happens you need to load a different map!

p3_fsm_execute

Syntax

p3_fsm_execute [P3S function] [command] -- Will always execute for Players

p3_fsm_execute_ex [entity name] [P3S function] [command] -- Will always execute for named NPCs

Examples

// Players
p3_fsm_execute State st_mytestingstate
// This will print out tutorials how to use it
p3_fsm_execute SetAttr ?
p3_fsm_execute IfAttr ?
p3_fsm_execute ExecutePattern ?

// Headblob for a named NPC
p3_fsm_execute_ex someguy Headblob 1,HappyCat
// This will kill every someguy NPC
p3_fsm_execute_ex someguy SetAttr "ea_health 0"


High Level Debugging

This one is not really useful to most people, it requires p3_fsm_spew, developer, and the use of npc_fsminfo in combination.

Enable these 3 commands, then set npc_fsm_log to 1, this will print out the currently under debugging NPC's P3S executions at high level onto the console.


General Advice

If you are not sure how Postal3Script works you can always check the functions on the left, every one of them have examples on their usage and how they work.
Alternatively, like we sometimes do, search through TM's Postal3Script files for a function and try to understand how they work.

I highly recommend to use a program like Notepad++ which is capable of searching through mass of files:

notepadpp

That being said, hopefully this will give you less headache in understanding Postal3Script, and may help you modding the game.
Make sure to keep Postal3Script's limitations in mind!