diff --git a/animations/index.html b/animations/index.html index 1dad91ec..be4b02fc 100644 --- a/animations/index.html +++ b/animations/index.html @@ -2,8 +2,8 @@

Exactly like reg_anim_animate but the object will automatically disappear after the last animation frame (but not destroyed).


reg_anim_callback

void reg_anim_callback(procedure proc)
 

Adds the given procedure to an animation sequence-list and executes it in the registered sequence.


reg_anim_change_fid

void reg_anim_change_fid(ObjectPtr, int FID, int delay)
 

Should work like art_change_fid_num but in reg_anim sequence.


reg_anim_combat_check

void reg_anim_combat_check(int enable)
-

Allows to enable all reg_anim_* functions in combat (including vanilla functions) if set to 0. It is automatically reset at the end of each frame, so you need to call it before reg_anim_begin - reg_anim_end block.


reg_anim_destroy

void reg_anim_destroy(ObjectPtr)
+

Allows enabling all reg_anim_* functions in combat (including vanilla functions) if set to 0. It is automatically reset at the end of each frame, so you need to call it before reg_anim_begin - reg_anim_end block.


reg_anim_destroy

void reg_anim_destroy(ObjectPtr)
 

Given object is destroyed at the end of current animation set.


reg_anim_light

void reg_anim_light(ObjectPtr, int light, int delay)
 

Change light of any object. Light argument is a light radius (0-8), but you can use highest 2 bytes to pass light intensity as well (example: 0xFFFF0008 - intensity 65535 and radius 8). If highest 2 bytes are 0, intensity will not be changed. Intensity range is from 0 to 65535 (0xFFFF)


reg_anim_take_out

void reg_anim_take_out(ObjectPtr, holdFrameID, delay)
 

Plays “take out weapon” animation for given holdFrameID. It is not required to have such weapon in critter’s inventory.


reg_anim_turn_towards

void reg_anim_turn_towards(ObjectPtr, int tile/target, delay)
-

Makes object change its direction to face given tile num or target object.

+

Makes object change its direction to face given tile number or target object.

diff --git a/assets/js/search-data.json b/assets/js/search-data.json index 8c5f8d6c..a8a135e1 100644 --- a/assets/js/search-data.json +++ b/assets/js/search-data.json @@ -22,7 +22,7 @@ },"3": { "doc": "Animations", "title": "Functions", - "content": ". | reg_anim_animate_and_hide | reg_anim_callback | reg_anim_change_fid | reg_anim_combat_check | reg_anim_destroy | reg_anim_light | reg_anim_take_out | reg_anim_turn_towards | . reg_anim_animate_and_hide . void reg_anim_animate_and_hide(ObjectPtr, int animID, int delay) . Exactly like reg_anim_animate but the object will automatically disappear after the last animation frame (but not destroyed). reg_anim_callback . void reg_anim_callback(procedure proc) . Adds the given procedure to an animation sequence-list and executes it in the registered sequence. reg_anim_change_fid . void reg_anim_change_fid(ObjectPtr, int FID, int delay) . Should work like art_change_fid_num but in reg_anim sequence. reg_anim_combat_check . void reg_anim_combat_check(int enable) . Allows to enable all reg_anim_* functions in combat (including vanilla functions) if set to 0. It is automatically reset at the end of each frame, so you need to call it before reg_anim_begin - reg_anim_end block. reg_anim_destroy . void reg_anim_destroy(ObjectPtr) . Given object is destroyed at the end of current animation set. reg_anim_light . void reg_anim_light(ObjectPtr, int light, int delay) . Change light of any object. Light argument is a light radius (0-8), but you can use highest 2 bytes to pass light intensity as well (example: 0xFFFF0008 - intensity 65535 and radius 8). If highest 2 bytes are 0, intensity will not be changed. Intensity range is from 0 to 65535 (0xFFFF) . reg_anim_take_out . void reg_anim_take_out(ObjectPtr, holdFrameID, delay) . Plays “take out weapon” animation for given holdFrameID. It is not required to have such weapon in critter’s inventory. reg_anim_turn_towards . void reg_anim_turn_towards(ObjectPtr, int tile/target, delay) . Makes object change its direction to face given tile num or target object. ", + "content": ". | reg_anim_animate_and_hide | reg_anim_callback | reg_anim_change_fid | reg_anim_combat_check | reg_anim_destroy | reg_anim_light | reg_anim_take_out | reg_anim_turn_towards | . reg_anim_animate_and_hide . void reg_anim_animate_and_hide(ObjectPtr, int animID, int delay) . Exactly like reg_anim_animate but the object will automatically disappear after the last animation frame (but not destroyed). reg_anim_callback . void reg_anim_callback(procedure proc) . Adds the given procedure to an animation sequence-list and executes it in the registered sequence. reg_anim_change_fid . void reg_anim_change_fid(ObjectPtr, int FID, int delay) . Should work like art_change_fid_num but in reg_anim sequence. reg_anim_combat_check . void reg_anim_combat_check(int enable) . Allows enabling all reg_anim_* functions in combat (including vanilla functions) if set to 0. It is automatically reset at the end of each frame, so you need to call it before reg_anim_begin - reg_anim_end block. reg_anim_destroy . void reg_anim_destroy(ObjectPtr) . Given object is destroyed at the end of current animation set. reg_anim_light . void reg_anim_light(ObjectPtr, int light, int delay) . Change light of any object. Light argument is a light radius (0-8), but you can use highest 2 bytes to pass light intensity as well (example: 0xFFFF0008 - intensity 65535 and radius 8). If highest 2 bytes are 0, intensity will not be changed. Intensity range is from 0 to 65535 (0xFFFF) . reg_anim_take_out . void reg_anim_take_out(ObjectPtr, holdFrameID, delay) . Plays “take out weapon” animation for given holdFrameID. It is not required to have such weapon in critter’s inventory. reg_anim_turn_towards . void reg_anim_turn_towards(ObjectPtr, int tile/target, delay) . Makes object change its direction to face given tile number or target object. ", "url": "/sfall/animations/#functions", "relUrl": "/animations/#functions" @@ -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_critical_table | get_critter_current_ap | get_last_attacker | get_last_target | reset_critical_table | set_bodypart_hit_modifier | set_critical_table | set_critter_burst_disable | set_critter_current_ap | . 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_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 set to 1 in ddraw.ini. (Disabled by default, because it noticably increases loading times.) . 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_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 set to 1 in ddraw.ini. (Disabled by default, because it noticably increases loading times.) . 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. ", + "content": ". | attack_is_aimed | block_combat | combat_data | disable_aimed_shots | force_aimed_shots | get_attack_type | get_bodypart_hit_modifier | get_critical_table | get_critter_current_ap | get_last_attacker | get_last_target | reset_critical_table | set_bodypart_hit_modifier | set_critical_table | set_critter_burst_disable | set_critter_current_ap | . 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_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_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. ", "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 dirty easy hack to allow dynamically change some explosion parameters (ranged attack). All changed parameters are reset to vanilla state automatically 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 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" @@ -694,7 +694,7 @@ },"99": { "doc": "INI settings", "title": "Functions", - "content": ". | get_ini_section | get_ini_sections | get_ini_setting | get_ini_string | modified_ini | set_ini_setting | . get_ini_section . sfall.h . array get_ini_section(string file, string sect) . Returns an associative array of keys and values for a given INI file and section. NOTE: all keys and their values will be of String type. get_ini_sections . sfall.h . array get_ini_sections(string file) . Returns an array of names of all sections in a given INI file. get_ini_setting . int get_ini_setting(string setting) . | Reads an integer value from an ini file in the fallout directory. | It only takes a single argument; seperate the file name, section and key with a “|” character; e.g. myvar:=get_ini_setting(\"myini.ini|mysec|var1\") If the file or key cannot be found, -1 is returned. | The file name is limited to 63 chars, including the extension. | The section name is limited to 32 characters. | It can also be used to get sfall’s settings, by using ddraw.ini as the file name. | . get_ini_string . string get_ini_string(string setting) . Reads a string value from an ini file in the fallout directory. modified_ini . int modified_ini . Returns the value of ModifiedIni setting in [Main] section of the INI. set_ini_setting . sfall.h . void set_ini_setting(string setting, int/string value) . Writes an integer or a string value to an ini file in the Fallout directory. If the ini file does not exist, it will be created The setting argument works in the same way as in get_ini_setting, seperate the file name, section and key with a “|” character. Note: the file name is limited to 63 chars (including the extension), the section name is limited to 32 characters. ", + "content": ". | get_ini_section | get_ini_sections | get_ini_setting | get_ini_string | modified_ini | set_ini_setting | . get_ini_section . sfall.h . array get_ini_section(string file, string sect) . Returns an associative array of keys and values for a given INI file and section. | If the INI file is not found, it returns an empty array. | NOTE: all keys and their values will be of String type. | . get_ini_sections . sfall.h . array get_ini_sections(string file) . Returns an array of names of all sections in a given INI file. | If the INI file is not found, it returns an empty array. | . get_ini_setting . int get_ini_setting(string setting) . Reads an integer value from an ini file in the Fallout directory. | It only takes a single argument; seperate the file name, section and key with a “|” character; e.g. myvar:=get_ini_setting(\"myini.ini|mysec|var1\") | If the file or key cannot be found or the setting argument is in an invalid format, it returns -1. | The file name is limited to 63 chars, including the extension. | The section name is limited to 32 characters. | It can also be used to get sfall settings by using ddraw.ini as the file name. | . get_ini_string . string get_ini_string(string setting) . Reads a string value from an ini file in the Fallout directory. | If the file or key cannot be found, it returns an empty string. | If the setting argument is in an invalid format, it returns -1 (integer). | . modified_ini . int modified_ini . Returns the value of ModifiedIni setting in [Main] section of the INI. set_ini_setting . sfall.h . void set_ini_setting(string setting, int/string value) . Writes an integer or a string value to an ini file in the Fallout directory. If the ini file does not exist, it will be created The setting argument works in the same way as in get_ini_setting, seperate the file name, section and key with a “|” character. Note: the file name is limited to 63 chars (including the extension), the section name is limited to 32 characters. ", "url": "/sfall/ini-settings/#functions", "relUrl": "/ini-settings/#functions" @@ -827,7 +827,7 @@ },"118": { "doc": "Math", "title": "Functions", - "content": ". | ^ | abs | arctan | ceil | cos | div | exponent | floor2 | log | round | sin | sqrt | tan | . ^ . x^y . Exponentiation. Use as any other arithmetic operator, like 5^(1/3). If exponent is an integer, you can use a negative base, otherwise you will get “NaN” with a negative base. If both arguments are integers, the result will be an integer. abs . int/float abs(int/float x) . Absolute (positive) value of x. arctan . float arctan(float x, float y) . Arctangent of x. Pass 1 as y (don’t ask…). ceil . int ceil(float x) . Round x to the nearest integer that is not less than x. cos . float cos(float x) . Cosine of x . div . div(x, y) . Unsigned integer division. Use as a division operator, like 3 + (20 div 5). If both dividend and divisor are integers, they will be treated as unsigned integers. If one of them is a float, div will perform the signed division just like vanilla division operator. exponent . float exponent(float x) . E^X . floor2 . sfall.h . int floor2(int/float value) . Works just like vanilla floor function, but returns correct integers for negative values (vanilla floor function works exactly the same as ceil for negative values, much like trunc in C/C++). log . float log(float x) . Natural logarithm of x. round . int round(float x) . Round x to the nearest integer. sin . float sin(float x) . Sine of x . sqrt . float sqrt(float x) . Square root of x. tan . float tan(float x) . Tangent of x . ", + "content": ". | ^ | abs | arctan | ceil | cos | div | exponent | floor2 | log | round | sin | sqrt | tan | . ^ . x^y . Exponentiation. Use as any other arithmetic operator, like 5^(1/3). If exponent is an integer, you can use a negative base, otherwise you will get “NaN” with a negative base. If both arguments are integers, the result will be an integer. abs . int/float abs(int/float x) . Absolute (positive) value of x. arctan . float arctan(float x, float y) . Arctangent of x. Pass 1 as y (don’t ask…). ceil . int ceil(float x) . Round x to the nearest integer that is not less than x. cos . float cos(float x) . Cosine of x . div . div(x, y) . Unsigned integer division. Use as a division operator, like 3 + (20 div 5). If both dividend and divisor are integers, they will be treated as unsigned integers. If one of them is a float, div will perform the signed division just like vanilla division operator. exponent . float exponent(float x) . E^X . floor2 . sfall.h . int floor2(int/float value) . Works just like vanilla floor function, but returns correct integers for negative floats. | NOTE: vanilla floor function works exactly the same as ceil for negative floats (i.e. basically trunc in C/C++). | . log . float log(float x) . Natural logarithm of x. round . int round(float x) . Round x to the nearest integer. sin . float sin(float x) . Sine of x . sqrt . float sqrt(float x) . Square root of x. tan . float tan(float x) . Tangent of x . ", "url": "/sfall/math/#functions", "relUrl": "/math/#functions" @@ -1086,7 +1086,7 @@ },"155": { "doc": "Strings", "title": "Functions", - "content": ". | charcode | get_string_pointer | string_format | string_split | string_to_case | strlen | substr | . charcode . int charcode(string text) . Returns ASCII code for the first character in given string. get_string_pointer . sfall.h . int get_string_pointer(string text) . Returns a pointer to a string variable or to a text. string_format . sfall.h . string string_format(string format, any val1, any val2, ...) . Formats given value using standard syntax of C printf function (google “printf” for format details). However it is limited to formatting up to 4 values. | formatting is only supported for %s and %d, and the format string is limited to 1024 characters | . string_split . array string_split(string text, split) . Takes a string and a seperator, searches the string for all instances of the seperator, and returns a temp array filled with the pieces of the string split at each instance. If you give an empty string as the seperator, the string is split into individual characters. You can use this to search for a substring in a string like this: strlen(get_array(string_split(haystack, needle), 0)) . string_to_case . string sfall_func2(\"string_to_case\", string text, int toCase) . Converts all letters in the given string to the specified case. toCase: 0 - lowercase, 1 - uppercase . NOTE: this function works only for English letters of A-Z/a-z. strlen . int strlen(string text) . Returns string length. substr . string substr(string text, start, length) . Cuts a substring from a string starting at “start” up to “length” characters. The first character position is 0 (zero). | If start is negative - it indicates starting position from the end of the string (for example substr(\"test\", -2, 2) will return last 2 charactes: “st”). | If length is negative - it means so many characters will be omitted from the end of string (example: substr(\"test\", 0, -2) will return string without last 2 characters: “te”). | If length is zero - it will return a string from the starting position to the end of the string New behavior for sfall 4.2.2/3.8.22 | . ", + "content": ". | charcode | get_string_pointer | string_find | string_find_from | string_format | string_format_array | string_replace | string_split | string_to_case | strlen | substr | . charcode . int charcode(string text) . Returns ASCII code for the first character in given string. get_string_pointer . sfall.h . int get_string_pointer(string text) . (DEPRECATED) Returns a pointer to a string variable or to a text . | NOTE: this function is intended for use only in HOOK_DESCRIPTIONOBJ. Starting from sfall 4.4/3.8.40, you can return normal strings directly in the hook without calling the function | . string_find . sfall.h . int string_find(string haystack, string needle) . Returns the position of the first occurrence of a needle string in a haystack string, or -1 if not found. The first character position is 0 (zero). string_find_from . sfall.h . int string_find_from(string haystack, string needle, int pos) . Works the same as string_find, except you can specify the position to start the search. | If pos is negative - it indicates a position starting from the end of the string, similar to substr(). | . string_format . sfall.h . string string_format(string format, any val1, any val2, ...) . Formats given values using standard syntax of C printf function (google “printf” for format details). However, it is limited to formatting up to 7 values. | The format string is limited to 1024 characters | . string_format_array . lib.strings.h . string string_format_array(string format, int array) . The same as string_format, but accepts an array of parameters. string_replace . lib.strings.h . string string_replace(string str, string search, string replace) . Replaces all occurances of a given search string in a string with a given replacement string. string_split . array string_split(string text, split) . Takes a string and a seperator, searches the string for all instances of the seperator, and returns a temp array filled with the pieces of the string split at each instance. If you give an empty string as the seperator, the string is split into individual characters. You can use this to search for a substring in a string like this: strlen(get_array(string_split(haystack, needle), 0)) . string_to_case . string sfall_func2(\"string_to_case\", string text, int toCase) . Converts all letters in the given string to the specified case. toCase: 0 - lowercase, 1 - uppercase . NOTE: this function works only for English letters of A-Z/a-z. strlen . int strlen(string text) . Returns string length. substr . string substr(string text, int start, int length) . Cuts a substring from a string starting at “start” up to “length” characters. The first character position is 0 (zero). | If start is negative - it indicates a position starting from the end of the string (for example substr(\"test\", -2, 2) will return last 2 charactes: “st”). | If length is negative - it means so many characters will be omitted from the end of string (example: substr(\"test\", 0, -2) will return string without last 2 characters: “te”). | If length is zero - it will return a string from the starting position to the end of the string. New behavior for sfall 4.2.2/3.8.22 | . ", "url": "/sfall/strings/#functions", "relUrl": "/strings/#functions" @@ -1114,7 +1114,7 @@ },"159": { "doc": "Tiles and paths", "title": "Functions", - "content": ". | get_tile_fid | obj_blocking_line | obj_blocking_tile | path_find_to | tile_by_position | tile_get_objs | tile_light | tile_refresh_display | tile_under_cursor | . get_tile_fid . int get_tile_fid(int tile) . obj_blocking_line . ObjectPtr obj_blocking_line(ObjectPtr objFrom, int tileTo, int blockingType) . Returns first object which blocks direct linear path from objFrom to tileTo using selected blocking function (see BLOCKING_TYPE_* constants in sfall.h). If path is clear (no blocker was encountered by selected function) - returns 0. objFrom is always excluded from calculations, but is required to be a valid object. obj_blocking_tile . ObjectPtr obj_blocking_tile(int tileNum, int elevation, int blockingType) . Returns first object blocking given tile using given blocking function or 0 if tile is clear. path_find_to . array path_find_to(ObjectPtr objFrom, int tileTo, int blockingType) . Returns the shortest path to a given tile using given blocking function as an array of tile directions (0..5) to move on each step. Array length equals to a number of steps. Empty array means that specified target cannot be reached. tile_by_position . sfall.h . int tile_by_position(int x, int y) . | returns the tile number at the x, y position relative to the top-left corner of the screen | if the position is outside of the range of tiles, it will return -1 | . tile_get_objs . array tile_get_objs(int tileNum, int elevation) . Returns an array of all objects at given tile. It will include any hidden, dead or system objects (like cursor), so make sure to check properly when iterating. tile_light . int tile_light(int elevation, int tileNum) . Returns light intensity at the given tile in range from 0 to 65535. tile_refresh_display . void tile_refresh_display() . Redraws the game scene (tiles, walls, objects, etc.). tile_under_cursor . int tile_under_cursor . ", + "content": ". | get_tile_fid | get_tile_ground_fid | get_tile_roof_fid | obj_blocking_line | obj_blocking_tile | path_find_to | tile_by_position | tile_get_objs | tile_light | tile_refresh_display | tile_under_cursor | . get_tile_fid . int get_tile_fid(int tileData) . | Returns FID information about the square under the given tile at elevation 0 | Pass elevation as 4-bit number in bits 25-28 to access other elevations | Pass result mode in bits 29-32: 0 - ground FID, 1 - roof FID, 2 - raw data. | . get_tile_ground_fid . sfall.h . int get_tile_ground_fid(int tileNum, int elevation) . Returns FID of a ground tile at given tile number and elevation. get_tile_roof_fid . sfall.h . int get_tile_roof_fid(int tileNum, int elevation) . Returns FID of a roof tile at given tile number and elevation. Note that FID of 1 is used when there is no actual roof. obj_blocking_line . ObjectPtr obj_blocking_line(ObjectPtr objFrom, int tileTo, int blockingType) . Returns first object which blocks direct linear path from objFrom to tileTo using selected blocking function (see BLOCKING_TYPE_* constants in sfall.h). If path is clear (no blocker was encountered by selected function) - returns 0. objFrom is always excluded from calculations, but is required to be a valid object. obj_blocking_tile . ObjectPtr obj_blocking_tile(int tileNum, int elevation, int blockingType) . Returns first object blocking given tile using given blocking function or 0 if tile is clear. path_find_to . array path_find_to(ObjectPtr objFrom, int tileTo, int blockingType) . Returns the shortest path to a given tile using given blocking function as an array of tile directions (0..5) to move on each step. Array length equals to a number of steps. Empty array means that specified target cannot be reached. tile_by_position . sfall.h . int tile_by_position(int x, int y) . | returns the tile number at the x, y position relative to the top-left corner of the screen | if the position is outside of the range of tiles, it will return -1 | . tile_get_objs . array tile_get_objs(int tileNum, int elevation) . Returns an array of all objects at given tile. It will include any hidden, dead or system objects (like cursor), so make sure to check properly when iterating. tile_light . int tile_light(int elevation, int tileNum) . Returns light intensity at the given tile in range from 0 to 65535. tile_refresh_display . void tile_refresh_display() . Redraws the game scene (tiles, walls, objects, etc.). tile_under_cursor . int tile_under_cursor . ", "url": "/sfall/tiles-and-paths/#functions", "relUrl": "/tiles-and-paths/#functions" @@ -1135,7 +1135,7 @@ },"162": { "doc": "Variables", "title": "Functions", - "content": ". | atof | atoi | sprintf | typeof | . atof . float atof(string text) . atoi . int atoi(string text) . sprintf . string sprintf(string format, any value) . Formats given value using standart syntax of C printf function (google “printf” for format details). However it is limited to formatting only 1 value. Can be used to get character by ASCII code (“%c”). typeof . int typeof(any value) . Returns type of the given value: VALTYPE_INT, VALTYPE_FLOAT or VALTYPE_STR. ", + "content": ". | atof | atoi | sprintf | typeof | . atof . float atof(string text) . atoi . int atoi(string text) . sprintf . string sprintf(string format, any value) . Formats given value using standart syntax of C printf function (google “printf” for format details). However, it is limited to formatting only 1 value. | Can be used to get character by ASCII code (“%c”). | . typeof . int typeof(any value) . Returns type of the given value: VALTYPE_INT, VALTYPE_FLOAT or VALTYPE_STR. ", "url": "/sfall/variables/#functions", "relUrl": "/variables/#functions" diff --git a/combat/index.html b/combat/index.html index 663f7e3d..1756a749 100644 --- a/combat/index.html +++ b/combat/index.html @@ -6,12 +6,12 @@

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_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 set to 1 in ddraw.ini. (Disabled by default, because it noticably increases loading times.)


get_critter_current_ap

int get_critter_current_ap(CritterPtr)
+

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_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 set to 1 in ddraw.ini. (Disabled by default, because it noticably increases loading times.)


set_critter_burst_disable

void set_critter_burst_disable(int critter, int disable)
+

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.

diff --git a/explosions/index.html b/explosions/index.html index 06ccb3dc..7745786e 100644 --- a/explosions/index.html +++ b/explosions/index.html @@ -1,7 +1,7 @@ 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)
-

Was made as a dirty easy hack to allow dynamically change some explosion parameters (ranged attack). All changed parameters are reset to vanilla state automatically after each attack action.


set_attack_explosion_art

sfall.h

void set_attack_explosion_art(x, y)
+

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
diff --git a/feed.xml b/feed.xml
index 0c0414a7..6a439410 100644
--- a/feed.xml
+++ b/feed.xml
@@ -1 +1 @@
-Jekyll2023-08-22T02:01:08+00:00/sfall/feed.xmlsfallSfall documentation
\ No newline at end of file
+Jekyll2023-08-22T02:07:31+00:00/sfall/feed.xmlsfallSfall documentation
\ No newline at end of file
diff --git a/ini-settings/index.html b/ini-settings/index.html
index 393d3ff9..dab92839 100644
--- a/ini-settings/index.html
+++ b/ini-settings/index.html
@@ -1,7 +1,7 @@
             INI settings | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

INI settings

Functions


get_ini_section

sfall.h

array get_ini_section(string file, string sect)
-

Returns an associative array of keys and values for a given INI file and section. NOTE: all keys and their values will be of String type.


get_ini_sections

sfall.h

array get_ini_sections(string file)
-

Returns an array of names of all sections in a given INI file.


get_ini_setting

int get_ini_setting(string setting)
-
  • Reads an integer value from an ini file in the fallout directory.
  • It only takes a single argument; seperate the file name, section and key with a “|” character; e.g. myvar:=get_ini_setting("myini.ini|mysec|var1") If the file or key cannot be found, -1 is returned.
  • The file name is limited to 63 chars, including the extension.
  • The section name is limited to 32 characters.
  • It can also be used to get sfall’s settings, by using ddraw.ini as the file name.

get_ini_string

string get_ini_string(string setting)
-

Reads a string value from an ini file in the fallout directory.


modified_ini

int modified_ini
+

Returns an associative array of keys and values for a given INI file and section.

  • If the INI file is not found, it returns an empty array.
  • NOTE: all keys and their values will be of String type.

get_ini_sections

sfall.h

array get_ini_sections(string file)
+

Returns an array of names of all sections in a given INI file.

  • If the INI file is not found, it returns an empty array.

get_ini_setting

int get_ini_setting(string setting)
+

Reads an integer value from an ini file in the Fallout directory.

  • It only takes a single argument; seperate the file name, section and key with a “|” character; e.g. myvar:=get_ini_setting("myini.ini|mysec|var1")
  • If the file or key cannot be found or the setting argument is in an invalid format, it returns -1.
  • The file name is limited to 63 chars, including the extension.
  • The section name is limited to 32 characters.
  • It can also be used to get sfall settings by using ddraw.ini as the file name.

get_ini_string

string get_ini_string(string setting)
+

Reads a string value from an ini file in the Fallout directory.

  • If the file or key cannot be found, it returns an empty string.
  • If the setting argument is in an invalid format, it returns -1 (integer).

modified_ini

int modified_ini
 

Returns the value of ModifiedIni setting in [Main] section of the INI.


set_ini_setting

sfall.h

void set_ini_setting(string setting, int/string value)
 

Writes an integer or a string value to an ini file in the Fallout directory. If the ini file does not exist, it will be created The setting argument works in the same way as in get_ini_setting, seperate the file name, section and key with a “|” character. Note: the file name is limited to 63 chars (including the extension), the section name is limited to 32 characters.

diff --git a/math/index.html b/math/index.html index 10c36106..9a6d493f 100644 --- a/math/index.html +++ b/math/index.html @@ -6,7 +6,7 @@

Cosine of x


div

div(x, y)
 

Unsigned integer division. Use as a division operator, like 3 + (20 div 5). If both dividend and divisor are integers, they will be treated as unsigned integers. If one of them is a float, div will perform the signed division just like vanilla division operator.


exponent

float exponent(float x)
 

E^X


floor2

sfall.h

int floor2(int/float value)
-

Works just like vanilla floor function, but returns correct integers for negative values (vanilla floor function works exactly the same as ceil for negative values, much like trunc in C/C++).


log

float log(float x)
+

Works just like vanilla floor function, but returns correct integers for negative floats.

  • NOTE: vanilla floor function works exactly the same as ceil for negative floats (i.e. basically trunc in C/C++).

log

float log(float x)
 

Natural logarithm of x.


round

int round(float x)
 

Round x to the nearest integer.


sin

float sin(float x)
 

Sine of x


sqrt

float sqrt(float x)
diff --git a/strings/index.html b/strings/index.html
index 367b862c..ee672979 100644
--- a/strings/index.html
+++ b/strings/index.html
@@ -1,9 +1,13 @@
-            Strings | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Strings

Functions


charcode

int charcode(string text)
+            Strings | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Strings

Functions


charcode

int charcode(string text)
 

Returns ASCII code for the first character in given string.


get_string_pointer

sfall.h

int get_string_pointer(string text)
-

Returns a pointer to a string variable or to a text.


string_format

sfall.h

string string_format(string format, any val1, any val2, ...)
-

Formats given value using standard syntax of C printf function (google “printf” for format details). However it is limited to formatting up to 4 values.

  • formatting is only supported for %s and %d, and the format string is limited to 1024 characters

string_split

array string_split(string text, split)
+

(DEPRECATED) Returns a pointer to a string variable or to a text

  • NOTE: this function is intended for use only in HOOK_DESCRIPTIONOBJ. Starting from sfall 4.4/3.8.40, you can return normal strings directly in the hook without calling the function

string_find

sfall.h

int string_find(string haystack, string needle)
+

Returns the position of the first occurrence of a needle string in a haystack string, or -1 if not found. The first character position is 0 (zero).


string_find_from

sfall.h

int string_find_from(string haystack, string needle, int pos)
+

Works the same as string_find, except you can specify the position to start the search.

  • If pos is negative - it indicates a position starting from the end of the string, similar to substr().

string_format

sfall.h

string string_format(string format, any val1, any val2, ...)
+

Formats given values using standard syntax of C printf function (google “printf” for format details). However, it is limited to formatting up to 7 values.

  • The format string is limited to 1024 characters

string_format_array

lib.strings.h

string string_format_array(string format, int array)
+

The same as string_format, but accepts an array of parameters.


string_replace

lib.strings.h

string string_replace(string str, string search, string replace)
+

Replaces all occurances of a given search string in a string with a given replacement string.


string_split

array string_split(string text, split)
 

Takes a string and a seperator, searches the string for all instances of the seperator, and returns a temp array filled with the pieces of the string split at each instance. If you give an empty string as the seperator, the string is split into individual characters. You can use this to search for a substring in a string like this: strlen(get_array(string_split(haystack, needle), 0))


string_to_case

string sfall_func2("string_to_case", string text, int toCase)
 

Converts all letters in the given string to the specified case.

toCase: 0 - lowercase, 1 - uppercase
 

NOTE: this function works only for English letters of A-Z/a-z.


strlen

int strlen(string text)
-

Returns string length.


substr

string substr(string text, start, length)
-

Cuts a substring from a string starting at “start” up to “length” characters. The first character position is 0 (zero).

  • If start is negative - it indicates starting position from the end of the string (for example substr("test", -2, 2) will return last 2 charactes: “st”).
  • If length is negative - it means so many characters will be omitted from the end of string (example: substr("test", 0, -2) will return string without last 2 characters: “te”).
  • If length is zero - it will return a string from the starting position to the end of the string New behavior for sfall 4.2.2/3.8.22
+

Returns string length.


substr

string substr(string text, int start, int length)
+

Cuts a substring from a string starting at “start” up to “length” characters. The first character position is 0 (zero).

  • If start is negative - it indicates a position starting from the end of the string (for example substr("test", -2, 2) will return last 2 charactes: “st”).
  • If length is negative - it means so many characters will be omitted from the end of string (example: substr("test", 0, -2) will return string without last 2 characters: “te”).
  • If length is zero - it will return a string from the starting position to the end of the string. New behavior for sfall 4.2.2/3.8.22
diff --git a/tiles-and-paths/index.html b/tiles-and-paths/index.html index f665a37c..280b6afa 100644 --- a/tiles-and-paths/index.html +++ b/tiles-and-paths/index.html @@ -1,5 +1,7 @@ - Tiles and paths | sfall Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Tiles and paths

Functions


get_tile_fid

int get_tile_fid(int tile)
-

obj_blocking_line

ObjectPtr obj_blocking_line(ObjectPtr objFrom, int tileTo, int blockingType)
+            Tiles and paths | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Tiles and paths

Functions


get_tile_fid

int get_tile_fid(int tileData)
+
  • Returns FID information about the square under the given tile at elevation 0
  • Pass elevation as 4-bit number in bits 25-28 to access other elevations
  • Pass result mode in bits 29-32: 0 - ground FID, 1 - roof FID, 2 - raw data.

get_tile_ground_fid

sfall.h

int get_tile_ground_fid(int tileNum, int elevation)
+

Returns FID of a ground tile at given tile number and elevation.


get_tile_roof_fid

sfall.h

int get_tile_roof_fid(int tileNum, int elevation)
+

Returns FID of a roof tile at given tile number and elevation. Note that FID of 1 is used when there is no actual roof.


obj_blocking_line

ObjectPtr obj_blocking_line(ObjectPtr objFrom, int tileTo, int blockingType)
 

Returns first object which blocks direct linear path from objFrom to tileTo using selected blocking function (see BLOCKING_TYPE_* constants in sfall.h). If path is clear (no blocker was encountered by selected function) - returns 0. objFrom is always excluded from calculations, but is required to be a valid object.


obj_blocking_tile

ObjectPtr obj_blocking_tile(int tileNum, int elevation, int blockingType)
 

Returns first object blocking given tile using given blocking function or 0 if tile is clear.


path_find_to

array path_find_to(ObjectPtr objFrom, int tileTo, int blockingType)
 

Returns the shortest path to a given tile using given blocking function as an array of tile directions (0..5) to move on each step. Array length equals to a number of steps. Empty array means that specified target cannot be reached.


tile_by_position

sfall.h

int tile_by_position(int x, int y)
diff --git a/variables/index.html b/variables/index.html
index b936fc2c..5b8e06eb 100644
--- a/variables/index.html
+++ b/variables/index.html
@@ -1,5 +1,5 @@
             Variables | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Variables

Subcategories

Functions


atof

float atof(string text)
 

atoi

int atoi(string text)
 

sprintf

string sprintf(string format, any value)
-

Formats given value using standart syntax of C printf function (google “printf” for format details). However it is limited to formatting only 1 value. Can be used to get character by ASCII code (“%c”).


typeof

int typeof(any value)
+

Formats given value using standart syntax of C printf function (google “printf” for format details). However, it is limited to formatting only 1 value.

  • Can be used to get character by ASCII code (“%c”).

typeof

int typeof(any value)
 

Returns type of the given value: VALTYPE_INT, VALTYPE_FLOAT or VALTYPE_STR.