From ba006cf3f4d08d941defb1a46a72d29a9b417bac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 17 Apr 2026 04:00:08 +0000 Subject: [PATCH] deploy: 81e612f383502cbd6b289248ddfdb085dae8d623 --- assets/js/search-data.json | 14 +++++++------- combat/index.html | 4 ++-- explosions/index.html | 2 +- feed.xml | 2 +- hook-functions/index.html | 2 +- objects-and-scripts/index.html | 2 +- other/index.html | 2 +- outline/index.html | 2 +- sfall-funcx-macros/index.html | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/assets/js/search-data.json b/assets/js/search-data.json index 4a8d8a9f..98660eab 100644 --- a/assets/js/search-data.json +++ b/assets/js/search-data.json @@ -183,7 +183,7 @@ },"26": { "doc": "Combat", "title": "Functions", - "content": ". | attack_is_aimed | block_combat | combat_data | disable_aimed_shots | force_aimed_shots | get_attack_type | get_bodypart_hit_modifier | get_combat_free_move | get_critical_table | get_critter_current_ap | get_last_attacker | get_last_target | reset_critical_table | set_bodypart_hit_modifier | set_combat_free_move | set_critical_table | set_critter_burst_disable | set_critter_current_ap | set_spray_settings | . attack_is_aimed . sfall.h . bool attack_is_aimed . Returns 1 if the aimed attack mode is selected, 0 otherwise. block_combat . void block_combat(bool value) . Deny the player to enter combat mode. combat_data . mixed combat_data . | returns a pointer to the C_ATTACK_* data for the current combat attack process (see defined constants in define_extra.h) | can be used in conjunction with the get_object_data and set_object_data functions example: sfall_func3(\"set_object_data\", sfall_func0(\"combat_data\"), C_ATTACK_UNUSED, 255); | . disable_aimed_shots . void disable_aimed_shots(int pid) . Allows overriding the normal rules regarding which weapons are allowed to make aimed attacks. (e.g. weapons that cause explosive damage normally cannot normally make aimed shots.) stops a weapon from making aimed shots even if it normally coulld. Affects player and NPCs alike. The list of edited weapons is not saved over game loads, so you need to call the function once at each reload. Use a pid of 0 to represent unarmed. force_aimed_shots . void force_aimed_shots(int pid) . Allows overriding the normal rules regarding which weapons are allowed to make aimed attacks. (e.g. weapons that cause explosive damage normally cannot normally make aimed shots.) Will allow a weapon to make aimed shots even if it normally couldn’t. Affects player and NPCs alike. Does not override the effects of the fast shot trait. The list of edited weapons is not saved over game loads, so you need to call the function once at each reload. Use a pid of 0 to represent unarmed. get_attack_type . int get_attack_type . get_bodypart_hit_modifier . int get_bodypart_hit_modifier(int bodypart) . Gets the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id’s are from 0 to 8. get_combat_free_move . sfall.h . int get_combat_free_move . Returns available “bonus move” points of the current critter’s turn. For NPCs, this is always 0 unless changed by set_combat_free_move . get_critical_table . int get_critical_table(int crittertype, int bodypart, int level, int valuetype) . Gets current critical table. For details see critical hit tables. Requires OverrideCriticalTable to be enabled in ddraw.ini (already enabled by default). get_critter_current_ap . int get_critter_current_ap(CritterPtr) . Should only be used during the target critters turn while in combat. Calling it outside of combat typically returns the critters max ap, but don’t rely on that behaviour. (Specifically, if the critter has never before entered combat, it will probably return the critters base ap ignoring any extra bonuses from perks etc.) . get_last_attacker . ObjectPtr get_last_attacker(ObjectPtr critter) . Will return the last critter to deliberately launch an attack against the argument critter. If a critter has not launched/received an attack, it will return 0. Outside of combat always returns 0. get_last_target . ObjectPtr get_last_target(ObjectPtr critter) . Will return the last critter to be deliberately attacked. Outside of combat always returns 0. reset_critical_table . void reset_critical_table(int crittertype, int bodypart, int level, int valuetype) . Resets the critical table to default (or to the contents of CriticalOverrides.ini, if it exists). For details see ‘http://falloutmods.wikia.com/wiki/Critical_hit_tables’. Requires OverrideCriticalTable to be set to 1 in ddraw.ini. (Disabled by default, because it noticably increases loading times.) . set_bodypart_hit_modifier . void set_bodypart_hit_modifier(int bodypart, int value) . Alters the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id’s are from 0 to 8. Changes are not saved, and will reset to the defaults (or to the values specified in ddraw.ini if they exist) at each reload. set_combat_free_move . sfall.h . void set_combat_free_move(int value) . Allows changing “bonus move” points (yellow lights on the interface bar) that can only be used for movement, not attacking . | Can be called from HOOK_COMBATTURN at the start of the turn (will not work on dude_obj) | Can be called from HOOK_STDPROCEDURE with combat_proc event (will work on both NPCs and dude_obj) | . set_critical_table . void set_critical_table(int crittertype, int bodypart, int level, int valuetype, int value) . Used for modifying the critical table. For details see critical hit tables. Changes are not saved, and will reset to the defaults (or to the contents of CriticalOverrides.ini, if it exists) at each game reload. Requires OverrideCriticalTable to be enabled in ddraw.ini (already enabled by default). set_critter_burst_disable . void set_critter_burst_disable(int critter, int disable) . set_critter_current_ap . void set_critter_current_ap(CritterPtr, int ap) . Should only be used during the target critters turn while in combat. set_spray_settings . sfall.h . void set_spray_settings(int centerMult, int centerDiv, int targetMult, int targetDiv) . Allows changing the multipliers and divisors for the bullet distribution of burst attacks dynamically. All settings are automatically reset to default values (i.e. ComputeSpray_* settings in ddraw.ini) after each attack action . | Should be called before the calculation of the bullet distribution (e.g. in HOOK_TOHIT or HOOK_AMMOCOST) | centerDiv/targetDiv: the minimum value of divisor is 1 | centerMult/targetMult: multiplier values are capped at divisor values | NOTE: refer to the description of ComputeSpray_* settings in ddraw.ini for details of the bullet distribution of burst attacks | . ", + "content": ". | attack_is_aimed | block_combat | combat_data | disable_aimed_shots | force_aimed_shots | get_attack_type | get_bodypart_hit_modifier | get_combat_free_move | get_critical_table | get_critter_current_ap | get_last_attacker | get_last_target | reset_critical_table | set_bodypart_hit_modifier | set_combat_free_move | set_critical_table | set_critter_burst_disable | set_critter_current_ap | set_spray_settings | . attack_is_aimed . sfall.h . bool attack_is_aimed . Returns 1 if the aimed attack mode is selected, 0 otherwise. block_combat . void block_combat(bool value) . Deny the player to enter combat mode. combat_data . mixed combat_data . | returns a pointer to the C_ATTACK_* data for the current combat attack process (see defined constants in define_extra.h) | can be used in conjunction with the get_object_data and set_object_data functions example: sfall_func3(\"set_object_data\", sfall_func0(\"combat_data\"), C_ATTACK_UNUSED, 255); | . disable_aimed_shots . void disable_aimed_shots(int pid) . Allows overriding the normal rules regarding which weapons are allowed to make aimed attacks. (e.g. weapons that cause explosive damage normally cannot normally make aimed shots.) stops a weapon from making aimed shots even if it normally coulld. Affects player and NPCs alike. The list of edited weapons is not saved over game loads, so you need to call the function once at each reload. Use a pid of 0 to represent unarmed. force_aimed_shots . void force_aimed_shots(int pid) . Allows overriding the normal rules regarding which weapons are allowed to make aimed attacks. (e.g. weapons that cause explosive damage normally cannot normally make aimed shots.) Will allow a weapon to make aimed shots even if it normally couldn’t. Affects player and NPCs alike. Does not override the effects of the fast shot trait. The list of edited weapons is not saved over game loads, so you need to call the function once at each reload. Use a pid of 0 to represent unarmed. get_attack_type . int get_attack_type . get_bodypart_hit_modifier . int get_bodypart_hit_modifier(int bodypart) . Returns the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id’s are from 0 to 8. get_combat_free_move . sfall.h . int get_combat_free_move . Returns available “bonus move” points of the current critter’s turn. For NPCs, this is always 0 unless changed by set_combat_free_move . get_critical_table . int get_critical_table(int crittertype, int bodypart, int level, int valuetype) . Returns the current critical table. For details see critical hit tables. Requires OverrideCriticalTable to be enabled in ddraw.ini (already enabled by default). get_critter_current_ap . int get_critter_current_ap(CritterPtr) . Should only be used during the target critters turn while in combat. Calling it outside of combat typically returns the critters max ap, but don’t rely on that behaviour. (Specifically, if the critter has never before entered combat, it will probably return the critters base ap ignoring any extra bonuses from perks etc.) . get_last_attacker . ObjectPtr get_last_attacker(ObjectPtr critter) . Will return the last critter to deliberately launch an attack against the argument critter. If a critter has not launched/received an attack, it will return 0. Outside of combat always returns 0. get_last_target . ObjectPtr get_last_target(ObjectPtr critter) . Will return the last critter to be deliberately attacked. Outside of combat always returns 0. reset_critical_table . void reset_critical_table(int crittertype, int bodypart, int level, int valuetype) . Resets the critical table to default (or to the contents of CriticalOverrides.ini, if it exists). For details see ‘http://falloutmods.wikia.com/wiki/Critical_hit_tables’. Requires OverrideCriticalTable to be set to 1 in ddraw.ini. (Disabled by default, because it noticably increases loading times.) . set_bodypart_hit_modifier . void set_bodypart_hit_modifier(int bodypart, int value) . Alters the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id’s are from 0 to 8. Changes are not saved, and will reset to the defaults (or to the values specified in ddraw.ini if they exist) at each reload. set_combat_free_move . sfall.h . void set_combat_free_move(int value) . Allows changing “bonus move” points (yellow lights on the interface bar) that can only be used for movement, not attacking . | Can be called from HOOK_COMBATTURN at the start of the turn (will not work on dude_obj) | Can be called from HOOK_STDPROCEDURE with combat_proc event (will work on both NPCs and dude_obj) | . set_critical_table . void set_critical_table(int crittertype, int bodypart, int level, int valuetype, int value) . Used for modifying the critical table. For details see critical hit tables. Changes are not saved, and will reset to the defaults (or to the contents of CriticalOverrides.ini, if it exists) at each game reload. Requires OverrideCriticalTable to be enabled in ddraw.ini (already enabled by default). set_critter_burst_disable . void set_critter_burst_disable(int critter, int disable) . set_critter_current_ap . void set_critter_current_ap(CritterPtr, int ap) . Should only be used during the target critters turn while in combat. set_spray_settings . sfall.h . void set_spray_settings(int centerMult, int centerDiv, int targetMult, int targetDiv) . Allows changing the multipliers and divisors for the bullet distribution of burst attacks dynamically. All settings are automatically reset to default values (i.e. ComputeSpray_* settings in ddraw.ini) after each attack action . | Should be called before the calculation of the bullet distribution (e.g. in HOOK_TOHIT or HOOK_AMMOCOST) | centerDiv/targetDiv: the minimum value of divisor is 1 | centerMult/targetMult: multiplier values are capped at divisor values | NOTE: refer to the description of ComputeSpray_* settings in ddraw.ini for details of the bullet distribution of burst attacks | . ", "url": "/sfall/combat/#functions", "relUrl": "/combat/#functions" @@ -232,7 +232,7 @@ },"33": { "doc": "Explosions", "title": "Functions", - "content": ". | get_explosion_damage | item_make_explosive | metarule2_explosions | set_attack_explosion_art | set_attack_explosion_pattern | set_attack_explosion_radius | set_attack_is_explosion_fire | set_dynamite_damage | set_explosion_max_targets | set_explosion_radius | set_plastic_damage | . get_explosion_damage . sfall.h . array get_explosion_damage(itemPid) . Returns an array of the minimum and maximum damage of the explosive item. item_make_explosive . sfall.h . void item_make_explosive(int pid, int activePid, int minDamage, int maxDamage) . | makes the specified item (pid) an explosive item like Dynamite or Plastic Explosives | maxDamage is optional | activePid is for an item with an active timer, can be the same as the pid argument | the item proto must be the Misc Item type and have the Use action flag | minDamage/maxDamage are the minimum and maximum explosion damage | using the function on an item that is already set as an explosive will override its previous settings | NOTE: this function does not work for pids of Dynamite and Plastic Explosives | . metarule2_explosions . int metarule2_explosions(int arg1, int arg2) . Was made as a quick-and-dirty hack to enable dynamic changes to some explosion parameters for ranged attacks. All changed parameters are automatically reset to vanilla state after each attack action. set_attack_explosion_art . sfall.h . void set_attack_explosion_art(x, y) . Y not used and X is a misc frame ID (last 3 bytes, without object type) to use for the next explosion. set_attack_explosion_pattern . sfall.h . void set_attack_explosion_pattern(x, y) . Currently Y is not used and X means: 1 - reduced explosion pattern (3 effects are spawned instead of 7), 0 - full pattern. set_attack_explosion_radius . sfall.h . void set_attack_explosion_radius(x) . Changes radius at which explosion will hit secondary targets for the next attack (from the experiments it is limited to something around 8 by the engine). set_attack_is_explosion_fire . sfall.h . void set_attack_is_explosion_fire . If you call this right before using a weapon with fire damage type (e.g. in HOOK_AFTERHITROLL), it will produce explosion effects (and radius damage) just like “explosion” type, but all targets will still receive fire damage. set_dynamite_damage . sfall.h . void set_dynamite_damage(minDmg, maxDmg) . Sets the minimum and maximum damage for Dynamite. Changed damage will be reset each time the player reloads the game. set_explosion_max_targets . sfall.h . void set_explosion_max_targets(x) . Sets the maximum number of additional targets for an explosion, valid range: 1..6 (default is 6). set_explosion_radius . sfall.h . void set_explosion_radius(grenade, rocket) . Sets a permanent radius of the explosion for grenades and/or rockets. Passing 0 means not changing the corresponding radius. Changed radius will be reset each time the player reloads the game. set_plastic_damage . sfall.h . void set_plastic_damage(minDmg, maxDmg) . Sets the minimum and maximum damage for Plastic Explosives. Changed damage will be reset each time the player reloads the game. ", + "content": ". | get_explosion_damage | item_make_explosive | metarule2_explosions | set_attack_explosion_art | set_attack_explosion_pattern | set_attack_explosion_radius | set_attack_is_explosion_fire | set_dynamite_damage | set_explosion_max_targets | set_explosion_radius | set_plastic_damage | . get_explosion_damage . sfall.h . array get_explosion_damage(itemPid) . Returns an array of the minimum and maximum damage of the explosive item. item_make_explosive . sfall.h . void item_make_explosive(int pid, int activePid, int minDamage, int maxDamage) . | makes the specified item (pid) an explosive item like Dynamite or Plastic Explosives | maxDamage is optional | activePid is for an item with an active timer, can be the same as the pid argument | the item proto must be of the Misc Item type and have the Use action flag | minDamage/maxDamage are the minimum and maximum explosion damage | using the function on an item that is already set as an explosive will override its previous settings | NOTE: this function does not work for pids of Dynamite and Plastic Explosives | . metarule2_explosions . int metarule2_explosions(int arg1, int arg2) . Was made as a quick-and-dirty hack to enable dynamic changes to some explosion parameters for ranged attacks. All changed parameters are automatically reset to vanilla state after each attack action. set_attack_explosion_art . sfall.h . void set_attack_explosion_art(x, y) . Y not used and X is a misc frame ID (last 3 bytes, without object type) to use for the next explosion. set_attack_explosion_pattern . sfall.h . void set_attack_explosion_pattern(x, y) . Currently Y is not used and X means: 1 - reduced explosion pattern (3 effects are spawned instead of 7), 0 - full pattern. set_attack_explosion_radius . sfall.h . void set_attack_explosion_radius(x) . Changes radius at which explosion will hit secondary targets for the next attack (from the experiments it is limited to something around 8 by the engine). set_attack_is_explosion_fire . sfall.h . void set_attack_is_explosion_fire . If you call this right before using a weapon with fire damage type (e.g. in HOOK_AFTERHITROLL), it will produce explosion effects (and radius damage) just like “explosion” type, but all targets will still receive fire damage. set_dynamite_damage . sfall.h . void set_dynamite_damage(minDmg, maxDmg) . Sets the minimum and maximum damage for Dynamite. Changed damage will be reset each time the player reloads the game. set_explosion_max_targets . sfall.h . void set_explosion_max_targets(x) . Sets the maximum number of additional targets for an explosion, valid range: 1..6 (default is 6). set_explosion_radius . sfall.h . void set_explosion_radius(grenade, rocket) . Sets a permanent radius of the explosion for grenades and/or rockets. Passing 0 means not changing the corresponding radius. Changed radius will be reset each time the player reloads the game. set_plastic_damage . sfall.h . void set_plastic_damage(minDmg, maxDmg) . Sets the minimum and maximum damage for Plastic Explosives. Changed damage will be reset each time the player reloads the game. ", "url": "/sfall/explosions/#functions", "relUrl": "/explosions/#functions" @@ -309,7 +309,7 @@ },"44": { "doc": "Hook functions", "title": "Functions", - "content": ". | get_sfall_arg | get_sfall_arg_at | get_sfall_args | init_hook | register_hook | register_hook_proc | register_hook_proc_spec | set_sfall_arg | set_sfall_return | . get_sfall_arg . mixed get_sfall_arg . Gets the next argument from sfall. Each time it’s called it returns the next argument, or otherwise it returns 0 if there are no more arguments left. You can arbitrarily get the value of any argument using the sfall_func1(\"get_sfall_arg_at\", argNum) function. get_sfall_arg_at . sfall.h . mixed get_sfall_arg_at(int argNum) . Gets the value of hook argument with the specified argument number (first argument of hook starts from 0) . get_sfall_args . int get_sfall_args . Returns all hook arguments as a new temp array. init_hook . int init_hook . The hook script equivalent of game_loaded; it returns 1 when the script is loaded for the first time or when the player reloads the game, and 0 otherwise. register_hook . void register_hook(int hookID) . Used from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, start procedure will be executed in current global script. You can use all above functions like normal. register_hook_proc . void register_hook_proc(int hookID, proc procedure) . The same as register_hook, except that you specifically define which procedure in the current script should be called as a hook (instead of “start” by default). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script with no conflicts) and flexibility. You can place all related hook scripts for a specific mod in one global script! . Use zero (0) as second argument to unregister hook script from current global script. NOTE: you can hook several scripts to a single hook point, for example if it’s different mods from different authors or just some different aspects of one larger mod. When one of the scripts in a chain returns value with set_sfall_return, the next script may override this value if calls set_sfall_return again. Example: Sometimes you need to multiply certain value in a chain of hook scripts. Let’s say we have a Mod A which reduces all “to hit” chances by 50%. The code might look like this: . original_chance = get_sfall_arg; set_sfall_return(original_chance / 2); . Mod B also want to affect hit chances globally, by increasing them by 50%. Now in order for both mods to work well together, we need to add this line to Mod A hook script: . set_sfall_arg(0, (original_chance / 2)); . This basically changes hook argument for the next script. Mod B code: . original_chance = get_sfall_arg; set_sfall_return(original_chance * 1.5); set_sfall_arg(0, (original_chance * 1.5)); . So if you combine both mods together, they will run in chain and the end result will be a 75% from original hit chance (hook register order doesn’t matter in this case, if you use set_sfall_arg in both hooks). The defines to use for the hookID are in sfall.h. register_hook_proc_spec . void register_hook_proc_spec(int hookID, procedure proc) . Works the same as register_hook_proc, except that it registers the current script at the end of the hook script execution chain (i.e. the script will be executed after all previously registered scripts for the same hook, including the hs_<name>.int script). In addition, all scripts hooked to a single hook point with this function are executed in the exact order of how they were registered. In the case of using register_hook and register_hook_proc functions, scripts are executed in reverse order of how they were registered. The execution chain of script procedures for a hook is as follows: 1. Procedures registered with register_hook and register_hook_proc functions (executed in reverse order of registration). 2. The hs_<name>.int script. 3. Procedures registered with the register_hook_proc_spec function (executed in the exact order of registration). set_sfall_arg . void set_sfall_arg(int argNum, int value) . Changes argument value. The argument number (argNum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see register_hook_proc). set_sfall_return . void set_sfall_return(any value) . Used to return the new values from the script. Each time it’s called it sets the next value, or if you’ve already set all return values it does nothing. ", + "content": ". | get_sfall_arg | get_sfall_arg_at | get_sfall_args | init_hook | register_hook | register_hook_proc | register_hook_proc_spec | set_sfall_arg | set_sfall_return | . get_sfall_arg . mixed get_sfall_arg . Gets the next argument from sfall. Each time it’s called it returns the next argument, or otherwise it returns 0 if there are no more arguments left. You can arbitrarily get the value of any argument using the sfall_func1(\"get_sfall_arg_at\", argNum) function. get_sfall_arg_at . sfall.h . mixed get_sfall_arg_at(int argNum) . Returns the value of hook argument with the specified argument number (first argument of hook starts from 0) . get_sfall_args . int get_sfall_args . Returns all hook arguments as a new temp array. init_hook . int init_hook . The hook script equivalent of game_loaded; it returns 1 when the script is loaded for the first time or when the player reloads the game, and 0 otherwise. register_hook . void register_hook(int hookID) . Used from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, start procedure will be executed in current global script. You can use all above functions like normal. register_hook_proc . void register_hook_proc(int hookID, proc procedure) . The same as register_hook, except that you specifically define which procedure in the current script should be called as a hook (instead of “start” by default). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script with no conflicts) and flexibility. You can place all related hook scripts for a specific mod in one global script! . Use zero (0) as second argument to unregister hook script from current global script. NOTE: you can hook several scripts to a single hook point, for example if it’s different mods from different authors or just some different aspects of one larger mod. When one of the scripts in a chain returns value with set_sfall_return, the next script may override this value if calls set_sfall_return again. Example: Sometimes you need to multiply certain value in a chain of hook scripts. Let’s say we have a Mod A which reduces all “to hit” chances by 50%. The code might look like this: . original_chance = get_sfall_arg; set_sfall_return(original_chance / 2); . Mod B also want to affect hit chances globally, by increasing them by 50%. Now in order for both mods to work well together, we need to add this line to Mod A hook script: . set_sfall_arg(0, (original_chance / 2)); . This basically changes hook argument for the next script. Mod B code: . original_chance = get_sfall_arg; set_sfall_return(original_chance * 1.5); set_sfall_arg(0, (original_chance * 1.5)); . So if you combine both mods together, they will run in chain and the end result will be a 75% from original hit chance (hook register order doesn’t matter in this case, if you use set_sfall_arg in both hooks). The defines to use for the hookID are in sfall.h. register_hook_proc_spec . void register_hook_proc_spec(int hookID, procedure proc) . Works the same as register_hook_proc, except that it registers the current script at the end of the hook script execution chain (i.e. the script will be executed after all previously registered scripts for the same hook, including the hs_<name>.int script). In addition, all scripts hooked to a single hook point with this function are executed in the exact order of how they were registered. In the case of using register_hook and register_hook_proc functions, scripts are executed in reverse order of how they were registered. The execution chain of script procedures for a hook is as follows: 1. Procedures registered with register_hook and register_hook_proc functions (executed in reverse order of registration). 2. The hs_<name>.int script. 3. Procedures registered with the register_hook_proc_spec function (executed in the exact order of registration). set_sfall_arg . void set_sfall_arg(int argNum, int value) . Changes argument value. The argument number (argNum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see register_hook_proc). set_sfall_return . void set_sfall_return(any value) . Used to return the new values from the script. Each time it’s called it sets the next value, or if you’ve already set all return values it does nothing. ", "url": "/sfall/hook-functions/#functions", "relUrl": "/hook-functions/#functions" @@ -862,7 +862,7 @@ },"123": { "doc": "Objects and scripts", "title": "Functions", - "content": ". | dialog_obj | get_flags | get_object_data | get_script | loot_obj | obj_is_carrying_obj | obj_is_openable | obj_under_cursor | real_dude_obj | remove_script | set_dude_obj | set_flags | set_object_data | set_scr_name | set_script | set_self | set_unique_id | . dialog_obj . sfall.h . ObjectPtr dialog_obj . Returns a pointer to the object (critter) the player is having a conversation or bartering with. get_flags . sfall.h . int get_flags(ObjectPtr obj) . Gets the current value of object flags (see define_extra.h for available flags). get_object_data . sfall.h . get_object_data(ObjectPtr object, int offset) . Returns the data at the specified offset of an object (see OBJ_DATA_* constants in define_extra.h for offsets). get_script . int get_script(ObjectPtr obj) . | accepts a pointer to an object and returns its scriptID (line number in scripts.lst), or 0 if the object is unscripted. | returns -1 on argument error. | . loot_obj . sfall.h . ObjectPtr loot_obj . Returns a pointer to the target object (container or critter) of the loot screen. obj_is_carrying_obj . int (ObjectPtr invenObj, ObjectPtr itemObj) . Returns number of itemObj inside invenObj’s inventory, note that both arguments are object pointers. useful when dealing with different stacks of same item (obj_is_carrying_obj_pid just returns total for all stacks of the same PID.) . obj_is_openable . sfall.h . bool obj_is_openable(object obj) . Returns True if the object is openable (i.e. has an opening/closing animation), False otherwise . obj_under_cursor . sfall.h . ObjectPtr obj_under_cursor(bool onlyCritter, bool includeDude) . Returns the object under the cursor on the main game screen. | onlyCritter: . | True - only checks critters and ignores their cover (roof tiles, walls, scenery, etc.) | False - checks all objects (can’t check critters under objects) | . | passing False to the includeDude argument will ignore dude_obj . | NOTE: to get an object located on a tile when the cursor is in movement mode (hexagon cursor), use the tile_under_cursor function | . | . real_dude_obj . sfall.h . ObjectPtr real_dude_obj . Returns the initial dude_obj after set_dude_obj was used. remove_script . void remove_script(ObjectPtr obj) . Accepts a pointer to an object and will remove the script from that object. set_dude_obj . sfall.h . void set_dude_obj(ObjectPtr critter) . Take control of a given critter. Passing value 0 will reset control back to “real” dude. set_flags . sfall.h . void set_flags(ObjectPtr obj, int flags) . Sets the current flags of an object. All flags are rewritten with given integer, so first get current flags with get_flags and use bwor/bwand to set/remove specific flag. set_object_data . sfall.h . set_object_data(ObjectPtr object, int offset, int data) . Sets the data at the specified offset of an object. set_scr_name . sfall.h . void set_scr_name(string name) . Overrides the name of the script object that was set from scrname.msg. | The changed name will be reset each time the player leaves the map or reloads the game | Passing an empty string (“”) to the name argument or omitting it will allow the game to get the name for the object from pro_*.msg files | NOTE: this function is intended for use in normal game scripts and overrides the name only once for the same object until reset | . set_script . void set_script(ObjectPtr obj, int scriptID) . Accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as create_object_sid from sfall 3.6). If used on an object that is already scripted, it will remove the existing script first; you cannot have multiple scripts attached to a single object. Calling set_script on self_obj will have all sorts of wacky side effects, and should be avoided. If you add 0x80000000 to the sid when calling set_script, map_enter_p_proc will be SKIPPED. The start proc will always be run. set_self . void set_self(ObjectPtr setObj) . Overrides the script’s self_obj for the next function call. | It is primarily used to allow the calling of functions which take an implicit self_obj parameter (e.g. drop_obj) from global scripts, but it can also be used from normal scripts. | self_obj will be reverted to its original value after the next function call. | Calling set_self(0) will also revert self_obj to its original value. It is recommended to call this after each use of set_self in normal scripts in order to avoid unforeseen side effects. | source_obj, target_obj, and similar functions will not work if preceded by set_self. | NOTE: for use_obj, use_obj_on_obj vanilla functions to work correctly, it is required to call set_self twice. You can also access the local variables in the script of an object after calling set_self twice. | . set_unique_id . sfall.h . int set_unique_id(ObjectPtr object, int flag) . Assigns a unique ID number to the object and returns it. If a unique ID number has already been assigned to an object, then ID number is returned without reassignment. flag is optional. | items with unique IDs will not stack with other items of the same type in the inventory | to just get the current ID number of an object, use get_object_data(object, OBJ_DATA_ID) | unique ID numbers are saved in your savegame, and have a range from 0x10000000 to 0x7FFFFFFF | there is also a unique ID number range for the player and party members from 18000 to 83535 | to assign a new ID number generated by the engine to the object (i.e. unassign a unique ID), call the function with two arguments and pass -1 for the flag argument | . ", + "content": ". | dialog_obj | get_flags | get_object_data | get_script | loot_obj | obj_is_carrying_obj | obj_is_openable | obj_under_cursor | real_dude_obj | remove_script | set_dude_obj | set_flags | set_object_data | set_scr_name | set_script | set_self | set_unique_id | . dialog_obj . sfall.h . ObjectPtr dialog_obj . Returns a pointer to the object (critter) the player is having a conversation or bartering with. get_flags . sfall.h . int get_flags(ObjectPtr obj) . Returns the current value of object flags (see define_extra.h for available flags). get_object_data . sfall.h . get_object_data(ObjectPtr object, int offset) . Returns the data at the specified offset of an object (see OBJ_DATA_* constants in define_extra.h for offsets). get_script . int get_script(ObjectPtr obj) . | accepts a pointer to an object and returns its scriptID (line number in scripts.lst), or 0 if the object is unscripted. | returns -1 on argument error. | . loot_obj . sfall.h . ObjectPtr loot_obj . Returns a pointer to the target object (container or critter) of the loot screen. obj_is_carrying_obj . int (ObjectPtr invenObj, ObjectPtr itemObj) . Returns number of itemObj inside invenObj’s inventory, note that both arguments are object pointers. useful when dealing with different stacks of same item (obj_is_carrying_obj_pid just returns total for all stacks of the same PID.) . obj_is_openable . sfall.h . bool obj_is_openable(object obj) . Returns True if the object is openable (i.e. has an opening/closing animation), False otherwise . obj_under_cursor . sfall.h . ObjectPtr obj_under_cursor(bool onlyCritter, bool includeDude) . Returns the object under the cursor on the main game screen. | onlyCritter: . | True - only checks critters and ignores their cover (roof tiles, walls, scenery, etc.) | False - checks all objects (can’t check critters under objects) | . | passing False to the includeDude argument will ignore dude_obj . | NOTE: to get an object located on a tile when the cursor is in movement mode (hexagon cursor), use the tile_under_cursor function | . | . real_dude_obj . sfall.h . ObjectPtr real_dude_obj . Returns the initial dude_obj after set_dude_obj was used. remove_script . void remove_script(ObjectPtr obj) . Accepts a pointer to an object and will remove the script from that object. set_dude_obj . sfall.h . void set_dude_obj(ObjectPtr critter) . Take control of a given critter. Passing value 0 will reset control back to “real” dude. set_flags . sfall.h . void set_flags(ObjectPtr obj, int flags) . Sets the current flags of an object. All flags are rewritten with given integer, so first get current flags with get_flags and use bwor/bwand to set/remove specific flag. set_object_data . sfall.h . set_object_data(ObjectPtr object, int offset, int data) . Sets the data at the specified offset of an object. set_scr_name . sfall.h . void set_scr_name(string name) . Overrides the name of the script object that was set from scrname.msg. | The changed name will be reset each time the player leaves the map or reloads the game | Passing an empty string (“”) to the name argument or omitting it will allow the game to get the name for the object from pro_*.msg files | NOTE: this function is intended for use in normal game scripts and overrides the name only once for the same object until reset | . set_script . void set_script(ObjectPtr obj, int scriptID) . Accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as create_object_sid from sfall 3.6). If used on an object that is already scripted, it will remove the existing script first; you cannot have multiple scripts attached to a single object. Calling set_script on self_obj will have all sorts of wacky side effects, and should be avoided. If you add 0x80000000 to the sid when calling set_script, map_enter_p_proc will be SKIPPED. The start proc will always be run. set_self . void set_self(ObjectPtr setObj) . Overrides the script’s self_obj for the next function call. | It is primarily used to allow the calling of functions which take an implicit self_obj parameter (e.g. drop_obj) from global scripts, but it can also be used from normal scripts. | self_obj will be reverted to its original value after the next function call. | Calling set_self(0) will also revert self_obj to its original value. It is recommended to call this after each use of set_self in normal scripts in order to avoid unforeseen side effects. | source_obj, target_obj, and similar functions will not work if preceded by set_self. | NOTE: for use_obj, use_obj_on_obj vanilla functions to work correctly, it is required to call set_self twice. You can also access the local variables in the script of an object after calling set_self twice. | . set_unique_id . sfall.h . int set_unique_id(ObjectPtr object, int flag) . Assigns a unique ID number to the object and returns it. If a unique ID number has already been assigned to an object, then ID number is returned without reassignment. flag is optional. | items with unique IDs will not stack with other items of the same type in the inventory | to just get the current ID number of an object, use get_object_data(object, OBJ_DATA_ID) | unique ID numbers are saved in your savegame, and have a range from 0x10000000 to 0x7FFFFFFF | there is also a unique ID number range for the player and party members from 18000 to 83535 | to assign a new ID number generated by the engine to the object (i.e. unassign a unique ID), call the function with two arguments and pass -1 for the flag argument | . ", "url": "/sfall/objects-and-scripts/#functions", "relUrl": "/objects-and-scripts/#functions" @@ -897,7 +897,7 @@ },"128": { "doc": "Other", "title": "Functions", - "content": ". | active_hand | add_g_timer_event | create_message_window | create_spatial | game_loaded | gdialog_get_barter_mod | get_game_mode | get_inven_ap_cost | get_kill_counter | get_light_level | get_npc_level | get_proto_data | get_unspent_ap_bonus | get_unspent_ap_perk_bonus | get_uptime | get_viewport_x | get_viewport_y | get_year | hero_select_win | inc_npc_level | input_funcs_available | mark_movie_played | message_str_game | mod_kill_counter | nb_create_char | resume_game | set_base_hit_chance_mod | set_base_pickpocket_mod | set_critter_hit_chance_mod | set_critter_pickpocket_mod | set_df_model | set_dm_model | set_hit_chance_max | set_hp_per_level_mod | set_inven_ap_cost | set_movie_path | set_pickpocket_max | set_pipboy_available | set_proto_data | set_unspent_ap_bonus | set_unspent_ap_perk_bonus | set_viewport_x | set_viewport_y | set_xp_mod | signal_close_game | sneak_success | stop_game | toggle_active_hand | unwield_slot | . active_hand . int active_hand . add_g_timer_event . sfall.h . void add_g_timer_event(int time, int fixedParam) . Adds a timer event that calls the timed_event_p_proc procedure in the current global script time: the number of ticks after which the event timer is triggered fixedParam: the value that is passed to the timed_event_p_proc procedure for the fixed_param function . create_message_window . void create_message_window(string message) . create_spatial . ObjectPtr create_spatial(int scriptID, int tile, int elevation, int radius) . Creates new spatial script with given SID, at given tile, and radius. game_loaded . int game_loaded . Returns 1 the first time it is called after a new game or game load, and 0 any time after. It works on an individual basis for each script, so one script wont interfere with others. Its primary use is for global scripts, so that they know when to call set_global_script_repeat, but it can be called from normal scripts too. gdialog_get_barter_mod . int gdialog_get_barter_mod . get_game_mode . int get_game_mode . A more flexible version of in_world_map. It will return a set of flags indicating which mode the game is currently in. These flags are the same as those used in the set_shader_mode function. get_inven_ap_cost . int get_inven_ap_cost . Returns the current AP cost to access the inventory in combat . get_kill_counter . int get_kill_counter(int critterType) . get_light_level . int get_light_level . Returns ambient light level in the range of 0 to 65536. The value returned by get_light_level may not exactly match that set by set_light_level, as set_light_level applies modifiers from the Night Vision perk. get_npc_level . int get_npc_level(string npc) . get_proto_data . int get_proto_data(int pid, int offset) . Used to read the in-memory copies of the .pro files Fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading. get_unspent_ap_bonus . int get_unspent_ap_bonus . Gets the AC bonus you receive per unused action point at the end of your turn in combat. To allow for fractional values, the value given if divided by 4. (Hence the default value is 4 and not 1.) . get_unspent_ap_perk_bonus . int get_unspent_ap_perk_bonus . Similar to get_unspent_ap_bonus, but accounts for the extra AC granted by the H2H Evade perk. (The default value of this is also 4, equivalent to doubling the original bonus. get_uptime . int get_uptime . Just a wrapper around the windows GetTickCount() function. It’s useful for making time fade effects in shaders, since they already have access to the current tick count. get_viewport_x . int get_viewport_x . get_viewport_y . int get_viewport_y . get_year . int get_year . hero_select_win . void hero_select_win(int) . inc_npc_level . void inc_npc_level(int party_member_pid) . Takes a party member PID or an NPC name (deprecated, for compatibility with sfall 4.1.5/3.8.15 or earlier) as an argument. The NPC must be in your party. | This function ignores the player’s minimum level and the required number of level-ups between NPC level gains. It also ignores the random element, regardless of sfall’s NPCAutoLevel or PartyMemberNonRandomLevelUp setting. | Starting from sfall 4.4.10/3.8.50, the maximum possible NPC level is 10. | . input_funcs_available . int input_funcs_available . (DEPRECATED) The input functions are only available if the user has the input hook turned on in ddraw.ini. Use input_funcs_available to check. mark_movie_played . void mark_movie_played(int id) . message_str_game . string message_str_game(int fileId, int messageId) . Works exactly the same as message_str, except you get messages from files in text/english/game folder. Use GAME_MSG_* defines or mstr_* macros from sfall.h to use specific msg file . | Additional game msg files added by ExtraGameMsgFileList setting will have consecutive fileIds assigned beginning from 0x2000 to 0x2FFF. (e.g. if you set ExtraGameMsgFileList=foo,bar in ddraw.ini, foo.msg will be associated with 0x2000 and bar.msg with 0x2001.). | If a file has a specific number assigned in ExtraGameMsgFileList, its fileId will be (0x2000 + assigned number). (e.g. with ExtraGameMsgFileList=foo,bar:2,foobar in ddraw.ini, bar.msg will be associated with 0x2002 and foobar.msg with 0x2003.) | . mod_kill_counter . void mod_kill_counter(int critterType, int amount) . nb_create_char . int nb_create_char . (DEPRECATED) Reserved for the brotherhood tactical training mod, and should be avoided. Not implemented, always returns 0. resume_game . void resume_game . set_base_hit_chance_mod . void set_base_hit_chance_mod(int max, int mod) . set_base_pickpocket_mod . void set_base_pickpocket_mod(int max, int mod) . Changes maximum chance of success and chance mod for each steal attempt. max will replace 95% success chance cap (so you can set 100% maximum chance, for instance). mod will add this much percent to each success chance. for example if your chance is 50% and mod is 20, you will get 70% actual success rate . set_critter_hit_chance_mod . void set_critter_hit_chance_mod(CritterPtr, int max, int mod) . set_critter_pickpocket_mod . void set_critter_pickpocket_mod(CritterPtr, int max, int mod) . The same as set_base_pickpocket, but applies only to specific critter. set_df_model . void set_df_model(string name) . set_dm_model . void set_dm_model(string name) . set_hit_chance_max . void set_hit_chance_max(int percentage) . Effects all critters rather than just the player and can set the maximum in the range of 0 to 999. set_hp_per_level_mod . void set_hp_per_level_mod(int mod) . set_inven_ap_cost . void set_inven_ap_cost(int cost) . set_movie_path . void set_movie_path(string filename, int movieid) . set_pickpocket_max . void set_pickpocket_max(int percentage) . Effects all critters rather than just the player and can set the maximum in the range of 0 to 999. set_pipboy_available . void set_pipboy_available(int available) . Sets the availability of the pipboy in the game. Use 0 to disable the pipboy, and 1 or 2 to enable it (value 2 does not change the player’s default appearance). | The availability state will be reset each time the player reloads the game. | NOTE: starting from sfall 4.4.6/3.8.46, value 1 no longer marks the VSUIT_MOVIE movie as “played”. Use mark_movie_played(VSUIT_MOVIE) instead if you want the old behavior. | . set_proto_data . void set_proto_data(int pid, int offset, int value) . Used to alter the in-memory copies of the .pro files Fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading. Changes are not stored on disc, and are not permanent. If you modify the protos, and then Fallout subsequently reloads the file your changes will be lost. set_unspent_ap_bonus . void set_unspent_ap_bonus(int multiplier) . Alters the AC bonus you receive per unused action point at the end of your turn in combat. To allow for fractional values, the value given if divided by 4. (Hence the default value is 4 and not 1.) . set_unspent_ap_perk_bonus . void set_unspent_ap_perk_bonus(int multiplier) . Similar to set_unspent_ap_bonus, but effects the extra AC granted by the H2H Evade perk. (The default value of this is also 4, equivalent to doubling the original bonus. set_viewport_x . void set_viewport_x(int view_x) . set_viewport_y . void set_viewport_y(int view_y) . set_xp_mod . void set_xp_mod(int percentage) . signal_close_game . sfall.h . void signal_close_game . Works in a similar way to vanilla function: metarule(METARULE_SIGNAL_END_GAME, 0), but it will then close the game instead of only returning the player to the main menu . sneak_success . int sneak_success . Returns 1 if last sneak attempt (roll against skill) was successful, 0 otherwise. This calls an internal engine function which is used to determine the perception range of critters (which you can override using HOOK_WITHINPERCEPTION). stop_game . void stop_game . toggle_active_hand . void toggle_active_hand . unwield_slot . void sfall_func2(\"unwield_slot\", object critter, int slot) . unequips an item from the specified slot for a critter or the player can take off player’s equipped item when the inventory is opened, or the player is in the barter screen slot: 0 - armor slot, 1 - right slot, 2 - left slot (see INVEN_TYPE_* in define.h) . ", + "content": ". | active_hand | add_g_timer_event | create_message_window | create_spatial | game_loaded | gdialog_get_barter_mod | get_game_mode | get_inven_ap_cost | get_kill_counter | get_light_level | get_npc_level | get_proto_data | get_unspent_ap_bonus | get_unspent_ap_perk_bonus | get_uptime | get_viewport_x | get_viewport_y | get_year | hero_select_win | inc_npc_level | input_funcs_available | mark_movie_played | message_str_game | mod_kill_counter | nb_create_char | resume_game | set_base_hit_chance_mod | set_base_pickpocket_mod | set_critter_hit_chance_mod | set_critter_pickpocket_mod | set_df_model | set_dm_model | set_hit_chance_max | set_hp_per_level_mod | set_inven_ap_cost | set_movie_path | set_pickpocket_max | set_pipboy_available | set_proto_data | set_unspent_ap_bonus | set_unspent_ap_perk_bonus | set_viewport_x | set_viewport_y | set_xp_mod | signal_close_game | sneak_success | stop_game | toggle_active_hand | unwield_slot | . active_hand . int active_hand . add_g_timer_event . sfall.h . void add_g_timer_event(int time, int fixedParam) . Adds a timer event that calls the timed_event_p_proc procedure in the current global script time: the number of ticks after which the event timer is triggered fixedParam: the value that is passed to the timed_event_p_proc procedure for the fixed_param function . create_message_window . void create_message_window(string message) . create_spatial . ObjectPtr create_spatial(int scriptID, int tile, int elevation, int radius) . Creates new spatial script with given SID, at given tile, and radius. game_loaded . int game_loaded . Returns 1 the first time it is called after a new game or game load, and 0 any time after. It works on an individual basis for each script, so one script wont interfere with others. Its primary use is for global scripts, so that they know when to call set_global_script_repeat, but it can be called from normal scripts too. gdialog_get_barter_mod . int gdialog_get_barter_mod . get_game_mode . int get_game_mode . A more flexible version of in_world_map. It will return a set of flags indicating which mode the game is currently in. These flags are the same as those used in the set_shader_mode function. get_inven_ap_cost . int get_inven_ap_cost . Returns the current AP cost to access the inventory in combat . get_kill_counter . int get_kill_counter(int critterType) . get_light_level . int get_light_level . Returns ambient light level in the range of 0 to 65536. The value returned by get_light_level may not exactly match that set by set_light_level, as set_light_level applies modifiers from the Night Vision perk. get_npc_level . int get_npc_level(string npc) . get_proto_data . int get_proto_data(int pid, int offset) . Used to read the in-memory copies of the .pro files Fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading. get_unspent_ap_bonus . int get_unspent_ap_bonus . Returns the AC bonus you receive per unused action point at the end of your turn in combat. To allow for fractional values, the value given if divided by 4. (Hence the default value is 4 and not 1.) . get_unspent_ap_perk_bonus . int get_unspent_ap_perk_bonus . Similar to get_unspent_ap_bonus, but accounts for the extra AC granted by the H2H Evade perk. (The default value of this is also 4, equivalent to doubling the original bonus. get_uptime . int get_uptime . Just a wrapper around the windows GetTickCount() function. It’s useful for making time fade effects in shaders, since they already have access to the current tick count. get_viewport_x . int get_viewport_x . get_viewport_y . int get_viewport_y . get_year . int get_year . hero_select_win . void hero_select_win(int) . inc_npc_level . void inc_npc_level(int party_member_pid) . Takes a party member PID or an NPC name (deprecated, for compatibility with sfall 4.1.5/3.8.15 or earlier) as an argument. The NPC must be in your party. | This function ignores the player’s minimum level and the required number of level-ups between NPC level gains. It also ignores the random element, regardless of sfall’s NPCAutoLevel or PartyMemberNonRandomLevelUp setting. | Starting from sfall 4.4.10/3.8.50, the maximum possible NPC level is 10. | . input_funcs_available . int input_funcs_available . (DEPRECATED) The input functions are only available if the user has the input hook turned on in ddraw.ini. Use input_funcs_available to check. mark_movie_played . void mark_movie_played(int id) . message_str_game . string message_str_game(int fileId, int messageId) . Works exactly the same as message_str, except you get messages from files in text/english/game folder. Use GAME_MSG_* defines or mstr_* macros from sfall.h to use specific msg file . | Additional game msg files added by ExtraGameMsgFileList setting will have consecutive fileIds assigned beginning from 0x2000 to 0x2FFF. (e.g. if you set ExtraGameMsgFileList=foo,bar in ddraw.ini, foo.msg will be associated with 0x2000 and bar.msg with 0x2001.). | If a file has a specific number assigned in ExtraGameMsgFileList, its fileId will be (0x2000 + assigned number). (e.g. with ExtraGameMsgFileList=foo,bar:2,foobar in ddraw.ini, bar.msg will be associated with 0x2002 and foobar.msg with 0x2003.) | . mod_kill_counter . void mod_kill_counter(int critterType, int amount) . nb_create_char . int nb_create_char . (DEPRECATED) Reserved for the brotherhood tactical training mod, and should be avoided. Not implemented, always returns 0. resume_game . void resume_game . set_base_hit_chance_mod . void set_base_hit_chance_mod(int max, int mod) . set_base_pickpocket_mod . void set_base_pickpocket_mod(int max, int mod) . Changes maximum chance of success and chance mod for each steal attempt. max will replace 95% success chance cap (so you can set 100% maximum chance, for instance). mod will add this much percent to each success chance. for example if your chance is 50% and mod is 20, you will get 70% actual success rate . set_critter_hit_chance_mod . void set_critter_hit_chance_mod(CritterPtr, int max, int mod) . set_critter_pickpocket_mod . void set_critter_pickpocket_mod(CritterPtr, int max, int mod) . The same as set_base_pickpocket, but applies only to specific critter. set_df_model . void set_df_model(string name) . set_dm_model . void set_dm_model(string name) . set_hit_chance_max . void set_hit_chance_max(int percentage) . Effects all critters rather than just the player and can set the maximum in the range of 0 to 999. set_hp_per_level_mod . void set_hp_per_level_mod(int mod) . set_inven_ap_cost . void set_inven_ap_cost(int cost) . set_movie_path . void set_movie_path(string filename, int movieid) . set_pickpocket_max . void set_pickpocket_max(int percentage) . Effects all critters rather than just the player and can set the maximum in the range of 0 to 999. set_pipboy_available . void set_pipboy_available(int available) . Sets the availability of the pipboy in the game. Use 0 to disable the pipboy, and 1 or 2 to enable it (value 2 does not change the player’s default appearance). | The availability state will be reset each time the player reloads the game. | NOTE: starting from sfall 4.4.6/3.8.46, value 1 no longer marks the VSUIT_MOVIE movie as “played”. Use mark_movie_played(VSUIT_MOVIE) instead if you want the old behavior. | . set_proto_data . void set_proto_data(int pid, int offset, int value) . Used to alter the in-memory copies of the .pro files Fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading. Changes are not stored on disc, and are not permanent. If you modify the protos, and then Fallout subsequently reloads the file your changes will be lost. set_unspent_ap_bonus . void set_unspent_ap_bonus(int multiplier) . Alters the AC bonus you receive per unused action point at the end of your turn in combat. To allow for fractional values, the value given if divided by 4. (Hence the default value is 4 and not 1.) . set_unspent_ap_perk_bonus . void set_unspent_ap_perk_bonus(int multiplier) . Similar to set_unspent_ap_bonus, but effects the extra AC granted by the H2H Evade perk. (The default value of this is also 4, equivalent to doubling the original bonus. set_viewport_x . void set_viewport_x(int view_x) . set_viewport_y . void set_viewport_y(int view_y) . set_xp_mod . void set_xp_mod(int percentage) . signal_close_game . sfall.h . void signal_close_game . Works in a similar way to vanilla function: metarule(METARULE_SIGNAL_END_GAME, 0), but it will then close the game instead of only returning the player to the main menu . sneak_success . int sneak_success . Returns 1 if last sneak attempt (roll against skill) was successful, 0 otherwise. This calls an internal engine function which is used to determine the perception range of critters (which you can override using HOOK_WITHINPERCEPTION). stop_game . void stop_game . toggle_active_hand . void toggle_active_hand . unwield_slot . void sfall_func2(\"unwield_slot\", object critter, int slot) . unequips an item from the specified slot for a critter or the player can take off player’s equipped item when the inventory is opened, or the player is in the barter screen slot: 0 - armor slot, 1 - right slot, 2 - left slot (see INVEN_TYPE_* in define.h) . ", "url": "/sfall/other/#functions", "relUrl": "/other/#functions" @@ -911,7 +911,7 @@ },"130": { "doc": "Outline", "title": "Functions", - "content": ". | get_outline | outlined_object | set_outline | . get_outline . sfall.h . int get_outline(ObjectPtr obj) . Gets the current outline color for an object. outlined_object . sfall.h . ObjectPtr outlined_object . Returns an object that is currently highlighted by hovering the mouse above it. set_outline . sfall.h . void set_outline(ObjectPtr obj, int color) . | sets the outline color of an object (see OUTLINE_* constants in sfall.h) | can also set a custom color from the game palette by shifting the color index value left by 8 bits: 0xCC00 where CC is the palette index (available since sfall 4.2.7/3.8.27) | passing 0 will disable the outline | . ", + "content": ". | get_outline | outlined_object | set_outline | . get_outline . sfall.h . int get_outline(ObjectPtr obj) . Returns the current outline color of an object. outlined_object . sfall.h . ObjectPtr outlined_object . Returns an object that is currently highlighted by hovering the mouse above it. set_outline . sfall.h . void set_outline(ObjectPtr obj, int color) . | sets the outline color of an object (see OUTLINE_* constants in sfall.h) | can also set a custom color from the game palette by shifting the color index value left by 8 bits: 0xCC00 where CC is the palette index (available since sfall 4.2.7/3.8.27) | passing 0 will disable the outline | . ", "url": "/sfall/outline/#functions", "relUrl": "/outline/#functions" @@ -988,7 +988,7 @@ },"141": { "doc": "Sfall funcX macros", "title": "Functions", - "content": ". | add_extra_msg_file | critter_inven_obj2 | dialog_message | get_current_inven_size | get_metarule_table | get_object_ai_data | get_text_width | item_weight | metarule_exist | npc_engine_level_up | objects_in_radius | set_drugs_data | set_rest_heal_time | set_rest_mode | set_worldmap_heal_time | sfall_func0(“hide_window”) | sfall_func0(“show_window”) | sfall_func1(“hide_window”, string winName) | sfall_func1(“remove_timer_event”, int fixedParam) | sfall_func1(“show_window”, string winName) | sfall_func2(“string_compare”, string str1, string str2) | sfall_func3(“string_compare”, string str1, string str2, int codePage) | spatial_radius | void sfall_func0(“remove_timer_event”) | . add_extra_msg_file . sfall.h . int add_extra_msg_file(string fileName) . Loads a custom message file and returns the file ID number assigned to it, in the range of 0x3000 to 0x3FFF, for use with the message_str_game function. | fileName: the name of the custom message file (including the .msg extension) in text\\<language>\\game\\ directory. | NOTE: if the msg file does not exist in the current language directory, the function will try to load it from the text\\English\\game\\ directory. | . Alternative form: int add_extra_msg_file(string fileName, int fileNumber) [DEPRECATED] . | Deprecation notice: Starting from sfall 4.4.10/3.8.50, the two-argument form is deprecated. The fileNumber argument is ignored, and the function behaves the same as the one-argument form. | . critter_inven_obj2 . sfall.h . ObjectPtr critter_inven_obj2(ObjectPtr obj, int type) . Works just like vanilla critter_inven_obj, but correctly reports item in player’s inactive hand slot. dialog_message . sfall.h . void dialog_message(string text) . Displays a message in the NPC response window in dialog or barter screen. get_current_inven_size . sfall.h . get_current_inven_size(ObjectPtr object) . Returns the current inventory size of the container or the critter. get_metarule_table . sfall.h . array get_metarule_table . Returns names of all currently available script functions. get_object_ai_data . sfall.h . int get_object_ai_data(ObjectPtr object, int aiParam) . Returns the setting value from the AI packet of an object (critter). Use AI_CAP_* constants from define_extra.h for the aiParam argument to get AI value. get_text_width . sfall.h . int get_text_width(string text) . Returns the text width in pixels for the currently set font. item_weight . sfall.h . int item_weight(ObjectPtr obj) . Gets the current weight of an object. metarule_exist . sfall.h . bool metarule_exist(string metaruleName) . Returns True if the specified name of metarule (sfall_funcX) function exists in the current version of sfall. npc_engine_level_up . sfall.h . void npc_engine_level_up(bool toggle) . Enables/disables the engine function that increases the level of party members in the player leveling process. If the engine function is disabled, the process of leveling up party members should be performed by script functions. objects_in_radius . sfall.h . array objects_in_radius(int tile, int radius, int elevation, int type) . | returns an array of objects of a type (see OBJ_TYPE_* constants in define_extra.h) within the specified radius from the given tile | passing -1 to the type argument or not specifying it will return all objects within the radius | the radius is limited to 50 hexes | . set_drugs_data . sfall.h . void set_drugs_data(int type, int pid, int value) . Overrides the parameters of drugs set in the configuration file (DrugsFile setting in ddraw.ini). Type: 0 - changes the value of NumEffects for the drug (see Drugs.ini for the description of NumEffects), 1 - changes the duration of the addiction effect for the drug (a value of 1 = one game minute). set_rest_heal_time . sfall.h . void set_rest_heal_time(int time) . Sets the time interval in minutes for healing during resting. The default is 180 . | the time interval will be reset each time the player reloads the game | . set_rest_mode . sfall.h . void set_rest_mode(int flags) . Sets the bit flags for the rest mode (see RESTMODE_* constants in sfall.h). Passing 0 will reset the rest mode. It will also be reset each time the player reloads the game. set_worldmap_heal_time . sfall.h . void set_worldmap_heal_time(int time) . Sets the time interval in minutes for healing during world map travel. The default is 180 . | passing 0 will revert to 1 second of real time (vanilla engine behavior) | passing -1 will disable healing during travel | the time interval will be reset each time the player reloads the game | . sfall_func0(“hide_window”) . sfall.h . void sfall_func0(\"hide_window\") . Hides currently active (selected) script window. sfall_func0(“show_window”) . sfall.h . void sfall_func0(\"show_window\") . Displays the script window previously hidden with the sfall_func0(\"hide_window\") function. sfall_func1(“hide_window”, string winName) . sfall.h . void sfall_func0(\"hide_window\") . Hides the specified script window. | winName: the window name, assigned to the window by the CreateWin/create_win function | . sfall_func1(“remove_timer_event”, int fixedParam) . sfall.h . void sfall_func1(\"remove_timer_event\", int fixedParam) . Removes all timer events with the specified fixedParam value for the current global script. sfall_func1(“show_window”, string winName) . sfall.h . void sfall_func1(\"show_window\", string winName) . Displays the specified hidden script window. winName: the window name, assigned to the window by the CreateWin/create_win function . sfall_func2(“string_compare”, string str1, string str2) . sfall.h . bool sfall_func2(\"string_compare\", string str1, string str2) . Compares two strings case-insensitive, and returns True if the two strings are matched. sfall_func3(“string_compare”, string str1, string str2, int codePage) . sfall.h . bool sfall_func3(\"string_compare\", string str1, string str2, int codePage) . Compares two strings case-insensitive, and returns True if the two strings are matched . | codePage: code page number to properly compare national characters in the range 128-255 of the ASCII code table available encodings: 1250-1252, 866 | . spatial_radius . sfall.h . int spatial_radius(ObjectPtr obj) . Returns radius of spatial script, associated with given dummy-object (returned by create_spatial). void sfall_func0(“remove_timer_event”) . sfall.h . void sfall_func0(\"remove_timer_event\") . Clears all set timer events for the current global script. ", + "content": ". | add_extra_msg_file | critter_inven_obj2 | dialog_message | get_current_inven_size | get_metarule_table | get_object_ai_data | get_text_width | item_weight | metarule_exist | npc_engine_level_up | objects_in_radius | set_drugs_data | set_rest_heal_time | set_rest_mode | set_worldmap_heal_time | sfall_func0(“hide_window”) | sfall_func0(“show_window”) | sfall_func1(“hide_window”, string winName) | sfall_func1(“remove_timer_event”, int fixedParam) | sfall_func1(“show_window”, string winName) | sfall_func2(“string_compare”, string str1, string str2) | sfall_func3(“string_compare”, string str1, string str2, int codePage) | spatial_radius | void sfall_func0(“remove_timer_event”) | . add_extra_msg_file . sfall.h . int add_extra_msg_file(string fileName) . Loads a custom message file and returns the file ID number assigned to it, in the range of 0x3000 to 0x3FFF, for use with the message_str_game function. | fileName: the name of the custom message file (including the .msg extension) in text\\<language>\\game\\ directory. | NOTE: if the msg file does not exist in the current language directory, the function will try to load it from the text\\English\\game\\ directory. | . Alternative form: int add_extra_msg_file(string fileName, int fileNumber) [DEPRECATED] . | Deprecation notice: Starting from sfall 4.4.10/3.8.50, the two-argument form is deprecated. The fileNumber argument is ignored, and the function behaves the same as the one-argument form. | . critter_inven_obj2 . sfall.h . ObjectPtr critter_inven_obj2(ObjectPtr obj, int type) . Works just like vanilla critter_inven_obj, but correctly reports item in player’s inactive hand slot. dialog_message . sfall.h . void dialog_message(string text) . Displays a message in the NPC response window in dialog or barter screen. get_current_inven_size . sfall.h . get_current_inven_size(ObjectPtr object) . Returns the current inventory size of the container or the critter. get_metarule_table . sfall.h . array get_metarule_table . Returns names of all currently available script functions. get_object_ai_data . sfall.h . int get_object_ai_data(ObjectPtr object, int aiParam) . Returns the setting value from the AI packet of an object (critter). Use AI_CAP_* constants from define_extra.h for the aiParam argument to get AI value. get_text_width . sfall.h . int get_text_width(string text) . Returns the text width in pixels for the currently set font. item_weight . sfall.h . int item_weight(ObjectPtr obj) . Returns the weight of an item object. metarule_exist . sfall.h . bool metarule_exist(string metaruleName) . Returns True if the specified name of metarule (sfall_funcX) function exists in the current version of sfall. npc_engine_level_up . sfall.h . void npc_engine_level_up(bool toggle) . Enables/disables the engine function that increases the level of party members in the player leveling process. If the engine function is disabled, the process of leveling up party members should be performed by script functions. objects_in_radius . sfall.h . array objects_in_radius(int tile, int radius, int elevation, int type) . | returns an array of objects of a type (see OBJ_TYPE_* constants in define_extra.h) within the specified radius from the given tile | passing -1 to the type argument or not specifying it will return all objects within the radius | the radius is limited to 50 hexes | . set_drugs_data . sfall.h . void set_drugs_data(int type, int pid, int value) . Overrides the parameters of drugs set in the configuration file (DrugsFile setting in ddraw.ini). Type: 0 - changes the value of NumEffects for the drug (see Drugs.ini for the description of NumEffects), 1 - changes the duration of the addiction effect for the drug (a value of 1 = one game minute). set_rest_heal_time . sfall.h . void set_rest_heal_time(int time) . Sets the time interval in minutes for healing during resting. The default is 180 . | the time interval will be reset each time the player reloads the game | . set_rest_mode . sfall.h . void set_rest_mode(int flags) . Sets the bit flags for the rest mode (see RESTMODE_* constants in sfall.h). Passing 0 will reset the rest mode. It will also be reset each time the player reloads the game. set_worldmap_heal_time . sfall.h . void set_worldmap_heal_time(int time) . Sets the time interval in minutes for healing during world map travel. The default is 180 . | passing 0 will revert to 1 second of real time (vanilla engine behavior) | passing -1 will disable healing during travel | the time interval will be reset each time the player reloads the game | . sfall_func0(“hide_window”) . sfall.h . void sfall_func0(\"hide_window\") . Hides currently active (selected) script window. sfall_func0(“show_window”) . sfall.h . void sfall_func0(\"show_window\") . Displays the script window previously hidden with the sfall_func0(\"hide_window\") function. sfall_func1(“hide_window”, string winName) . sfall.h . void sfall_func0(\"hide_window\") . Hides the specified script window. | winName: the window name, assigned to the window by the CreateWin/create_win function | . sfall_func1(“remove_timer_event”, int fixedParam) . sfall.h . void sfall_func1(\"remove_timer_event\", int fixedParam) . Removes all timer events with the specified fixedParam value for the current global script. sfall_func1(“show_window”, string winName) . sfall.h . void sfall_func1(\"show_window\", string winName) . Displays the specified hidden script window. winName: the window name, assigned to the window by the CreateWin/create_win function . sfall_func2(“string_compare”, string str1, string str2) . sfall.h . bool sfall_func2(\"string_compare\", string str1, string str2) . Compares two strings case-insensitive, and returns True if the two strings are matched. sfall_func3(“string_compare”, string str1, string str2, int codePage) . sfall.h . bool sfall_func3(\"string_compare\", string str1, string str2, int codePage) . Compares two strings case-insensitive, and returns True if the two strings are matched . | codePage: code page number to properly compare national characters in the range 128-255 of the ASCII code table available encodings: 1250-1252, 866 | . spatial_radius . sfall.h . int spatial_radius(ObjectPtr obj) . Returns radius of spatial script, associated with given dummy-object (returned by create_spatial). void sfall_func0(“remove_timer_event”) . sfall.h . void sfall_func0(\"remove_timer_event\") . Clears all set timer events for the current global script. ", "url": "/sfall/sfall-funcx-macros/#functions", "relUrl": "/sfall-funcx-macros/#functions" diff --git a/combat/index.html b/combat/index.html index 81bceee9..cc1aeed5 100644 --- a/combat/index.html +++ b/combat/index.html @@ -5,9 +5,9 @@

Allows overriding the normal rules regarding which weapons are allowed to make aimed attacks. (e.g. weapons that cause explosive damage normally cannot normally make aimed shots.) stops a weapon from making aimed shots even if it normally coulld. Affects player and NPCs alike. The list of edited weapons is not saved over game loads, so you need to call the function once at each reload. Use a pid of 0 to represent unarmed.


force_aimed_shots

void force_aimed_shots(int pid)
 

Allows overriding the normal rules regarding which weapons are allowed to make aimed attacks. (e.g. weapons that cause explosive damage normally cannot normally make aimed shots.) Will allow a weapon to make aimed shots even if it normally couldn’t. Affects player and NPCs alike. Does not override the effects of the fast shot trait. The list of edited weapons is not saved over game loads, so you need to call the function once at each reload. Use a pid of 0 to represent unarmed.


get_attack_type

int get_attack_type
 

get_bodypart_hit_modifier

int get_bodypart_hit_modifier(int bodypart)
-

Gets the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id’s are from 0 to 8.


get_combat_free_move

sfall.h

int get_combat_free_move
+

Returns the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id’s are from 0 to 8.


get_combat_free_move

sfall.h

int get_combat_free_move
 

Returns available “bonus move” points of the current critter’s turn. For NPCs, this is always 0 unless changed by set_combat_free_move


get_critical_table

int get_critical_table(int crittertype, int bodypart, int level, int valuetype)
-

Gets current critical table. For details see critical hit tables. Requires OverrideCriticalTable to be enabled in ddraw.ini (already enabled by default).


get_critter_current_ap

int get_critter_current_ap(CritterPtr)
+

Returns the current critical table. For details see critical hit tables. Requires OverrideCriticalTable to be enabled in ddraw.ini (already enabled by default).


get_critter_current_ap

int get_critter_current_ap(CritterPtr)
 

Should only be used during the target critters turn while in combat. Calling it outside of combat typically returns the critters max ap, but don’t rely on that behaviour. (Specifically, if the critter has never before entered combat, it will probably return the critters base ap ignoring any extra bonuses from perks etc.)


get_last_attacker

ObjectPtr get_last_attacker(ObjectPtr critter)
 

Will return the last critter to deliberately launch an attack against the argument critter. If a critter has not launched/received an attack, it will return 0. Outside of combat always returns 0.


get_last_target

ObjectPtr get_last_target(ObjectPtr critter)
 

Will return the last critter to be deliberately attacked. Outside of combat always returns 0.


reset_critical_table

void reset_critical_table(int crittertype, int bodypart, int level, int valuetype)
diff --git a/explosions/index.html b/explosions/index.html
index 81189df8..27bfff91 100644
--- a/explosions/index.html
+++ b/explosions/index.html
@@ -1,6 +1,6 @@
              Explosions | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Explosions

Functions


get_explosion_damage

sfall.h

array get_explosion_damage(itemPid)
 

Returns an array of the minimum and maximum damage of the explosive item.


item_make_explosive

sfall.h

void item_make_explosive(int pid, int activePid, int minDamage, int maxDamage)
-
  • makes the specified item (pid) an explosive item like Dynamite or Plastic Explosives
  • maxDamage is optional
  • activePid is for an item with an active timer, can be the same as the pid argument
  • the item proto must be the Misc Item type and have the Use action flag
  • minDamage/maxDamage are the minimum and maximum explosion damage
  • using the function on an item that is already set as an explosive will override its previous settings
  • NOTE: this function does not work for pids of Dynamite and Plastic Explosives

metarule2_explosions

int metarule2_explosions(int arg1, int arg2)
+
  • makes the specified item (pid) an explosive item like Dynamite or Plastic Explosives
  • maxDamage is optional
  • activePid is for an item with an active timer, can be the same as the pid argument
  • the item proto must be of the Misc Item type and have the Use action flag
  • minDamage/maxDamage are the minimum and maximum explosion damage
  • using the function on an item that is already set as an explosive will override its previous settings
  • NOTE: this function does not work for pids of Dynamite and Plastic Explosives

metarule2_explosions

int metarule2_explosions(int arg1, int arg2)
 

Was made as a quick-and-dirty hack to enable dynamic changes to some explosion parameters for ranged attacks. All changed parameters are automatically reset to vanilla state after each attack action.


set_attack_explosion_art

sfall.h

void set_attack_explosion_art(x, y)
 

Y not used and X is a misc frame ID (last 3 bytes, without object type) to use for the next explosion.


set_attack_explosion_pattern

sfall.h

void set_attack_explosion_pattern(x, y)
 

Currently Y is not used and X means: 1 - reduced explosion pattern (3 effects are spawned instead of 7), 0 - full pattern.


set_attack_explosion_radius

sfall.h

void set_attack_explosion_radius(x)
diff --git a/feed.xml b/feed.xml
index 4cf24300..3f8bcb7a 100644
--- a/feed.xml
+++ b/feed.xml
@@ -1 +1 @@
-Jekyll2026-04-16T02:32:02+00:00/sfall/feed.xmlsfallSfall documentation
\ No newline at end of file
+Jekyll2026-04-17T04:00:01+00:00/sfall/feed.xmlsfallSfall documentation
\ No newline at end of file
diff --git a/hook-functions/index.html b/hook-functions/index.html
index b31c96d7..b8b12f7b 100644
--- a/hook-functions/index.html
+++ b/hook-functions/index.html
@@ -1,6 +1,6 @@
              Hook functions | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Hook functions

Functions


get_sfall_arg

mixed get_sfall_arg
 

Gets the next argument from sfall. Each time it’s called it returns the next argument, or otherwise it returns 0 if there are no more arguments left. You can arbitrarily get the value of any argument using the sfall_func1("get_sfall_arg_at", argNum) function.


get_sfall_arg_at

sfall.h

mixed get_sfall_arg_at(int argNum)
-

Gets the value of hook argument with the specified argument number (first argument of hook starts from 0)


get_sfall_args

int get_sfall_args
+

Returns the value of hook argument with the specified argument number (first argument of hook starts from 0)


get_sfall_args

int get_sfall_args
 

Returns all hook arguments as a new temp array.


init_hook

int init_hook
 

The hook script equivalent of game_loaded; it returns 1 when the script is loaded for the first time or when the player reloads the game, and 0 otherwise.


register_hook

void register_hook(int hookID)
 

Used from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, start procedure will be executed in current global script. You can use all above functions like normal.


register_hook_proc

void register_hook_proc(int hookID, proc procedure)
diff --git a/objects-and-scripts/index.html b/objects-and-scripts/index.html
index 061e2757..1cad3544 100644
--- a/objects-and-scripts/index.html
+++ b/objects-and-scripts/index.html
@@ -1,6 +1,6 @@
              Objects and scripts | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Objects and scripts

Functions


dialog_obj

sfall.h

ObjectPtr dialog_obj
 

Returns a pointer to the object (critter) the player is having a conversation or bartering with.


get_flags

sfall.h

int get_flags(ObjectPtr obj)
-

Gets the current value of object flags (see define_extra.h for available flags).


get_object_data

sfall.h

get_object_data(ObjectPtr object, int offset)
+

Returns the current value of object flags (see define_extra.h for available flags).


get_object_data

sfall.h

get_object_data(ObjectPtr object, int offset)
 

Returns the data at the specified offset of an object (see OBJ_DATA_* constants in define_extra.h for offsets).


get_script

int get_script(ObjectPtr obj)
 
  • accepts a pointer to an object and returns its scriptID (line number in scripts.lst), or 0 if the object is unscripted.
  • returns -1 on argument error.

loot_obj

sfall.h

ObjectPtr loot_obj
 

Returns a pointer to the target object (container or critter) of the loot screen.


obj_is_carrying_obj

int (ObjectPtr invenObj, ObjectPtr itemObj)
diff --git a/other/index.html b/other/index.html
index 518515e1..8a43100f 100644
--- a/other/index.html
+++ b/other/index.html
@@ -11,7 +11,7 @@
 

Returns ambient light level in the range of 0 to 65536. The value returned by get_light_level may not exactly match that set by set_light_level, as set_light_level applies modifiers from the Night Vision perk.


get_npc_level

int get_npc_level(string npc)
 

get_proto_data

int get_proto_data(int pid, int offset)
 

Used to read the in-memory copies of the .pro files Fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading.


get_unspent_ap_bonus

int get_unspent_ap_bonus
-

Gets the AC bonus you receive per unused action point at the end of your turn in combat. To allow for fractional values, the value given if divided by 4. (Hence the default value is 4 and not 1.)


get_unspent_ap_perk_bonus

int get_unspent_ap_perk_bonus
+

Returns the AC bonus you receive per unused action point at the end of your turn in combat. To allow for fractional values, the value given if divided by 4. (Hence the default value is 4 and not 1.)


get_unspent_ap_perk_bonus

int get_unspent_ap_perk_bonus
 

Similar to get_unspent_ap_bonus, but accounts for the extra AC granted by the H2H Evade perk. (The default value of this is also 4, equivalent to doubling the original bonus.


get_uptime

int get_uptime
 

Just a wrapper around the windows GetTickCount() function. It’s useful for making time fade effects in shaders, since they already have access to the current tick count.


get_viewport_x

int get_viewport_x
 

get_viewport_y

int get_viewport_y
diff --git a/outline/index.html b/outline/index.html
index de4f745e..ecb8142a 100644
--- a/outline/index.html
+++ b/outline/index.html
@@ -1,4 +1,4 @@
              Outline | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Outline

Functions


get_outline

sfall.h

int get_outline(ObjectPtr obj)
-

Gets the current outline color for an object.


outlined_object

sfall.h

ObjectPtr outlined_object
+

Returns the current outline color of an object.


outlined_object

sfall.h

ObjectPtr outlined_object
 

Returns an object that is currently highlighted by hovering the mouse above it.


set_outline

sfall.h

void set_outline(ObjectPtr obj, int color)
 
  • sets the outline color of an object (see OUTLINE_* constants in sfall.h)
  • can also set a custom color from the game palette by shifting the color index value left by 8 bits: 0xCC00 where CC is the palette index (available since sfall 4.2.7/3.8.27)
  • passing 0 will disable the outline

This site uses Just the Docs, a documentation theme for Jekyll.
diff --git a/sfall-funcx-macros/index.html b/sfall-funcx-macros/index.html index 1dcb69c2..a1ab8c16 100644 --- a/sfall-funcx-macros/index.html +++ b/sfall-funcx-macros/index.html @@ -6,7 +6,7 @@

Returns names of all currently available script functions.


get_object_ai_data

sfall.h

int get_object_ai_data(ObjectPtr object, int aiParam)
 

Returns the setting value from the AI packet of an object (critter). Use AI_CAP_* constants from define_extra.h for the aiParam argument to get AI value.


get_text_width

sfall.h

int get_text_width(string text)
 

Returns the text width in pixels for the currently set font.


item_weight

sfall.h

int item_weight(ObjectPtr obj)
-

Gets the current weight of an object.


metarule_exist

sfall.h

bool metarule_exist(string metaruleName)
+

Returns the weight of an item object.


metarule_exist

sfall.h

bool metarule_exist(string metaruleName)
 

Returns True if the specified name of metarule (sfall_funcX) function exists in the current version of sfall.


npc_engine_level_up

sfall.h

void npc_engine_level_up(bool toggle)
 

Enables/disables the engine function that increases the level of party members in the player leveling process. If the engine function is disabled, the process of leveling up party members should be performed by script functions.


objects_in_radius

sfall.h

array objects_in_radius(int tile, int radius, int elevation, int type)
 
  • returns an array of objects of a type (see OBJ_TYPE_* constants in define_extra.h) within the specified radius from the given tile
  • passing -1 to the type argument or not specifying it will return all objects within the radius
  • the radius is limited to 50 hexes

set_drugs_data

sfall.h

void set_drugs_data(int type, int pid, int value)