mirror of
https://github.com/fallout2-ce/fallout2-ce.git
synced 2026-07-27 16:47:11 -07:00
12 KiB
12 KiB
Sfall Compatibility
This document tracks Fallout 2 CE compatibility with sfall. This is for modders who need to know which Sfall features work in CE.
For now, this covers opcodes/metarules, and hooks. In the future, it will include other ways of modifying the engine (like ini files), and other Sfall-specific behaviour.
Opcodes / Metarules
See https://sfall-team.github.io/sfall/ for documentation on specific functions.
| Group | Opcodes In Group | Compatibility | Notes |
|---|---|---|---|
| Direct memory access | read_byte,short,int,string write_byte,short,int,string call_offset_vX |
🚫 | Not possible. Open an issue if you need functionality not covered by other opcodes. |
| Stats | get/set_pc_base_stat get/set_pc_extra_stat get/set_critter_base_stat get/set_critter_extra_stat |
✅ | CE uses engine stat helpers here instead of sfall's direct proto-field behavior, so derived-stat update behavior can differ. |
| Stats / Alter min/max | get/set_stat_min/max set_pc_stat_min/max set_npc_stat_min/max |
not implemented | - |
| Skills | get/set_critter_skill_points get/set_available_skill_points set_skill_max set_critter_skill_mod set_base_skill_mod mod_skill_points_per_level |
not implemented | - |
| Graphics | graphics_funcs_available force_graphics_refresh get_screen_width get_screen_height set_palette |
implemented: only get_screen_width, get_screen_height | - |
| Shaders | load_shader free_shader activate_shader deactivate_shader set/get_shader_* |
🚫 | likely will not implement direct compatibility |
| Perks and traits | set_perk_image set_perk_* set_pyromaniac_mod apply_heaveho_fix set_swiftlearner_mod set_fake_perk set_fake_trait set_selectable_perk set_perkbox_title hide_real_perks show_real_perks perk_add_mode clear_selectable_perks has_fake_perk has_fake_trait add_trait remove_trait seq_perk_freq |
not implemented | - |
| Virtual file system | fs_create fs_copy fs_find fs_read/write_* fs_delete fs_size fs_pos fs_seek fs_resize |
🚫 | Open an issue if you have a use case for these |
| Combat / Knockback | set_weapon_knockback set_target_knockback set_attacker_knockback remove_weapon_knockback remove_target_knockback remove_attacker_knockback |
not implemented | - |
| Maps and encounters | in_world_map force_encounter force_encounter_with_flags set_map_time_multi get/set_map_enter_position exec_map_update_scripts get/set_terrain_name set_town_title get/set_can_rest_on_map set_rest_heal_time set_rest_mode set_worldmap_heal_time |
implemented: in_world_map, force_encounter, force_encounter_with_flags, set_map_time_multi | - |
| Maps and encounters / Worldmap | get_world_map_x/y_pos set_world_map_pos |
✅ | - |
| Audio | eax_available set_eax_environment play_sfall_sound stop_sfall_sound |
not implemented | eax opcodes will not be implemented |
| Combat / Weapons and ammo | get/set_weapon_ammo_pid get/set_weapon_ammo_count |
✅ | - |
| Sfall / Version | sfall_ver_major sfall_ver_minor sfall_ver_build |
✅ | CE currently reports 4.3.4 |
| Utility / Math | log, exponent, round, sqrt, abs, sin, cos, tan, arctan, ceil, ^, floor2, div | ✅ | - |
| Keyboard and mouse | key_pressed tap_key get_mouse_x/y get_mouse_buttons |
✅ | - |
| Lists | list_begin list_next list_end list_as_array party_member_list |
✅ | - |
| Explosions | metarule2_explosions set_attack_explosion_pattern set_attack_explosion_art set_attack_explosion_radius set_attack_is_explosion_fire set_explosion_radius set_dynamite_damage set_plastic_damage get_explosion_damage set_explosion_max_targets item_make_explosive |
✅ except item_make_explosive | - |
| Animations | reg_anim_combat_check reg_anim_destroy reg_anim_animate_and_hide reg_anim_light reg_anim_change_fid reg_anim_take_out reg_anim_turn_towards reg_anim_callback reg_anim_animate_and_move |
✅ except reg_anim_callback | - |
| Art and appearance | art_exists refresh_pc_art art_cache_clear set_hero_race set_hero_style |
implemented: art_exists, refresh_pc_art, art_cache_clear | - |
| Tiles and paths | get_tile_fid tile_under_cursor tile_light tile_get_objs tile_refresh_display obj_blocking_tile tile_by_position get_tile_ground_fid get_tile_roof_fid obj_blocking_line path_find_to objects_in_radius |
✅ except objects_in_radius | - |
| Utility | sprintf typeof atoi atof |
✅ | - |
| Utility / Strings | string_split substr strlen charcode get_string_pointer string_find string_find_from string_format string_format_array string_replace string_to_case string_compare |
✅ | get_string_pointer is deprecated and intentionally omitted. |
| Interface / Tags | show_iface_tag hide_iface_tag is_iface_tag_active set_iface_tag_text add_iface_tag |
✅ except set_iface_tag_text, add_iface_tag | CE only handles built-in interface tags here; custom tag creation/text is not supported yet. |
| Global variables | set_sfall_global get_sfall_global_int get_sfall_global_float |
✅ except get_sfall_global_float | Current CE storage is int-backed; set_sfall_global stores integer values |
| Hooks / Hook functions | init_hook get_sfall_arg get_sfall_args get_sfall_arg_at set_sfall_return set_sfall_arg register_hook register_hook_proc register_hook_proc_spec |
✅ | See below for implemented hooks. init_hook is deprecated and will not be implemented. register_hook_proc and register_hook_proc_spec both add hooks to the end of the hook list, instead of beginning and end, respectively. |
| Arrays / Array functions | create_array temp_array fix_array get/set_array resize_array free_array scan_array len_array save/load_array array_key arrayexpr |
✅ except save_array, load_array | - |
| Perks and traits / NPC perks | set_fake_perk_npc set_fake_trait_npc set_selectable_perk_npc has_fake_perk_npc has_fake_trait_npc |
not implemented | - |
| Global scripts / Global script functions | set_global_script_repeat set_global_script_type available_global_script_types |
implemented: all except available_global_script_types | - |
| Combat | attack_is_aimed block_combat force_aimed_shots disable_aimed_shots get_attack_type get/set_bodypart_hit_modifier combat_data get/set/reset_critical_table get_last_target get_last_attacker set_critter_burst_disable get/set_critter_current_ap set_spray_settings get/set_combat_free_move |
implemented: only get_attack_type, get_bodypart_hit_modifier, combat_data, set_bodypart_hit_modifier | - |
| Car | set_car_current_town car_gas_amount set_car_intface_art |
implemented: all except set_car_intface_art | - |
| Interface / Windows and images | art_frame_data interface_art_draw interface_print draw_image draw_image_scaled get_window_under_mouse create_win get_window_attribute message_box set_window_flag win_fill_color interface_overlay dialog_message get_text_width hide_window show_window |
implemented: only message_box, get_text_width, show_window | - |
| Interface / Outline | outlined_object get_outline set_outline |
implemented: all except get_outline | - |
| Interface / Main interface | intface_is_hidden intface_redraw intface_hide intface_show set_quest_failure_value |
implemented: only intface_redraw | intface_redraw only supports the zero-argument form; the optional-argument path is explicitly unimplemented. |
| Interface / Inventory | display_stats inventory_redraw critter_inven_obj2 get_current_inven_size item_weight |
implemented: only critter_inven_obj2 | - |
| Interface / Cursor | get/set_cursor_mode | ✅ | - |
| Locks | lock_is_jammed unjam_lock set_unjam_locks_time |
not implemented | - |
| INI settings | modified_ini get_ini_setting get_ini_string get_ini_section get_ini_sections get_ini_config get_ini_config_db set_ini_setting |
✅ except modified_ini, get_ini_config, get_ini_config_db | modified_ini is intentionally omitted as deprecated. |
| Objects and scripts | set_self set_dude_obj real_dude_obj remove_script set_script get_script obj_is_carrying_obj loot_obj dialog_obj obj_under_cursor get_object_data set_object_data get_flags set_flags set_unique_id set_scr_name obj_is_openable get/set_proto_data get_object_ai_data |
implemented: set_self, get_script, obj_is_carrying_obj, loot_obj, dialog_obj, obj_under_cursor, get_object_data, get_flags, set_flags, get_proto_data, set_proto_data | - |
| Other / Game management | set_movie_path stop_game resume_game mark_movie_played game_loaded get_game_mode get_uptime signal_close_game |
implemented: game_loaded, get_game_mode, get_uptime | - |
| Other | input_funcs_available get_year set_dm_model set_df_model set_pipboy_available get_kill_counter mod_kill_counter active_hand toggle_active_hand set_pickpocket_max set_hit_chance_max set_xp_mod set_critter_hit_chance_mod set_base_hit_chance_mod inc_npc_level get_npc_level get/set_viewport_x/y set_hp_per_level_mod get/set_unspent_ap_bonus get/set_unspent_ap_perk_bonus hero_select_win create_message_window get_light_level gdialog_get_barter_mod set_inven_ap_cost set_base_pickpocket_mod set_critter_pickpocket_mod message_str_game sneak_success create_spatial unwield_slot get_inven_ap_cost add_g_timer_event add_extra_msg_file get_metarule_table metarule_exist npc_engine_level_up remove_timer_event set_drugs_data spatial_radius |
implemented: get_year, active_hand, toggle_active_hand, create_message_window, message_str_game, add_extra_msg_file, metarule_exist | input_funcs_available, nb_create_char are deprecated in sfall and intentionally absent in CE. add_extra_msg_file does not support the explicit fileNumber form in CE. |
Hooks
| Hook | ID | Compatibility | Notes |
|---|---|---|---|
| ToHit | HOOK_TOHIT |
✅ | - |
| AfterHitRoll | HOOK_AFTERHITROLL |
🚫 | Et tu |
| CalcAPCost | HOOK_CALCAPCOST |
🚫 | - |
| DeathAnim1 | HOOK_DEATHANIM1 |
🚫 | Use DEATHANIM2 instead |
| DeathAnim2 | HOOK_DEATHANIM2 |
✅ | - |
| CombatDamage | HOOK_COMBATDAMAGE |
✅ | - |
| OnDeath | HOOK_ONDEATH |
🚫 | - |
| FindTarget | HOOK_FINDTARGET |
🚫 | (maybe) |
| UseObjOn | HOOK_USEOBJON |
✅ | - |
| UseObj | HOOK_USEOBJ |
✅ | CE notes an sfall-matching inconsistency around return code 2 behavior between interface contexts. |
| RemoveInvenObj | HOOK_REMOVEINVENOBJ |
🚫 | - |
| BarterPrice | HOOK_BARTERPRICE |
✅ | - |
| MoveCost | HOOK_MOVECOST |
🚫 | - |
| ItemDamage | HOOK_ITEMDAMAGE |
🚫 | - |
| AmmoCost | HOOK_AMMOCOST |
🚫 | Et tu |
| KeyPress | HOOK_KEYPRESS |
✅ | Third hook arg is currently 0; CE doesn't use VK codes. |
| MouseClick | HOOK_MOUSECLICK |
🚫 | - |
| UseSkill | HOOK_USESKILL |
🚫 | - |
| Steal | HOOK_STEAL |
🚫 | Et tu |
| WithinPerception | HOOK_WITHINPERCEPTION |
🚫 | Et tu |
| InventoryMove | HOOK_INVENTORYMOVE |
✅ | - |
| InvenWield | HOOK_INVENWIELD |
🚫 | - |
| AdjustFID | HOOK_ADJUSTFID |
🚫 | - |
| CombatTurn | HOOK_COMBATTURN |
✅ | - |
| StdProcedure | HOOK_STDPROCEDURE |
🚫 | Et tu |
| StdProcedureEnd | HOOK_STDPROCEDURE_END |
🚫 | - |
| CarTravel | HOOK_CARTRAVEL |
🚫 | - |
| SetGlobalVar | HOOK_SETGLOBALVAR |
🚫 | - |
| RestTimer | HOOK_RESTTIMER |
🚫 | Et tu |
| GameModeChange | HOOK_GAMEMODECHANGE |
✅ | - |
| UseAnimObj | HOOK_USEANIMOBJ |
🚫 | Et tu; (maybe) |
| ExplosiveTimer | HOOK_EXPLOSIVETIMER |
🚫 | - |
| DescriptionObj | HOOK_DESCRIPTIONOBJ |
🚫 | Et tu |
| UseSkillOn | HOOK_USESKILLON |
🚫 | Et tu |
| OnExplosion | HOOK_ONEXPLOSION |
🚫 | (maybe) |
| SubCombatDamage | HOOK_SUBCOMBATDAMAGE |
🚫 | (maybe) |
| SetLighting | HOOK_SETLIGHTING |
🚫 | Et tu; (maybe) |
| Sneak | HOOK_SNEAK |
🚫 | - |
| TargetObject | HOOK_TARGETOBJECT |
🚫 | (maybe) |
| Encounter | HOOK_ENCOUNTER |
🚫 | Et tu |
| AdjustPoison | HOOK_ADJUSTPOISON |
🚫 | (maybe) |
| AdjustRads | HOOK_ADJUSTRADS |
🚫 | (maybe) |
| RollCheck | HOOK_ROLLCHECK |
🚫 | - |
| BestWeapon | HOOK_BESTWEAPON |
🚫 | - |
| CanUseWeapon | HOOK_CANUSEWEAPON |
🚫 | - |
| BuildSfxWeapon | HOOK_BUILDSFXWEAPON |
🚫 | - |