From 0d072e3bc36826d151d3a3613102d4384fbbe987 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 10 Jan 2025 01:07:15 +0000 Subject: [PATCH] deploy: aa54e855375d0df80e76ed33632dd1c2d3d56bff --- assets/js/search-data.json | 2 +- feed.xml | 2 +- hook-types/index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/search-data.json b/assets/js/search-data.json index 7ac8a48a..6822fd57 100644 --- a/assets/js/search-data.json +++ b/assets/js/search-data.json @@ -645,7 +645,7 @@ },"92": { "doc": "Hook types", "title": "WithinPerception", - "content": "HOOK_WITHINPRECEPTION (hs_withinperception.int) . Runs when checking if one critter sees another critter. This is used in different situations like combat AI. You can override the result. NOTE: obj_can_see_obj calls this first when deciding if critter can possibly see another critter with regard to perception, lighting, sneak factors. If check fails, the end result is false. If check succeeds (e.g. critter is within perception range), another check is made if there is any blocking tile between two critters (which includes stuff like windows, large bushes, barrels, etc.) and if there is - check still fails. You can override “within perception” check by returning 0 or 1, OR, as a convenience, you can also override blocking check after the perception check by returning 2 instead. In this case you should add “line of sight” check inside your hook script, otherwise critters will detect you through walls. This is fired after the default calculation is made. Critter arg0 - Watcher object Obj arg1 - Target object int arg2 - Result of vanilla function: 1 - within perception range, 0 - otherwise int arg3 - Type of hook: 1 - when being called from obj_can_see_obj script function 2 - when being called from obj_can_hear_obj script function (need to set ObjCanHearObjFix=1 in ddraw.ini) 3 - when AI determines whether it sees a potential target when selecting attack targets 0 - all other cases int ret0 - overrides the returned result of the function: 0 - not in range (can't see) 1 - in range (will see if not blocked) 2 - forced detection (will see regardless, only used in obj_can_see_obj script function which is called by every critter in the game) . ", + "content": "HOOK_WITHINPERCEPTION (hs_withinperception.int) . Runs when checking if one critter sees another critter. This is used in different situations like combat AI. You can override the result. NOTE: obj_can_see_obj calls this first when deciding if critter can possibly see another critter with regard to perception, lighting, sneak factors. If check fails, the end result is false. If check succeeds (e.g. critter is within perception range), another check is made if there is any blocking tile between two critters (which includes stuff like windows, large bushes, barrels, etc.) and if there is - check still fails. You can override “within perception” check by returning 0 or 1, OR, as a convenience, you can also override blocking check after the perception check by returning 2 instead. In this case you should add “line of sight” check inside your hook script, otherwise critters will detect you through walls. This is fired after the default calculation is made. Critter arg0 - Watcher object Obj arg1 - Target object int arg2 - Result of vanilla function: 1 - within perception range, 0 - otherwise int arg3 - Type of hook: 1 - when being called from obj_can_see_obj script function 2 - when being called from obj_can_hear_obj script function (need to set ObjCanHearObjFix=1 in ddraw.ini) 3 - when AI determines whether it sees a potential target when selecting attack targets 0 - all other cases int ret0 - overrides the returned result of the function: 0 - not in range (can't see) 1 - in range (will see if not blocked) 2 - forced detection (will see regardless, only used in obj_can_see_obj script function which is called by every critter in the game) . ", "url": "/sfall/hook-types/#withinperception", "relUrl": "/hook-types/#withinperception" diff --git a/feed.xml b/feed.xml index a806de7b..3bfbb045 100644 --- a/feed.xml +++ b/feed.xml @@ -1 +1 @@ -Jekyll2025-01-09T03:47:04+00:00/sfall/feed.xmlsfallSfall documentation \ No newline at end of file +Jekyll2025-01-10T01:07:08+00:00/sfall/feed.xmlsfallSfall documentation \ No newline at end of file diff --git a/hook-types/index.html b/hook-types/index.html index d9226cd5..9d3ea242 100644 --- a/hook-types/index.html +++ b/hook-types/index.html @@ -331,7 +331,7 @@ int arg2 - skill being used int ret0 - a new critter to override the user critter. Pass -1 to cancel the skill use, pass 0 to skip this return value int ret1 - pass 1 to allow the skill to be used in combat (only for dude_obj or critter being controlled by the player) -

WithinPerception

HOOK_WITHINPRECEPTION (hs_withinperception.int)

Runs when checking if one critter sees another critter. This is used in different situations like combat AI. You can override the result.

NOTE: obj_can_see_obj calls this first when deciding if critter can possibly see another critter with regard to perception, lighting, sneak factors.
If check fails, the end result is false. If check succeeds (e.g. critter is within perception range), another check is made if there is any blocking tile between two critters (which includes stuff like windows, large bushes, barrels, etc.) and if there is - check still fails.
You can override “within perception” check by returning 0 or 1, OR, as a convenience, you can also override blocking check after the perception check by returning 2 instead. In this case you should add “line of sight” check inside your hook script, otherwise critters will detect you through walls.

This is fired after the default calculation is made.

Critter arg0 - Watcher object
+

WithinPerception

HOOK_WITHINPERCEPTION (hs_withinperception.int)

Runs when checking if one critter sees another critter. This is used in different situations like combat AI. You can override the result.

NOTE: obj_can_see_obj calls this first when deciding if critter can possibly see another critter with regard to perception, lighting, sneak factors.
If check fails, the end result is false. If check succeeds (e.g. critter is within perception range), another check is made if there is any blocking tile between two critters (which includes stuff like windows, large bushes, barrels, etc.) and if there is - check still fails.
You can override “within perception” check by returning 0 or 1, OR, as a convenience, you can also override blocking check after the perception check by returning 2 instead. In this case you should add “line of sight” check inside your hook script, otherwise critters will detect you through walls.

This is fired after the default calculation is made.

Critter arg0 - Watcher object
 Obj     arg1 - Target object
 int     arg2 - Result of vanilla function: 1 - within perception range, 0 - otherwise
 int     arg3 - Type of hook: