diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini
index 0e0da033..90b5f915 100644
--- a/artifacts/ddraw.ini
+++ b/artifacts/ddraw.ini
@@ -1,5 +1,5 @@
;sfall configuration settings
-;v4.3.1
+;v4.3.2
[Main]
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
@@ -657,7 +657,9 @@ ExplosionsEmitLight=0
;Set to 0 for backward compatibility with pre-3.4 scripts
ArraysBehavior=1
-;Set to 1 to add proper checks to see if there is enough ammo to attack with weapons that use multiple ammo per shot
+;Set to 1 to add proper check for ammo before attacking and proper calculation of the number of burst rounds
+;By default, weapons can make attacks when at least one ammo is left, regardless of ammo cost calculations
+;Note that enabling this option will prevent super cattle prods and mega power fists from attacking if there is only one ammo left
CheckWeaponAmmoCost=0
;Controls the speed of combat panel animations (lower - faster; valid range: 0..65535)
diff --git a/artifacts/scripting/arrays.md b/artifacts/scripting/arrays.md
index b905991b..d8bc4178 100644
--- a/artifacts/scripting/arrays.md
+++ b/artifacts/scripting/arrays.md
@@ -238,7 +238,7 @@ For those who used arrays in their mods before sfall 3.4:
* There is an INI parameter **arraysBehavior** in **Misc** section of ddraw.ini. If set to 0, all scripts which used sfall arrays before should work. This basically changes that `create_array` will create permanent arrays which are "saved" by default and their ID is also permanent. It is 1 by default.
-* How savegame compatibility is handled?
+* How savegame compatibility is handled?\
Saved arrays are stored in **sfallgv.sav** file (in savegame) in new (more flexible) format, just after the old arrays. So basically, when you load older savegame, sfall will load arrays from old format and save them to new format on next game save. If you load savegame made with sfall 3.4 using sfall 3.3 (for example), game shouldn't crash, but all arrays will be lost.
* Previously you had to specify size in bytes for array elements. This parameter is now ignored and you can store strings of arbitrary length in arrays.
diff --git a/artifacts/scripting/hookscripts.md b/artifacts/scripting/hookscripts.md
index 8d5fa6d6..2db9213e 100644
--- a/artifacts/scripting/hookscripts.md
+++ b/artifacts/scripting/hookscripts.md
@@ -87,7 +87,7 @@ The defines to use for the hookID are in **sfall.h**.
#### `HOOK_TOHIT (hs_tohit.int)`
-Runs when Fallout is calculating the chances of an attack striking a target.
+Runs when Fallout is calculating the chances of an attack striking a target.\
Runs after the hit chance is fully calculated normally, including applying the 95% cap.
```
@@ -125,8 +125,8 @@ Critter ret2 - Override the target of the attack
#### `HOOK_CALCAPCOST (hs_calcapcost.int)`
-Runs whenever Fallout is calculating the AP cost of using the weapon (or unarmed attack). Doesn't run for using other item types or moving.
-Note that the first time a game is loaded, this script doesn't run before the initial interface is drawn, so if the script effects the AP cost of whatever is in the player's hands at the time the wrong AP cost will be shown. It will be fixed the next time the interface is redrawn.
+Runs whenever Fallout is calculating the AP cost of using the weapon (or unarmed attack). Doesn't run for using other item types or moving.\
+Note that the first time a game is loaded, this script doesn't run before the initial interface is drawn, so if the script effects the AP cost of whatever is in the player's hands at the time the wrong AP cost will be shown. It will be fixed the next time the interface is redrawn.\
You can get the weapon object by checking item slot based on attack type (`ATKTYPE_LWEP1`, `ATKTYPE_LWEP2`, etc) and then calling `critter_inven_obj`.
```
@@ -161,7 +161,7 @@ int ret0 - The pid of an object to override the attacking weapon with
#### `HOOK_DEATHANIM2 (hs_deathanim2.int)`
-Runs after Fallout has calculated the death animation. Lets you set your own custom frame id, so more powerful than `HOOK_DEATHANIM1`, but performs no validation.
+Runs after Fallout has calculated the death animation. Lets you set your own custom frame id, so more powerful than `HOOK_DEATHANIM1`, but performs no validation.\
When using `critter_dmg` function, this script will also run. In that case weapon pid will be -1 and attacker will point to an object with `obj_art_fid == 0x20001F5`.
Does not run for critters in the knockdown/out state.
@@ -222,7 +222,7 @@ Critter arg0 - The critter that just died
#### `HOOK_FINDTARGET (hs_findtarget.int)`
-Runs when the AI is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the AI caps of the attacker.
+Runs when the AI is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the AI caps of the attacker.\
This hook replaces that sorting function, allowing you to sort the targets in some arbitrary way.
The return values can include critters that weren't in the list of possible targets, but the additional targets may still be discarded later on in the combat turn if they are out of the attackers perception or the chance of a successful hit is too low. The list of possible targets often includes duplicated entries, but this is fixed in sfall 4.2.3/3.8.23.
@@ -350,8 +350,8 @@ int ret0 - the new AP cost
Run when checking to see if a hex blocks movement or shooting. (or ai-ing, presumably...)
__NOTE:__ These hook scripts can become very CPU-intensive and you should avoid using them.
-For this reason, these hooks are not thoroughly supported in sfall, and may be removed in future versions.
-If you want to check if some tile or path is blocked, use functions: `obj_blocking_tile`, `obj_blocking_line`, `path_find_to`.
+For this reason, these hooks are not thoroughly supported in sfall, and may be removed in future versions.\
+If you want to check if some tile or path is blocked, use functions: `obj_blocking_tile`, `obj_blocking_line`, `path_find_to`.\
If you want script to be called every time NPC moves by hex in combat, use `HOOK_MOVECOST` hook.
```
@@ -385,9 +385,9 @@ int ret1 - The new maximum damage
#### `HOOK_AMMOCOST (hs_ammocost.int)`
-Runs when calculating ammo cost for a weapon. Doesn't affect damage, only how much ammo is spent.
-By default, weapon will shoot when at least 1 round is left, regardless of ammo cost calculations.
-To add proper check for ammo before shooting and proper calculation of number of burst rounds (hook type 1 and 2 in `arg3`), set **CheckWeaponAmmoCost=1** in **Misc** section of ddraw.ini.
+Runs when calculating ammo cost for a weapon. Doesn't affect damage, only how much ammo is spent.\
+By default, weapons can make attacks when at least 1 ammo is left, regardless of ammo cost calculations.\
+To add proper check for ammo before attacking and proper calculation of the number of burst rounds (hook type 1 and 2 in `arg3`), set **CheckWeaponAmmoCost=1** in **Misc** section of ddraw.ini.
```
Item arg0 - The weapon
@@ -459,7 +459,7 @@ Runs when checking an attempt to steal or plant an item in other inventory using
This is fired before the default handlers are called, which you can override. In this case you MUST provide message of the result to player ("You steal the %s", "You are caught planting the %s", etc.).
-Example message (vanilla behavior):
+Example message (vanilla behavior):\
`display_msg(sprintf(mstr_skill(570 + (isSuccess != false) + arg3 * 2), obj_name(arg2)));`
```
@@ -477,8 +477,8 @@ int ret0 - overrides hard-coded handler (1 - force success, 0 - force fail,
Runs when checking if one critter sees another critter. This is used in different situations like combat AI. You can override the result.
-__NOTE:__ `obj_can_see_obj` calls this first when deciding if critter can possibly see another critter with regard to perception, lighting, sneak factors.
-If check fails, the end result is false. If check succeeds (e.g. critter is within perception range), another check is made if there is any blocking tile between two critters (which includes stuff like windows, large bushes, barrels, etc.) and if there is - check still fails.
+__NOTE:__ `obj_can_see_obj` calls this first when deciding if critter can possibly see another critter with regard to perception, lighting, sneak factors.\
+If check fails, the end result is false. If check succeeds (e.g. critter is within perception range), another check is made if there is any blocking tile between two critters (which includes stuff like windows, large bushes, barrels, etc.) and if there is - check still fails.\
You can override "within perception" check by returning 0 or 1, OR, as a convenience, you can also override blocking check after the perception check by returning 2 instead. In this case you should add "line of sight" check inside your hook script, otherwise critters will detect you through walls.
This is fired after the default calculation is made.
@@ -503,7 +503,7 @@ int ret0 - overrides the returned result of the function:
#### `HOOK_INVENTORYMOVE (hs_inventorymove.int)`
-Runs before moving items between inventory slots in dude interface. You can override the action.
+Runs before moving items between inventory slots in dude interface. You can override the action.\
What you can NOT do with this hook:
- force moving items to inappropriate slots (like gun in armor slot)
@@ -533,7 +533,7 @@ int ret0 - Override setting (-1 - use engine handler, any other value - prev
#### `HOOK_INVENWIELD (hs_invenwield.int)`
-Runs before causing a critter or the player to wield/unwield an armor or a weapon (except when using the inventory by PC).
+Runs before causing a critter or the player to wield/unwield an armor or a weapon (except when using the inventory by PC).\
An example usage would be to change critter art depending on armor being used or to dynamically customize weapon animations.
__NOTE:__ When replacing a previously wielded armor or weapon, the unwielding hook will not be executed.
@@ -553,7 +553,7 @@ int ret0 - overrides hard-coded handler (-1 - use engine handler, any other
#### `HOOK_ADJUSTFID (hs_adjustfid.int)`
-Runs after calculating character figure FID on the inventory screen, whenever the game decides that character appearance might change.
+Runs after calculating character figure FID on the inventory screen, whenever the game decides that character appearance might change.\
Also happens on other screens, like barter.
__NOTE:__ FID has following format: `0x0ABBCDDD`, where: `A` - object type, `BB` - animation code (always 0 in this case), `C` - weapon code, `DDD` - FRM index in LST file.
@@ -701,7 +701,7 @@ int ret1 - pass 1 to allow the skill being used in combat (only for dude_obj
#### `HOOK_ONEXPLOSION (hs_onexplosion.int)`
-Runs when Fallout is checking all the tiles within the explosion radius for targets before an explosion occurs.
+Runs when Fallout is checking all the tiles within the explosion radius for targets before an explosion occurs.\
The tile checking will be interrupted when 6 additional targets (critters) are received.
```
@@ -764,7 +764,7 @@ int ret1 - overrides the light radius. Radius range is from 0 to 8 (works on
#### `HOOK_SNEAK (hs_sneak.int)`
-Runs when the Sneak skill is activated, or when the game rolls another Sneak check after the duration for the current one is over.
+Runs when the Sneak skill is activated, or when the game rolls another Sneak check after the duration for the current one is over.\
You can override the result of a random Sneak check or the duration time for the current result.
```
@@ -797,7 +797,7 @@ int ret0 - pass -1 to cancel the execution of the handler (only for HOOK_STD
#### `HOOK_TARGETOBJECT (hs_targetobject.int)`
-Runs when the targeting cursor hovers over an object, or when the player tries to attack the target object.
+Runs when the targeting cursor hovers over an object, or when the player tries to attack the target object.\
You can override the target object or prevent the player from attacking the chosen target.
```
@@ -812,7 +812,7 @@ mixed ret0 - overrides the target object, or pass -1 to prevent the player fro
#### `HOOK_ENCOUNTER (hs_encounter.int)`
-Runs whenever a random encounter occurs (except the Horrigan meeting and scripted encounters), or when the player enters a local map from the world map.
+Runs whenever a random encounter occurs (except the Horrigan meeting and scripted encounters), or when the player enters a local map from the world map.\
You can override the map for loading or the encounter.
```
@@ -882,7 +882,7 @@ int ret0 - overrides the roll result
#### `HOOK_BESTWEAPON (hs_bestweapon.int)`
-Runs when the AI decides which weapon is the best while searching the inventory for a weapon to equip in combat.
+Runs when the AI decides which weapon is the best while searching the inventory for a weapon to equip in combat.\
This also runs when the player presses the "Use Best Weapon" button on the party member control panel.
```
@@ -899,8 +899,8 @@ Item ret0 - overrides the chosen best weapon
#### `HOOK_CANUSEWEAPON (hs_canuseweapon.int)`
-Run when the AI checks whether it can use a weapon, or when the game checks whether the player can use an item (weapon) in hand slot.
-For AI, this mostly happens when NPCs try to find weapons in their inventory or on the map.
+Run when the AI checks whether it can use a weapon, or when the game checks whether the player can use an item (weapon) in hand slot.\
+For AI, this mostly happens when NPCs try to find weapons in their inventory or on the map.\
For the player, this happens when the game updates the item data for active item slots on the interface bar.
```
diff --git a/artifacts/scripting/sfall function notes.md b/artifacts/scripting/sfall function notes.md
index a1115725..8789e6ec 100644
--- a/artifacts/scripting/sfall function notes.md
+++ b/artifacts/scripting/sfall function notes.md
@@ -73,7 +73,7 @@ The `list_xxx` functions can be used to loop over all items on a map. `list_begi
The `play_sfall_sound` and `stop_sfall_sound` are used to play **mp3/wav/wma** files. The path given is relative to the Fallout folder. Specify mode as 1 to loop the file continuously, 2 to replace the current background game music with playing the specified file in loop mode, or 0 to play the file once. If you don't wish to loop, `play_sfall_sound` returns 0. If you do loop, it returns an id which can be passed back to `stop_sfall_sound` when you want to stop the effect. All sounds effects will be stopped on game reload, looping or not. These functions do not require **AllowDShowSound** to be set to 1 in ddraw.ini.
Starting from sfall 4.2.8/3.8.28, you can pass a value in the **mode** argument for a reduced sound volume. To set the volume, You need to convert the number to hexadecimal and use the argument format `0xZZZZ000Y`, where `ZZZZ` is the volume reduction value in range from 0 to 32767 (the value 32767 is muted), and `Y` is the playback mode.
-Arrays are created and manipulated with the `xxx_array` functions. An array must first be created with `create_array` or `temp_array`, specifying how many data elements the array can hold. You can store any of ints, floats and strings in an array, and can mix all 3 in a single array. The ID returned by `create_array` or `temp_array` can then be used with the other array functions. Arrays are shared between all scripts. (i.e. you can call `create_array` from one script, and then use the returned ID from another script.) They are also saved across savegames. Arrays created with `temp_array` will be automatically freed at the end of the frame. These functions are safe, in that supplying a bad id or trying to access out of range elements will not crash the script. `create_array` is the only function that returns a permanent array, all other functions which return arrays (`string_split`, `list_as_array`, etc,) all return temp arrays. You can use `fix_array` to make a temp array permanent.
+Arrays are created and manipulated with the `xxx_array` functions. An array must first be created with `create_array` or `temp_array`, specifying how many data elements the array can hold. You can store any of ints, floats and strings in an array, and can mix all 3 in a single array. The ID returned by `create_array` or `temp_array` can then be used with the other array functions. Arrays are shared between all scripts. (i.e. you can call `create_array` from one script, and then use the returned ID from another script.) They are also saved across savegames. Arrays created with `temp_array` will be automatically freed at the end of the frame. These functions are safe, in that supplying a bad id or trying to access out of range elements will not crash the script. `create_array` is the only function that returns a permanent array, all other functions which return arrays (`string_split`, `list_as_array`, etc,) all return temp arrays. You can use `fix_array` to make a temp array permanent.\
__NOTE:__ the above description only applies when **arraysBehavior** is set to 0 in ddraw.ini. Refer to **arrays.md** for detailed description of new arrays behavior.
The `force_aimed_shots` and `disable_aimed_shots` allow 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.) `force_aimed_shots` will allow a weapon to make aimed shots even if it normally couldn't, and `disable_aimed_shots` stops a weapon from making aimed shots even if it normally could. Both of these functions affect player and NPCs alike. `force_aimed_shots` 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 functions once at each reload. Use a pid of 0 to represent unarmed.
@@ -483,7 +483,7 @@ sfall_funcX metarule functions
----
#### intface_redraw
-`void sfall_func0("intface_redraw")`
+`void sfall_func0("intface_redraw")`\
`void sfall_func1("intface_redraw", int winType)`
- Redraws main game interface, useful to reflect changes after directly changing current player weapons or stats
- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**). Pass -1 to redraw all interface windows
@@ -679,14 +679,14 @@ sfall_funcX metarule functions
----
#### inventory_redraw
-`void sfall_func0("inventory_redraw")`
+`void sfall_func0("inventory_redraw")`\
`void sfall_func1("inventory_redraw", int invSide)`
- Redraws inventory list in the inventory/use inventory item on/loot/barter screens
- `invSide` specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens), -1 - both sides (same as without argument)
----
#### item_make_explosive
-`void sfall_func3("item_make_explosive", int pid, int activePid, int damage)`
+`void sfall_func3("item_make_explosive", int pid, int activePid, int damage)`\
`void sfall_func4("item_make_explosive", int pid, int activePid, int min, int max)`
- Makes the specified item (pid) an explosive item like Dynamite or Plastic Explosives
- `activePid` is for an item with an active timer, can be the same as the pid argument
@@ -712,7 +712,7 @@ sfall_funcX metarule functions
----
#### create_win
-`void sfall_func5("create_win", string winName, int x, int y, int width, int height)`
+`void sfall_func5("create_win", string winName, int x, int y, int width, int height)`\
`void sfall_func6("create_win", string winName, int x, int y, int width, int height, int flags)`
- Works just like vanilla `CreateWin` function, but creates a window with `MoveOnTop` flag if the flags argument is not specified, and allows to set additional flags for the created window
- `MoveOnTop` flag allows the created window to be placed on top of the game interface
@@ -741,8 +741,8 @@ sfall_funcX metarule functions
#### obj_under_cursor
`object sfall_func2("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.)
+- `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
@@ -783,13 +783,13 @@ sfall_funcX metarule functions
#### set_drugs_data
`void sfall_func3("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)
+- `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_unique_id
-`int sfall_func1("set_unique_id", object)`
+`int sfall_func1("set_unique_id", object)`\
`int sfall_func2("set_unique_id", 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
- Items with unique IDs will not stack with other items of the same type in the inventory
@@ -800,7 +800,7 @@ sfall_funcX metarule functions
----
#### draw_image | draw_image_scaled
-`void sfall_func5("draw_image", string/int artFile/artId, int frame, int x, int y, bool noTransparent)`
+`void sfall_func5("draw_image", string/int artFile/artId, int frame, int x, int y, bool noTransparent)`\
`void sfall_func6("draw_image_scaled", string/int pathFile/artId, int frame, int x, int y, int width, int height)`
- Displays the specified PCX or FRM image in the active window created by vanilla `CreateWin` or sfall's `create_win` script function
- `artFile/artId`: path to the PCX/FRM file (e.g. `art\\inven\\5mmap.frm`), or its FRM ID number (e.g. `0x7000026`, see specification of the FID format)
@@ -815,16 +815,16 @@ sfall_funcX metarule functions
----
#### set_fake_perk_npc | set_fake_trait_npc | set_selectable_perk_npc | has_fake_perk_npc | has_fake_trait_npc
-`void sfall_func5("set_fake_perk_npc", object npc, string namePerk, int level, int image, string desc)`
-`void sfall_func5("set_fake_trait_npc", object npc, string nameTrait, int active, int image, string desc)`
-`void sfall_func5("set_selectable_perk_npc", object npc, string namePerk, int active, int image, string desc)`
-`int sfall_func2("has_fake_perk_npc", object npc, string namePerk)`
+`void sfall_func5("set_fake_perk_npc", object npc, string namePerk, int level, int image, string desc)`\
+`void sfall_func5("set_fake_trait_npc", object npc, string nameTrait, int active, int image, string desc)`\
+`void sfall_func5("set_selectable_perk_npc", object npc, string namePerk, int active, int image, string desc)`\
+`int sfall_func2("has_fake_perk_npc", object npc, string namePerk)`\
`int sfall_func2("has_fake_trait_npc", object npc, string nameTrait)`
- These functions are similar to `has_fake_perk`, `has_fake_trait`, `set_fake_perk`, `set_fake_trait`, `set_selectable_perk`, and `set_selectable_trait` functions, but apply to the specified party member NPC (including `dude_obj`)
----
#### add_extra_msg_file
-`int sfall_func1("add_extra_msg_file", string fileName)`
+`int sfall_func1("add_extra_msg_file", string fileName)`\
`int sfall_func2("add_extra_msg_file", string fileName, int fileNumber)`
- Loads the custom message file, and returns the file ID number assigned to it in range from `0x3000` to `0x3FFF` for the `message_str_game` function to get messages from the file
- `fileName`: the name of the custom message file (including the **.msg** extension) in the `text\\game\` directory
@@ -859,7 +859,7 @@ sfall_funcX metarule functions
----
#### remove_timer_event
-`void sfall_func0("remove_timer_event")`
+`void sfall_func0("remove_timer_event")`\
`void sfall_func1("remove_timer_event", int fixedParam)`
- Clears all set timer events for the current global script
- `fixedParam`: removes all timer events with the specified value for the current global script
@@ -871,14 +871,14 @@ sfall_funcX metarule functions
----
#### hide_window
-`void sfall_func0("hide_window")`
+`void sfall_func0("hide_window")`\
`void sfall_func1("hide_window", string winName)`
- Hides the specified or currently active (selected) script window
- `winName`: the window name, assigned to the window by the `CreateWin` or `create_win` function
----
#### show_window
-`void sfall_func0("show_window")`
+`void sfall_func0("show_window")`\
`void sfall_func1("show_window", string winName)`
- Displays the specified hidden script window or the one previously hidden with the `sfall_func0("hide_window")` function
- `winName`: the window name, assigned to the window by the `CreateWin` or `create_win` function
@@ -899,7 +899,7 @@ sfall_funcX metarule functions
----
#### string_compare
-`bool sfall_func2("string_compare", string str1, string str2)`
+`bool sfall_func2("string_compare", string str1, string str2)`\
`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
@@ -912,7 +912,7 @@ sfall_funcX metarule functions
----
#### objects_in_radius
-`array sfall_func3("objects_in_radius", int tile, int radius, int elevation)`
+`array sfall_func3("objects_in_radius", int tile, int radius, int elevation)`\
`array sfall_func4("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
@@ -938,14 +938,14 @@ sfall_funcX metarule functions
----
#### get_window_attribute
-`int sfall_func1("get_window_attribute", int winType)`
+`int sfall_func1("get_window_attribute", int winType)`\
`int sfall_func2("get_window_attribute", int winType, int attrType)`
- Returns the attribute of the specified interface window by the `attrType` argument
- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**)
-- `attrType:`
- 0 - checks and returns a value of 1 if the specified interface window is created by the game (same as without the argument)
- 1 - X position, 2 - Y position (relative to the top-left corner of the game screen)
- 3 - interface width size, 4 - interface height size
+- `attrType:`\
+ 0 - checks and returns a value of 1 if the specified interface window is created by the game (same as without the argument)\
+ 1 - X position, 2 - Y position (relative to the top-left corner of the game screen)\
+ 3 - interface width size, 4 - interface height size\
-1 - returns an associative array of keys (left, top, right, bottom) and values that define the position of the window rectangle (use standard syntax to access array values, e.g. `win.top`, `win.bottom`)
- Returns -1 if the specified attribute cannot be obtained
@@ -968,17 +968,17 @@ sfall_funcX metarule functions
----
#### get_stat_min | get_stat_max
-`int sfall_func1("get_stat_min", int stat)`
-`int sfall_func1("get_stat_max", int stat)`
-`int sfall_func2("get_stat_min", int stat, bool who)`
+`int sfall_func1("get_stat_min", int stat)`\
+`int sfall_func1("get_stat_max", int stat)`\
+`int sfall_func2("get_stat_min", int stat, bool who)`\
`int sfall_func2("get_stat_max", int stat, bool who)`
- Returns the maximum or minimum set value of the specified stat (see `set_stat_min` and `set_stat_max` functions)
- `who`: 0 (false) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters
----
#### interface_art_draw
-`int sfall_func4("interface_art_draw", int winType, string/int artFile/artId, int x, int y)`
-`int sfall_func5("interface_art_draw", int winType, string/int artFile/artId, int x, int y, int frame)`
+`int sfall_func4("interface_art_draw", int winType, string/int artFile/artId, int x, int y)`\
+`int sfall_func5("interface_art_draw", int winType, string/int artFile/artId, int x, int y, int frame)`\
`int sfall_func6("interface_art_draw", int winType, string/int artFile/artId, int x, int y, int frame, array param)`
- Draws the specified PCX or FRM image in the game interface window, returns -1 on any error
- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**). This also takes the value of the flag `0x1000000` to prevent immediate redrawing of the interface window
@@ -987,22 +987,22 @@ sfall_funcX metarule functions
**Optional arguments:**
- `frame`: frame number, the first frame starts from zero
-- `param`: an array which specifies additional parameters, where:
- index 0 - sprite direction for multi-directional FRM
+- `param`: an array which specifies additional parameters, where:\
+ index 0 - sprite direction for multi-directional FRM\
index 1/index 2 - the new width/height to scale the image to. Pass -1 to use the original width/height
----
#### interface_print
-`int sfall_func5("interface_print", string text, int winType, int x, int y, int color)`
+`int sfall_func5("interface_print", string text, int winType, int x, int y, int color)`\
`int sfall_func6("interface_print", string text, int winType, int x, int y, int color, int width)`
- Displays the text in the specified interface window with the current font. Use vanilla `SetFont` function to set the font
- Returns the count of lines printed, or -1 on any error
- `text`: the text to be printed. Use the `\n` control character to move text to a new line (example: "Hello\nWorld!")
- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**)
- `x/y`: offset relative to the top-left corner of the window
-- `color`: the color index in the game palette. Pass 0 if the text color was previously set by vanilla `SetTextColor` function. It can also take additional flags (via `bwor`) for displaying text:
- `0x0010000` - adds a shadow to the text, the `textshadow` compiler constant
- `0x1000000` - prevents immediate redrawing of the interface window, the `textdirect` compiler constant (works the other way around)
+- `color`: the color index in the game palette. Pass 0 if the text color was previously set by vanilla `SetTextColor` function. It can also take additional flags (via `bwor`) for displaying text:\
+ `0x0010000` - adds a shadow to the text, the `textshadow` compiler constant\
+ `0x1000000` - prevents immediate redrawing of the interface window, the `textdirect` compiler constant (works the other way around)\
`0x2000000` - fills the background of the text with black color, the `textnofill` compiler constant (works the other way around)
**Optional argument:**
@@ -1012,25 +1012,25 @@ sfall_funcX metarule functions
#### combat_data
`mixed sfall_func0("combat_data")`
- Returns a pointer to the `C_ATTACK_*` data for the current combat attack turn (see defined constants in **define_extra.h**)
-- Can be used in conjunction with the `get_object_data` and `set_object_data` functions
+- 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);`
----
#### win_fill_color
-`int sfall_func0("win_fill_color")`
+`int sfall_func0("win_fill_color")`\
`int sfall_func5("win_fill_color", int x, int y, int width, int height, int color)`
- Fills the rectangle area of the currently selected script window with the specified color, or clears the window with transparent color (use index 0 or call the function without arguments)
- `color`: the color index in the game palette (from 0 to 255)
----
#### interface_overlay
-`int sfall_func2("interface_overlay", int winType, int mode)`
+`int sfall_func2("interface_overlay", int winType, int mode)`\
`int sfall_func6("interface_overlay", int winType, 2, int x, int y, int width, int height)`
- Creates an additional drawing surface above the graphic layer of the specified interface window. All subsequent calls of `interface_art_draw` and `interface_print` functions will draw on it
- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**)
-- `mode`:
- 1 - creates a new overlay surface
- 2 - clears the overlay area or the specified rectangle defined by the x, y, width, height arguments
+- `mode`:\
+ 1 - creates a new overlay surface\
+ 2 - clears the overlay area or the specified rectangle defined by the x, y, width, height arguments\
0 - destroys the created overlay surface (frees up the memory allocated to the surface)
----
diff --git a/artifacts/scripting/sfall opcode list.md b/artifacts/scripting/sfall opcode list.md
index e39aa2b6..a18b34cc 100644
--- a/artifacts/scripting/sfall opcode list.md
+++ b/artifacts/scripting/sfall opcode list.md
@@ -1,368 +1,368 @@
_^ - These functions require AllowUnsafeScripting to be enabled in ddraw.ini_
-0x8156 - `int read_byte(int address)`
-0x8157 - `int read_short(int address)`
-0x8158 - `int read_int(int address)`
-0x8159 - `string read_string(int address)`
-
-^ 0x81cf - `void write_byte(int address, int value)`
-^ 0x81d0 - `void write_short(int address, int value)`
-^ 0x81d1 - `void write_int(int address, int value)`
-^ 0x821b - `void write_string(int address, string value)`
-
-^ 0x81d2 - `void call_offset_v0(int address)`
-^ 0x81d3 - `void call_offset_v1(int address, int arg1)`
-^ 0x81d4 - `void call_offset_v2(int address, int arg1, int arg2)`
-^ 0x81d5 - `void call_offset_v3(int address, int arg1, int arg2, int arg3)`
-^ 0x81d6 - `void call_offset_v4(int address, int arg1, int arg2, int arg3, int arg4)`
-^ 0x81d7 - `int call_offset_r0(int address)`
-^ 0x81d8 - `int call_offset_r1(int address, int arg1)`
-^ 0x81d9 - `int call_offset_r2(int address, int arg1, int arg2)`
-^ 0x81da - `int call_offset_r3(int address, int arg1, int arg2, int arg3)`
-^ 0x81db - `int call_offset_r4(int address, int arg1, int arg2, int arg3, int arg4)`
-
-0x815a - `void set_pc_base_stat(int StatID, int value)`
-0x815b - `void set_pc_extra_stat(int StatID, int value)`
-0x815c - `int get_pc_base_stat(int StatID)`
-0x815d - `int get_pc_extra_stat(int StatID)`
-
-0x815e - `void set_critter_base_stat(object, int StatID, int value)`
-0x815f - `void set_critter_extra_stat(object, int StatID, int value)`
-0x8160 - `int get_critter_base_stat(object, int StatID)`
-0x8161 - `int get_critter_extra_stat(object, int StatID)`
-0x8242 - `void set_critter_skill_points(int critter, int skill, int value)`
-0x8243 - `int get_critter_skill_points(int critter, int skill)`
-0x8244 - `void set_available_skill_points(int value)`
-0x8245 - `int get_available_skill_points()`
-0x8246 - `void mod_skill_points_per_level(int value)`
-
-0x81b4 - `void set_stat_max(int stat, int value)`
-0x81b5 - `void set_stat_min(int stat, int value)`
-0x81b7 - `void set_pc_stat_max(int stat, int value)`
-0x81b8 - `void set_pc_stat_min(int stat, int value)`
-0x81b9 - `void set_npc_stat_max(int stat, int value)`
-0x81ba - `void set_npc_stat_min(int stat, int value)`
-
-0x816b - `int input_funcs_available()`
-0x816c - `int key_pressed(int dxScancode)`
-0x8162 - `void tap_key(int dxScancode)`
-0x821c - `int get_mouse_x()`
-0x821d - `int get_mouse_y()`
-0x821e - `int get_mouse_buttons()`
-0x821f - `int get_window_under_mouse()`
-
-0x8163 - `int get_year()`
-
-0x8164 - `bool game_loaded()`
-
-0x8165 - `bool graphics_funcs_available()`
-0x8166 - `int load_shader(string path)`
-0x8167 - `void free_shader(int ID)`
-0x8168 - `void activate_shader(int ID)`
-0x8169 - `void deactivate_shader(int ID)`
-0x816d - `void set_shader_int(int ID, string param, int value)`
-0x816e - `void set_shader_float(int ID, string param, float value)`
-0x816f - `void set_shader_vector(int ID, string param, float f1, float f2, float f3, float f4)`
-0x81ad - `int get_shader_version()`
-0x81ae - `void set_shader_mode(int mode)`
-0x81b0 - `void force_graphics_refresh(bool enabled)`
-0x81b1 - `int get_shader_texture(int ID, int texture)`
-0x81b2 - `void set_shader_texture(int ID, string param, int texID)`
-
-0x816a - `void set_global_script_repeat(int frames)`
-0x819b - `void set_global_script_type(int type)`
-0x819c - `int available_global_script_types()`
-
-0x8170 - `bool in_world_map()`
-
-0x8171 - `void force_encounter(int map)`
-0x8229 - `void force_encounter_with_flags(int map, int flags)`
-0x822a - `void set_map_time_multi(float multi)`
-
-0x8172 - `void set_world_map_pos(int x, int y)`
-0x8173 - `int get_world_map_x_pos()`
-0x8174 - `int get_world_map_y_pos()`
-
-0x8175 - `void set_dm_model(string name)`
-0x8176 - `void set_df_model(string name)`
-0x8177 - `void set_movie_path(string filename, int movieid)`
-
-0x8178 - `void set_perk_image(int perkID, int value)`
-0x8179 - `void set_perk_ranks(int perkID, int value)`
-0x817a - `void set_perk_level(int perkID, int value)`
-0x817b - `void set_perk_stat(int perkID, int value)`
-0x817c - `void set_perk_stat_mag(int perkID, int value)`
-0x817d - `void set_perk_skill1(int perkID, int value)`
-0x817e - `void set_perk_skill1_mag(int perkID, int value)`
-0x817f - `void set_perk_type(int perkID, int value)`
-0x8180 - `void set_perk_skill2(int perkID, int value)`
-0x8181 - `void set_perk_skill2_mag(int perkID, int value)`
-0x8182 - `void set_perk_str(int perkID, int value)`
-0x8183 - `void set_perk_per(int perkID, int value)`
-0x8184 - `void set_perk_end(int perkID, int value)`
-0x8185 - `void set_perk_chr(int perkID, int value)`
-0x8196 - `void set_perk_int(int perkID, int value)`
-0x8187 - `void set_perk_agl(int perkID, int value)`
-0x8188 - `void set_perk_lck(int perkID, int value)`
-0x8189 - `void set_perk_name(int perkID, string value)`
-0x818a - `void set_perk_desc(int perkID, string value)`
-0x8247 - `void set_perk_freq(int value)`
-
-0x818b - `void set_pipboy_available(int available)`
-
-0x818c - `int get_kill_counter(int critterType)`
-0x818d - `void mod_kill_counter(int critterType, int amount)`
-
-0x818e - `int get_perk_owed()`
-0x818f - `void set_perk_owed(int value)`
-0x8190 - `int get_perk_available(int perk)`
-
-0x8191 - `int get_critter_current_ap(object critter)`
-0x8192 - `void set_critter_current_ap(object critter, int ap)`
-
-0x8193 - `int active_hand()`
-0x8194 - `void toggle_active_hand()`
-
-0x8195 - `void set_weapon_knockback(object weapon, int type, int/float value)`
-0x8196 - `void set_target_knockback(object critter, int type, int/float value)`
-0x8197 - `void set_attacker_knockback(object critter, int type, int/float value)`
-0x8198 - `void remove_weapon_knockback(object weapon)`
-0x8199 - `void remove_target_knockback(object critter)`
-0x819a - `void remove_attacker_knockback(object critter)`
-
-0x819d - `void set_sfall_global(string/int varname, int/float value)`
-0x819e - `int get_sfall_global_int(string/int varname)`
-0x819f - `float get_sfall_global_float(string/int varname)`
-0x822d - `int create_array(int element_count, int flags)`
-0x822e - `void set_array(int array, any element, any value)`
-0x822f - `any get_array(int array, any element)`
-0x8230 - `void free_array(int array)`
-0x8231 - `int len_array(int array)`
-0x8232 - `void resize_array(int array, int new_element_count)`
-0x8233 - `int temp_array(int element_count, int flags)`
-0x8234 - `void fix_array(int array)`
-0x8239 - `int scan_array(int array, int/float var)`
-0x8256 - `int array_key(int array, int index)`
-0x8257 - `int arrayexpr(any key, any value)`
-0x8254 - `void save_array(any key, int array)`
-0x8255 - `int load_array(any key)`
-
-0x81a0 - `void set_pickpocket_max(int percentage)`
-0x81a1 - `void set_hit_chance_max(int percentage)`
-0x81a2 - `void set_skill_max(int value)`
-0x81aa - `void set_xp_mod(int percentage)`
-0x81ab - `void set_perk_level_mod(int levels)`
-
-0x81c5 - `void set_critter_hit_chance_mod(object, int max, int mod)`
-0x81c6 - `void set_base_hit_chance_mod(int max, int mod)`
-0x81c7 - `void set_critter_skill_mod(object, int max)`
-0x81c8 - `void set_base_skill_mod(int max)`
-0x81c9 - `void set_critter_pickpocket_mod(object, int max, int mod)`
-0x81ca - `void set_base_pickpocket_mod(int max, int mod)`
-
-0x81a3 - `int eax_available()`
-0x81a4 - `void set_eax_environment(int environment)`
-
-0x81a5 - `void inc_npc_level(int pid/string name)`
-0x8241 - `int get_npc_level(int pid/string name)`
-
-0x81a6 - `int get_viewport_x()`
-0x81a7 - `int get_viewport_y()`
-0x81a8 - `void set_viewport_x(int view_x)`
-0x81a9 - `void set_viewport_y(int view_y)`
-
-0x81ac - `int get_ini_setting(string setting)`
-0x81eb - `string get_ini_string(string setting)`
-
-0x81af - `int get_game_mode()`
-
-0x81b3 - `int get_uptime()`
-
-0x81b6 - `void set_car_current_town(int town)`
-
-0x81bb - `void set_fake_perk(string name, int level, int image, string desc)`
-0x81bc - `void set_fake_trait(string name, int active, int image, string desc)`
-0x81bd - `void set_selectable_perk(string name, int active, int image, string desc)`
-0x81be - `void set_perkbox_title(string title)`
-0x81bf - `void hide_real_perks()`
-0x81c0 - `void show_real_perks()`
-0x81c1 - `int has_fake_perk(string name/int extraPerkID)`
-0x81c2 - `int has_fake_trait(string name)`
-0x81c3 - `void perk_add_mode(int type)`
-0x81c4 - `void clear_selectable_perks()`
-0x8225 - `void remove_trait(int traitID)`
-
-0x81cb - `void set_pyromaniac_mod(int bonus)`
-0x81cc - `void apply_heaveho_fix()`
-0x81cd - `void set_swiftlearner_mod(int bonus)`
-0x81ce - `void set_hp_per_level_mod(int mod)`
-
-0x81dc - `void show_iface_tag(int tag)`
-0x81dd - `void hide_iface_tag(int tag)`
-0x81de - `int is_iface_tag_active(int tag)`
-
-0x81df - `int get_bodypart_hit_modifier(int bodypart)`
-0x81e0 - `void set_bodypart_hit_modifier(int bodypart, int value)`
-
-0x81e1 - `void set_critical_table(int crittertype, int bodypart, int level, int valuetype, int value)`
-0x81e2 - `int get_critical_table(int crittertype, int bodypart, int level, int valuetype)`
-0x81e3 - `void reset_critical_table(int crittertype, int bodypart, int level, int valuetype)`
-
-0x81e4 - `int get_sfall_arg()`
-0x823c - `array get_sfall_args()`
-0x823d - `void set_sfall_arg(int argnum, int value)`
-0x81e5 - `void set_sfall_return(int value)`
-0x81ea - `int init_hook()`
-
-0x81e6 - `void set_unspent_ap_bonus(int multiplier)`
-0x81e7 - `int get_unspent_ap_bonus()`
-0x81e8 - `void set_unspent_ap_perk_bonus(int multiplier)`
-0x81e9 - `int get_unspent_ap_perk_bonus()`
-
-0x81ec - `float sqrt(float)`
-0x81ed - `int/float abs(int/float)`
-0x81ee - `float sin(float)`
-0x81ef - `float cos(float)`
-0x81f0 - `float tan(float)`
-0x81f1 - `float arctan(float x, float y)`
-0x8263 - `^` operator (exponentiation)
-0x8264 - `float log(float)`
-0x8265 - `float exponent(float)`
-0x8266 - `int ceil(float)`
-0x8267 - `int round(float)`
-
-0x81f2 - `void set_palette(string path)`
-
-0x81f3 - `void remove_script(object)`
-0x81f4 - `void set_script(object, int scriptid)`
-0x81f5 - `int get_script(object)`
-
-0x81f6 - `int nb_create_char()`
-
-0x81f7 - `int fs_create(string path, int size)`
-0x81f8 - `int fs_copy(string path, string source)`
-0x81f9 - `int fs_find(string path)`
-0x81fa - `void fs_write_byte(int id, int data)`
-0x81fb - `void fs_write_short(int id, int data)`
-0x81fc - `void fs_write_int(int id, int data)`
-0x81fd - `void fs_write_float(int id, int data)`
-0x81fe - `void fs_write_string(int id, string data)`
-0x8208 - `void fs_write_bstring(int id, string data)`
-0x8209 - `int fs_read_byte(int id)`
-0x820a - `int fs_read_short(int id)`
-0x820b - `int fs_read_int(int id)`
-0x820c - `float fs_read_float(int id)`
-0x81ff - `void fs_delete(int id)`
-0x8200 - `int fs_size(int id)`
-0x8201 - `int fs_pos(int id)`
-0x8202 - `void fs_seek(int id, int pos)`
-0x8203 - `void fs_resize(int id, int size)`
-
-0x8204 - `int get_proto_data(int pid, int offset)`
-0x8205 - `void set_proto_data(int pid, int offset, int value)`
-
-0x8206 - `void set_self(object)`
-0x8207 - `void register_hook(int hook)`
-
-0x820d - `int list_begin(int type)`
-0x820e - `int list_next(int listid)`
-0x820f - `void list_end(int listid)`
-0x8236 - `array list_as_array(int type)`
-
-0x8210 - `int sfall_ver_major()`
-0x8211 - `int sfall_ver_minor()`
-0x8212 - `int sfall_ver_build()`
-
-0x8213 - `void hero_select_win(int)`
-0x8214 - `void set_hero_race(int style)`
-0x8215 - `void set_hero_style(int style)`
-
-0x8216 - `void set_critter_burst_disable(object critter, int disable)`
-
-0x8217 - `int get_weapon_ammo_pid(object weapon)`
-0x8218 - `void set_weapon_ammo_pid(object weapon, int pid)`
-0x8219 - `int get_weapon_ammo_count(object weapon)`
-0x821a - `void set_weapon_ammo_count(object weapon, int count)`
-
-0x8220 - `int get_screen_width()`
-0x8221 - `int get_screen_height()`
-
-0x8222 - `void stop_game()`
-0x8223 - `void resume_game()`
-0x8224 - `void create_message_window(string message)`
-
-0x8226 - `int get_light_level()`
-
-0x8227 - `void refresh_pc_art()`
-
-0x8228 - `int get_attack_type()`
-
-0x822b - `int play_sfall_sound(string file, int mode)`
-0x822c - `void stop_sfall_sound(int soundID)`
-
-0x8235 - `array string_split(string string, string split)`
-0x8237 - `int atoi(string string)`
-0x8238 - `float atof(string string)`
-0x824e - `string substr(string string, int start, int length)`
-0x824f - `int strlen(string string)`
-0x8250 - `string sprintf(string format, any value)`
-0x8251 - `int charcode(string string)`
-0x8253 - `int typeof(any value)`
-
-0x823a - `int get_tile_fid(int tile)`
-
-0x823b - `int modified_ini()`
-
-0x823e - `void force_aimed_shots(int pid)`
-0x823f - `void disable_aimed_shots(int pid)`
-
-0x8240 - `void mark_movie_played(int id)`
-
-0x8248 - `object get_last_target(object critter)`
-0x8249 - `object get_last_attacker(object critter)`
-0x824a - `void block_combat(int enable)`
-
-0x824b - `int tile_under_cursor()`
-0x824c - `int gdialog_get_barter_mod()`
-0x824d - `void set_inven_ap_cost()`
-
-0x825c - `void reg_anim_combat_check(int enable)`
-0x825a - `void reg_anim_destroy(object object)`
-0x825b - `void reg_anim_animate_and_hide(object object, int animID, int delay)`
-0x825d - `void reg_anim_light(object object, int radius, int delay)`
-0x825e - `void reg_anim_change_fid(object object, int FID, int delay)`
-0x825f - `void reg_anim_take_out(object object, int holdFrameID, int delay)`
-0x8260 - `void reg_anim_turn_towards(object object, int tile/targetObj, int delay)`
-
-0x8261 - `int metarule2_explosions(object object)`
-
-0x8262 - `void register_hook_proc(int hook, procedure proc)`
-
-0x826b - `string message_str_game(int fileId, int messageId)`
-0x826c - `int sneak_success()`
-0x826d - `int tile_light(int elevation, int tileNum)`
-0x826e - `object obj_blocking_line(object objFrom, int tileTo, int blockingType)`
-0x826f - `object obj_blocking_tile(int tileNum, int elevation, int blockingType)`
-0x8270 - `array tile_get_objs(int tileNum, int elevation)`
-0x8271 - `array party_member_list(int includeHidden)`
-0x8272 - `array path_find_to(object objFrom, int tileTo, int blockingType)`
-0x8273 - `object create_spatial(int scriptID, int tile, int elevation, int radius)`
-0x8274 - `int art_exists(int artFID)`
-0x8275 - `int obj_is_carrying_obj(object invenObj, object itemObj)`
-
-0x8276 - `any sfall_func0(string funcName)`
-0x8277 - `any sfall_func1(string funcName, arg1)`
-0x8278 - `any sfall_func2(string funcName, arg1, arg2)`
-0x8279 - `any sfall_func3(string funcName, arg1, arg2, arg3)`
-0x827a - `any sfall_func4(string funcName, arg1, arg2, arg3, arg4)`
-0x827b - `any sfall_func5(string funcName, arg1, arg2, arg3, arg4, arg5)`
-0x827c - `any sfall_func6(string funcName, arg1, arg2, arg3, arg4, arg5, arg6)`
+0x8156 - `int read_byte(int address)`\
+0x8157 - `int read_short(int address)`\
+0x8158 - `int read_int(int address)`\
+0x8159 - `string read_string(int address)`
+
+^ 0x81cf - `void write_byte(int address, int value)`\
+^ 0x81d0 - `void write_short(int address, int value)`\
+^ 0x81d1 - `void write_int(int address, int value)`\
+^ 0x821b - `void write_string(int address, string value)`
+
+^ 0x81d2 - `void call_offset_v0(int address)`\
+^ 0x81d3 - `void call_offset_v1(int address, int arg1)`\
+^ 0x81d4 - `void call_offset_v2(int address, int arg1, int arg2)`\
+^ 0x81d5 - `void call_offset_v3(int address, int arg1, int arg2, int arg3)`\
+^ 0x81d6 - `void call_offset_v4(int address, int arg1, int arg2, int arg3, int arg4)`\
+^ 0x81d7 - `int call_offset_r0(int address)`\
+^ 0x81d8 - `int call_offset_r1(int address, int arg1)`\
+^ 0x81d9 - `int call_offset_r2(int address, int arg1, int arg2)`\
+^ 0x81da - `int call_offset_r3(int address, int arg1, int arg2, int arg3)`\
+^ 0x81db - `int call_offset_r4(int address, int arg1, int arg2, int arg3, int arg4)`
+
+0x815a - `void set_pc_base_stat(int StatID, int value)`\
+0x815b - `void set_pc_extra_stat(int StatID, int value)`\
+0x815c - `int get_pc_base_stat(int StatID)`\
+0x815d - `int get_pc_extra_stat(int StatID)`
+
+0x815e - `void set_critter_base_stat(object, int StatID, int value)`\
+0x815f - `void set_critter_extra_stat(object, int StatID, int value)`\
+0x8160 - `int get_critter_base_stat(object, int StatID)`\
+0x8161 - `int get_critter_extra_stat(object, int StatID)`\
+0x8242 - `void set_critter_skill_points(int critter, int skill, int value)`\
+0x8243 - `int get_critter_skill_points(int critter, int skill)`\
+0x8244 - `void set_available_skill_points(int value)`\
+0x8245 - `int get_available_skill_points()`\
+0x8246 - `void mod_skill_points_per_level(int value)`
+
+0x81b4 - `void set_stat_max(int stat, int value)`\
+0x81b5 - `void set_stat_min(int stat, int value)`\
+0x81b7 - `void set_pc_stat_max(int stat, int value)`\
+0x81b8 - `void set_pc_stat_min(int stat, int value)`\
+0x81b9 - `void set_npc_stat_max(int stat, int value)`\
+0x81ba - `void set_npc_stat_min(int stat, int value)`
+
+0x816b - `int input_funcs_available()`\
+0x816c - `int key_pressed(int dxScancode)`\
+0x8162 - `void tap_key(int dxScancode)`\
+0x821c - `int get_mouse_x()`\
+0x821d - `int get_mouse_y()`\
+0x821e - `int get_mouse_buttons()`\
+0x821f - `int get_window_under_mouse()`
+
+0x8163 - `int get_year()`
+
+0x8164 - `bool game_loaded()`
+
+0x8165 - `bool graphics_funcs_available()`\
+0x8166 - `int load_shader(string path)`\
+0x8167 - `void free_shader(int ID)`\
+0x8168 - `void activate_shader(int ID)`\
+0x8169 - `void deactivate_shader(int ID)`\
+0x816d - `void set_shader_int(int ID, string param, int value)`\
+0x816e - `void set_shader_float(int ID, string param, float value)`\
+0x816f - `void set_shader_vector(int ID, string param, float f1, float f2, float f3, float f4)`\
+0x81ad - `int get_shader_version()`\
+0x81ae - `void set_shader_mode(int mode)`\
+0x81b0 - `void force_graphics_refresh(bool enabled)`\
+0x81b1 - `int get_shader_texture(int ID, int texture)`\
+0x81b2 - `void set_shader_texture(int ID, string param, int texID)`
+
+0x816a - `void set_global_script_repeat(int frames)`\
+0x819b - `void set_global_script_type(int type)`\
+0x819c - `int available_global_script_types()`
+
+0x8170 - `bool in_world_map()`
+
+0x8171 - `void force_encounter(int map)`\
+0x8229 - `void force_encounter_with_flags(int map, int flags)`\
+0x822a - `void set_map_time_multi(float multi)`
+
+0x8172 - `void set_world_map_pos(int x, int y)`\
+0x8173 - `int get_world_map_x_pos()`\
+0x8174 - `int get_world_map_y_pos()`
+
+0x8175 - `void set_dm_model(string name)`\
+0x8176 - `void set_df_model(string name)`\
+0x8177 - `void set_movie_path(string filename, int movieid)`
+
+0x8178 - `void set_perk_image(int perkID, int value)`\
+0x8179 - `void set_perk_ranks(int perkID, int value)`\
+0x817a - `void set_perk_level(int perkID, int value)`\
+0x817b - `void set_perk_stat(int perkID, int value)`\
+0x817c - `void set_perk_stat_mag(int perkID, int value)`\
+0x817d - `void set_perk_skill1(int perkID, int value)`\
+0x817e - `void set_perk_skill1_mag(int perkID, int value)`\
+0x817f - `void set_perk_type(int perkID, int value)`\
+0x8180 - `void set_perk_skill2(int perkID, int value)`\
+0x8181 - `void set_perk_skill2_mag(int perkID, int value)`\
+0x8182 - `void set_perk_str(int perkID, int value)`\
+0x8183 - `void set_perk_per(int perkID, int value)`\
+0x8184 - `void set_perk_end(int perkID, int value)`\
+0x8185 - `void set_perk_chr(int perkID, int value)`\
+0x8196 - `void set_perk_int(int perkID, int value)`\
+0x8187 - `void set_perk_agl(int perkID, int value)`\
+0x8188 - `void set_perk_lck(int perkID, int value)`\
+0x8189 - `void set_perk_name(int perkID, string value)`\
+0x818a - `void set_perk_desc(int perkID, string value)`\
+0x8247 - `void set_perk_freq(int value)`
+
+0x818b - `void set_pipboy_available(int available)`
+
+0x818c - `int get_kill_counter(int critterType)`\
+0x818d - `void mod_kill_counter(int critterType, int amount)`
+
+0x818e - `int get_perk_owed()`\
+0x818f - `void set_perk_owed(int value)`\
+0x8190 - `int get_perk_available(int perk)`
+
+0x8191 - `int get_critter_current_ap(object critter)`\
+0x8192 - `void set_critter_current_ap(object critter, int ap)`
+
+0x8193 - `int active_hand()`\
+0x8194 - `void toggle_active_hand()`
+
+0x8195 - `void set_weapon_knockback(object weapon, int type, int/float value)`\
+0x8196 - `void set_target_knockback(object critter, int type, int/float value)`\
+0x8197 - `void set_attacker_knockback(object critter, int type, int/float value)`\
+0x8198 - `void remove_weapon_knockback(object weapon)`\
+0x8199 - `void remove_target_knockback(object critter)`\
+0x819a - `void remove_attacker_knockback(object critter)`
+
+0x819d - `void set_sfall_global(string/int varname, int/float value)`\
+0x819e - `int get_sfall_global_int(string/int varname)`\
+0x819f - `float get_sfall_global_float(string/int varname)`\
+0x822d - `int create_array(int element_count, int flags)`\
+0x822e - `void set_array(int array, any element, any value)`\
+0x822f - `any get_array(int array, any element)`\
+0x8230 - `void free_array(int array)`\
+0x8231 - `int len_array(int array)`\
+0x8232 - `void resize_array(int array, int new_element_count)`\
+0x8233 - `int temp_array(int element_count, int flags)`\
+0x8234 - `void fix_array(int array)`\
+0x8239 - `int scan_array(int array, int/float var)`\
+0x8256 - `int array_key(int array, int index)`\
+0x8257 - `int arrayexpr(any key, any value)`\
+0x8254 - `void save_array(any key, int array)`\
+0x8255 - `int load_array(any key)`
+
+0x81a0 - `void set_pickpocket_max(int percentage)`\
+0x81a1 - `void set_hit_chance_max(int percentage)`\
+0x81a2 - `void set_skill_max(int value)`\
+0x81aa - `void set_xp_mod(int percentage)`\
+0x81ab - `void set_perk_level_mod(int levels)`
+
+0x81c5 - `void set_critter_hit_chance_mod(object, int max, int mod)`\
+0x81c6 - `void set_base_hit_chance_mod(int max, int mod)`\
+0x81c7 - `void set_critter_skill_mod(object, int max)`\
+0x81c8 - `void set_base_skill_mod(int max)`\
+0x81c9 - `void set_critter_pickpocket_mod(object, int max, int mod)`\
+0x81ca - `void set_base_pickpocket_mod(int max, int mod)`
+
+0x81a3 - `int eax_available()`\
+0x81a4 - `void set_eax_environment(int environment)`
+
+0x81a5 - `void inc_npc_level(int pid/string name)`\
+0x8241 - `int get_npc_level(int pid/string name)`
+
+0x81a6 - `int get_viewport_x()`\
+0x81a7 - `int get_viewport_y()`\
+0x81a8 - `void set_viewport_x(int view_x)`\
+0x81a9 - `void set_viewport_y(int view_y)`
+
+0x81ac - `int get_ini_setting(string setting)`\
+0x81eb - `string get_ini_string(string setting)`
+
+0x81af - `int get_game_mode()`
+
+0x81b3 - `int get_uptime()`
+
+0x81b6 - `void set_car_current_town(int town)`
+
+0x81bb - `void set_fake_perk(string name, int level, int image, string desc)`\
+0x81bc - `void set_fake_trait(string name, int active, int image, string desc)`\
+0x81bd - `void set_selectable_perk(string name, int active, int image, string desc)`\
+0x81be - `void set_perkbox_title(string title)`\
+0x81bf - `void hide_real_perks()`\
+0x81c0 - `void show_real_perks()`\
+0x81c1 - `int has_fake_perk(string name/int extraPerkID)`\
+0x81c2 - `int has_fake_trait(string name)`\
+0x81c3 - `void perk_add_mode(int type)`\
+0x81c4 - `void clear_selectable_perks()`\
+0x8225 - `void remove_trait(int traitID)`
+
+0x81cb - `void set_pyromaniac_mod(int bonus)`\
+0x81cc - `void apply_heaveho_fix()`\
+0x81cd - `void set_swiftlearner_mod(int bonus)`\
+0x81ce - `void set_hp_per_level_mod(int mod)`
+
+0x81dc - `void show_iface_tag(int tag)`\
+0x81dd - `void hide_iface_tag(int tag)`\
+0x81de - `int is_iface_tag_active(int tag)`
+
+0x81df - `int get_bodypart_hit_modifier(int bodypart)`\
+0x81e0 - `void set_bodypart_hit_modifier(int bodypart, int value)`
+
+0x81e1 - `void set_critical_table(int crittertype, int bodypart, int level, int valuetype, int value)`\
+0x81e2 - `int get_critical_table(int crittertype, int bodypart, int level, int valuetype)`\
+0x81e3 - `void reset_critical_table(int crittertype, int bodypart, int level, int valuetype)`
+
+0x81e4 - `int get_sfall_arg()`\
+0x823c - `array get_sfall_args()`\
+0x823d - `void set_sfall_arg(int argnum, int value)`\
+0x81e5 - `void set_sfall_return(int value)`\
+0x81ea - `int init_hook()`
+
+0x81e6 - `void set_unspent_ap_bonus(int multiplier)`\
+0x81e7 - `int get_unspent_ap_bonus()`\
+0x81e8 - `void set_unspent_ap_perk_bonus(int multiplier)`\
+0x81e9 - `int get_unspent_ap_perk_bonus()`
+
+0x81ec - `float sqrt(float)`\
+0x81ed - `int/float abs(int/float)`\
+0x81ee - `float sin(float)`\
+0x81ef - `float cos(float)`\
+0x81f0 - `float tan(float)`\
+0x81f1 - `float arctan(float x, float y)`\
+0x8263 - `^` operator (exponentiation)\
+0x8264 - `float log(float)`\
+0x8265 - `float exponent(float)`\
+0x8266 - `int ceil(float)`\
+0x8267 - `int round(float)`
+
+0x81f2 - `void set_palette(string path)`
+
+0x81f3 - `void remove_script(object)`\
+0x81f4 - `void set_script(object, int scriptid)`\
+0x81f5 - `int get_script(object)`
+
+0x81f6 - `int nb_create_char()`
+
+0x81f7 - `int fs_create(string path, int size)`\
+0x81f8 - `int fs_copy(string path, string source)`\
+0x81f9 - `int fs_find(string path)`\
+0x81fa - `void fs_write_byte(int id, int data)`\
+0x81fb - `void fs_write_short(int id, int data)`\
+0x81fc - `void fs_write_int(int id, int data)`\
+0x81fd - `void fs_write_float(int id, int data)`\
+0x81fe - `void fs_write_string(int id, string data)`\
+0x8208 - `void fs_write_bstring(int id, string data)`\
+0x8209 - `int fs_read_byte(int id)`\
+0x820a - `int fs_read_short(int id)`\
+0x820b - `int fs_read_int(int id)`\
+0x820c - `float fs_read_float(int id)`\
+0x81ff - `void fs_delete(int id)`\
+0x8200 - `int fs_size(int id)`\
+0x8201 - `int fs_pos(int id)`\
+0x8202 - `void fs_seek(int id, int pos)`\
+0x8203 - `void fs_resize(int id, int size)`
+
+0x8204 - `int get_proto_data(int pid, int offset)`\
+0x8205 - `void set_proto_data(int pid, int offset, int value)`
+
+0x8206 - `void set_self(object)`\
+0x8207 - `void register_hook(int hook)`
+
+0x820d - `int list_begin(int type)`\
+0x820e - `int list_next(int listid)`\
+0x820f - `void list_end(int listid)`\
+0x8236 - `array list_as_array(int type)`
+
+0x8210 - `int sfall_ver_major()`\
+0x8211 - `int sfall_ver_minor()`\
+0x8212 - `int sfall_ver_build()`
+
+0x8213 - `void hero_select_win(int)`\
+0x8214 - `void set_hero_race(int style)`\
+0x8215 - `void set_hero_style(int style)`
+
+0x8216 - `void set_critter_burst_disable(object critter, int disable)`
+
+0x8217 - `int get_weapon_ammo_pid(object weapon)`\
+0x8218 - `void set_weapon_ammo_pid(object weapon, int pid)`\
+0x8219 - `int get_weapon_ammo_count(object weapon)`\
+0x821a - `void set_weapon_ammo_count(object weapon, int count)`
+
+0x8220 - `int get_screen_width()`\
+0x8221 - `int get_screen_height()`
+
+0x8222 - `void stop_game()`\
+0x8223 - `void resume_game()`\
+0x8224 - `void create_message_window(string message)`
+
+0x8226 - `int get_light_level()`
+
+0x8227 - `void refresh_pc_art()`
+
+0x8228 - `int get_attack_type()`
+
+0x822b - `int play_sfall_sound(string file, int mode)`\
+0x822c - `void stop_sfall_sound(int soundID)`
+
+0x8235 - `array string_split(string string, string split)`\
+0x8237 - `int atoi(string string)`\
+0x8238 - `float atof(string string)`\
+0x824e - `string substr(string string, int start, int length)`\
+0x824f - `int strlen(string string)`\
+0x8250 - `string sprintf(string format, any value)`\
+0x8251 - `int charcode(string string)`\
+0x8253 - `int typeof(any value)`
+
+0x823a - `int get_tile_fid(int tile)`
+
+0x823b - `int modified_ini()`
+
+0x823e - `void force_aimed_shots(int pid)`\
+0x823f - `void disable_aimed_shots(int pid)`
+
+0x8240 - `void mark_movie_played(int id)`
+
+0x8248 - `object get_last_target(object critter)`\
+0x8249 - `object get_last_attacker(object critter)`\
+0x824a - `void block_combat(int enable)`
+
+0x824b - `int tile_under_cursor()`\
+0x824c - `int gdialog_get_barter_mod()`\
+0x824d - `void set_inven_ap_cost()`
+
+0x825c - `void reg_anim_combat_check(int enable)`\
+0x825a - `void reg_anim_destroy(object object)`\
+0x825b - `void reg_anim_animate_and_hide(object object, int animID, int delay)`\
+0x825d - `void reg_anim_light(object object, int radius, int delay)`\
+0x825e - `void reg_anim_change_fid(object object, int FID, int delay)`\
+0x825f - `void reg_anim_take_out(object object, int holdFrameID, int delay)`\
+0x8260 - `void reg_anim_turn_towards(object object, int tile/targetObj, int delay)`
+
+0x8261 - `int metarule2_explosions(object object)`
+
+0x8262 - `void register_hook_proc(int hook, procedure proc)`
+
+0x826b - `string message_str_game(int fileId, int messageId)`\
+0x826c - `int sneak_success()`\
+0x826d - `int tile_light(int elevation, int tileNum)`\
+0x826e - `object obj_blocking_line(object objFrom, int tileTo, int blockingType)`\
+0x826f - `object obj_blocking_tile(int tileNum, int elevation, int blockingType)`\
+0x8270 - `array tile_get_objs(int tileNum, int elevation)`\
+0x8271 - `array party_member_list(int includeHidden)`\
+0x8272 - `array path_find_to(object objFrom, int tileTo, int blockingType)`\
+0x8273 - `object create_spatial(int scriptID, int tile, int elevation, int radius)`\
+0x8274 - `int art_exists(int artFID)`\
+0x8275 - `int obj_is_carrying_obj(object invenObj, object itemObj)`
+
+0x8276 - `any sfall_func0(string funcName)`\
+0x8277 - `any sfall_func1(string funcName, arg1)`\
+0x8278 - `any sfall_func2(string funcName, arg1, arg2)`\
+0x8279 - `any sfall_func3(string funcName, arg1, arg2, arg3)`\
+0x827a - `any sfall_func4(string funcName, arg1, arg2, arg3, arg4)`\
+0x827b - `any sfall_func5(string funcName, arg1, arg2, arg3, arg4, arg5)`\
+0x827c - `any sfall_func6(string funcName, arg1, arg2, arg3, arg4, arg5, arg6)`
-0x827d - `void register_hook_proc_spec(int hook, procedure proc)`
-0x827e - `void reg_anim_callback(procedure proc)`
+0x827d - `void register_hook_proc_spec(int hook, procedure proc)`\
+0x827e - `void reg_anim_callback(procedure proc)`
-0x827f - `div` operator (unsigned integer division)
+0x827f - `div` operator (unsigned integer division)
-0x8280 - `any sfall_func7(string funcName, arg1, arg2, arg3, arg4, arg5, arg6, arg7)`
-0x8281 - `any sfall_func8(string funcName, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)`
+0x8280 - `any sfall_func7(string funcName, arg1, arg2, arg3, arg4, arg5, arg6, arg7)`\
+0x8281 - `any sfall_func8(string funcName, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)`\