This commit is contained in:
github-actions[bot]
2025-01-10 01:07:15 +00:00
parent 114076b6d2
commit 0d072e3bc3
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="/sfall/feed.xml" rel="self" type="application/atom+xml" /><link href="/sfall/" rel="alternate" type="text/html" /><updated>2025-01-09T03:47:04+00:00</updated><id>/sfall/feed.xml</id><title type="html">sfall</title><subtitle>Sfall documentation</subtitle></feed>
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="/sfall/feed.xml" rel="self" type="application/atom+xml" /><link href="/sfall/" rel="alternate" type="text/html" /><updated>2025-01-10T01:07:08+00:00</updated><id>/sfall/feed.xml</id><title type="html">sfall</title><subtitle>Sfall documentation</subtitle></feed>
+1 -1
View File
@@ -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)
</code></pre></div></div> <h2 id="withinperception"> <a href="#withinperception" class="anchor-heading" aria-labelledby="withinperception"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> WithinPerception </h2> <p><code class="language-plaintext highlighter-rouge">HOOK_WITHINPRECEPTION</code> (hs_withinperception.int)</p> <p>Runs when checking if one critter sees another critter. This is used in different situations like combat AI. You can override the result.</p> <p><strong>NOTE:</strong> <code class="language-plaintext highlighter-rouge">obj_can_see_obj</code> calls this first when deciding if critter can possibly see another critter with regard to perception, lighting, sneak factors.<br /> 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.<br /> 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.</p> <p>This is fired after the default calculation is made.</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Critter arg0 - Watcher object
</code></pre></div></div> <h2 id="withinperception"> <a href="#withinperception" class="anchor-heading" aria-labelledby="withinperception"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> WithinPerception </h2> <p><code class="language-plaintext highlighter-rouge">HOOK_WITHINPERCEPTION</code> (hs_withinperception.int)</p> <p>Runs when checking if one critter sees another critter. This is used in different situations like combat AI. You can override the result.</p> <p><strong>NOTE:</strong> <code class="language-plaintext highlighter-rouge">obj_can_see_obj</code> calls this first when deciding if critter can possibly see another critter with regard to perception, lighting, sneak factors.<br /> 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.<br /> 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.</p> <p>This is fired after the default calculation is made.</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>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: