mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed duplicate critters being added to the target list for AI
Edited hookscripts.txt to mention the fix. Some code correction.
This commit is contained in:
@@ -192,9 +192,15 @@ HOOK_FINDTARGET (hs_findtarget.int)
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
Use sfall_return to give the 4 targets, in order of preference. If you want to specify less than 4 targets, fill in the extra spaces with 0's or pass -1 to skip the return value.
|
||||
|
||||
NOTE: The engine can choose targets by the following criteria:
|
||||
1) The nearest enemy to the attacker.
|
||||
2) The enemy that attacked the attacker.
|
||||
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 arg2 - A possible target
|
||||
critter arg3 - A possible target
|
||||
|
||||
Reference in New Issue
Block a user