mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Edits to hookscripts.md and hooks.yml
Corrected a typo in arrays.md. Removed redundant compiler txt files.
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
- name: ToHit
|
||||
id: HOOK_TOHIT
|
||||
doc: |
|
||||
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.
|
||||
Runs when Fallout is calculating the chances of an attack striking a target.<br>
|
||||
Runs after the hit chance is fully calculated normally, including applying the 95% cap.
|
||||
|
||||
```
|
||||
int arg0 - The hit chance (capped)
|
||||
@@ -45,8 +46,8 @@
|
||||
- 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.
|
||||
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.
|
||||
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.<br>
|
||||
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.<br>
|
||||
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`.
|
||||
|
||||
```
|
||||
@@ -63,6 +64,7 @@
|
||||
id: HOOK_DEATHANIM1
|
||||
doc: |
|
||||
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.
|
||||
|
||||
```
|
||||
@@ -78,8 +80,9 @@
|
||||
- name: DeathAnim2
|
||||
id: HOOK_DEATHANIM2
|
||||
doc: |
|
||||
Runs after Fallout has calculated the death animation. Lets you set your own custom frame id, so more powerful than `HOOK_DEATHANIM1`, but performs no validation.
|
||||
Runs after Fallout has calculated the death animation. Lets you set your own custom frame id, so more powerful than `HOOK_DEATHANIM1`, but performs no validation.<br>
|
||||
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.
|
||||
|
||||
```
|
||||
@@ -136,7 +139,7 @@
|
||||
- name: FindTarget
|
||||
id: HOOK_FINDTARGET
|
||||
doc: |
|
||||
Runs when the AI is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the AI caps of the attacker.
|
||||
Runs when the AI is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the AI caps of the attacker.<br>
|
||||
This hook replaces that sorting function, allowing you to sort the targets in some arbitrary way.
|
||||
|
||||
The return values can include critters that weren't in the list of possible targets, but the additional targets may still be discarded later on in the combat turn if they are out of the attackers perception or the chance of a successful hit is too low. The list of possible targets often includes duplicated entries, but this is fixed in sfall 4.2.3/3.8.23.
|
||||
@@ -169,8 +172,9 @@
|
||||
1. a critter uses an object from inventory screen AND this object does not have "Use" action flag set and it's not active flare or explosive.
|
||||
1. player or AI uses any drug
|
||||
|
||||
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.
|
||||
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 arg0 - The target
|
||||
@@ -291,9 +295,9 @@
|
||||
- name: AmmoCost
|
||||
id: HOOK_AMMOCOST
|
||||
doc: |
|
||||
Runs when calculating ammo cost for a weapon. Doesn't affect damage, only how much ammo is spent.
|
||||
By default, weapons can make attacks when at least 1 ammo is left, regardless of ammo cost calculations.
|
||||
To add proper check for ammo before attacking and proper calculation of the number of burst rounds (hook type 1 and 2 in arg3), set **CheckWeaponAmmoCost=1** in **Misc** section of ddraw.ini.
|
||||
Runs when calculating ammo cost for a weapon. Doesn't affect damage, only how much ammo is spent.<br>
|
||||
By default, weapons can make attacks when at least 1 ammo is left, regardless of ammo cost calculations.<br>
|
||||
To add proper check for ammo before attacking and proper calculation of the number of burst rounds (hook type 1 and 2 in `arg3`), set **CheckWeaponAmmoCost=1** in **Misc** section of ddraw.ini.
|
||||
|
||||
```
|
||||
Item arg0 - The weapon
|
||||
@@ -342,8 +346,9 @@
|
||||
Runs when using any skill on any object.
|
||||
|
||||
This is fired before the default handlers are called, which you can override. In this case you should write your own skill use handler entirely, or otherwise nothing will happen (this includes fade in/fade out, time lapsing and messages - all of this can be scripted; to get vanilla text messages - use `message_str_game` along with `sprintf`).
|
||||
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.
|
||||
Suggested use - override First Aid/Doctor skills to buff/nerf them, override Steal skill to disallow observing NPCs inventories in some cases.
|
||||
|
||||
Does not run if the script of the object calls `script_overrides` for using the skill.
|
||||
|
||||
```
|
||||
Critter arg0 - The user critter
|
||||
@@ -586,6 +591,7 @@
|
||||
doc: |
|
||||
Runs when using the examine action icon to display the description of an object. You can override the description text.
|
||||
An example usage would be to add an additional description to the item based on player's stats/skills.
|
||||
|
||||
Does not run if the script of the object overrides the description.
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user