From ac233c710d4cae293713d4bd4905b3a7f6f16f53 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Mon, 16 Nov 2020 09:15:26 +0800 Subject: [PATCH] Changed the numbering of args in hookscripts.txt (#345) * because arg numbers are 0-indexed for related functions. --- artifacts/scripting/hookscripts.txt | 437 ++++++++++++++-------------- 1 file changed, 219 insertions(+), 218 deletions(-) diff --git a/artifacts/scripting/hookscripts.txt b/artifacts/scripting/hookscripts.txt index 1f917e7f..183f1bde 100644 --- a/artifacts/scripting/hookscripts.txt +++ b/artifacts/scripting/hookscripts.txt @@ -80,16 +80,16 @@ HOOK_TOHIT (hs_tohit.int) Runs when Fallout is calculating the chances of an attack striking a target Runs after the hit chance is fully calculated normally, including applying the 95% cap -int arg1 - The hit chance (capped) -critter arg2 - The attacker -critter arg3 - The target of the attack -int arg4 - The targeted bodypart -int arg5 - Source tile (may differ from attacker's tile, when AI is considering potential fire position) -int arg6 - Attack Type (one of ATKTYPE_*) -int arg7 - Ranged flag. 1 means the hit chance is calculated by taking into account the bonuses/penalties of the distance to the target -int arg8 - The raw hit chance before applying the cap +int arg0 - The hit chance (capped) +critter arg1 - The attacker +critter arg2 - The target of the attack +int arg3 - The targeted bodypart +int arg4 - Source tile (may differ from attacker's tile, when AI is considering potential fire position) +int arg5 - Attack Type (one of ATKTYPE_*) +int arg6 - Ranged flag. 1 means the hit chance is calculated by taking into account the bonuses/penalties of the distance to the target +int arg7 - The raw hit chance before applying the cap -int ret1 - the new hit chance +int ret0 - the new hit chance ------------------------------------------- @@ -97,15 +97,15 @@ HOOK_AFTERHITROLL (hs_afterhitroll.int) Runs after Fallout has decided if an attack will hit or miss -int arg1 - If the attack will hit. (0 - critical miss, 1 - miss, 2 - hit, 3 - critical hit) -critter arg2 - The attacker -critter arg3 - The target of the attack -int arg4 - The bodypart -int arg5 - The hit chance +int arg0 - If the attack will hit. (0 - critical miss, 1 - miss, 2 - hit, 3 - critical hit) +critter arg1 - The attacker +critter arg2 - The target of the attack +int arg3 - The bodypart +int arg4 - The hit chance -int ret1 - Override the hit/miss -int ret2 - Override the targeted bodypart -critter ret3 - Override the target of the attack +int ret0 - Override the hit/miss +int ret1 - Override the targeted bodypart +critter ret2 - Override the target of the attack ------------------------------------------- @@ -115,12 +115,12 @@ Runs whenever Fallout is calculating the AP cost of using the weapon (or unarmed 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(). -critter arg1 - The critter performing the action -int arg2 - Attack Type (see ATKTYPE_* constants) -int arg3 - Is aimed attack (1 or 0) -int arg4 - The normal AP cost +critter arg0 - The critter performing the action +int arg1 - Attack Type (see ATKTYPE_* constants) +int arg2 - Is aimed attack (1 or 0) +int arg3 - The normal AP cost -int ret1 - The new AP cost +int ret0 - The new AP cost ------------------------------------------- @@ -129,13 +129,13 @@ HOOK_DEATHANIM1 (hs_deathanim1.int) Runs before Fallout tries to calculate the death animation. Lets you switch out which weapon Fallout sees Does not run for critters in the knockdown/out state. -int arg1 - The pid of the weapon performing the attack. (May be -1 if the attack is unarmed) -critter arg2 - The attacker -critter arg3 - The target -int arg4 - The amount of damage -int arg5 - Unused, always -1. Use this if you are using the same procedure for HOOK_DEATHANIM1 and HOOK_DEATHANIM2 (since sfall 4.1/3.8.24) +int arg0 - The pid of the weapon performing the attack. (May be -1 if the attack is unarmed) +critter arg1 - The attacker +critter arg2 - The target +int arg3 - The amount of damage +int arg4 - Unused, always -1. Use this if you are using the same procedure for HOOK_DEATHANIM1 and HOOK_DEATHANIM2 (since sfall 4.1/3.8.24) -int ret1 - The pid of an object to override the attacking weapon with +int ret0 - The pid of an object to override the attacking weapon with ------------------------------------------- @@ -145,13 +145,13 @@ Runs after Fallout has calculated the death animation. Lets you set your own cus When using critter_dmg function, this script will also run. In that case weapon pid will be -1 and attacker will point to an object with obj_art_fid == 0x20001F5. Does not run for critters in the knockdown/out state. -item arg1 - The pid of the weapon performing the attack. (May be -1 if the attack is unarmed) -critter arg2 - The attacker -critter arg3 - The target -int arg4 - The amount of damage -int arg5 - The death anim id calculated by Fallout +item arg0 - The pid of the weapon performing the attack. (May be -1 if the attack is unarmed) +critter arg1 - The attacker +critter arg2 - The target +int arg3 - The amount of damage +int arg4 - The death anim id calculated by Fallout -int ret1 - The death anim id to override with +int ret0 - The death anim id to override with ------------------------------------------- @@ -162,25 +162,25 @@ Runs when: 2) AI decides whether it is safe to use area attack (burst, grenades), if he might hit friendlies. Does not run for misses, or non-combat damage like dynamite explosions. -critter arg1 - The target -critter arg2 - The attacker -int arg3 - The amount of damage to the target -int arg4 - The amount of damage to the attacker -int arg5 - The special effect flags for the target (use bwand DAM_* to check specific flags) -int arg6 - The special effect flags for the attacker (use bwand DAM_* to check specific flags) -int arg7 - The weapon used in the attack -int arg8 - The bodypart that was struck -int arg9 - Damage Multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled) -int arg10 - Number of bullets actually hit the target (1 for melee attacks) -int arg11 - The amount of knockback to the target -int arg12 - Attack Type (see ATKTYPE_* constants) -mixed arg13 - computed attack data (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data) +critter arg0 - The target +critter arg1 - The attacker +int arg2 - The amount of damage to the target +int arg3 - The amount of damage to the attacker +int arg4 - The special effect flags for the target (use bwand DAM_* to check specific flags) +int arg5 - The special effect flags for the attacker (use bwand DAM_* to check specific flags) +int arg6 - The weapon used in the attack +int arg7 - The bodypart that was struck +int arg8 - Damage Multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled) +int arg9 - Number of bullets actually hit the target (1 for melee attacks) +int arg10 - The amount of knockback to the target +int arg11 - Attack Type (see ATKTYPE_* constants) +mixed arg12 - computed attack data (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data) -int ret1 - The damage to the target -int ret2 - The damage to the attacker -int ret3 - The special effect flags for the target -int ret4 - The special effect flags for the attacker -int ret5 - The amount of knockback to the target +int ret0 - The damage to the target +int ret1 - The damage to the attacker +int ret2 - The special effect flags for the target +int ret3 - The special effect flags for the attacker +int ret4 - The amount of knockback to the target ------------------------------------------- @@ -188,7 +188,7 @@ HOOK_ONDEATH (hs_ondeath.int) Runs immediately after a critter dies for any reason. No return values; this is just a convenience for when you need to do something after death for a large number of different critters and don't want to have to script each and every one of them. -Critter arg1 - The critter that just died +Critter arg0 - The critter that just died ------------------------------------------- @@ -206,16 +206,16 @@ NOTE: The engine can choose targets by the following criteria: 3) The enemy that attacked an NPC from the same team as the attacker. 4) The enemy that is attacked by an NPC from the same team as the attacker. -critter arg1 - The attacker +critter arg0 - The attacker +critter arg1 - A possible target critter arg2 - A possible target critter arg3 - A possible target critter arg4 - A possible target -critter arg5 - A possible target -critter ret1 - The first choice of target -critter ret2 - The second choice of target -critter ret3 - The third choice of target -critter ret4 - The fourth choice of target +critter ret0 - The first choice of target +critter ret1 - The second choice of target +critter ret2 - The third choice of target +critter ret3 - The fourth choice of target ------------------------------------------- @@ -229,11 +229,11 @@ Runs when: This is fired before the object is used, and the relevant use_obj_on script procedures are run. You can disable default item behavior. NOTE: you can't remove and/or destroy this object during the hookscript (game will crash otherwise). To remove it, return 1. -Critter arg1 - The target -Critter arg2 - The user -int arg3 - The object used +Critter arg0 - The target +Critter arg1 - The user +int arg2 - The object used -int ret1 - overrides hard-coded handler and selects what should happen with the item (0 - place it back, 1 - remove it, -1 - use engine handler) +int ret0 - overrides hard-coded handler and selects what should happen with the item (0 - place it back, 1 - remove it, -1 - use engine handler) ------------------------------------------- @@ -246,10 +246,10 @@ Runs when: This is fired before the object is used, and the relevant use_obj script procedures are run. You can disable default item behavior. NOTE: you can't remove and/or destroy this object during the hookscript (game will crash otherwise). To remove it, return 1. -Critter arg1 - The user -int arg2 - The object used +Critter arg0 - The user +int arg1 - The object used -int ret1 - overrides hard-coded handler and selects what should happen with the item (0 - place it back, 1 - remove it, -1 - use engine handler) +int ret0 - overrides hard-coded handler and selects what should happen with the item (0 - place it back, 1 - remove it, -1 - use engine handler) ------------------------------------------- @@ -257,11 +257,11 @@ HOOK_REMOVEINVENOBJ (hs_removeinvenobj.int) Runs when an object is removed from a container or critter's inventory for any reason -Obj arg1 - the owner that the object is being removed from -item arg2 - the item that is being removed -int arg3 - the number of items to remove -int arg4 - The reason the object is being removed (see RMOBJ_* constants) -Obj arg5 - The destination object when the item is moved to another object, 0 otherwise +Obj arg0 - the owner that the object is being removed from +item arg1 - the item that is being removed +int arg2 - the number of items to remove +int arg3 - The reason the object is being removed (see RMOBJ_* constants) +Obj arg4 - The destination object when the item is moved to another object, 0 otherwise ------------------------------------------- @@ -270,19 +270,19 @@ HOOK_BARTERPRICE (hs_barterprice.int) Runs whenever the value of goods being purchased is calculated NOTE: the hook is executed twice when entering the barter screen or after transaction: the first time is for the player and the second time is for NPC -critter arg1 - the critter doing the bartering (either dude_obj or inven_dude) -critter arg2 - the critter being bartered with -int arg3 - the default value of the goods -critter arg4 - table of requested goods (being bought from NPC) -int arg5 - the amount of actual caps in the barter stack (as opposed to goods) -int arg6 - the value of all goods being traded before skill modifications -critter arg7 - table of offered goods (being sold to NPC) -int arg8 - the total cost of the goods offered by the player -int arg9 - 1 if the "offers" button was pressed (not for a party member), 0 otherwise -int arg10 - 1 if trading with a party member, 0 otherwise +critter arg0 - the critter doing the bartering (either dude_obj or inven_dude) +critter arg1 - the critter being bartered with +int arg2 - the default value of the goods +critter arg3 - table of requested goods (being bought from NPC) +int arg4 - the amount of actual caps in the barter stack (as opposed to goods) +int arg5 - the value of all goods being traded before skill modifications +critter arg6 - table of offered goods (being sold to NPC) +int arg7 - the total cost of the goods offered by the player +int arg8 - 1 if the "offers" button was pressed (not for a party member), 0 otherwise +int arg9 - 1 if trading with a party member, 0 otherwise -int ret1 - the modified value of all of the goods (pass -1 if you just want to modify offered goods) -int ret2 - the modified value of all offered goods +int ret0 - the modified value of all of the goods (pass -1 if you just want to modify offered goods) +int ret1 - the modified value of all offered goods ------------------------------------------- @@ -290,11 +290,11 @@ HOOK_MOVECOST (hs_movecost.int) Runs when calculating the AP cost of movement -Critter arg1 - the critter doing the moving -int arg2 - the number of hexes being moved -int arg3 - the original AP cost +Critter arg0 - the critter doing the moving +int arg1 - the number of hexes being moved +int arg2 - the original AP cost -int ret1 - the new AP cost +int ret0 - the new AP cost ------------------------------------------- @@ -311,12 +311,12 @@ For this reason, they may be removed in future versions. If you want to check if some tile or path is blocked, use functions: obj_blocking_tile, obj_blocking_line, path_find_to. If you want script to be called every time NPC moves by hex in combat, use hs_movecost hook. -Critter arg1 - the critter doing the moving -int arg2 - the tile number being checked -int arg3 - the elevation being checked -int arg4 - 1 if the hex would normally be blocking +Critter arg0 - the critter doing the moving +int arg1 - the tile number being checked +int arg2 - the elevation being checked +int arg3 - 1 if the hex would normally be blocking -object* ret1 - 0 if the hex doesn't block, or any sort of object pointer if it does +object* ret0 - 0 if the hex doesn't block, or any sort of object pointer if it does ------------------------------------------- @@ -324,15 +324,15 @@ HOOK_ITEMDAMAGE (hs_itemdamage.int) Runs when retrieving the damage rating of the player's used weapon. (Which may be their fists.) -int arg1 - The default min damage -int arg2 - The default max damage -Item arg3 - The weapon used. (0 if unarmed) -Critter arg4 - The critter doing the attacking -int arg5 - The type of attack -int arg6 - non-zero if this is an attack using a melee weapon +int arg0 - The default min damage +int arg1 - The default max damage +Item arg2 - The weapon used. (0 if unarmed) +Critter arg3 - The critter doing the attacking +int arg4 - The type of attack +int arg5 - non-zero if this is an attack using a melee weapon -int ret1 - Either the damage to be used, if ret2 isn't given, or the new minimum damage if it is -int ret2 - The new maximum damage +int ret0 - Either the damage to be used, if ret2 isn't given, or the new minimum damage if it is +int ret1 - The new maximum damage ------------------------------------------- @@ -342,12 +342,12 @@ Runs when calculating ammo cost for a weapon. Doesn't affect damage, only how mu By default, weapon will shoot when at least 1 round is left, regardless of ammo cost calculations. To add proper check for ammo before shooting and proper calculation of number of burst rounds (hook type 1 and 2 in arg4), set Misc.CheckWeaponAmmoCost=1 in ddraw.ini -Item arg1 - weapon -int arg2 - Number of bullets in burst (1 for single shots) -int arg3 - Ammo cost calculated by original function (this is basically 2 for Super Cattle Prod and Mega Power Fist) -int arg4 - Type of hook (0 - when subtracting ammo after single shot attack, 1 - when checking for "out of ammo" before attack, 2 - when calculating number of burst rounds, 3 - when subtracting ammo after burst attack) +Item arg0 - weapon +int arg1 - Number of bullets in burst (1 for single shots) +int arg2 - Ammo cost calculated by original function (this is basically 2 for Super Cattle Prod and Mega Power Fist) +int arg3 - Type of hook (0 - when subtracting ammo after single shot attack, 1 - when checking for "out of ammo" before attack, 2 - when calculating number of burst rounds, 3 - when subtracting ammo after burst attack) -int ret1 - new ammo cost value (set to 0 for unlimited ammo) +int ret0 - new ammo cost value (set to 0 for unlimited ammo) ------------------------------------------- @@ -358,11 +358,11 @@ DX codes: (see dik.h header) VK codes: http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx NOTE: if you want to override a key, the new key DX scancode should be the same for both pressed and released events. -int arg1 - event type: 1 - pressed, 0 - released -int arg2 - key DX scancode -int arg3 - key VK code (very similar to ASCII codes) +int arg0 - event type: 1 - pressed, 0 - released +int arg1 - key DX scancode +int arg2 - key VK code (very similar to ASCII codes) -int ret1 - overrides the pressed key (a new key DX scancode or 0 for no override) +int ret0 - overrides the pressed key (a new key DX scancode or 0 for no override) ------------------------------------------- @@ -370,8 +370,8 @@ HOOK_MOUSECLICK (hs_mouseclick.int) Runs once every time when a mouse button was pressed or release. -int arg1 - event type: 1 - pressed, 0 - released -int arg2 - button number (0 - left, 1 - right, up to 7) +int arg0 - event type: 1 - pressed, 0 - released +int arg1 - button number (0 - left, 1 - right, up to 7) ------------------------------------------- @@ -383,12 +383,12 @@ This is fired before the default handlers are called, which you can override. In Suggested use - override first aid/doctor skills to buff/nerf them, override steal skill to disallow observing NPCs inventories in some cases. Doesn't seem to run when lock picking. -Critter arg1 - The user critter -Obj arg2 - The target object -int arg3 - skill being used -int arg4 - skill bonus from items such as first aid kits +Critter arg0 - The user critter +Obj arg1 - The target object +int arg2 - skill being used +int arg3 - skill bonus from items such as first aid kits -int ret1 - overrides hard-coded handler (-1 - use engine handler, any other value - override) +int ret0 - overrides hard-coded handler (-1 - use engine handler, any other value - override) ------------------------------------------- @@ -399,12 +399,12 @@ Runs when checking an attempt to steal or plant an item in other inventory using This is fired before the default handlers are called, which you can override. In this case you MUST provide message of the result to player ("You steal the %s", "You are caught planting the %s", etc.). Example message (vanilla behavior): display_msg(sprintf(mstr_skill(570 + (isSuccess != false) + arg4*2), obj_name(arg3))); -Critter arg1 - Thief -Obj arg2 - The target -Item arg3 - Item being stolen/planted -int arg4 - 0 when stealing, 1 when planting +Critter arg0 - Thief +Obj arg1 - The target +Item arg2 - Item being stolen/planted +int arg3 - 0 when stealing, 1 when planting -int ret1 - overrides hard-coded handler (1 - force success, 0 - force fail, -1 - use engine handler) +int ret0 - overrides hard-coded handler (1 - force success, 0 - force fail, -1 - use engine handler) ------------------------------------------- @@ -416,15 +416,16 @@ NOTE: obj_can_see_obj calls this first when deciding if critter can possibly see This is fired after the default calculation is made. -Critter arg1 - Watcher object -Obj arg2 - Target object -int arg3 - Result of vanilla function: 1 - within perception range, 0 - otherwise -int arg4 - Type of hook: +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 ret1 - 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 scripting function which is called by every critter in the game) + +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 scripting function which is called by every critter in the game) ------------------------------------------- @@ -438,11 +439,11 @@ What you can do: - add AP costs for all inventory movement including reloading - apply or remove some special scripted effects depending on PC's armor -int arg1 - Target slot (0 - main backpack, 1 - left hand, 2 - right hand, 3 - armor slot, 4 - weapon, when reloading it by dropping ammo, 5 - container, like bag/backpack, 6 - dropping on the ground, 7 - picking up item, 8 - dropping item on the character portrait) -Item arg2 - Item being moved -Item arg3 - Item being replaced, weapon being reloaded, or container being filled (can be 0) +int arg0 - Target slot (0 - main backpack, 1 - left hand, 2 - right hand, 3 - armor slot, 4 - weapon, when reloading it by dropping ammo, 5 - container, like bag/backpack, 6 - dropping on the ground, 7 - picking up item, 8 - dropping item on the character portrait) +Item arg1 - Item being moved +Item arg2 - Item being replaced, weapon being reloaded, or container being filled (can be 0) -int ret1 - Override setting (-1 - use engine handler, any other value - prevent relocation of item/reloading weapon/picking up item) +int ret0 - Override setting (-1 - use engine handler, any other value - prevent relocation of item/reloading weapon/picking up item) ------------------------------------------- @@ -453,13 +454,13 @@ An example usage would be to change critter art depending on armor being used or NOTE: when replacing a previously wielded armor or weapon, the unwielding hook will not be executed. If you need to rely on this, try checking if armor/weapon is already equipped when wielding hook is executed. -Critter arg1 - critter -Obj arg2 - item being wielded or unwielded (weapon/armor) -int arg3 - slot (INVEN_TYPE_*) -int arg4 - 1 when wielding, 0 when unwielding -int arg5 - 1 when removing an equipped item from inventory, 0 otherwise +Critter arg0 - critter +Obj arg1 - item being wielded or unwielded (weapon/armor) +int arg2 - slot (INVEN_TYPE_*) +int arg3 - 1 when wielding, 0 when unwielding +int arg4 - 1 when removing an equipped item from inventory, 0 otherwise -int ret1 - overrides hard-coded handler (-1 - use engine handler, any other value - override) - NOT RECOMMENDED +int ret0 - overrides hard-coded handler (-1 - use engine handler, any other value - override) - NOT RECOMMENDED ------------------------------------------- @@ -470,10 +471,10 @@ Also happens on other screens, like barter. NOTE: FID has following format: 0x0ABBCDDD, where A is object type, BB - animation code (always 0 in this case), C - weapon code, DDD - FRM index in LST file. -int arg1 - the vanilla FID calculated by the engine according to critter base FID and armor/weapon being used -int arg2 - the modified FID calculated by the internal sfall code (like Hero Appearance Mod) +int arg0 - the vanilla FID calculated by the engine according to critter base FID and armor/weapon being used +int arg1 - the modified FID calculated by the internal sfall code (like Hero Appearance Mod) -int ret1 - overrides the calculated FID with provided value +int ret0 - overrides the calculated FID with provided value ------------------------------------------- @@ -481,11 +482,11 @@ HOOK_COMBATTURN (hs_combatturn.int) Runs before and after each turn in combat (for both PC and NPC). -int arg1 - event type: 1 - start of turn, 0 - normal end of turn, -1 - combat ends abruptly (by script or by pressing Enter during PC turn), -2 - combat ends normally (hook always runs at the end of combat) -int arg2 - critter doing the turn -bool arg3 - 1 at the start/end of the player's turn after loading a game saved in combat mode, 0 otherwise +int arg0 - event type: 1 - start of turn, 0 - normal end of turn, -1 - combat ends abruptly (by script or by pressing Enter during PC turn), -2 - combat ends normally (hook always runs at the end of combat) +int arg1 - critter doing the turn +bool arg2 - 1 at the start/end of the player's turn after loading a game saved in combat mode, 0 otherwise -int ret1 - pass 1 at the start of turn to skip the turn, pass -1 at the end of turn to force end of combat +int ret0 - pass 1 at the start of turn to skip the turn, pass -1 at the end of turn to force end of combat ------------------------------------------- @@ -493,11 +494,11 @@ HOOK_CARTRAVEL (hs_cartravel.int) Runs continuously during worldmap travel on car. -int arg1 - vanilla car speed (between 3 and 8 "steps") -int arg2 - vanilla fuel consumption (100 and below) +int arg0 - vanilla car speed (between 3 and 8 "steps") +int arg1 - vanilla fuel consumption (100 and below) -int ret1 - car speed override (pass -1 if you just want to override fuel consumption) -int ret2 - fuel consumption override +int ret0 - car speed override (pass -1 if you just want to override fuel consumption) +int ret1 - fuel consumption override ------------------------------------------- @@ -505,10 +506,10 @@ HOOK_SETGLOBALVAR (hs_setglobalvar.int) Runs when setting the value of a global variable. -int arg1 - the index number of the global variable being set -int arg2 - the set value of the global variable +int arg0 - the index number of the global variable being set +int arg1 - the set value of the global variable -int ret1 - overrides the value of the global variable +int ret0 - overrides the value of the global variable ------------------------------------------- @@ -516,12 +517,12 @@ HOOK_RESTTIMER (hs_resttimer.int) Runs continuously while the player is resting (using pipboy alarm clock). -int arg1 - the game time in ticks -int arg2 - event type: 1 - when the resting ends normally, -1 - when pressing ESC to cancel the timer, 0 - otherwise -int arg3 - the hour part of the length of resting time -int arg4 - the minute part of the length of resting time +int arg0 - the game time in ticks +int arg1 - event type: 1 - when the resting ends normally, -1 - when pressing ESC to cancel the timer, 0 - otherwise +int arg2 - the hour part of the length of resting time +int arg3 - the minute part of the length of resting time -int ret1 - pass 1 to interrupt the resting, pass 0 to continue the rest if it was interrupted by pressing ESC key +int ret0 - pass 1 to interrupt the resting, pass 0 to continue the rest if it was interrupted by pressing ESC key ------------------------------------------- @@ -529,8 +530,8 @@ HOOK_GAMEMODECHANGE (hs_gamemodechange.int) Runs once every time when the game mode was changed, like opening/closing the inventory, character screen, pipboy, etc. -int arg1 - event type: 1 - when the player exits the game, 0 - otherwise -int arg2 - the previous game mode +int arg0 - event type: 1 - when the player exits the game, 0 - otherwise +int arg1 - the previous game mode ------------------------------------------- @@ -538,11 +539,11 @@ HOOK_USEANIMOBJ (hs_useanimobj.int) Runs before playing the "use" (usually "magic hands") animation when a critter uses a scenery/container object on the map, or before walking/running animation if the player is at a distance from the object. -Critter arg1 - the critter that uses an object (usually dude_obj) -Obj arg2 - the object being used -int arg3 - the animation code being used (see ANIM_* in Animcomd.h) +Critter arg0 - the critter that uses an object (usually dude_obj) +Obj arg1 - the object being used +int arg2 - the animation code being used (see ANIM_* in Animcomd.h) -int ret1 - overrides the animation code (pass -1 if you want to skip the animation) +int ret0 - overrides the animation code (pass -1 if you want to skip the animation) ------------------------------------------- @@ -550,12 +551,12 @@ HOOK_EXPLOSIVETIMER (hs_explosivetimer.int) Runs after setting the explosive timer. You can override the result. -int arg1 - the time in ticks set in the timer -Obj arg2 - the explosive object -int arg3 - the result of engine calculation of whether the timer was set successfully: 1 - failure, 2 - success (similar to ROLL_* in Condtion.h) +int arg0 - the time in ticks set in the timer +Obj arg1 - the explosive object +int arg2 - the result of engine calculation of whether the timer was set successfully: 1 - failure, 2 - success (similar to ROLL_* in Condtion.h) -int ret1 - overrides the time of the timer (maximum 18000 ticks) -int ret2 - overrides the result of engine calculation: 0/1 - failure, 2/3 - success (similar to ROLL_*), any other value - use engine handler +int ret0 - overrides the time of the timer (maximum 18000 ticks) +int ret1 - overrides the result of engine calculation: 0/1 - failure, 2/3 - success (similar to ROLL_*), any other value - use engine handler ------------------------------------------- @@ -564,9 +565,9 @@ HOOK_DESCRIPTIONOBJ (hs_descriptionobj.int) Runs when using the examine action icon to display item description. You can override the description of the item. An example usage would be to add an additional description to the item based on player's stats/skills. -Obj arg1 - the item +Obj arg0 - the item -int ret1 - a pointer to the new text received by using "get_string_pointer" function +int ret0 - a pointer to the new text received by using "get_string_pointer" function ------------------------------------------- @@ -575,12 +576,12 @@ HOOK_USESKILLON (hs_useskillon.int) Runs before using any skill on any object. Lets you override the critter that uses the skill. NOTE: the user critter can't be overridden when using Steal skill. -Critter arg1 - the user critter (usually dude_obj) -Obj arg2 - the target object/critter -int arg3 - skill being used +Critter arg0 - the user critter (usually dude_obj) +Obj arg1 - the target object/critter +int arg2 - skill being used -int ret1 - a new critter to override the user critter. Pass -1 to cancel the skill use, pass 0 to skip this return value -int ret2 - pass 1 to allow the skill being used in combat (only for dude_obj or critter being controlled by the player) +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 being used in combat (only for dude_obj or critter being controlled by the player) ------------------------------------------- @@ -589,15 +590,15 @@ HOOK_ONEXPLOSION (hs_onexplosion.int) Runs when Fallout is checking all the tiles within the explosion radius for targets before an explosion occurs. The tile checking will be interrupted when 6 additional targets (critters) are received. -int arg1 - event type: 1 - when checking objects within the explosion radius without causing damage (e.g. the player drops an active explosive), 0 - otherwise -Critter arg2 - the attacker -int arg3 - the tile on which the explosion occurs -int arg4 - checked tile within the explosion radius -Obj arg5 - first found object on the checked tile as an additional target -Critter arg6 - the target critter, may be 0 or equal to the attacker -int arg7 - 1 when using throwing weapons (e.g. grenades), 0 otherwise +int arg0 - event type: 1 - when checking objects within the explosion radius without causing damage (e.g. the player drops an active explosive), 0 - otherwise +Critter arg1 - the attacker +int arg2 - the tile on which the explosion occurs +int arg3 - checked tile within the explosion radius +Obj arg4 - first found object on the checked tile as an additional target +Critter arg5 - the target critter, may be 0 or equal to the attacker +int arg6 - 1 when using throwing weapons (e.g. grenades), 0 otherwise -int ret1 - overrides the found object on the checked tile, pass 0 to skip the object +int ret0 - overrides the found object on the checked tile, pass 0 to skip the object ------------------------------------------- @@ -609,20 +610,20 @@ Runs when: 2) AI decides whether it is safe to use area attack (burst, grenades), if he might hit friendlies. Does not run for misses, non-combat damage like dynamite explosions, or if one of the damage formulas is selected in ddraw.ini. -Critter arg1 - the attacker -Critter arg2 - the target -Obj arg3 - the weapon used in the attack -int arg4 - attack type (see ATKTYPE_* constants) -int arg5 - number of bullets actually hit the target (1 for melee attacks) -int arg6 - target's Damage Resistance (DR) value (affected by critical hit effects, perks, traits, and special unarmed attacks) -int arg7 - target's Damage Threshold (DT) value (affected by critical hit effects, perks, traits, and special unarmed attacks) -int arg8 - bonus ranged damage from the perk -int arg9 - damage multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled) -int arg10 - combat difficulty multiplier (125 - rough, 100 - normal, 75 - wimpy; for player or party members it's always 100) -int arg11 - the calculated amount of damage (usually 0, required when using multiple hook scripts to calculate damage and using the set_sfall_arg function) -mixed arg12 - computed attack data (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data) +Critter arg0 - the attacker +Critter arg1 - the target +Obj arg2 - the weapon used in the attack +int arg3 - attack type (see ATKTYPE_* constants) +int arg4 - number of bullets actually hit the target (1 for melee attacks) +int arg5 - target's Damage Resistance (DR) value (affected by critical hit effects, perks, traits, and special unarmed attacks) +int arg6 - target's Damage Threshold (DT) value (affected by critical hit effects, perks, traits, and special unarmed attacks) +int arg7 - bonus ranged damage from the perk +int arg8 - damage multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled) +int arg9 - combat difficulty multiplier (125 - rough, 100 - normal, 75 - wimpy; for player or party members it's always 100) +int arg10 - the calculated amount of damage (usually 0, required when using multiple hook scripts to calculate damage and using the set_sfall_arg function) +mixed arg11 - computed attack data (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data) -int ret1 - the returned amount of damage +int ret0 - the returned amount of damage ------------------------------------------- @@ -630,12 +631,12 @@ HOOK_SETLIGHTING (hs_setlighting.int) Runs before setting the light level for an object or a map. You can override the result. -Obj arg1 - the object being set, or -1 when setting the light level for a map -int arg2 - the light intensity -int arg3 - the light radius, or -1 when setting the light level for a map +Obj arg0 - the object being set, or -1 when setting the light level for a map +int arg1 - the light intensity +int arg2 - the light radius, or -1 when setting the light level for a map -int ret1 - overrides the light intensity. Intensity range is from 0 to 65536 -int ret2 - overrides the light radius. Radius range is from 0 to 8 (works only for the object) +int ret0 - overrides the light intensity. Intensity range is from 0 to 65536 +int ret1 - overrides the light radius. Radius range is from 0 to 8 (works only for the object) ------------------------------------------- @@ -644,12 +645,12 @@ HOOK_SNEAK (hs_sneak.int) Runs when the Sneak skill is activated, or when the game rolls another Sneak check after the duration for the current one is over. You can override the result of a random Sneak check or the duration time for the current result. -int arg1 - Sneak check result: 1 - success, 0 - failure -int arg2 - the duration in ticks for the current Sneak check (time depends on Sneak skill level) -Critter arg3 - the critter (usually dude_obj) +int arg0 - Sneak check result: 1 - success, 0 - failure +int arg1 - the duration in ticks for the current Sneak check (time depends on Sneak skill level) +Critter arg2 - the critter (usually dude_obj) -int ret1 - overrides the result of the Sneak check -int ret2 - overrides the duration time for the current result +int ret0 - overrides the result of the Sneak check +int ret1 - overrides the duration time for the current result ------------------------------------------- @@ -658,12 +659,12 @@ HOOK_STDPROCEDURE, HOOK_STDPROCEDURE_END (hs_stdprocedure.int) Runs before or after Fallout engine executes a standard procedure (handler) in any script of any object. NOTE: this hook will not be executed for "start", critter_p_proc, timed_event_p_proc, and map_update_p_proc procedures. -int arg1 - the number of the standard script handler (see define.h) -Obj arg2 - the object that owns this handler (self_obj) -Obj arg3 - the object that called this handler (source_obj, can be 0) -int arg4 - 1 after procedure execution (for HOOK_STDPROCEDURE_END), 0 otherwise +int arg0 - the number of the standard script handler (see define.h) +Obj arg1 - the object that owns this handler (self_obj) +Obj arg2 - the object that called this handler (source_obj, can be 0) +int arg3 - 1 after procedure execution (for HOOK_STDPROCEDURE_END), 0 otherwise -int ret1 - pass -1 to cancel the execution of the handler (only for HOOK_STDPROCEDURE) +int ret0 - pass -1 to cancel the execution of the handler (only for HOOK_STDPROCEDURE) ------------------------------------------- @@ -672,11 +673,11 @@ HOOK_TARGETOBJECT (hs_targetobject.int) Runs when the targeting cursor hovers over an object, or when the player tries to attack the target object. You can override the target object or prevent the player from attacking the chosen target. -int arg1 - event type: 0 - when the targeting cursor hovers over the object, 1 - when trying to attack the target object -int arg2 - 1 when the target object is valid to attack, 0 otherwise -Obj arg3 - the target object +int arg0 - event type: 0 - when the targeting cursor hovers over the object, 1 - when trying to attack the target object +int arg1 - 1 when the target object is valid to attack, 0 otherwise +Obj arg2 - the target object -mixed ret1 - overrides the target object, or pass -1 to prevent the player from attacking the object +mixed ret0 - overrides the target object, or pass -1 to prevent the player from attacking the object ------------------------------------------- @@ -685,9 +686,9 @@ HOOK_ENCOUNTER (hs_encounter.int) Runs whenever a random encounter occurs (except the Horrigan meeting and scripted encounters), or when the player enters a local map from the world map. You can override the map for loading or the encounter. -int arg1 - event type: 0 - when a random encounter occurs, 1 - when the player enters from the world map -int arg2 - the map ID that the encounter will load (see MAPS.h or Maps.txt) -int arg3 - 1 when the encounter occurs is a special encounter, 0 otherwise +int arg0 - event type: 0 - when a random encounter occurs, 1 - when the player enters from the world map +int arg1 - the map ID that the encounter will load (see MAPS.h or Maps.txt) +int arg2 - 1 when the encounter occurs is a special encounter, 0 otherwise -int ret1 - overrides the map ID, or pass -1 for event type 0 to cancel the encounter and continue traveling -int ret2 - pass 1 to cancel the encounter and load the specified map from the ret1 (only for event type 0) +int ret0 - overrides the map ID, or pass -1 for event type 0 to cancel the encounter and continue traveling +int ret1 - pass 1 to cancel the encounter and load the specified map from the ret1 (only for event type 0)