Hook scripts are specially named scripts that are run by sfall at specific points to allow mods to override normally hardcoded behaviour in a more flexible way than sfall’s normal ini configuration.
In addition to the bit of code it overrides, the script will be run once when first loaded and again at each player reload to allow for setup. Hook scripts have access to a set of arguments supplied to sfall, but aren’t required to use them all. They also return one or more values, but again they’re optional, and you only need to return a value if you want to override the default.
Example setup for a hook-script based mod:
procedure tohit_hook_handler begin display_msg("Modifying hit_hook " + get_sfall_arg); set_hit_chance_max(100); set_sfall_return(100); end procedure start begin if game_loaded then begin register_hook_proc(HOOK_TOHIT, tohit_hook_handler); end end