mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
deploy: aa54e85537
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user