Class hookexecutor
hookexecutor contains functions which can modify the game executable during the startup hook functions OnStart and OnLocaleLoad.
Functions defined here are temporary, and will likely move in the future once more of the internal game tables are exposed through the Lua interface.
Methods
hookexecutor:ReplacePerk (perkTable, perkId) | ReplacePerk changes the data for a perk in the Fallout: Tactics perk table. |
hookexecutor:AddLocaleString (key, value) | AddLocaleString adds a locale string mapping from within the Lua script. |
hookexecutor:InstallVtableHook (classname, index, hook_function) | InstallVtableHook sets up a hook on an Entity virtual table (vtable) function. |
Types
hookexecutor.PerkTable | PerkTable format used in ReplacePerk. |
Methods
- hookexecutor:ReplacePerk (perkTable, perkId)
-
ReplacePerk changes the data for a perk in the Fallout: Tactics perk table.
This allows for the requirements and permanent bonuses from perks to be changed, and for currently disabled perk slots to be used for custom behavior.
Parameters:
- perkTable A table formatted as PerkTable, with the new parameters to use for the perk.
- perkId The index into the perk table to modify. This can be determined by finding the location of the desired perk slot in the entity editor, and starts from 0.
Returns:
-
None.
- hookexecutor:AddLocaleString (key, value)
-
AddLocaleString adds a locale string mapping from within the Lua script.
This allows a script to provide a translation string without having to edit the BOS locale files.
Parameters:
- key The key (name) of the locale string to add.
- value The text (value) of the locale string to add.
Returns:
-
None.
- hookexecutor:InstallVtableHook (classname, index, hook_function)
-
InstallVtableHook sets up a hook on an Entity virtual table (vtable) function.
This allows a script to receive notification on any event or call which is made to a
class of Entity or any of its subtypes. See the "Calling and Hooking Entity Vtable Functions"
section of the manual for information on how this can be useful in scripts.
Parameters:
- classname A string containing the name of the class for which the hook should be installed, or "ALL" for all subclasses of Entity. Note that this field is case sensitive.
- index The numeric index of the vtable function to hook. See the list of Entity Vtable functions for these values, and for the expected parameters and return value(s) the hook function will need.
- hook_function The name of the Lua function which should be called by the hook.
Returns:
-
None.
See also:
Types
- hookexecutor.PerkTable
-
PerkTable format used in ReplacePerk.
All fields are optional. If defaulted, integer parameters default to 0, and strings default to empty string, "".
Fields:
- minlevel The minimum character level required to be eligible to select this perk.
- maxperktaken The number of times a player is allowed to select this perk for a character.
- bonusstat If a perk applies a permanent bonus to a stat, provide the name of the stat here. The name should match the name of the stat in the Entity editor. Leave as an empty string, "", if no bonus should be applied.
- bonusamt How much to add or remove from the bonus stat.
- requiredstat1 The first skill requirement, for perks which have minimum skill levels to be selected. If no skill requirement is needed for the perk, leave as an empty string, "".
- requiredamt1 The minimum skill level of the skill listed in requiredstat1.
- and_or_flag For perks with two skill requirements, this flag indicates whether only one of the two requirements must be met (value of 1), or if both requirements need to be met (value of 2).
- requiredstat2 The second skill requirement, if any, for perks which have minimum skill levels to be selected. If no second skill requirement is needed for the perk, leave as an empty string, "".
- requiredamt2 The minimum skill level of the skill listed in requiredstat2.
- requiredST The minimum Strength attribute in order to use this perk.
- requiredPE The minimum Perception attribute in order to use this perk.
- requiredEN The minimum Endurance attribute in order to use this perk.
- requiredCH The minimum Charisma attribute in order to use this perk.
- requiredIN The minimum Intelligence attribute in order to use this perk.
- requiredAG The minimum Agility attribute in order to use this perk.
- requiredLK The minimum Luck attribute in order to use this perk.
- prohibitedRace A comma-separated list of races which are prohibited from selecting the perk. If no prohibition, leave as an empty string, "".
- requiredRace A string indicating the only race allowed to select the perk. If no limitation, leave as an empty string, "".