404
Page not found :(
The requested page could not be found.
diff --git a/404.html b/404.html index d90e4d39..52476f73 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -
Page not found :(
The requested page could not be found.
Page not found :(
The requested page could not be found.
The set_stat_max/min functions can be used to set the valid ranges on stats. Values returned by get_current_stat will be clamped to this range. The set_pc_ function only affects the player, the set_npc_ functions only affects other critters, and the set_ functions affects both.
void set_npc_stat_max(int stat, int value)
+ Alter min/max - sfall Alter min/max | sfall Alter min/max
The set_stat_max/min functions can be used to set the valid ranges on stats. Values returned by get_current_stat will be clamped to this range. The set_pc_ function only affects the player, the set_npc_ functions only affects other critters, and the set_ functions affects both.
Functions
set_npc_stat_max
void set_npc_stat_max(int stat, int value)
set_npc_stat_min
void set_npc_stat_min(int stat, int value)
set_pc_stat_max
void set_pc_stat_max(int stat, int value)
set_pc_stat_min
void set_pc_stat_min(int stat, int value)
diff --git a/animations/index.html b/animations/index.html
index 6f3e7794..545a4b61 100644
--- a/animations/index.html
+++ b/animations/index.html
@@ -1,4 +1,4 @@
- Animations - sfall Animations | sfall Animations
Functions
- reg_anim_animate_and_hide
- reg_anim_callback
- reg_anim_change_fid
- reg_anim_combat_check
- reg_anim_destroy
- reg_anim_light
- reg_anim_take_out
- reg_anim_turn_towards
reg_anim_animate_and_hide
void reg_anim_animate_and_hide(ObjectPtr, int animID, int delay)
+ Animations - sfall Animations | sfall Animations
Functions
- reg_anim_animate_and_hide
- reg_anim_callback
- reg_anim_change_fid
- reg_anim_combat_check
- reg_anim_destroy
- reg_anim_light
- reg_anim_take_out
- reg_anim_turn_towards
reg_anim_animate_and_hide
void reg_anim_animate_and_hide(ObjectPtr, int animID, int delay)
Exactly like reg_anim_animate but the object will automatically disappear after the last animation frame (but not destroyed).
reg_anim_callback
void reg_anim_callback(procedure proc)
Adds the given procedure to an animation sequence-list and executes it in the registered sequence.
reg_anim_change_fid
void reg_anim_change_fid(ObjectPtr, int FID, int delay)
Should work like art_change_fid_num but in reg_anim sequence.
reg_anim_combat_check
void reg_anim_combat_check(int enable)
diff --git a/array-functions/index.html b/array-functions/index.html
index 81dbb005..7b12560d 100644
--- a/array-functions/index.html
+++ b/array-functions/index.html
@@ -1,4 +1,4 @@
- Array functions - sfall Array functions | sfall Array functions
Functions
- array_key
- arrayexpr
- create_array
- fix_array
- free_array
- get_array
- len_array
- load_array
- resize_array
- save_array
- scan_array
- set_array
- temp_array
array_key
mixed array_key(int arrayID, int index)
+ Array functions - sfall Array functions | sfall Array functions
Functions
- array_key
- arrayexpr
- create_array
- fix_array
- free_array
- get_array
- len_array
- load_array
- resize_array
- save_array
- scan_array
- set_array
- temp_array
array_key
mixed array_key(int arrayID, int index)
Don’t use it directly; it is generated by the compiler in foreach loops.
arrayexpr
int arrayexpr(mixed key, mixed value)
Don’t use it directly; it is used by compiler to create array expressions.
create_array
int create_array(int size, int nothing)
Creates permanent array (but not “saved”).
fix_array
void fix_array(int arrayID)
diff --git a/arrays/index.html b/arrays/index.html
index 1307faee..fa3fa914 100644
--- a/arrays/index.html
+++ b/arrays/index.html
@@ -1,4 +1,4 @@
- Arrays - sfall Arrays | sfall Arrays
sfall introduces new method of storing variables - arrays.
Array is basically a container which can store variable number of values (elements). Each element in array can be of any type. Arrays can be extremely useful for some more advanced scripting, in conjunction with loops. See array function reference here.
- Arrays concept
- Arrays syntax
- Storing arrays
- Practical examples
- Array operators reference
- Backward compatibility notes
Arrays concept
Array elements are accessed by index or key. For example:
// this code puts some string in array "list" at index 5:
+ Arrays - sfall Arrays | sfall Arrays
sfall introduces new method of storing variables - arrays.
Array is basically a container which can store variable number of values (elements). Each element in array can be of any type. Arrays can be extremely useful for some more advanced scripting, in conjunction with loops. See array function reference here.
- Arrays concept
- Arrays syntax
- Storing arrays
- Practical examples
- Array operators reference
- Backward compatibility notes
Arrays concept
Array elements are accessed by index or key. For example:
// this code puts some string in array "list" at index 5:
list[5] := "Value";
There are 2 different types of arrays currently available:
-
Lists - a set of values with specific size (number of elements), where all elements have numeric indexes starting from zero (0) up to array length minus one.
For example:
// this creates list with 3 elements. Element "A" has index 0, element "B" has index 1, element "C" - 2
list := ["A", "B", "C"];
diff --git a/art-and-appearance/index.html b/art-and-appearance/index.html
index 185052bb..20f3c5bd 100644
--- a/art-and-appearance/index.html
+++ b/art-and-appearance/index.html
@@ -1,4 +1,4 @@
- Art and appearance - sfall Art and appearance | sfall Art and appearance
Functions
art_cache_clear
sfall.h
void art_cache_clear()
+ Art and appearance - sfall Art and appearance | sfall Art and appearance
Functions
art_cache_clear
sfall.h
void art_cache_clear()
Clears the cache of FRM image files loaded into memory.
art_exists
int art_exists(int artFID)
checks if given artFID exists in the game. Useful when you want to check if critter can use specific weapon: art_exists((artFid bwand 0xffff0fff) bwor (weaponAnim * 0x1000)).
refresh_pc_art
void refresh_pc_art
set_hero_race
void set_hero_race(int style)
diff --git a/audio/index.html b/audio/index.html
index 0d3cc8b8..5a3e5449 100644
--- a/audio/index.html
+++ b/audio/index.html
@@ -1,4 +1,4 @@
- Audio - sfall Audio | sfall Audio
Functions
eax_available
int eax_available
+ Audio - sfall Audio | sfall Audio
Functions
eax_available
int eax_available
play_sfall_sound
int play_sfall_sound(string file, int mode)
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. Does 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 mute), and Y is the playback mode.
set_eax_environment
void set_eax_environment(int environment)
stop_sfall_sound
void stop_sfall_sound(int soundID)
diff --git a/best-practices/index.html b/best-practices/index.html
index 8cb1da81..9af169bb 100644
--- a/best-practices/index.html
+++ b/best-practices/index.html
@@ -1,4 +1,4 @@
- Best practices - sfall Best practices | sfall Best practices
Mod compatibility
- If it can be done in a global script, do it in a global script. Combined with hooks, they are extremely powerful, possibilities ranging from creating new perks to UI scripting to prototype altering on-the-fly. While scripting does take a bit longer to get started, and hacking prototypes directly with GUI programs might look easier at first, consider that:
- Scripts from different mods modifying the same thing can actually be compatible with each other. Binary files can’t.
- Scripts can be version controlled and thus are much more easier to maintain.
-
If you’re using set_sfall_return, always couple it with set_sfall_arg for the corresponding arg(s), unless you have a specific reason not to. Detailed explanation is available here.
- Pick yourself a 2-3 character modding prefix. Use it for:
- global script names
- global variable names and saved array names
- debug messages
This will ensure (to some degree), that another mod doesn’t overwrite your scripts, doesn’t mess with your global variables, and that debug messages coming from your scripts can be distinguished easily.
For example, if you pick prefix “a_”, your script could be named gl_a_myscript.int, and might look like this:
#define NAME "gl_a_myscript"
+ Best practices - sfall Best practices | sfall Best practices
Mod compatibility
- If it can be done in a global script, do it in a global script. Combined with hooks, they are extremely powerful, possibilities ranging from creating new perks to UI scripting to prototype altering on-the-fly. While scripting does take a bit longer to get started, and hacking prototypes directly with GUI programs might look easier at first, consider that:
- Scripts from different mods modifying the same thing can actually be compatible with each other. Binary files can’t.
- Scripts can be version controlled and thus are much more easier to maintain.
-
If you’re using set_sfall_return, always couple it with set_sfall_arg for the corresponding arg(s), unless you have a specific reason not to. Detailed explanation is available here.
- Pick yourself a 2-3 character modding prefix. Use it for:
- global script names
- global variable names and saved array names
- debug messages
This will ensure (to some degree), that another mod doesn’t overwrite your scripts, doesn’t mess with your global variables, and that debug messages coming from your scripts can be distinguished easily.
For example, if you pick prefix “a_”, your script could be named gl_a_myscript.int, and might look like this:
#define NAME "gl_a_myscript"
#define ndebug(message) debug_msg(NAME + ": " + message + "\n")
procedure start begin
diff --git a/call_offset_vx/index.html b/call_offset_vx/index.html
index c6d1b8d2..d9ca41c2 100644
--- a/call_offset_vx/index.html
+++ b/call_offset_vx/index.html
@@ -1,4 +1,4 @@
- call_offset_vX - sfall call_offset_vX | sfall call_offset_vX
Can be used to call arbitrary functions inside Fallout. Different versions are used to call functions with different numbers of arguments. None of these functions will work unless AllowUnsafeScripting is enabled in ddraw.ini.
Functions
- call_offset_r0
- call_offset_r1
- call_offset_r2
- call_offset_r3
- call_offset_r4
- call_offset_v0
- call_offset_v1
- call_offset_v2
- call_offset_v3
- call_offset_v4
call_offset_r0
UNSAFE
int call_offset_r0(int address)
+ call_offset_vX - sfall call_offset_vX | sfall call_offset_vX
Can be used to call arbitrary functions inside Fallout. Different versions are used to call functions with different numbers of arguments. None of these functions will work unless AllowUnsafeScripting is enabled in ddraw.ini.
Functions
- call_offset_r0
- call_offset_r1
- call_offset_r2
- call_offset_r3
- call_offset_r4
- call_offset_v0
- call_offset_v1
- call_offset_v2
- call_offset_v3
- call_offset_v4
call_offset_r0
UNSAFE
int call_offset_r0(int address)
call_offset_r1
UNSAFE
int call_offset_r1(int address, int arg1)
call_offset_r2
UNSAFE
int call_offset_r2(int address, int arg1, int arg2)
call_offset_r3
UNSAFE
int call_offset_r3(int address, int arg1, int arg2, int arg3)
diff --git a/car/index.html b/car/index.html
index f94c2e79..8869f936 100644
--- a/car/index.html
+++ b/car/index.html
@@ -1,4 +1,4 @@
- Car - sfall Car | sfall Car
Functions
car_gas_amount
sfall.h
int car_gas_amount()
+ Car - sfall Car | sfall Car
Functions
car_gas_amount
sfall.h
int car_gas_amount()
Returns the current amount of fuel in player’s car (between 0 and 80000). To change fuel amount, use vanilla function: metarule(METARULE_GIVE_CAR_GAS, amount) - amount can be positive or negative.
set_car_current_town
void set_car_current_town(int town)
Changes the current town index for the player’s car.
set_car_intface_art
sfall.h
void set_car_intface_art(int artIndex)
- Changes the interface art (index in
intrface.lst) for the car image on the world map interface - Should be called before going to the world map
- Vanilla art index is 433
diff --git a/combat/index.html b/combat/index.html
index 546be7e8..8ba90dbd 100644
--- a/combat/index.html
+++ b/combat/index.html
@@ -1,4 +1,4 @@
- Combat - sfall Combat | sfall Combat
Subcategories
Functions
- attack_is_aimed
- block_combat
- combat_data
- disable_aimed_shots
- force_aimed_shots
- get_attack_type
- get_bodypart_hit_modifier
- get_critical_table
- get_critter_current_ap
- get_last_attacker
- get_last_target
- reset_critical_table
- set_bodypart_hit_modifier
- set_critical_table
- set_critter_burst_disable
- set_critter_current_ap
attack_is_aimed
sfall.h
bool attack_is_aimed()
+ Combat - sfall Combat | sfall Combat
Subcategories
Functions
- attack_is_aimed
- block_combat
- combat_data
- disable_aimed_shots
- force_aimed_shots
- get_attack_type
- get_bodypart_hit_modifier
- get_critical_table
- get_critter_current_ap
- get_last_attacker
- get_last_target
- reset_critical_table
- set_bodypart_hit_modifier
- set_critical_table
- set_critter_burst_disable
- set_critter_current_ap
attack_is_aimed
sfall.h
bool attack_is_aimed()
Returns 1 if the aimed attack mode is selected, 0 otherwise.
block_combat
void block_combat(bool value)
Deny the player to enter combat mode.
combat_data
mixed combat_data
- returns a pointer to the
C_ATTACK_* data for the current combat attack process (see defined constants in define_extra.h) - can be used in conjunction with the
get_object_data and set_object_data functions example: sfall_func3("set_object_data", sfall_func0("combat_data"), C_ATTACK_UNUSED, 255);
disable_aimed_shots
void disable_aimed_shots(int pid)
diff --git a/cursor/index.html b/cursor/index.html
index 6643d217..e19f2965 100644
--- a/cursor/index.html
+++ b/cursor/index.html
@@ -1,3 +1,3 @@
- Cursor - sfall Cursor | sfall Cursor
Functions
get_cursor_mode
sfall.h
int get_cursor_mode()
+ Cursor - sfall Cursor | sfall Cursor
Functions
get_cursor_mode
sfall.h
int get_cursor_mode()
Returns the current cursor mode. Values: 0 - movement cursor, 1 - command cursor, 2 - targeting cursor, 4 to 10 are Skilldex skills (yellow targeting cursor).
set_cursor_mode
sfall.h
void set_cursor_mode(int mode)
Sets the current cursor mode.
diff --git a/data-types/index.html b/data-types/index.html
index 62f840ea..60976db3 100644
--- a/data-types/index.html
+++ b/data-types/index.html
@@ -1 +1 @@
- Data types - sfall Data types | sfall Data types
Data types mentioned in this document
array - array ID to be used with array-related functions (actually an integer) any - any type bool - boolean (in fact, int: True is 1 and False is 0) int - integer number mixed - type depends on exact use case float - floating point number ObjectPtr - pointer to a game object (actually an integer) proc - procedure name (used in register_hook_proc) string - string (text) value void - means opcode does not return any value
+ Data types - sfall Data types | sfall Data types
Data types mentioned in this document
array - array ID to be used with array-related functions (actually an integer) any - any type bool - boolean (in fact, int: True is 1 and False is 0) int - integer number mixed - type depends on exact use case float - floating point number ObjectPtr - pointer to a game object (actually an integer) proc - procedure name (used in register_hook_proc) string - string (text) value void - means opcode does not return any value
diff --git a/direct-memory-access/index.html b/direct-memory-access/index.html
index 3daa1898..fbb6d8ef 100644
--- a/direct-memory-access/index.html
+++ b/direct-memory-access/index.html
@@ -1 +1 @@
- Direct memory access - sfall Direct memory access | sfall
+ Direct memory access - sfall Direct memory access | sfall
diff --git a/explosions/index.html b/explosions/index.html
index 854243ea..8b202079 100644
--- a/explosions/index.html
+++ b/explosions/index.html
@@ -1,4 +1,4 @@
- Explosions - sfall Explosions | sfall Explosions
Functions
- get_explosion_damage
- item_make_explosive
- metarule2_explosions
- set_attack_explosion_art
- set_attack_explosion_pattern
- set_attack_explosion_radius
- set_attack_is_explosion_fire
- set_dynamite_damage
- set_explosion_max_targets
- set_explosion_radius
- set_plastic_damage
get_explosion_damage
sfall.h
array get_explosion_damage(itemPid)
+ Explosions - sfall Explosions | sfall Explosions
Functions
- get_explosion_damage
- item_make_explosive
- metarule2_explosions
- set_attack_explosion_art
- set_attack_explosion_pattern
- set_attack_explosion_radius
- set_attack_is_explosion_fire
- set_dynamite_damage
- set_explosion_max_targets
- set_explosion_radius
- set_plastic_damage
get_explosion_damage
sfall.h
array get_explosion_damage(itemPid)
Returns an array of the minimum and maximum damage of the explosive item.
item_make_explosive
sfall.h
void item_make_explosive(int pid, int activePid, int minDamage, int maxDamage)
- makes the specified item (pid) an explosive item like Dynamite or Plastic Explosives
maxDamage is optional activePid is for an item with an active timer, can be the same as the pid argument - the item proto must be “Misc Item” type and have “Use” action flag
- minDamage/maxDamage are the minimum and maximum explosion damage
- using the function on an item that is already set as an explosive will override its previous settings
- NOTE: this function does not work for pids of Dynamite and Plastic Explosives
metarule2_explosions
int metarule2_explosions(int arg1, int arg2)
Was made as a dirty easy hack to allow dynamically change some explosion parameters (ranged attack). All changed parameters are reset to vanilla state automatically after each attack action.
set_attack_explosion_art
sfall.h
void set_attack_explosion_art(x, y)
diff --git a/feed.xml b/feed.xml
index 72de732e..9ba00ac8 100644
--- a/feed.xml
+++ b/feed.xml
@@ -1 +1 @@
-Jekyll 2021-07-03T01:31:50+00:00 /sfall/ sfall Sfall documentation
\ No newline at end of file
+Jekyll 2021-07-31T22:45:56+00:00 /sfall/ sfall Sfall documentation
\ No newline at end of file
diff --git a/funcx/index.html b/funcx/index.html
index 6a30cc6e..870af91f 100644
--- a/funcx/index.html
+++ b/funcx/index.html
@@ -1,4 +1,4 @@
- funcX - sfall funcX | sfall funcX
Functions
- sfall_func0
- sfall_func1
- sfall_func2
- sfall_func3
- sfall_func4
- sfall_func5
- sfall_func6
- sfall_func7
- sfall_func8
sfall_func0
any sfall_func0(char* funcName)
+ funcX - sfall funcX | sfall funcX
Functions
- sfall_func0
- sfall_func1
- sfall_func2
- sfall_func3
- sfall_func4
- sfall_func5
- sfall_func6
- sfall_func7
- sfall_func8
sfall_func0
any sfall_func0(char* funcName)
Calls scripting function with given name and no arguments.
sfall_func1
any sfall_func1(char* funcName, arg1)
Calls scripting function with given name and 1 argument.
sfall_func2
any sfall_func2(char* funcName, arg1, arg2)
Calls scripting function with given name and 2 arguments.
sfall_func3
any sfall_func3(char* funcName, arg1, arg2, arg3)
diff --git a/global-script-functions/index.html b/global-script-functions/index.html
index f02e8037..f708dcce 100644
--- a/global-script-functions/index.html
+++ b/global-script-functions/index.html
@@ -1,4 +1,4 @@
- Global script functions - sfall Global script functions | sfall Global script functions
Functions
available_global_script_types
int available_global_script_types
+ Global script functions - sfall Global script functions | sfall Global script functions
Functions
available_global_script_types
int available_global_script_types
set_global_script_repeat
void set_global_script_repeat(int frames)
Only has an effect on the script it is called from. Every global script needs its own game_loaded block to correctly set up repeat rate. Will have no effect if called on a non-global script.
set_global_script_type
void set_global_script_type(int type)
Only has an effect on the script it is called from. Every global script needs its own game_loaded block to correctly set up the script type.
diff --git a/global-scripts/index.html b/global-scripts/index.html
index 73b804a4..2cc34371 100644
--- a/global-scripts/index.html
+++ b/global-scripts/index.html
@@ -1 +1 @@
- Global scripts - sfall Global scripts | sfall Global scripts
As well as the new functions, sfall also adds global scripts. These run independent of any loaded maps, but do not have an attached object. (i.e. using self_obj without using set_self first will crash the script.) To use a global script, the script must have a name which begins with gl and contains a procedure called start, map_enter_p_proc, map_exit_p_proc, or map_update_p_proc. The start procedure will be executed once when the player loads a saved game or starts a new game. The map_*_p_proc procedures will be executed once when a map is being entered/left/updated. If you wish the script to be executed repeatedly, call set_global_script_repeat on the first run of the start procedure using the number of frames between each run as the argument. (0 disables the script, 1 runs it every frame, 2 runs it every other frame etc.)
Global scripts have multiple modes, which can be set using the set_global_script_type function.
- In the default mode (i.e. mode 0) their execution is linked to the local map game loop, so the script will not run in dialogs or on the world map. [Using mode 1 requires the input wrapper to be enabled. Use
available_global_script_types to check what is available.] - Obsolete. - In mode 1 their execution is linked to the player input, and so they will run whenever the mouse cursor is visible on screen, including the world map, character dialogs etc.
- In mode 2, execution is linked to the world map loop, so the script will only be executed on the world map and not on the local map or in any dialog windows.
- Mode 3 is a combination of modes 0 and 2, so scripts will be executed on both local maps and the world map, but not in dialog windows.
+ Global scripts - sfall Global scripts | sfall Global scripts
As well as the new functions, sfall also adds global scripts. These run independent of any loaded maps, but do not have an attached object. (i.e. using self_obj without using set_self first will crash the script.) To use a global script, the script must have a name which begins with gl and contains a procedure called start, map_enter_p_proc, map_exit_p_proc, or map_update_p_proc. The start procedure will be executed once when the player loads a saved game or starts a new game. The map_*_p_proc procedures will be executed once when a map is being entered/left/updated. If you wish the script to be executed repeatedly, call set_global_script_repeat on the first run of the start procedure using the number of frames between each run as the argument. (0 disables the script, 1 runs it every frame, 2 runs it every other frame etc.)
Global scripts have multiple modes, which can be set using the set_global_script_type function.
- In the default mode (i.e. mode 0) their execution is linked to the local map game loop, so the script will not run in dialogs or on the world map. [Using mode 1 requires the input wrapper to be enabled. Use
available_global_script_types to check what is available.] - Obsolete. - In mode 1 their execution is linked to the player input, and so they will run whenever the mouse cursor is visible on screen, including the world map, character dialogs etc.
- In mode 2, execution is linked to the world map loop, so the script will only be executed on the world map and not on the local map or in any dialog windows.
- Mode 3 is a combination of modes 0 and 2, so scripts will be executed on both local maps and the world map, but not in dialog windows.
diff --git a/global-variables/index.html b/global-variables/index.html
index c37a3329..244cc9cf 100644
--- a/global-variables/index.html
+++ b/global-variables/index.html
@@ -1,4 +1,4 @@
- Global variables - sfall Global variables | sfall Global variables
These functions require an EXACTLY 8 characters long, case sensitive string for the variable name. The variables behave the same as normal Fallout globals, except that they don’t have to be declared beforehand in vault13.gam. Trying to get a variable which hasn’t been set will always return 0. The functions are intended for use when a patch to a mod requires the addition of a new global variable, a case which would otherwise require the player to start a new game.
Functions
get_sfall_global_float
float get_sfall_global_float(string/int varname)
+ Global variables - sfall Global variables | sfall Global variables
These functions require an EXACTLY 8 characters long, case sensitive string for the variable name. The variables behave the same as normal Fallout globals, except that they don’t have to be declared beforehand in vault13.gam. Trying to get a variable which hasn’t been set will always return 0. The functions are intended for use when a patch to a mod requires the addition of a new global variable, a case which would otherwise require the player to start a new game.
Functions
get_sfall_global_float
float get_sfall_global_float(string/int varname)
get_sfall_global_int
int get_sfall_global_int(string/int varname)
set_sfall_global
void set_sfall_global(string/int varname, int/float value)
diff --git a/graphics/index.html b/graphics/index.html
index 26e94f87..77f0aee8 100644
--- a/graphics/index.html
+++ b/graphics/index.html
@@ -1,4 +1,4 @@
- Graphics - sfall Graphics | sfall Graphics
The graphics functions are only available if the user is using graphics mode 4 or 5. Use graphics_funcs_available to check; it returns 1 if you can use them or 0 if you can’t. Calling graphics functions when graphics_funcs_available returns 0 will do nothing.
Functions
- activate_shader
- deactivate_shader
- force_graphics_refresh
- free_shader
- get_screen_height
- get_screen_width
- get_shader_texture
- get_shader_version
- graphics_funcs_available
- load_shader
- set_palette
- set_shader_float
- set_shader_int
- set_shader_mode
- set_shader_texture
- set_shader_vector
activate_shader
void activate_shader(int ID)
+ Graphics - sfall Graphics | sfall Graphics
The graphics functions are only available if the user is using graphics mode 4 or 5. Use graphics_funcs_available to check; it returns 1 if you can use them or 0 if you can’t. Calling graphics functions when graphics_funcs_available returns 0 will do nothing.
Functions
- activate_shader
- deactivate_shader
- force_graphics_refresh
- free_shader
- get_screen_height
- get_screen_width
- get_shader_texture
- get_shader_version
- graphics_funcs_available
- load_shader
- set_palette
- set_shader_float
- set_shader_int
- set_shader_mode
- set_shader_texture
- set_shader_vector
activate_shader
void activate_shader(int ID)
deactivate_shader
void deactivate_shader(int ID)
force_graphics_refresh
void force_graphics_refresh(bool enabled)
Forces the screen to redraw at times when it normally wouldn’t. If you’re using animated shader, turning this option on is recommended.
free_shader
void free_shader(int ID)
diff --git a/hook-functions/index.html b/hook-functions/index.html
index 7ecb2b3e..50f48b57 100644
--- a/hook-functions/index.html
+++ b/hook-functions/index.html
@@ -1,4 +1,4 @@
- Hook functions - sfall Hook functions | sfall Hook functions
Functions
- get_sfall_arg
- get_sfall_arg_at
- get_sfall_args
- init_hook
- register_hook
- register_hook_proc
- register_hook_proc_spec
- set_sfall_arg
- set_sfall_return
get_sfall_arg
mixed get_sfall_arg()
+ Hook functions - sfall Hook functions | sfall Hook functions
Functions
- get_sfall_arg
- get_sfall_arg_at
- get_sfall_args
- init_hook
- register_hook
- register_hook_proc
- register_hook_proc_spec
- set_sfall_arg
- set_sfall_return
get_sfall_arg
mixed get_sfall_arg()
Gets the next argument from sfall. Each time it’s called it returns the next argument, or otherwise it returns 0 if there are no more arguments left. You can arbitrarily get the value of any argument using the sfall_func1("get_sfall_arg_at", argNum) function.
get_sfall_arg_at
sfall.h
mixed get_sfall_arg_at(int argNum)
Gets the value of hook argument with the specified argument number (first argument of hook starts from 0)
get_sfall_args
int get_sfall_args()
Returns all hook arguments as a new temp array.
init_hook
int init_hook()
diff --git a/hook-types/index.html b/hook-types/index.html
index 3ebf5597..bc2f3318 100644
--- a/hook-types/index.html
+++ b/hook-types/index.html
@@ -1,4 +1,4 @@
- Hook types - sfall Hook types | sfall Hook types
- AdjustFID
- AdjustPoison
- AdjustRads
- AfterHitRoll
- AmmoCost
- BarterPrice
- BestWeapon
- CalcAPCost
- CanUseWeapon
- CarTravel
- CombatDamage
- CombatTurn
- DeathAnim1
- DeathAnim2
- Deprecated hooks
- DescriptionObj
- Encounter
- ExplosiveTimer
- FindTarget
- GameModeChange
- InvenWield
- InventoryMove
- ItemDamage
- KeyPress
- MouseClick
- MoveCost
- OnDeath
- OnExplosion
- RemoveInvenObj
- RestTimer
- RollCheck
- SetGlobalVar
- SetLighting
- Sneak
- StdProcedure
- StdProcedureEnd
- Steal
- SubCombatDamage
- TargetObject
- ToHit
- UseAnimObj
- UseObj
- UseObjOn
- UseSkill
- UseSkillOn
- WithinPerception
AdjustFID
HOOK_ADJUSTFID (hs_adjustfid.int)
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.
int arg0 - the vanilla FID calculated by the engine according to critter base FID and armor/weapon being used
+ Hook types - sfall Hook types | sfall Hook types
- AdjustFID
- AdjustPoison
- AdjustRads
- AfterHitRoll
- AmmoCost
- BarterPrice
- BestWeapon
- CalcAPCost
- CanUseWeapon
- CarTravel
- CombatDamage
- CombatTurn
- DeathAnim1
- DeathAnim2
- Deprecated hooks
- DescriptionObj
- Encounter
- ExplosiveTimer
- FindTarget
- GameModeChange
- InvenWield
- InventoryMove
- ItemDamage
- KeyPress
- MouseClick
- MoveCost
- OnDeath
- OnExplosion
- RemoveInvenObj
- RestTimer
- RollCheck
- SetGlobalVar
- SetLighting
- Sneak
- StdProcedure
- StdProcedureEnd
- Steal
- SubCombatDamage
- TargetObject
- ToHit
- UseAnimObj
- UseObj
- UseObjOn
- UseSkill
- UseSkillOn
- WithinPerception
AdjustFID
HOOK_ADJUSTFID (hs_adjustfid.int)
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.
int arg0 - the vanilla FID calculated by the engine according to critter base FID and armor/weapon being used
int arg1 - the modified FID calculated by the internal sfall code (like Hero Appearance Mod)
int ret0 - overrides the calculated FID with provided value
diff --git a/hooks/index.html b/hooks/index.html
index 9331d586..eaa7fc42 100644
--- a/hooks/index.html
+++ b/hooks/index.html
@@ -1,4 +1,4 @@
- Hooks - sfall Hooks | sfall Hooks
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.
In addition to the bit of code it overrides, the script will be run once when first loaded and again at each player reload to allow for setup. Hook scripts have access to a set of arguments supplied to sfall, but aren’t required to use them all. They also return one or more values, but again they’re optional, and you only need to return a value if you want to override the default.
See hook types and hook functions reference for details.
Hooks compatibility
To aid in mods compatibility, avoid using hs_xxx .int scripts. Instead it is recommended to use a normal global script combined with register_hook_proc or register_hook.
Example setup for a hook-script based mod:
procedure tohit_hook_handler begin
+ Hooks - sfall Hooks | sfall Hooks
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.
In addition to the bit of code it overrides, the script will be run once when first loaded and again at each player reload to allow for setup. Hook scripts have access to a set of arguments supplied to sfall, but aren’t required to use them all. They also return one or more values, but again they’re optional, and you only need to return a value if you want to override the default.
See hook types and hook functions reference for details.
Hooks compatibility
To aid in mods compatibility, avoid using hs_xxx .int scripts. Instead it is recommended to use a normal global script combined with register_hook_proc or register_hook.
Example setup for a hook-script based mod:
procedure tohit_hook_handler begin
display_msg("Modifying hit_hook " + get_sfall_arg);
set_hit_chance_max(100);
set_sfall_return(100);
diff --git a/index.html b/index.html
index 7a26ca73..e991a9f5 100644
--- a/index.html
+++ b/index.html
@@ -1 +1 @@
- Home - sfall Home | sfall sfall
Sfall is a set of engine modifications for the classic game Fallout 2 in form of a DLL, which modifies executable in memory without changing anything in EXE file itself.
Engine modifications include:
- Better support for modern operating systems
- Externalizing many settings like starting map and game time, skills, perks, critical hit tables, books, etc.
- Bug fixes
- Many additional features for users, such as item highlight button, party member control, etc.
- Extended scripting capabilities for modders (many new opcodes to control sfall features as well as previously unavailable vanilla engine functions)
Note that this is documentation for sfall specifically, not Fallout scripting in general. For vanilla function reference, refer to the wiki.
Getting started
To get started with sfall, first familiarize yourself with new concepts:
- Global scripts and variables.
- Arrays and lists.
- Hooks.
- Data types.
- Object and script manipulation.
Pay special attention to the best practices page. Also, take a look at SSLC features and optimization guide.
Next, proceed to discover new functions. They are categorized, use the menu to find the one you need. If you can’t, check uncategorized functions list and sfall macros. Also, there’s search at the top of the page.
Questions and problems
+ Home - sfall Home | sfall sfall
Sfall is a set of engine modifications for the classic game Fallout 2 in form of a DLL, which modifies executable in memory without changing anything in EXE file itself.
Engine modifications include:
- Better support for modern operating systems
- Externalizing many settings like starting map and game time, skills, perks, critical hit tables, books, etc.
- Bug fixes
- Many additional features for users, such as item highlight button, party member control, etc.
- Extended scripting capabilities for modders (many new opcodes to control sfall features as well as previously unavailable vanilla engine functions)
Note that this is documentation for sfall specifically, not Fallout scripting in general. For vanilla function reference, refer to the wiki.
Getting started
To get started with sfall, first familiarize yourself with new concepts:
- Global scripts and variables.
- Arrays and lists.
- Hooks.
- Data types.
- Object and script manipulation.
Pay special attention to the best practices page. Also, take a look at SSLC features and optimization guide.
Next, proceed to discover new functions. They are categorized, use the menu to find the one you need. If you can’t, check uncategorized functions list and sfall macros. Also, there’s search at the top of the page.
Questions and problems
diff --git a/ini-settings/index.html b/ini-settings/index.html
index 3e7b39cf..bd2a83cd 100644
--- a/ini-settings/index.html
+++ b/ini-settings/index.html
@@ -1,4 +1,4 @@
- INI settings - sfall INI settings | sfall