Other
Functions
- active_hand
- add_g_timer_event
- create_message_window
- create_spatial
- game_loaded
- gdialog_get_barter_mod
- get_game_mode
- get_inven_ap_cost
- get_kill_counter
- get_light_level
- get_npc_level
- get_proto_data
- get_unspent_ap_bonus
- get_unspent_ap_perk_bonus
- get_uptime
- get_viewport_x
- get_viewport_y
- get_year
- hero_select_win
- inc_npc_level
- input_funcs_available
- mark_movie_played
- message_str_game
- mod_kill_counter
- nb_create_char
- resume_game
- set_base_hit_chance_mod
- set_base_pickpocket_mod
- set_critter_hit_chance_mod
- set_critter_pickpocket_mod
- set_df_model
- set_dm_model
- set_hit_chance_max
- set_hp_per_level_mod
- set_inven_ap_cost
- set_movie_path
- set_pickpocket_max
- set_pipboy_available
- set_proto_data
- set_unspent_ap_bonus
- set_unspent_ap_perk_bonus
- set_viewport_x
- set_viewport_y
- set_xp_mod
- signal_close_game
- sneak_success
- stop_game
- toggle_active_hand
- unwield_slot
active_hand
int active_hand
add_g_timer_event
sfall.h
void add_g_timer_event(int time, int fixedParam)
Adds a timer event that calls the timed_event_p_proc
procedure in the current global script time
: the number of ticks after which the event timer is triggered fixedParam
: the value that is passed to the timed_event_p_proc
procedure for the fixed_param
function
create_message_window
void create_message_window(string message)
create_spatial
ObjectPtr create_spatial(int scriptID, int tile, int elevation, int radius)
Creates new spatial script with given SID, at given tile, and radius.
game_loaded
int game_loaded()
Returns 1 the first time it is called after a new game or game load, and 0 any time after. It works on an individual basis for each script, so one script wont interfere with others. Its primary use is for global scripts, so that they know when to call set_global_script_repeat
, but it can be called from normal scripts too.
gdialog_get_barter_mod
int gdialog_get_barter_mod
get_game_mode
int get_game_mode()
A more flexible version of in_world_map. It will return a set of flags indicating which mode the game is currently in. These flags are the same as those used in the set_shader_mode function
.
get_inven_ap_cost
int get_inven_ap_cost
Returns the current AP cost to access the inventory in combat
get_kill_counter
int get_kill_counter(int critterType)
get_light_level
int get_light_level()
Returns ambient light level in range 0..65536. The value returned by get_light_level may not exactly match that set by set_light_level
, as set_light_level
applies modifiers from the Night Vision perk.
get_npc_level
int get_npc_level(string npc)
get_proto_data
int get_proto_data(int pid, int offset)
Used to read the in-memory copies of the .pro files Fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading.
get_unspent_ap_bonus
int get_unspent_ap_bonus()
Gets the AC bonus you receive per unused action point at the end of your turn in combat. To allow for fractional values, the value given if divided by 4. (Hence the default value is 4 and not 1.)
get_unspent_ap_perk_bonus
int get_unspent_ap_perk_bonus()
Similar to get_unspent_ap_bonus
, but accounts for the extra AC granted by the H2H Evade perk. (The default value of this is also 4, equivalent to doubling the original bonus.
get_uptime
int get_uptime()
Just a wrapper around the windows GetTickCount() function. It’s useful for making time fade effects in shaders, since they already have access to the current tick count.
get_viewport_x
int get_viewport_x()
get_viewport_y
int get_viewport_y()
get_year
int get_year
hero_select_win
void hero_select_win(int)
inc_npc_level
void inc_npc_level(int party_member_pid)
Takes a party member PID or an NPC name (deprecated, for compatibility with sfall 4.1.5/3.8.15 or earlier) as an argument. The NPC must be in your party. This function ignores player level requirements and the minimum 3 player level delay between NPC level gains. It also ignores the random element, regardless of sfall’s NPCAutoLevel
setting.
input_funcs_available
int input_funcs_available()
The input functions are only available if the user has the input hook turned on in ddraw.ini
. Use input_funcs_available
to check.
mark_movie_played
void mark_movie_played(int id)
message_str_game
string message_str_game(int fileId, int messageId)
Works exactly the same as message_str, except you get messages from files in text/english/game
folder. Use GAME_MSG_*
defines or mstr_*
macros from sfall.h to use specific msg file
- Additional game msg files added by
ExtraGameMsgFileList
setting will have consecutive fileIds assigned beginning from 0x2000 to 0x2FFF. (e.g. if you setExtraGameMsgFileList=foo,bar
inddraw.ini
,foo.msg
will be associated with 0x2000 andbar.msg
with 0x2001.). - If a file has a specific number assigned in
ExtraGameMsgFileList
, its fileId will be (0x2000 + assigned number). (e.g. withExtraGameMsgFileList=foo,bar:2,foobar
inddraw.ini
,bar.msg
will be associated with 0x2002 andfoobar.msg
with 0x2003.)
mod_kill_counter
void mod_kill_counter(int critterType, int amount)
nb_create_char
int nb_create_char()
nb_*
functions are reserved for the brotherhood tactical training mod, and should be avoided. Not implemented, always returns 0.
resume_game
void resume_game()
set_base_hit_chance_mod
void set_base_hit_chance_mod(int max, int mod)
set_base_pickpocket_mod
void set_base_pickpocket_mod(int max, int mod)
Changes maximum chance of success and chance mod for each steal attempt. max
will replace 95% success chance cap (so you can set 100% maximum chance, for instance). mod
will add this much percent to each success chance. for example if your chance is 50% and mod
is 20, you will get 70% actual success rate
set_critter_hit_chance_mod
void set_critter_hit_chance_mod(CritterPtr, int max, int mod)
set_critter_pickpocket_mod
void set_critter_pickpocket_mod(CritterPtr, int max, int mod)
The same as set_base_pickpocket
, but applies only to specific critter.
set_df_model
void set_df_model(string name)
set_dm_model
void set_dm_model(string name)
set_hit_chance_max
void set_hit_chance_max(int percentage)
Effects all critters rather than just the player and can set the maximum in range from 0 to 999.
set_hp_per_level_mod
void set_hp_per_level_mod(int mod)
set_inven_ap_cost
void set_inven_ap_cost(int cost)
set_movie_path
void set_movie_path(string filename, int movieid)
set_pickpocket_max
void set_pickpocket_max(int percentage)
Effects all critters rather than just the player and can set the maximum in range from 0 to 999.
set_pipboy_available
void set_pipboy_available(int available)
Sets the availability of the pipboy in the game. Use 0 to disable the pipboy, and 1 or 2 to enable it (value 2 does not mark the VSUIT_MOVIE
movie as “played”).
set_proto_data
void set_proto_data(int pid, int offset, int value)
Used to alter the in-memory copies of the .pro files Fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading. Changes are not stored on disc, and are not permanent. If you modify the protos, and then Fallout subsequently reloads the file your changes will be lost.
set_unspent_ap_bonus
void set_unspent_ap_bonus(int multiplier)
Alters the AC bonus you receive per unused action point at the end of your turn in combat. To allow for fractional values, the value given if divided by 4. (Hence the default value is 4 and not 1.)
set_unspent_ap_perk_bonus
void set_unspent_ap_perk_bonus(int multiplier)
Similar to set_unspent_ap_bonus
, but effects the extra AC granted by the H2H Evade perk. (The default value of this is also 4, equivalent to doubling the original bonus.
set_viewport_x
void set_viewport_x(int view_x)
set_viewport_y
void set_viewport_y(int view_y)
set_xp_mod
void set_xp_mod(int percentage)
signal_close_game
sfall.h
void signal_close_game
Works in a similar way to vanilla function: metarule(METARULE_SIGNAL_END_GAME, 0)
, but it will then close the game instead of only returning the player to the main menu
sneak_success
int sneak_success
Returns 1 if last sneak attempt (roll against skill) was successful, 0 otherwise. This calls an internal engine function which is used to determine the perception range of critters (which you can override using HOOK_WITHINPERCEPTION
).
stop_game
void stop_game()
toggle_active_hand
void toggle_active_hand
unwield_slot
void sfall_func2("unwield_slot", object critter, int slot)
unequips an item from the specified slot for a critter or the player can take off player’s equipped item when the inventory is opened, or the player is in the barter screen slot: 0 - armor slot, 1 - right slot, 2 - left slot (see INVEN_TYPE_*
in define.h)