From deee6fc5210e9d3f2a29f024f145975b0437c574 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Sat, 30 Sep 2023 17:17:53 +0800 Subject: [PATCH] Corrected the description of CALCAPCOST hook --- artifacts/scripting/hooks.yml | 2 +- artifacts/scripting/hookscripts.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/artifacts/scripting/hooks.yml b/artifacts/scripting/hooks.yml index a618b418..90dcf059 100644 --- a/artifacts/scripting/hooks.yml +++ b/artifacts/scripting/hooks.yml @@ -46,7 +46,7 @@ - name: CalcAPCost id: HOOK_CALCAPCOST doc: | - Runs whenever Fallout is calculating the AP cost of using the weapon (or unarmed attack). Doesn't run for using other item types or moving.
+ Runs whenever Fallout calculates the AP cost of using an active item in hand (or unarmed attack). Doesn't run for moving.
Note that the first time a game is loaded, this script doesn't run before the initial interface is drawn, so if the script effects the AP cost of whatever is in the player's hands at the time the wrong AP cost will be shown. It will be fixed the next time the interface is redrawn.
You can get the weapon object by checking item slot based on attack type (`ATKTYPE_LWEP1`, `ATKTYPE_LWEP2`, etc) and then calling `critter_inven_obj`. diff --git a/artifacts/scripting/hookscripts.md b/artifacts/scripting/hookscripts.md index 092be156..a059dd52 100644 --- a/artifacts/scripting/hookscripts.md +++ b/artifacts/scripting/hookscripts.md @@ -133,7 +133,7 @@ Critter ret2 - Override the target of the attack #### `HOOK_CALCAPCOST (hs_calcapcost.int)` -Runs whenever Fallout is calculating the AP cost of using the weapon (or unarmed attack). Doesn't run for using other item types or moving.\ +Runs whenever Fallout calculates the AP cost of using an active item in hand (or unarmed attack). Doesn't run for moving.\ Note that the first time a game is loaded, this script doesn't run before the initial interface is drawn, so if the script effects the AP cost of whatever is in the player's hands at the time the wrong AP cost will be shown. It will be fixed the next time the interface is redrawn.\ You can get the weapon object by checking item slot based on attack type (`ATKTYPE_LWEP1`, `ATKTYPE_LWEP2`, etc) and then calling `critter_inven_obj`.