Added markdown version of function notes and opcode list

This commit is contained in:
NovaRain
2021-05-28 21:38:10 +08:00
parent 09ab715687
commit 1a40aceea3
7 changed files with 1522 additions and 56 deletions
+25
View File
@@ -0,0 +1,25 @@
This folder contains documentation about sfall scripting extensions.
headers\ - folder contains sfall headers that you should #include in your scripts
sfall.h - main sfall header, always include it
define_extra.h - some additional preprocessor constants for vanilla engine stuff (proto offsets, etc.)
define_lite.h - a lite version of official define.h
command_lite.h - a lite version of official command.h
dik.h - DX scancodes constants for use with key_pressed function and HOOK_KEYPRESS
lib.arrays.h - procedures that will help you use arrays in their full:
- use them as stacks, sets
- easily compare, copy, slice, cut, add arrays
- display array contents (for debugging)
- save/load two-dimensional arrays to savegame in one command (e.g. arrays of objects)
lib.inven.h - fallout items manipulation functions
lib.math.h - a few simple functions for calculations
lib.strings.h - search in strings, join, repeat, etc.
lib.misc.h - misc stuff
sfall function notes.md - incomplete reference for new opcodes
sfall opcode list.md - list of all sfall opcodes (w/o descriptions)
hookscripts.md - detailed manual for using hook scripts to modify engine behavior
arrays.md - manual for sfall arrays
If you are/will be using sfall Script Editor, don't forget to check out new compiler documentation in **.\compiler\sslc_readme.txt**.
There are numerious new syntax features and extensions to SSL (Star-Trek Scripting language).
+3 -3
View File
@@ -4,6 +4,7 @@ This folder contains documentation about sfall scripting extensions.
sfall.h - main sfall header, always include it sfall.h - main sfall header, always include it
define_extra.h - some additional preprocessor constants for vanilla engine stuff (proto offsets, etc.) define_extra.h - some additional preprocessor constants for vanilla engine stuff (proto offsets, etc.)
define_lite.h - a lite version of official define.h define_lite.h - a lite version of official define.h
command_lite.h - a lite version of official command.h
dik.h - DX scancodes constants for use with key_pressed function and HOOK_KEYPRESS dik.h - DX scancodes constants for use with key_pressed function and HOOK_KEYPRESS
lib.arrays.h - procedures that will help you use arrays in their full: lib.arrays.h - procedures that will help you use arrays in their full:
- use them as stacks, sets - use them as stacks, sets
@@ -20,6 +21,5 @@ This folder contains documentation about sfall scripting extensions.
hookscripts.txt - detailed manual for using hook scripts to modify engine behavior hookscripts.txt - detailed manual for using hook scripts to modify engine behavior
arrays.txt - manual for sfall arrays arrays.txt - manual for sfall arrays
If you are/will be using sfall Script Editor, don't forget to check out new compiler documentation in ScriptEditor\docs\sslc_readme.txt, If you are/will be using sfall Script Editor, don't forget to check out new compiler documentation in .\compiler\sslc_readme.txt.
there are numerious new syntax features and extensions to SSL (Star-Trek Scripting language). There are numerious new syntax features and extensions to SSL (Star-Trek Scripting language).
+2 -2
View File
@@ -9,7 +9,7 @@ Arrays can be extremely useful for some more advanced scripting, in conjunction
*** ***
### ARRAYS CONCEPT ### ARRAYS CONCEPT
Arrays are created and manipulated with the 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/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 are created and manipulated with the 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 `int`, `float` and `string` 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.
*You must remember to free any arrays you create with `create_array` when you are done with them, or you will leak memory.* *You must remember to free any arrays you create with `create_array` when you are done with them, or you will leak memory.*
@@ -238,7 +238,7 @@ ___
For those who used arrays in their mods before sfall 3.4: 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. * 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. 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.
+54 -24
View File
@@ -1,5 +1,5 @@
------------------------------------- -------------------------------------
----------- WHAT IS THIS? ----------- ----------- HOOK SCRIPTS ------------
------------------------------------- -------------------------------------
Hook scripts are specially named scripts that are run by sfall at specific points to allow mods to override normally hardcoded behaviour in a more flexible way than sfall's normal ini configuration. Hook scripts are specially named scripts that are run by sfall at specific points to allow mods to override normally hardcoded behaviour in a more flexible way than sfall's normal ini configuration.
@@ -22,6 +22,7 @@ procedure start begin
end end
end end
-------------------------------------------
There are script functions available, specific to hook scripts: There are script functions available, specific to hook scripts:
@@ -97,7 +98,7 @@ HOOK_AFTERHITROLL (hs_afterhitroll.int)
Runs after Fallout has decided if an attack will hit or miss Runs after Fallout has decided if an attack will hit or miss
int arg0 - If the attack will hit. (0 - critical miss, 1 - miss, 2 - hit, 3 - critical hit) int arg0 - If the attack will hit: 0 - critical miss, 1 - miss, 2 - hit, 3 - critical hit
Critter arg1 - The attacker Critter arg1 - The attacker
Critter arg2 - The target of the attack Critter arg2 - The target of the attack
int arg3 - The bodypart int arg3 - The bodypart
@@ -113,7 +114,7 @@ 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. 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. 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(). 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.
Critter arg0 - The critter performing the action Critter arg0 - The critter performing the action
int arg1 - Attack Type (see ATKTYPE_* constants) int arg1 - Attack Type (see ATKTYPE_* constants)
@@ -127,7 +128,7 @@ int ret0 - The new AP cost
HOOK_DEATHANIM1 (hs_deathanim1.int) HOOK_DEATHANIM1 (hs_deathanim1.int)
Runs before Fallout tries to calculate the death animation. Lets you switch out which weapon Fallout sees Runs before Fallout tries to calculate the death animation. Lets you switch out which weapon Fallout sees.
Does not run for critters in the knockdown/out state. Does not run for critters in the knockdown/out state.
int arg0 - The pid of the weapon performing the attack. (May be -1 if the attack is unarmed) int arg0 - The pid of the weapon performing the attack. (May be -1 if the attack is unarmed)
@@ -142,7 +143,7 @@ int ret0 - The pid of an object to override the attacking weapon with
HOOK_DEATHANIM2 (hs_deathanim2.int) 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 hs_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. 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. Does not run for critters in the knockdown/out state.
@@ -199,7 +200,7 @@ Runs when the AI is trying to pick a target in combat. Fallout first chooses a l
This hook replaces that sorting function, allowing you to sort the targets in some arbitrary way. 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. The return values can include critters that weren't in the list of possible targets, but the additional targets may still be discarded later on in the combat turn if they are out of the attackers perception or the chance of a successful hit is too low. The list of possible targets often includes duplicated entries, but this is fixed in sfall 4.2.3/3.8.23.
Use sfall_return to give the 4 targets, in order of preference. If you want to specify less than 4 targets, fill in the extra spaces with 0's or pass -1 to skip the return value. Use set_sfall_return to give the 4 targets, in order of preference. If you want to specify less than 4 targets, fill in the extra spaces with 0's or pass -1 to skip the return value.
NOTE: The engine can choose targets by the following criteria: NOTE: The engine can choose targets by the following criteria:
1) The nearest enemy to the attacker. 1) The nearest enemy to the attacker.
@@ -268,16 +269,16 @@ Obj arg4 - The destination object when the item is moved to another object,
HOOK_BARTERPRICE (hs_barterprice.int) HOOK_BARTERPRICE (hs_barterprice.int)
Runs whenever the value of goods being purchased is calculated Runs whenever the value of goods being purchased is calculated.
NOTE: the hook is executed twice when entering the barter screen or after transaction: the first time is for the player and the second time is for NPC NOTE: the hook is executed twice when entering the barter screen or after transaction: the first time is for the player and the second time is for NPC.
critter arg0 - the critter doing the bartering (either dude_obj or inven_dude) Critter arg0 - the critter doing the bartering (either dude_obj or inven_dude)
critter arg1 - the critter being bartered with Critter arg1 - the critter being bartered with
int arg2 - the default value of the goods int arg2 - the default value of the goods
critter arg3 - table of requested goods (being bought from NPC) Critter arg3 - table of requested goods (being bought from NPC)
int arg4 - the amount of actual caps in the barter stack (as opposed to goods) int arg4 - the amount of actual caps in the barter stack (as opposed to goods)
int arg5 - the value of all goods being traded before skill modifications int arg5 - the value of all goods being traded before skill modifications
critter arg6 - table of offered goods (being sold to NPC) Critter arg6 - table of offered goods (being sold to NPC)
int arg7 - the total cost of the goods offered by the player int arg7 - the total cost of the goods offered by the player
int arg8 - 1 if the "offers" button was pressed (not for a party member), 0 otherwise int arg8 - 1 if the "offers" button was pressed (not for a party member), 0 otherwise
int arg9 - 1 if trading with a party member, 0 otherwise int arg9 - 1 if trading with a party member, 0 otherwise
@@ -305,12 +306,12 @@ HOOK_HEXAIBLOCKING (hs_hexaiblocking.int)
HOOK_HEXSHOOTBLOCKING (hs_hexshootblocking.int) HOOK_HEXSHOOTBLOCKING (hs_hexshootblocking.int)
HOOK_HEXSIGHTBLOCKING (hs_hexsightblocking.int) HOOK_HEXSIGHTBLOCKING (hs_hexsightblocking.int)
Runs when checking to see if a hex blocks movement or shooting. (or ai-ing, presumably...) 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. NOTE: these hook scripts can become very CPU-intensive and you should avoid using them.
For this reason, they may be removed in future versions. For this reason, they 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 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 hs_movecost hook. If you want script to be called every time NPC moves by hex in combat, use HOOK_MOVECOST hook.
Critter arg0 - the critter doing the moving Critter arg0 - the critter doing the moving
int arg1 - the tile number being checked int arg1 - the tile number being checked
@@ -332,7 +333,7 @@ Critter arg3 - The critter doing the attacking
int arg4 - The type of attack int arg4 - The type of attack
int arg5 - non-zero if this is an attack using a melee weapon int arg5 - non-zero if this is an attack using a melee weapon
int ret0 - Either the damage to be used, if ret2 isn't given, or the new minimum damage if it is int ret0 - Either the damage to be used, if ret1 isn't given, or the new minimum damage if it is
int ret1 - The new maximum damage int ret1 - The new maximum damage
------------------------------------------- -------------------------------------------
@@ -341,7 +342,7 @@ HOOK_AMMOCOST (hs_ammocost.int)
Runs when calculating ammo cost for a weapon. Doesn't affect damage, only how much ammo is spent. 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. 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 arg4), set Misc.CheckWeaponAmmoCost=1 in ddraw.ini 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.
Item arg0 - The weapon Item arg0 - The weapon
int arg1 - Number of bullets in burst or 1 for single shots int arg1 - Number of bullets in burst or 1 for single shots
@@ -360,7 +361,7 @@ int ret0 - The new amount of ammo to be consumed, or ammo cost per round for
HOOK_KEYPRESS (hs_keypress.int) HOOK_KEYPRESS (hs_keypress.int)
Runs once every time when any key was pressed or released. Runs once every time when any key was pressed or released.
DX codes: (see dik.h header) DX codes: see dik.h header or https://kippykip.com/b3ddocs/commands/scancodes.htm
VK codes: http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx VK codes: http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx
NOTE: if you want to override a key, the new key DX scancode should be the same for both pressed and released events. NOTE: if you want to override a key, the new key DX scancode should be the same for both pressed and released events.
@@ -385,7 +386,7 @@ HOOK_USESKILL (hs_useskill.int)
Runs when using any skill on any object. Runs when using any skill on any object.
This is fired before the default handlers are called, which you can override. In this case you should write your own skill use handler entirely, or otherwise nothing will happen (this includes fade in/fade out, time lapsing and messages - all of this can be scripted; to get vanilla text messages - use message_str_game() along with sprintf()). This is fired before the default handlers are called, which you can override. In this case you should write your own skill use handler entirely, or otherwise nothing will happen (this includes fade in/fade out, time lapsing and messages - all of this can be scripted; to get vanilla text messages - use message_str_game along with sprintf).
Suggested use - override first aid/doctor skills to buff/nerf them, override steal skill to disallow observing NPCs inventories in some cases. Suggested use - override first aid/doctor skills to buff/nerf them, override steal skill to disallow observing NPCs inventories in some cases.
Doesn't seem to run when lock picking. Doesn't seem to run when lock picking.
@@ -403,7 +404,7 @@ HOOK_STEAL (hs_steal.int)
Runs when checking an attempt to steal or plant an item in other inventory using Steal skill. Runs when checking an attempt to steal or plant an item in other inventory using Steal skill.
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.). 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): display_msg(sprintf(mstr_skill(570 + (isSuccess != false) + arg4*2), obj_name(arg3))); Example message (vanilla behavior): display_msg(sprintf(mstr_skill(570 + (isSuccess != false) + arg3*2), obj_name(arg2)));
Critter arg0 - Thief Critter arg0 - Thief
Obj arg1 - The target Obj arg1 - The target
@@ -431,7 +432,10 @@ int arg3 - Type of hook:
3 - when AI determines whether it sees a potential target when selecting attack targets 3 - when AI determines whether it sees a potential target when selecting attack targets
0 - all other cases 0 - all other cases
int ret0 - overrides the returned result of the function: 0 - not in range (can't see), 1 - in range (will see if not blocked), 2 - forced detection (will see regardless, only used in obj_can_see_obj scripting function which is called by every critter in the game) int ret0 - overrides the returned result of the function:
0 - not in range (can't see)
1 - in range (will see if not blocked)
2 - forced detection (will see regardless, only used in obj_can_see_obj scripting function which is called by every critter in the game)
------------------------------------------- -------------------------------------------
@@ -445,8 +449,16 @@ What you can do:
- add AP costs for all inventory movement including reloading - add AP costs for all inventory movement including reloading
- apply or remove some special scripted effects depending on PC's armor - apply or remove some special scripted effects depending on PC's armor
int arg0 - Target slot (0 - main backpack, 1 - left hand, 2 - right hand, 3 - armor slot, 4 - weapon, when reloading it by dropping ammo, 5 - container, like bag/backpack, 6 - dropping on the ground, int arg0 - Target slot:
7 - picking up item, 8 - dropping item on the character portrait) 0 - main backpack
1 - left hand
2 - right hand
3 - armor slot
4 - weapon, when reloading it by dropping ammo
5 - container, like bag/backpack
6 - dropping on the ground
7 - picking up item
8 - dropping item on the character portrait
Item arg1 - Item being moved Item arg1 - Item being moved
Item arg2 - Item being replaced, weapon being reloaded, or container being filled (can be 0) Item arg2 - Item being replaced, weapon being reloaded, or container being filled (can be 0)
@@ -489,7 +501,11 @@ HOOK_COMBATTURN (hs_combatturn.int)
Runs before and after each turn in combat (for both PC and NPC). Runs before and after each turn in combat (for both PC and NPC).
int arg0 - event type: 1 - start of turn, 0 - normal end of turn, -1 - combat ends abruptly (by script or by pressing Enter during PC turn), -2 - combat ends normally (hook always runs at the end of combat) int arg0 - event type:
1 - start of turn
0 - normal end of turn
-1 - combat ends abruptly (by script or by pressing Enter during PC turn)
-2 - combat ends normally (hook always runs at the end of combat)
Critter arg1 - critter doing the turn Critter arg1 - critter doing the turn
bool arg2 - 1 at the start/end of the player's turn after loading a game saved in combat mode, 0 otherwise bool arg2 - 1 at the start/end of the player's turn after loading a game saved in combat mode, 0 otherwise
@@ -699,7 +715,7 @@ int arg1 - the map ID that the encounter will load (see MAPS.h or Maps.txt)
int arg2 - 1 when the encounter occurs is a special encounter, 0 otherwise int arg2 - 1 when the encounter occurs is a special encounter, 0 otherwise
int ret0 - overrides the map ID, or pass -1 for event type 0 to cancel the encounter and continue traveling int ret0 - overrides the map ID, or pass -1 for event type 0 to cancel the encounter and continue traveling
int ret1 - pass 1 to cancel the encounter and load the specified map from the ret1 (only for event type 0) int ret1 - pass 1 to cancel the encounter and load the specified map from the ret0 (only for event type 0)
------------------------------------------- -------------------------------------------
@@ -763,3 +779,17 @@ Item arg3 - the second choice of weapon
Critter arg4 - the target of the critter (can be 0) Critter arg4 - the target of the critter (can be 0)
Item ret0 - overrides the chosen best weapon Item ret0 - overrides the chosen best weapon
-------------------------------------------
HOOK_CANUSEWEAPON (hs_canuseweapon.int)
Run when the AI checks whether it can use a weapon.
This mostly happens when NPCs try to find weapons in their inventory or on the map.
Critter arg0 - the critter doing the check
Item arg1 - the weapon being checked
int arg2 - attack type (see ATKTYPE_* constants)
int arg3 - original result of engine function: 1 - can use, 0 - can't use
int ret0 - overrides the result of engine function. Any non-zero value allows using the weapon
File diff suppressed because it is too large Load Diff
+368
View File
@@ -0,0 +1,368 @@
_^ - These functions require AllowUnsafeScripting to be enabled in ddraw.ini_
0x8156 - `int read_byte(int address)`<br>
0x8157 - `int read_short(int address)`<br>
0x8158 - `int read_int(int address)`<br>
0x8159 - `string read_string(int address)`<br>
^ 0x81cf - `void write_byte(int address, int value)`<br>
^ 0x81d0 - `void write_short(int address, int value)`<br>
^ 0x81d1 - `void write_int(int address, int value)`<br>
^ 0x821b - `void write_string(int address, string value)`<br>
^ 0x81d2 - `void call_offset_v0(int address)`<br>
^ 0x81d3 - `void call_offset_v1(int address, int arg1)`<br>
^ 0x81d4 - `void call_offset_v2(int address, int arg1, int arg2)`<br>
^ 0x81d5 - `void call_offset_v3(int address, int arg1, int arg2, int arg3)`<br>
^ 0x81d6 - `void call_offset_v4(int address, int arg1, int arg2, int arg3, int arg4)`<br>
^ 0x81d7 - `int call_offset_r0(int address)`<br>
^ 0x81d8 - `int call_offset_r1(int address, int arg1)`<br>
^ 0x81d9 - `int call_offset_r2(int address, int arg1, int arg2)`<br>
^ 0x81da - `int call_offset_r3(int address, int arg1, int arg2, int arg3)`<br>
^ 0x81db - `int call_offset_r4(int address, int arg1, int arg2, int arg3, int arg4)`<br>
0x815a - `void set_pc_base_stat(int StatID, int value)`<br>
0x815b - `void set_pc_extra_stat(int StatID, int value)`<br>
0x815c - `int get_pc_base_stat(int StatID)`<br>
0x815d - `int get_pc_extra_stat(int StatID)`<br>
0x815e - `void set_critter_base_stat(object, int StatID, int value)`<br>
0x815f - `void set_critter_extra_stat(object, int StatID, int value)`<br>
0x8160 - `int get_critter_base_stat(object, int StatID)`<br>
0x8161 - `int get_critter_extra_stat(object, int StatID)`<br>
0x8242 - `void set_critter_skill_points(int critter, int skill, int value)`<br>
0x8243 - `int get_critter_skill_points(int critter, int skill)`<br>
0x8244 - `void set_available_skill_points(int value)`<br>
0x8245 - `int get_available_skill_points()`<br>
0x8246 - `void mod_skill_points_per_level(int value)`<br>
0x81b4 - `void set_stat_max(int stat, int value)`<br>
0x81b5 - `void set_stat_min(int stat, int value)`<br>
0x81b7 - `void set_pc_stat_max(int stat, int value)`<br>
0x81b8 - `void set_pc_stat_min(int stat, int value)`<br>
0x81b9 - `void set_npc_stat_max(int stat, int value)`<br>
0x81ba - `void set_npc_stat_min(int stat, int value)`<br>
0x816b - `int input_funcs_available()`<br>
0x816c - `int key_pressed(int dxScancode)`<br>
0x8162 - `void tap_key(int dxScancode)`<br>
0x821c - `int get_mouse_x()`<br>
0x821d - `int get_mouse_y()`<br>
0x821e - `int get_mouse_buttons()`<br>
0x821f - `int get_window_under_mouse()`<br>
0x8163 - `int get_year()`<br>
0x8164 - `bool game_loaded()`<br>
0x8165 - `bool graphics_funcs_available()`<br>
0x8166 - `int load_shader(string path)`<br>
0x8167 - `void free_shader(int ID)`<br>
0x8168 - `void activate_shader(int ID)`<br>
0x8169 - `void deactivate_shader(int ID)`<br>
0x816d - `void set_shader_int(int ID, string param, int value)`<br>
0x816e - `void set_shader_float(int ID, string param, float value)`<br>
0x816f - `void set_shader_vector(int ID, string param, float f1, float f2, float f3, float f4)`<br>
0x81ad - `int get_shader_version()`<br>
0x81ae - `void set_shader_mode(int mode)`<br>
0x81b0 - `void force_graphics_refresh(bool enabled)`<br>
0x81b1 - `int get_shader_texture(int ID, int texture)`<br>
0x81b2 - `void set_shader_texture(int ID, string param, int texID)`<br>
0x816a - `void set_global_script_repeat(int frames)`<br>
0x819b - `void set_global_script_type(int type)`<br>
0x819c - `int available_global_script_types()`<br>
0x8170 - `bool in_world_map()`<br>
0x8171 - `void force_encounter(int map)`<br>
0x8229 - `void force_encounter_with_flags(int map, int flags)`<br>
0x822a - `void set_map_time_multi(float multi)`<br>
0x8172 - `void set_world_map_pos(int x, int y)`<br>
0x8173 - `int get_world_map_x_pos()`<br>
0x8174 - `int get_world_map_y_pos()`<br>
0x8175 - `void set_dm_model(string name)`<br>
0x8176 - `void set_df_model(string name)`<br>
0x8177 - `void set_movie_path(string filename, int movieid)`<br>
0x8178 - `void set_perk_image(int perkID, int value)`<br>
0x8179 - `void set_perk_ranks(int perkID, int value)`<br>
0x817a - `void set_perk_level(int perkID, int value)`<br>
0x817b - `void set_perk_stat(int perkID, int value)`<br>
0x817c - `void set_perk_stat_mag(int perkID, int value)`<br>
0x817d - `void set_perk_skill1(int perkID, int value)`<br>
0x817e - `void set_perk_skill1_mag(int perkID, int value)`<br>
0x817f - `void set_perk_type(int perkID, int value)`<br>
0x8180 - `void set_perk_skill2(int perkID, int value)`<br>
0x8181 - `void set_perk_skill2_mag(int perkID, int value)`<br>
0x8182 - `void set_perk_str(int perkID, int value)`<br>
0x8183 - `void set_perk_per(int perkID, int value)`<br>
0x8184 - `void set_perk_end(int perkID, int value)`<br>
0x8185 - `void set_perk_chr(int perkID, int value)`<br>
0x8196 - `void set_perk_int(int perkID, int value)`<br>
0x8187 - `void set_perk_agl(int perkID, int value)`<br>
0x8188 - `void set_perk_lck(int perkID, int value)`<br>
0x8189 - `void set_perk_name(int perkID, string value)`<br>
0x818a - `void set_perk_desc(int perkID, string value)`<br>
0x8247 - `void set_perk_freq(int value)`<br>
0x818b - `void set_pipboy_available(int available)`<br>
0x818c - `int get_kill_counter(int critterType)`<br>
0x818d - `void mod_kill_counter(int critterType, int amount)`<br>
0x818e - `int get_perk_owed()`<br>
0x818f - `void set_perk_owed(int value)`<br>
0x8190 - `int get_perk_available(int perk)`<br>
0x8191 - `int get_critter_current_ap(object critter)`<br>
0x8192 - `void set_critter_current_ap(object critter, int ap)`<br>
0x8193 - `int active_hand()`<br>
0x8194 - `void toggle_active_hand()`<br>
0x8195 - `void set_weapon_knockback(object weapon, int type, int/float value)`<br>
0x8196 - `void set_target_knockback(object critter, int type, int/float value)`<br>
0x8197 - `void set_attacker_knockback(object critter, int type, int/float value)`<br>
0x8198 - `void remove_weapon_knockback(object weapon)`<br>
0x8199 - `void remove_target_knockback(object critter)`<br>
0x819a - `void remove_attacker_knockback(object critter)`<br>
0x819d - `void set_sfall_global(string/int varname, int/float value)`<br>
0x819e - `int get_sfall_global_int(string/int varname)`<br>
0x819f - `float get_sfall_global_float(string/int varname)`<br>
0x822d - `int create_array(int element_count, int flags)`<br>
0x822e - `void set_array(int array, any element, any value)`<br>
0x822f - `any get_array(int array, any element)`<br>
0x8230 - `void free_array(int array)`<br>
0x8231 - `int len_array(int array)`<br>
0x8232 - `void resize_array(int array, int new_element_count)`<br>
0x8233 - `int temp_array(int element_count, int flags)`<br>
0x8234 - `void fix_array(int array)`<br>
0x8239 - `int scan_array(int array, int/float var)`<br>
0x8256 - `int array_key(int array, int index)`<br>
0x8257 - `int arrayexpr(any key, any value)`<br>
0x8254 - `void save_array(any key, int array)`<br>
0x8255 - `int load_array(any key)`<br>
0x81a0 - `void set_pickpocket_max(int percentage)`<br>
0x81a1 - `void set_hit_chance_max(int percentage)`<br>
0x81a2 - `void set_skill_max(int value)`<br>
0x81aa - `void set_xp_mod(int percentage)`<br>
0x81ab - `void set_perk_level_mod(int levels)`<br>
0x81c5 - `void set_critter_hit_chance_mod(object, int max, int mod)`<br>
0x81c6 - `void set_base_hit_chance_mod(int max, int mod)`<br>
0x81c7 - `void set_critter_skill_mod(object, int max)`<br>
0x81c8 - `void set_base_skill_mod(int max)`<br>
0x81c9 - `void set_critter_pickpocket_mod(object, int max, int mod)`<br>
0x81ca - `void set_base_pickpocket_mod(int max, int mod)`<br>
0x81a3 - `int eax_available()`<br>
0x81a4 - `void set_eax_environment(int environment)`<br>
0x81a5 - `void inc_npc_level(int pid/string name)`<br>
0x8241 - `int get_npc_level(int pid/string name)`<br>
0x81a6 - `int get_viewport_x()`<br>
0x81a7 - `int get_viewport_y()`<br>
0x81a8 - `void set_viewport_x(int view_x)`<br>
0x81a9 - `void set_viewport_y(int view_y)`<br>
0x81ac - `int get_ini_setting(string setting)`<br>
0x81eb - `string get_ini_string(string setting)`<br>
0x81af - `int get_game_mode()`<br>
0x81b3 - `int get_uptime()`<br>
0x81b6 - `void set_car_current_town(int town)`<br>
0x81bb - `void set_fake_perk(string name, int level, int image, string desc)`<br>
0x81bc - `void set_fake_trait(string name, int active, int image, string desc)`<br>
0x81bd - `void set_selectable_perk(string name, int active, int image, string desc)`<br>
0x81be - `void set_perkbox_title(string title)`<br>
0x81bf - `void hide_real_perks()`<br>
0x81c0 - `void show_real_perks()`<br>
0x81c1 - `int has_fake_perk(string name/int extraPerkID)`<br>
0x81c2 - `int has_fake_trait(string name)`<br>
0x81c3 - `void perk_add_mode(int type)`<br>
0x81c4 - `void clear_selectable_perks()`<br>
0x8225 - `void remove_trait(int traitID)`<br>
0x81cb - `void set_pyromaniac_mod(int bonus)`<br>
0x81cc - `void apply_heaveho_fix()`<br>
0x81cd - `void set_swiftlearner_mod(int bonus)`<br>
0x81ce - `void set_hp_per_level_mod(int mod)`<br>
0x81dc - `void show_iface_tag(int tag)`<br>
0x81dd - `void hide_iface_tag(int tag)`<br>
0x81de - `int is_iface_tag_active(int tag)`<br>
0x81df - `int get_bodypart_hit_modifier(int bodypart)`<br>
0x81e0 - `void set_bodypart_hit_modifier(int bodypart, int value)`<br>
0x81e1 - `void set_critical_table(int crittertype, int bodypart, int level, int valuetype, int value)`<br>
0x81e2 - `int get_critical_table(int crittertype, int bodypart, int level, int valuetype)`<br>
0x81e3 - `void reset_critical_table(int crittertype, int bodypart, int level, int valuetype)`<br>
0x81e4 - `int get_sfall_arg()`<br>
0x823c - `array get_sfall_args()`<br>
0x823d - `void set_sfall_arg(int argnum, int value)`<br>
0x81e5 - `void set_sfall_return(int value)`<br>
0x81ea - `int init_hook()`<br>
0x81e6 - `void set_unspent_ap_bonus(int multiplier)`<br>
0x81e7 - `int get_unspent_ap_bonus()`<br>
0x81e8 - `void set_unspent_ap_perk_bonus(int multiplier)`<br>
0x81e9 - `int get_unspent_ap_perk_bonus()`<br>
0x81ec - `float sqrt(float)`<br>
0x81ed - `int/float abs(int/float)`<br>
0x81ee - `float sin(float)`<br>
0x81ef - `float cos(float)`<br>
0x81f0 - `float tan(float)`<br>
0x81f1 - `float arctan(float x, float y)`<br>
0x8263 - `^` operator (exponentiation)<br>
0x8264 - `float log(float)`<br>
0x8265 - `float exponent(float)`<br>
0x8266 - `int ceil(float)`<br>
0x8267 - `int round(float)`<br>
0x81f2 - `void set_palette(string path)`<br>
0x81f3 - `void remove_script(object)`<br>
0x81f4 - `void set_script(object, int scriptid)`<br>
0x81f5 - `int get_script(object)`<br>
0x81f6 - `int nb_create_char()`<br>
0x81f7 - `int fs_create(string path, int size)`<br>
0x81f8 - `int fs_copy(string path, string source)`<br>
0x81f9 - `int fs_find(string path)`<br>
0x81fa - `void fs_write_byte(int id, int data)`<br>
0x81fb - `void fs_write_short(int id, int data)`<br>
0x81fc - `void fs_write_int(int id, int data)`<br>
0x81fd - `void fs_write_float(int id, int data)`<br>
0x81fe - `void fs_write_string(int id, string data)`<br>
0x8208 - `void fs_write_bstring(int id, string data)`<br>
0x8209 - `int fs_read_byte(int id)`<br>
0x820a - `int fs_read_short(int id)`<br>
0x820b - `int fs_read_int(int id)`<br>
0x820c - `float fs_read_float(int id)`<br>
0x81ff - `void fs_delete(int id)`<br>
0x8200 - `int fs_size(int id)`<br>
0x8201 - `int fs_pos(int id)`<br>
0x8202 - `void fs_seek(int id, int pos)`<br>
0x8203 - `void fs_resize(int id, int size)`<br>
0x8204 - `int get_proto_data(int pid, int offset)`<br>
0x8205 - `void set_proto_data(int pid, int offset, int value)`<br>
0x8206 - `void set_self(object)`<br>
0x8207 - `void register_hook(int hook)`<br>
0x820d - `int list_begin(int type)`<br>
0x820e - `int list_next(int listid)`<br>
0x820f - `void list_end(int listid)`<br>
0x8236 - `array list_as_array(int type)`<br>
0x8210 - `int sfall_ver_major()`<br>
0x8211 - `int sfall_ver_minor()`<br>
0x8212 - `int sfall_ver_build()`<br>
0x8213 - `void hero_select_win(int)`<br>
0x8214 - `void set_hero_race(int style)`<br>
0x8215 - `void set_hero_style(int style)`<br>
0x8216 - `void set_critter_burst_disable(object critter, int disable)`<br>
0x8217 - `int get_weapon_ammo_pid(object weapon)`<br>
0x8218 - `void set_weapon_ammo_pid(object weapon, int pid)`<br>
0x8219 - `int get_weapon_ammo_count(object weapon)`<br>
0x821a - `void set_weapon_ammo_count(object weapon, int count)`<br>
0x8220 - `int get_screen_width()`<br>
0x8221 - `int get_screen_height()`<br>
0x8222 - `void stop_game()`<br>
0x8223 - `void resume_game()`<br>
0x8224 - `void create_message_window(string message)`<br>
0x8226 - `int get_light_level()`<br>
0x8227 - `void refresh_pc_art()`<br>
0x8228 - `int get_attack_type()`<br>
0x822b - `int play_sfall_sound(string file, int mode)`<br>
0x822c - `void stop_sfall_sound(int soundID)`<br>
0x8235 - `array string_split(string string, string split)`<br>
0x8237 - `int atoi(string string)`<br>
0x8238 - `float atof(string string)`<br>
0x824e - `string substr(string string, int start, int length)`<br>
0x824f - `int strlen(string string)`<br>
0x8250 - `string sprintf(string format, any value)`<br>
0x8251 - `int charcode(string string)`<br>
0x8253 - `int typeof(any value)`<br>
0x823a - `int get_tile_fid(int tile)`<br>
0x823b - `int modified_ini()`<br>
0x823e - `void force_aimed_shots(int pid)`<br>
0x823f - `void disable_aimed_shots(int pid)`<br>
0x8240 - `void mark_movie_played(int id)`<br>
0x8248 - `object get_last_target(object critter)`<br>
0x8249 - `object get_last_attacker(object critter)`<br>
0x824a - `void block_combat(int enable)`<br>
0x824b - `int tile_under_cursor()`<br>
0x824c - `int gdialog_get_barter_mod()`<br>
0x824d - `void set_inven_ap_cost()`<br>
0x825c - `void reg_anim_combat_check(int enable)`<br>
0x825a - `void reg_anim_destroy(object object)`<br>
0x825b - `void reg_anim_animate_and_hide(object object, int animID, int delay)`<br>
0x825d - `void reg_anim_light(object object, int radius, int delay)`<br>
0x825e - `void reg_anim_change_fid(object object, int FID, int delay)`<br>
0x825f - `void reg_anim_take_out(object object, int holdFrameID, int delay)`<br>
0x8260 - `void reg_anim_turn_towards(object object, int tile/targetObj, int delay)`<br>
0x8261 - `int metarule2_explosions(object object)`<br>
0x8262 - `void register_hook_proc(int hook, procedure proc)`<br>
0x826b - `string message_str_game(int fileId, int messageId)`<br>
0x826c - `int sneak_success()`<br>
0x826d - `int tile_light(int elevation, int tileNum)`<br>
0x826e - `object obj_blocking_line(object objFrom, int tileTo, int blockingType)`<br>
0x826f - `object obj_blocking_tile(int tileNum, int elevation, int blockingType)`<br>
0x8270 - `array tile_get_objs(int tileNum, int elevation)`<br>
0x8271 - `array party_member_list(int includeHidden)`<br>
0x8272 - `array path_find_to(object objFrom, int tileTo, int blockingType)`<br>
0x8273 - `object create_spatial(int scriptID, int tile, int elevation, int radius)`<br>
0x8274 - `int art_exists(int artFID)`<br>
0x8275 - `int obj_is_carrying_obj(object invenObj, object itemObj)`<br>
0x8276 - `any sfall_func0(string funcName)`<br>
0x8277 - `any sfall_func1(string funcName, arg1)`<br>
0x8278 - `any sfall_func2(string funcName, arg1, arg2)`<br>
0x8279 - `any sfall_func3(string funcName, arg1, arg2, arg3)`<br>
0x827a - `any sfall_func4(string funcName, arg1, arg2, arg3, arg4)`<br>
0x827b - `any sfall_func5(string funcName, arg1, arg2, arg3, arg4, arg5)`<br>
0x827c - `any sfall_func6(string funcName, arg1, arg2, arg3, arg4, arg5, arg6)`<br>
0x827d - `void register_hook_proc_spec(int hook, procedure proc)`<br>
0x827e - `void reg_anim_callback(procedure proc)`<br>
0x827f - `div` operator (unsigned integer division)<br>
0x8280 - `any sfall_func7(string funcName, arg1, arg2, arg3, arg4, arg5, arg6, arg7)`<br>
0x8281 - `any sfall_func8(string funcName, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)`<br>
+23 -23
View File
@@ -1,24 +1,26 @@
^ - These functions require AllowUnsafeScripting to be enabled in ddraw.ini
0x8156 - int read_byte(int address) 0x8156 - int read_byte(int address)
0x8157 - int read_short(int address) 0x8157 - int read_short(int address)
0x8158 - int read_int(int address) 0x8158 - int read_int(int address)
0x8159 - string read_string(int address) 0x8159 - string read_string(int address)
*0x81cf - void write_byte(int address, int value) ^ 0x81cf - void write_byte(int address, int value)
*0x81d0 - void write_short(int address, int value) ^ 0x81d0 - void write_short(int address, int value)
*0x81d1 - void write_int(int address, int value) ^ 0x81d1 - void write_int(int address, int value)
*0x821b - void write_string(int address, string value) ^ 0x821b - void write_string(int address, string value)
*0x81d2 - void call_offset_v0(int address) ^ 0x81d2 - void call_offset_v0(int address)
*0x81d3 - void call_offset_v1(int address, int arg1) ^ 0x81d3 - void call_offset_v1(int address, int arg1)
*0x81d4 - void call_offset_v2(int address, int arg1, int arg2) ^ 0x81d4 - void call_offset_v2(int address, int arg1, int arg2)
*0x81d5 - void call_offset_v3(int address, int arg1, int arg2, int arg3) ^ 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) ^ 0x81d6 - void call_offset_v4(int address, int arg1, int arg2, int arg3, int arg4)
*0x81d7 - int call_offset_r0(int address) ^ 0x81d7 - int call_offset_r0(int address)
*0x81d8 - int call_offset_r1(int address, int arg1) ^ 0x81d8 - int call_offset_r1(int address, int arg1)
*0x81d9 - int call_offset_r2(int address, int arg1, int arg2) ^ 0x81d9 - int call_offset_r2(int address, int arg1, int arg2)
*0x81da - int call_offset_r3(int address, int arg1, int arg2, int arg3) ^ 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) ^ 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) 0x815a - void set_pc_base_stat(int StatID, int value)
0x815b - void set_pc_extra_stat(int StatID, int value) 0x815b - void set_pc_extra_stat(int StatID, int value)
@@ -192,7 +194,7 @@
0x8225 - void remove_trait(int traitID) 0x8225 - void remove_trait(int traitID)
0x81cb - void set_pyromaniac_mod(int bonus) 0x81cb - void set_pyromaniac_mod(int bonus)
0x81cc - void apply_heaveho_fix 0x81cc - void apply_heaveho_fix()
0x81cd - void set_swiftlearner_mod(int bonus) 0x81cd - void set_swiftlearner_mod(int bonus)
0x81ce - void set_hp_per_level_mod(int mod) 0x81ce - void set_hp_per_level_mod(int mod)
@@ -292,9 +294,9 @@
0x8226 - int get_light_level() 0x8226 - int get_light_level()
0x8227 - void refresh_pc_art 0x8227 - void refresh_pc_art()
0x8228 - int get_attack_type 0x8228 - int get_attack_type()
0x822b - int play_sfall_sound(string file, int mode) 0x822b - int play_sfall_sound(string file, int mode)
0x822c - void stop_sfall_sound(int soundID) 0x822c - void stop_sfall_sound(int soundID)
@@ -321,9 +323,9 @@
0x8249 - object get_last_attacker(object critter) 0x8249 - object get_last_attacker(object critter)
0x824a - void block_combat(int enable) 0x824a - void block_combat(int enable)
0x824b - int tile_under_cursor 0x824b - int tile_under_cursor()
0x824c - int gdialog_get_barter_mod 0x824c - int gdialog_get_barter_mod()
0x824d - void set_inven_ap_cost 0x824d - void set_inven_ap_cost()
0x825c - void reg_anim_combat_check(int enable) 0x825c - void reg_anim_combat_check(int enable)
0x825a - void reg_anim_destroy(object object) 0x825a - void reg_anim_destroy(object object)
@@ -338,7 +340,7 @@
0x8262 - void register_hook_proc(int hook, procedure proc) 0x8262 - void register_hook_proc(int hook, procedure proc)
0x826b - string message_str_game(int fileId, int messageId) 0x826b - string message_str_game(int fileId, int messageId)
0x826c - int sneak_success 0x826c - int sneak_success()
0x826d - int tile_light(int elevation, int tileNum) 0x826d - int tile_light(int elevation, int tileNum)
0x826e - object obj_blocking_line(object objFrom, int tileTo, int blockingType) 0x826e - object obj_blocking_line(object objFrom, int tileTo, int blockingType)
0x826f - object obj_blocking_tile(int tileNum, int elevation, int blockingType) 0x826f - object obj_blocking_tile(int tileNum, int elevation, int blockingType)
@@ -364,5 +366,3 @@
0x8280 - any sfall_func7(string funcName, arg1, arg2, arg3, arg4, arg5, arg6, arg7) 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) 0x8281 - any sfall_func8(string funcName, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
* These functions require AllowUnsafeScripting to be enabled in ddraw.ini