Compare commits

..
123 Commits
Author SHA1 Message Date
NovaRain 06df287b3a Updated version number and changelog
Edits to sfall opcode list.
2025-10-09 19:26:53 +08:00
NovaRain f57a261339 Updated Russian translation file 2025-09-17 20:51:42 +08:00
NovaRain ee5cdbcd81 Added support for switching the keyboard layout
(from Crafty)

Minor edits to some documents and LoadOrder.cpp.
2025-09-17 20:49:10 +08:00
NovaRain 93416a9450 Fixed the upper limit when applying mouse sensitivity 2025-09-11 22:13:47 +08:00
NovaRain 9a18193060 Added an option to disable Arroyo-related events
Minor fix to DisableSpecialMapIDs (as ID 0 is still a valid map).
Edited some descriptions in ddraw.ini.
2025-08-29 13:23:57 +08:00
NovaRain 95cd72348d Added splash screen fallback to Mash's HRP (4.1.8 only) 2025-08-28 09:08:11 +08:00
NovaRain 0b6a058dff Code fixes/edits to the previous commit
* nonEngLang didn't get set when using Mash's HRP.
2025-08-27 10:33:25 +08:00
NovaRain 6f5ebe76fc Added default path fallback for splash screens
* before the game loaded splash screens only from art\<language>\splash\
if the game language is not English, ignoring the default art\splash\.

Added a global boolean to replace individual game language checks.
2025-08-25 12:16:34 +08:00
NovaRain 4cef7cf72f Fixed file seeking in uncompressed .dat files
(ref. fallout2-ce/fallout2-ce#244)
2025-08-24 09:45:33 +08:00
NovaRain 400f94e302 Fixed crash in an encounter between two groups
* when they are set to fight each other but one group fails to spawn.
(ref. BGforgeNet/Fallout2_Restoration_Project#350)

Updated version number.
2025-08-17 15:11:05 +08:00
NovaRain 0a42f83084 Updated version number and changelog 2025-07-26 19:05:23 +08:00
NovaRain 9f5c8fa946 Updated sslc readme
Recompiled gl_npcarmor_lite due to sslc fixes.
2025-07-14 10:22:59 +08:00
NovaRain a8baf6c331 Removed unnecessary code in SingleCore option
* GetCurrentProcess returns a pseudo handle, with which calling the
CloseHandle function has no effect
2025-07-05 19:32:18 +08:00
NovaRain 2c33b2752b Fixed slightly misaligned buttons in the barter screen
(ref. fallout2-ce/fallout2-ce#204)
2025-06-11 21:43:29 +08:00
NovaRain 01ff118619 Updated use.frm/use_e.frm
(use invbox.frm as the base instead of loot.frm)
2025-06-02 10:03:04 +08:00
NovaRain c90571392b Improved the error handling for missing main .dat files
(ref. fallout2-ce/fallout2-ce#172)
2025-05-31 08:53:08 +08:00
NovaRain 7615e318ca Fixed slightly misaligned buttons in the character screen
(ref. fallout2-ce/fallout2-ce#154)
2025-05-26 21:45:03 +08:00
NovaRain 02f9be78f6 Fixed slightly misaligned buttons in the pipboy
(ref. fallout2-ce/fallout2-ce#147)
2025-05-24 08:05:23 +08:00
NovaRain bd87a49e87 Removed glass glare from use.frm/use_e.frm
* Now they look the same as all other interfaces that have the inventory
list and character portrait (ref. fallout2-ce/fallout2-ce#148)

Updated resource files.
2025-05-24 00:27:42 +08:00
NovaRain 508bcd745c Added lowercase 'a' as a hotkey for the 'Take All' button
(previously only uppercase 'A')
2025-05-22 08:44:12 +08:00
NovaRain 1c12b52303 Improved the clearing of floating text messages after map change
(ref. fallout2-ce/fallout2-ce#115)
2025-05-13 22:02:17 +08:00
NovaRain 7cd059a9a5 Added a safeguard to stat_level engine function
(ref. fallout2-ce/fallout2-ce#76)

Unified the naming style of return addr variables for some ASM code.
2025-05-11 12:07:27 +08:00
NovaRain 9355f84943 Minor code edits to Stats.cpp 2025-05-11 09:32:58 +08:00
NovaRain 5f220d54e4 Fixed potential undefined behavior in FullItemDescInBarter
* due to obj_examine_func_hack_objdesc, item description is coped to
messageBuffer already (max 354 chars), so in most cases desc is the same
as messageBuffer, which should be UB to strncpy_s. MSVC's implementation
seems treating self-copy as no-op, but we shouldn't rely on this
behavior.
2025-05-04 08:55:46 +08:00
NovaRain 0486a43532 Fixed duplicate sound in the "Move Items" and "Set Timer" windows
* happens when clicking the "Done" button.

Fixed crash when a critter with a powered melee/unarmed weapon runs out
of ammo and there is ammo nearby.

Minor code optimization to Interface.cpp, use spare ecx register instead
of the stack for eax value.
2025-05-03 21:39:50 +08:00
NovaRain 9cccb2e45b Improved the previous commit
* now the buttons have proper press/release sfx.
2025-05-02 21:28:19 +08:00
NovaRain b59930d831 Added missing click sound to the buttons in the combat control panel
Updated version number.
2025-04-29 11:01:26 +08:00
NovaRain d996e1f739 Correction to the previous commit
* shouldn't modify the string in-place.
2025-04-13 16:40:08 +08:00
NovaRain 86506b5ec7 Removed visible newline chars when examining items in the barter screen
(ref. #401, #591)

Minor code edits to BugFixes.cpp.
Updated changelog.
2025-04-13 01:10:58 +08:00
NovaRain 8f1813cd0b Moved render.cpp/h files to GUI folder/namespace
Moved newline support hacks from MiscPatches to Text.cpp/h as 4.x.
2025-04-13 00:13:37 +08:00
NovaRain 4e0e98dda9 Updated changelog 2025-04-09 09:23:55 +08:00
NovaRain 8ff09aa10e Minor code edits to Movies.cpp 2025-04-06 12:34:15 +08:00
NovaRain caa64822dd Code edit to the previous commit 2025-04-05 22:16:58 +08:00
NovaRain bad50cd335 Changed the implementation of ProcessorIdle
* now the same as CPU_USAGE_FIX in Mash's HRP, with a simpler toggle
setting.

* also avoids slowdowns if the player happens to enable both of them.
2025-04-05 17:42:17 +08:00
NovaRain 71c8b851e6 Tightened the compatibility mode check (again)
(OS check is now limited to unsupported Windows versions.)
2025-04-04 15:23:06 +08:00
NovaRain 16b2681c79 Reverted commit ef78c35
(found another way to fix freezing issues in Win11 24H2.)
2025-04-03 01:22:14 +08:00
NovaRain 764ab01d9d Fixed out-of-bounds selection in the file list when loading a GCD file 2025-04-02 14:21:56 +08:00
NovaRain ef78c35a30 Reverted part of the optimization for the save/load game screens
(commit a35a4e03, as it could cause the cursor to become unresponsive.)

Updated version number.
2025-03-31 21:55:59 +08:00
NovaRain 2e4998168c Updated version number and changelog 2025-03-20 22:31:04 +08:00
NovaRain eef4571cfe Correction to the previous commit
* should have checked for anim code directly instead of critter flag.
2025-03-18 11:03:24 +08:00
NovaRain 2e8c742fdb Minor edits to code and function notes 2025-03-11 09:01:30 +08:00
NovaRain 8782428615 Added a tweak to replace death anims on critters with "_sf" variants on map load
(also fix critters stuck in the middle of death anims after returning
to the map, #584)
2025-03-10 10:02:37 +08:00
NovaRain d62ec1b939 Fixed broken critter art debug message
(caused by commit e3b524dd)
2025-03-08 20:38:17 +08:00
NovaRain 5fb69175e5 Allow death animations to finish when entering combat
(to prevent animation glitch, #584)
2025-03-05 10:28:57 +08:00
NovaRain 157f4434d5 Changed PipBoyAvailableAtGameStart and set_pipboy_available
* They no longer modify the vault suit movie state, which was an
undesired behavior.

Updated scripting documents.
2025-03-02 11:29:20 +08:00
NovaRain 43fb1ec5f2 Improved the fix for "out of bounds" bug when printing the automap list
* prevent the overflow of _sortlist (holds 24 elements at max).
* NOTE: the fix just cuts off location/elevation lists, and should be
removed once a proper pagination in pipboy is implemented.
2025-03-01 23:28:49 +08:00
NovaRain 80679572c3 Improved the fix for extra hidden buttons in the previous commit
(ref. alexbatalov/fallout2-ce#465, alexbatalov/fallout2-ce#466)
2025-02-25 11:23:41 +08:00
NovaRain 7f0017a858 Fixed extra hidden buttons appearing below the location list
* in the Status section in the pipboy (a partial fix).
(ref. alexbatalov/fallout2-ce#465)
2025-02-24 23:52:32 +08:00
NovaRain 7e95e1b405 Fixed double click sound when selecting a location in pipboy status
(ref. alexbatalov/fallout2-ce#462)
2025-02-21 11:15:03 +08:00
NovaRain 03cc1f8ae4 Fixed the incorrect message when attempting to repair dead robots
(ref. alexbatalov/fallout2-ce#459)
2025-02-19 12:16:24 +08:00
NovaRain c4f6f9c9c7 Synced FunctionOffsets_def.h with 4.x
Removed VariableOffsets_HRP.h (was severely underused within 3.8 scope).
2025-02-12 22:30:36 +08:00
NovaRain 987419945f Fixed display issues when highlighting a multiline dialogue option
(ref. alexbatalov/fallout2-ce#418)
2025-02-12 13:24:48 +08:00
NovaRain 461b12037a Code edits to Perks.cpp 2025-02-09 12:32:10 +08:00
NovaRain e072cfda7c Restored the position of the ammo bar when ALTERNATE_AMMO_METRE=0 2025-02-03 12:19:22 +08:00
NovaRain 8bd0147578 Fixed the main menu music not stopping when replaying the intro
(ref. alexbatalov/fallout2-ce#399)
2025-02-01 16:04:03 +08:00
NovaRain b68655f7c8 Fixed item's unique ID being reset by a non-unique item (#582) 2025-01-31 22:41:31 +08:00
NovaRain 9d68ae2d4b Simplified some jumps in ASM code
* Replaced single-use "mov reg, addr; jmp reg" with constant variables.
2025-01-30 19:45:46 +08:00
NovaRain 7eec7a132e Added settings about Educated, Healer, and Lifegiver to perks.ini 2025-01-27 21:06:15 +08:00
NovaRain 3d630de332 Tightened the compatibility mode check 2025-01-26 11:33:02 +08:00
NovaRain b39d5d9a57 Edits to function documents 2025-01-22 21:37:38 +08:00
NovaRain d654233614 Fixed issues related to negative weapon ammo
(ref. alexbatalov/fallout2-ce#443)

Fixed freeze when reloading an overloaded weapon via the interface bar.
2025-01-19 15:10:55 +08:00
NovaRain 6f9d1fc1f8 Added German and French resource files 2025-01-14 12:32:06 +08:00
NovaRain fee5b7daa1 Reduced the green tone of the message window
(less pixelated colors and for text clarity)

Updated resource files.
2025-01-11 14:22:42 +08:00
NovaRain f36f204dd7 Fixed map lighting from Night Vision perk
* Before the perk effect only kicked in when map update proc ran after
game load. Now the delay is much shorter.
2025-01-09 10:47:26 +08:00
NovaRain cc7e471df0 Added setting about Comprehension perk to perks.ini 2025-01-07 11:58:45 +08:00
NovaRain 4b8478911e Added setting about Night Vision perk to perks.ini
Updated version number.
2025-01-05 21:05:59 +08:00
NovaRain deb6d2d0ea Cosmetic edits: updated year 2025-01-05 17:30:52 +08:00
NovaRain 1354ff2ec6 Updated changelog 2024-12-04 09:06:45 +08:00
NovaRain 38eed54c9f Added upper limit to WorldMapDelay2 2024-11-22 12:50:07 +08:00
NovaRain 5230d0aeca Tweaked how XPTable data was loaded
* to align hook functions with the engine functions they replaced.
2024-11-19 21:55:57 +08:00
NovaRain 62f9eb1987 Removed unnecessary selfrun file creation
* autoplay was disabled in 3.8.30 (commit 6c2eb479)

Updated version number.
2024-10-14 10:56:09 +08:00
NovaRain ef791b872a Updated version number and changelog 2024-09-15 12:45:36 +08:00
NovaRain bbf8e84696 Fixed the behavior of game_loaded script function
(always returned 1 when called from normal scripts)

- Revert the changes to ScriptExtender.cpp in commit 9149df1, and use
unordered_set instead of vector for caching script program pointers.
2024-09-10 09:52:21 +08:00
NovaRain b8add3dec5 Fixed issues with picking Tag! or Mutate! perk if there are unused perks
* their windows keep reappearing when picking other perks, can cause
various issues or even crashes.
2024-09-01 12:22:31 +08:00
NovaRain d3ff9d04b4 Fixed object_fix_weapon_ammo_ engine function
(was incorrectly checking Misc "object" type instead of item subtype.)
2024-08-14 14:42:20 +08:00
NovaRain 587ca5bee1 Fixed the return value of using_skill script function
* if the arguments are not the player and SKILL_SNEAK, it returned
garbage values due to the uninitialized variable.
2024-07-31 20:20:28 +08:00
NovaRain 20bf2ce145 Added a tweak to restore the sneak state when switching between maps
(can be overridden with map_enter/exit_p_proc in global scripts)

Minor edit to function notes.
2024-07-31 08:23:03 +08:00
NovaRain 486c897243 Added new HOOK_BUILDSFXWEAPON
* Hook for gsnd_build_weapon_sfx_name
* Fixed long name ACM crash in AutoSearchSFX
* Updated documents
2024-07-19 19:51:04 +08:00
NovaRain 87eca4898a Scripting headers: add material-related constants, minor lib extensions 2024-07-18 08:36:30 +08:00
NovaRain 3515dac146 Prevent unnecessary toggling of the tags in show/hide_iface_tag 2024-07-16 10:54:42 +08:00
NovaRain 73deda86c8 Fixed the skilldex art for the hero appearance mod (#555)
* the info card doesn't refresh properly due to cached FRM.
2024-07-07 18:18:49 +08:00
NovaRain d39535e0a6 Fixed inconsistent behavior of escaped percent sign in sprintf/string_format
Minor code edits to LoadGameHook.cpp.
2024-07-06 22:17:10 +08:00
NovaRain 5c246ba614 Reverted GameReset in LoadGameHook.cpp to pre-3.8.29 behavior
(when the engine's game_reset is called, sfall will reset modules as
well for consistency.)
2024-06-29 17:34:15 +08:00
NovaRain 33943bb6ff Added OutlineColorContainers/Corpses to the built-in item highlighting
Minor code refactor of the built-in item highlighting.
Updated version number.
2024-06-28 22:11:00 +08:00
NovaRain 81f4af927b Synced item highlighting mod with 4.x 2024-06-28 21:14:46 +08:00
NovaRain e2dcb3e0b2 Updated changelog and readme 2024-06-19 20:44:23 +08:00
NovaRain 88197f7fed Corrected proto pid offset in define_extra.h 2024-06-17 15:21:56 +08:00
NovaRain 0b14111472 Further simplification of the previous commit
Updated sslc_readme.md.
2024-06-15 19:08:04 +08:00
NovaRain 8448a24339 Added a tweak to prevent "forever" type of animation from stopping when entering combat 2024-06-09 14:15:30 +08:00
NovaRain 388a5de994 Changed the game mode check in gl_highlighting_lite
* now opening other interfaces (inventory, options, etc.) will also
turn off highlight.
2024-06-09 12:09:05 +08:00
NovaRain 803eeb4d27 Fixed crash on game save (due to commit 0409eb67) 2024-06-09 06:27:02 +08:00
NovaRain 2714b3bfc8 Expanded show/hide_iface_tag functions to work with tag value 0 (sneak)
Updated documents.
2024-06-07 08:08:13 +08:00
NovaRain 0409eb67e4 Minor code edits: replace some push/pop in ASM with pushadc/popadc pair 2024-06-06 21:56:45 +08:00
NovaRain ea74ff7d0c Added ItemMoveSkipDragKey from 4.x 2024-06-06 21:50:48 +08:00
NovaRain e05010c752 Cosmetic edits: unified the placement of __declspec keyword
* it's recommended to place __declspec before the return type.
(ref: https://stackoverflow.com/q/13613864 )
2024-06-04 20:48:49 +08:00
NovaRain 9f8a5b4766 Fixed possible crash in BoxBarCount 2024-06-03 09:29:05 +08:00
NovaRain 6a773780a7 Backported the per-line msg fallback from 4.x
Renamed PartyMemberNonRandomLevelUp for clarity.
2024-06-03 09:23:21 +08:00
NovaRain e2ad532607 Added a new attrType value to get_window_attribute
Added PAUSEWIN (Ctrl+P) to LoadGameHook game modes.
Fixed crash in interface_art_draw (when drawing beyond window bounds).
Fixed assert fail when calling sfall_func7+
Edits to documents.
2024-06-02 09:12:56 +08:00
NovaRain 181560265f Fixed NPCAutoLevel and set_npc_level opcode
- Now properly doesn't shift first level up too early and doesn't set "early" flag
- Fixed using set_npc_level without disabling engine leveling logic
- Renamed to PartyMemberNoEarlyLevelUpPatch to match behavior
2024-06-02 08:43:38 +08:00
NovaRain ca42b01193 Added new arguments to HOOK_ENCOUNTER
* to determine which encounter is being loaded, not just map ID.

Updated the document and header files.
2024-05-31 15:11:40 +08:00
NovaRain 73ac86d493 Updated healing skills example mod
(fix inaccurate behavior and refactoring)
2024-05-28 21:44:33 +08:00
NovaRain 7dc499eb24 Changed the world map healing rate patch to be enabled by default
* default 3 hrs according to Fallout v1.2 manual errata.

Changed AIDrugUsePerfFix to be enabled by default (UPU/RPU have it
enabled for years, and F2:CE also implemented a similar fix.)

Updated version number.
2024-05-28 21:30:52 +08:00
NovaRain 944a1be064 Added 'DontMoveTop' flag to the interface bar
* to prevent the interface bar from obscuring the barter/trade interface
when using the hi-res patch.
2024-05-27 22:26:22 +08:00
NovaRain bc882680e4 Added patch for healing time on worldmap and set_world_map_heal_time
* the time interval check is tied to real time clock, instead of game time.
2024-05-27 21:56:54 +08:00
NovaRain cfcfa21afe Reverted speed patch/keys behavior to pre-3.8.15
* Enable in [Speed] is the master switch for all Speed* settings.
* SpeedMultiInitial requires Enable=1, not a standalone setting.
* SpeedModKey=0 allows players to use only numpad keys to change speed.
2024-05-24 21:39:42 +08:00
NovaRain 0095ec212b Added healing skills example mod from 4.x 2024-05-24 08:55:01 +08:00
NovaRain 83d8104ed8 Added "item" type to the party member protos patch
(for the car trunk)
2024-05-24 08:51:04 +08:00
NovaRain c74ddc1cbc Backported ItemCounterAutoCaps from 4.x 2024-05-23 20:17:49 +08:00
NovaRain 0746d6b483 Header lib: refactor inven_as_array and add proper jsdoc defs to all comments
- inven_as_array was allocating blocks of 100 items which was unnecessary
2024-05-20 20:20:56 +08:00
NovaRain 3c8ec03e30 Add useful comments to most header lib procs and macros 2024-05-19 07:27:43 +08:00
NovaRain 0b67cb4125 Fixed the missing hotkeys for additional elevators derived from the original elevator types
(ref. BGforgeNet/Fallout2_Restoration_Project#290)
2024-05-18 15:17:22 +08:00
NovaRain e84c5fdc1d Added setting about Cautious Nature perk to perks.ini 2024-05-17 21:06:01 +08:00
NovaRain a56162c949 Backported the options for internal debug window 2024-05-14 21:33:11 +08:00
NovaRain 272b082d72 Removed duplicate implementation in round() script function
* there's a lroundf implementation already in Tiles.cpp.
2024-05-12 13:56:05 +08:00
NovaRain 4f43a47a09 Sync ExtraArt module with 4.x
Removed duplicate FRMs from repo.
Rename all interface FRMs to lowercase.
Updated resource files.
2024-05-12 13:47:48 +08:00
NovaRain 9c97d0da44 Removed unnecessary error message when AutoSearchSFX is enabled
Removed leftover from devlog_f() in release builds.
2024-05-11 00:23:11 +08:00
NovaRain c1b279f2fa Implemented ExtraArt module from 4.x
Changed ASM code in BugFixes.cpp and Inventory.cpp to match 4.x
2024-05-11 00:19:17 +08:00
NovaRain 3ebc4326c5 New metarule to read art size + DrawImage refactoring
- Fix inconsistent and duplicate FRM-related struct definitions
- Clean up code, especially around using PCX files
- When FID is used, read FRM directly from ArtCache instead of from disk
- When path is used, cache loaded FRM/PCX files
- Add art_frame_data to read FRM/PCX size by FID/filename

Updated docs and sfall.h for art_frame_data script function
2024-05-08 09:02:31 +08:00
NovaRain 257a1f7b33 Tweaked the check for stretch to fit of AVI movies 2024-05-06 23:38:23 +08:00
NovaRain a66db5a386 Backported ExpandWorldMap from 4.x 2024-05-06 08:42:02 +08:00
NovaRain db547212e8 Fixed PlayIdleAnimOnReload causing critters to lose highlights in combat
* happens when the Target Highlight pref is set to "targeting only".
2024-05-02 09:45:38 +08:00
NovaRain 10ffa66256 Added a check for NPC being dead to NPCsTryToSpendExtraAP 2024-05-02 08:47:21 +08:00
NovaRain 9734d18d68 Added signal_close_game script function
Updated documents and version number.
2024-04-24 08:57:23 +08:00
304 changed files with 9150 additions and 3053 deletions
+113 -19
View File
@@ -1,5 +1,99 @@
# Changelog
## 3.8.48
* Fixed incorrect mnemonic names in script dumps generated by the script decompiler (`int2ssl.exe` in the **modders pack**)
* Added a fix for a crash when an encounter between two groups fighting each other fails to spawn one group
* Added a fix to use the `art\splash\` directory as the fallback for loading splash screens for non-English languages
* Added a fix for the game not applying the mouse sensitivity setting correctly in certain cases
* Added a fix for file seeking in uncompressed **.dat** files
* Added an option to disable the engine's processing of Arroyo-related events
* Added support for switching to alternate keyboard character codes (from Crafty)
## 3.8.47
* Fixed potential undefined behavior in **FullItemDescInBarter**
* Fixed the behavior of `break` statement in script compiler and decompiler (`compile.exe` and `int2ssl.exe` in the **modders pack**)
* Improved the fix for removing floating text messages on the map when moving to another map or elevation
* Improved the error handling for missing main **.dat** files
* Removed glass glare from the **'Use Inventory Item On'** window to match other game interfaces
* Added a fix for a crash when a critter with a powered melee/unarmed weapon runs out of ammo and there was ammo nearby
* Added a fix to prevent a potential crash when using skills on non-critter objects
* Added a fix for the duplicate click sound for the 'Done' button in the **'Move Items'** and **'Set Timer'** windows
* Added a few fixes for slightly misaligned buttons in the pipboy, character screen, and barter screen
* Added missing sounds to the 'Done' and 'Cancel' buttons in the 'Custom' disposition of the combat control panel
* Added lowercase `a` as a hotkey for the 'Take All' button (previously only uppercase `A`)
## 3.8.46.1
* The compatibility mode check now targets only unsupported Windows versions
* Changed the way **ProcessorIdle** works to prevent conflicts with **CPU_USAGE_FIX** option in `f2_res.ini`
* Added a fix to prevent out-of-bounds selection in the file list when loading a character file
* Added a fix to remove visible newline control characters `\n` when examining items in the barter screen
## 3.8.46
* Fixed a bug introduced in 3.8.31 that broke the debug message about a missing critter art file
* Fixed an issue where an item with a unique ID in the inventory had its ID reset by a non-unique item
* Restored the position of the ammo bar when **ALTERNATE_AMMO_METRE=0** in `f2_res.ini`
* Improved the fix for the display issue in the pipboy when the automap list is too long
* Improved the compatibility mode check for newer Windows
* Changed **PipBoyAvailableAtGameStart** option and `set_pipboy_available` script function to no longer modify the vault suit movie state
* Added a fix for the main menu music not stopping when replaying the intro
* Added a fix for display issues when highlighting a multiline dialogue option
* Added a fix for the incorrect message being displayed when attempting to repair a dead robot
* Added a fix for the duplicate click sound when selecting a location in the Status section of the pipboy
* Added a fix for extra hidden buttons below the location list in the Status section of the pipboy
* Added a fix for map lighting from **Night Vision** perk not updating when loading a saved game
* Added a fix for an animation glitch when death animations and combat start simultaneously
* Added a fix to prevent the game from hanging when reloading a weapon overloaded with ammo via the interface bar
* Added a few fixes for issues related to weapons with negative ammo
* Added a tweak to replace death animations on critters with single-frame variants on map load
* Added more options for tweaking some engine perks to the **perks ini file**
* Reduced the green tone of the message window on the interface bar for text clarity
## 3.8.45.1
* Fixed a bug in **XPTable** that caused leveling issues with **Here and Now** perk
* Disabled unnecessary selfrun file creation in the recording mode (autoplay has been disabled in 3.8.30)
## 3.8.45
* Fixed a bug introduced in 3.8.29 that caused `game_loaded` script function to always return 1 when called from normal scripts
* Fixed a bug introduced in 3.8.44 that caused the information card for the **hero appearance mod** not to refresh properly
* Fixed a crash bug in **AutoSearchSFX** when an **ACM** file has a name longer than 12 characters
* Fixed an issue where sfall did not reset data properly after attempting to load a corrupted saved game
* Fixed the inconsistent behavior of the escaped percent sign `%` in `sprintf` and `string_format` script functions
* Fixed `show/hide_iface_tag` script functions to prevent unnecessary toggling of tags
* Fixed `using_skill` script function returning garbage values when the arguments are not the player and Sneak skill
* Added a fix for the engine not checking **'misc'** type items when correcting data for items on maps
* Added a fix to prevent the windows of **Tag!** and **Mutate!** perks from reappearing when there are still unused perks
* Added a tweak to restore the player's sneak state when switching between maps
* Added options to separately set the color of outlines for highlighted containers and corpses
* Updated **item highlighting mod** in the **modders pack** to match the feature set of the 4.x version
* New hook script: `hs_buildsfxweapon`
## 3.8.44
* Fixed a bug in **NPCsTryToSpendExtraAP** that caused NPCs to still be able to move in their combat turn after they killed themselves
* Fixed a bug in **PlayIdleAnimOnReload** that could cause critters to lose highlights after reloading weapons in combat
* Fixed a crash bug in `interface_art_draw` script function when drawing beyond window bounds
* Fixed the missing hotkeys for additional elevators derived from the original elevator types
* Fixed and improved the syntax parsing in script compiler (`compile.exe` in the **modders pack**)
* Improved the fix for using **'English'** as the fallback language directory for msg files to work on a per-line basis
* Improved the fix for saving/loading party member protos to include the car trunk
* Improved the performance of `draw_image`, `draw_image_scaled`, and `interface_art_draw` script functions
* Expanded `show/hide_iface_tag` script functions to work with the tag value 0 (sneak)
* Changed **AIDrugUsePerfFix** to be enabled by default
* Tweaked the behavior of **NPCAutoLevel** option and renamed it to **PartyMemberNonRandomLevelUp** to better match its behavior
* Removed the unnecessary error message about sndlist.lst when **AutoSearchSFX** is enabled
* Added a fix for the time interval for healing during world map travel being tied to the system timer instead of game time
* Added a fix for the interface bar obscuring the barter/trade interface when using the hi-res patch
* Added a tweak to prevent the **'forever'** type of animation on objects from stopping when entering combat
* Added an option to use the expanded world map interface (requires the hi-res patch)
* Added an option to pre-fill the **'Move Items'** window with the correct balancing amount when moving money/caps in the barter screen
* Added an option to set up a key to let you move items between inventory lists by simply clicking on them
* Added debug options to adjust the size and text font for the internal debug window
* Added an option for tweaking **Cautious Nature** perk to the **perks ini file**
* Added a new attribute type value to `get_window_attribute script` function
* Added `PAUSEWIN` flag to the game mode functions (when pausing the game using `Ctrl+P`)
* Added 2 new arguments to `HOOK_ENCOUNTER` hook script
* Added a healing skills example script to the example mods in the **modders pack**
* New script function: `signal_close_game`, `art_frame_data`, `set_worldmap_heal_time`
## 3.8.43.1
* Fixed a possible hang or crash introduced in 3.8.41 when running certain script sequences
@@ -124,10 +218,10 @@
* Removed **ComputeSprayMod** from `ddraw.ini`. Now **ComputeSpray_\*** options no longer require a master switch
* Added a fix for a crash when the player equips a weapon overloaded with ammo
* Added a fix for being able to use the **'Push'** action on members of the player's team in combat when they are knocked down
* Added missing sounds for the markers on the world map interface (similar to Fallout 1, from Ghosthack)
* Added missing sounds to the markers on the world map interface (similar to Fallout 1, from Ghosthack)
## 3.8.34
* Minor fixes to **LocalMapXLimit/LocalMapYLimit** options and the built-in **item highlighting mod**
* Minor fixes to **LocalMapXLimit/LocalMapYLimit** options and the built-in **item highlighting**
* Removed **FadeBackgroundMusic** option because the fix in 3.8.33 doesn't work reliably in all cases
* Added a fix for being unable to plant items on non-biped critters with the **'Barter'** flag set (e.g. Skynet and Goris)
* Updated the ammo ini loader mod in the **modders pack**
@@ -192,10 +286,10 @@
* Added a config file to change some engine parameters for the game mechanics
* Added the ability to continuously play the music when moving to another map that uses the same music
* Added the ability to set custom names for unarmed attacks in the inventory to **TranslationsINI**
* Added support for using the newline control character `'\n'` in the object description in `pro_*.msg` files
* Added support for using the newline control character `\n` in the object description in `pro_*.msg` files
* Added support for the new **'Healing Item'** flag to item protos. Now AI will also use items with this flag for healing in combat
* Added support for the new **'Cannot Use'** flag to the misc flags of item objects. This flag makes a weapon object unusable in combat
* Added missing sounds for the buttons on the world map interface (similar to Fallout 1 behavior)
* Added missing sounds to the buttons on the world map interface (similar to Fallout 1 behavior)
* Added 5 `metarule3` macros for controlling the save slot with scripts to `sfall.h` in the **modders pack**
* Added a `sfall.dat` resource file, which contains the required files for various features. The localized `sfall_xx.dat` is also supported
* New script functions: `set_scr_name`, `obj_is_openable`
@@ -236,7 +330,7 @@
* Added a fix to prevent the player name from being displayed at the bottom of the dialog review window when the text is longer than one screen
* Added a fix for the in-game quest list not being in the same order as in `quests.txt`
* Added a fix for multihex critters hitting themselves when they miss an attack with ranged weapons
* Added a fix to the placement of multihex critters in the player's party when entering a map or elevation
* Added a fix for the placement of multihex critters in the player's party when entering a map or elevation
* Added a fix to the starting position of the player's marker on the world map when starting a new game
* Added a fix for AI not checking the safety of weapons based on the selected attack mode
* Added a fix for the incorrect check and AP cost when AI reloads a weapon
@@ -246,9 +340,9 @@
* Added a tweak to prevent NPC aggression when non-hostile NPCs accidentally hit the player or members of the player's team
* Added a tweak to play the **'magic hands'** animation when using an item on an object. This also prevents a few issues with scripted animations not playing
* Added a tweak to remove the unspent skill points limit
* Added an option to disable the special handling of city areas 45 and 46 in the engine when visiting Area 45
* Added an option to disable the engine's special handling of city areas 45 and 46 when visiting Area 45
* Added an option to load alternative dialog msg and subtitle files for female PC (translation friendly)
* Added an option to allow using the caret character `'^'` in dialog msg files to specify alternative text in dialogue based on the player's gender
* Added an option to allow using the caret character `^` in dialog msg files to specify alternative text in dialogue based on the player's gender
* Added a new value to **AIDrugUsePerfFix** to allow NPCs to use only the drugs listed in `chem_primary_desire` and healing drugs
* Added support for loading premade character **GCD/BIO** files from the `premade\<language>\` directory for non-English languages
* Added support for loading fonts from the `fonts\<language>\` directory for non-English languages
@@ -280,7 +374,7 @@
* Added more options for tweaking some engine perks to the **perks ini file**
* Added options for tweaking tag skills to the **skills ini file**
* Added an option about the behavior of maximum HP calculation to the **stats ini file**
* Added 3 new attribute type values to `get_window_attribute` script functions
* Added 3 new attribute type values to `get_window_attribute` script function
* Added additional universal opcodes `sfall_func7` and `sfall_func8` (`compile.exe` and `int2ssl.exe` in the **modders pack** are also updated)
* Added an auto-close containers mod and **NPC armor appearance mod** to the example mods in the **modders pack**
* Added `snd2acm_fix.exe` (snd2acm with a fix wrapper) to the **modders pack** for writing the correct sample rate and channel info from **WAV** files to **ACM** format
@@ -334,7 +428,7 @@
* Fixed the default values for **Movie1 - Movie17** options
* Fixed the playback of additional movies defined in **Movie18 - Movie32** options
* Fixed **OverrideMusicDir=2** not overriding the music path properly
* Fixed incorrect Melee Damage stat value being displayed when setting **BonusHtHDamageFix=1** and **DisplayBonusDamage=0**
* Fixed incorrect Melee Damage stat value being displayed when **BonusHtHDamageFix=1** and **DisplayBonusDamage=0**
* Fixed `attack_complex script` function not setting result flags correctly for the attacker and the target
* Fixed and improved **SFX** and speech playback for alternative sound files
* Fixed and improved the behavior of nested timer events in global scripts
@@ -424,7 +518,7 @@
* Fixed the timing of setting `WORLDMAP`, `DIALOG`, `PIPBOY`, `INVENTORY`, `INTFACEUSE`, and `INTFACELOOT` game mode flags
* Fixed the execution of the timer event in global scripts
* Fixed the palette and the movie playback in **DX9** mode
* Improved the functionality of `create_message_window` script function to support the newline control character `'\n'`
* Improved the functionality of `create_message_window` script function to support the newline control character `\n`
* Removed **TownMapHotkeysFix** and **DisplaySecondWeaponRange** from `ddraw.ini` because there is little reason to turn them off
* Added a fix for duplicate critters being added to the list of potential targets for AI
* Added a fix for the playback of the speech sound file for the death screen being ended abruptly in some cases
@@ -448,7 +542,7 @@
* Changed the debug message about a missing critter art file to also be displayed in the game
* Code refactoring for various script functions
* Added a fix to prevent the player from moving when clicking on a script-created window and prevent the mouse cursor from being toggled when hovering over a **'hidden'** window
* Added a fix to prevent crashes when **DebugMode** is enabled and there is a `'%'` character in the printed message
* Added a fix to prevent crashes when **DebugMode** is enabled and there is a `%` character in the printed message
* Added an option to load a global shader file at game startup and added an example global shader file to the **modders pack**
* Added an option to highlight lootable corpses as well as items
* Added support for executing the `timed_event_p_proc` procedure in global scripts
@@ -587,7 +681,7 @@
* Added a fix to prevent the reserved object IDs of the player and party members from being generated for other objects
* Added a fix for the display issue in the pipboy when the automap list is too long
* Added a fix for the `start` procedure not being called correctly if the required standard script procedure is missing (from Crafty)
* Added an option to disable the special handling of map IDs 19 and 37 in the engine when entering the maps
* Added an option to disable the engine's special handling of map IDs 19 and 37 when entering those maps
* Added support for the new **'automap=yes/no'** parameter to `maps.txt`. This parameter overrides the hardcoded values for displaying the map in the pipboy automaps for the first 160 maps
* Added files for using 32-bit images for talking heads to the **modders pack**
* Improved the functionality of the debug editor (in the **modders pack**)
@@ -607,7 +701,7 @@
* Added a fix for the reserved item FRM being displayed in the top-left corner when in the loot/barter screens
* Added a fix for the active effects of drugs not being saved properly
* Added a fix for NPC stuck in a loop of reloading melee/unarmed weapons when out of ammo
* Added a fix for critters not being healed over time when entering the map if **'dead_bodies_age=No'** is set in `maps.txt`
* Added a fix for critters not being healed over time when entering a map with **'dead_bodies_age=No'** set in `maps.txt`
* Added a fix for corpses being removed early after returning to the map
* Added a fix for the removal of party member's corpse. Now items in party member's inventory are not removed along with the corpse
* Added an option to change the timer for deleting corpses on a map after you leave
@@ -694,7 +788,7 @@ Various bug fixes and features based on the work by Mr.Stalin:
* Improved the functionality of **ExtraSaveSlots**: added sound effect when clicking on the navigation buttons
* Improved the functionality of **StartGDialogFix** to fix a crash when calling `start_gdialog` outside the `talk_p_proc` procedure for talking heads
* Improved and expanded the functionality of **UseScrollingQuestsList** to display page numbers and add another set of scroll buttons
* Expanded `is_iface_tag_active` script function to check tag value of 0/1/2 (sneak/poisoned/radiated)
* Expanded `is_iface_tag_active` script function to check tag values of 0/1/2 (sneak/poisoned/radiated)
* Added a fix for the broken `obj_can_hear_obj` script function
* Added a fix for the underline position in the inventory display window when the item name is longer than one line
* Added a fix for AI being unable to use the picked up object immediately when there is a different object with the same ID
@@ -707,7 +801,7 @@ Various bug fixes and features based on the work by Mr.Stalin:
## 3.8.11
Various bug fixes based on the work by Mr.Stalin:
* Fixed an issue with file IDs of additional game msg files being shifted when a file in **ExtraGameMsgFileList** is missing
* Fixed an issue where the file IDs of additional game msg files were shifted when a file in **ExtraGameMsgFileList** was missing
* Fixed `obj_can_see_obj` script function not checking if source and target objects are on the same elevation before calling `HOOK_WITHINPERCEPTION` hook script
* Added a fix for the display issue in the pipboy when a quest list is too long with **UseScrollingQuestsList** diabled
* Added a fix for the clickability issue of the holodisk list in the pipboy
@@ -748,7 +842,7 @@ Original engine bug fixes and various features based on the work by Mr.Stalin:
* Fixed a crash bug in **NPC combat control** when trying to control a temporary party member that has no data in `party.txt`
## 3.8.5
* Fixed an issue with the game being rendered before the **hero appearance mod** is loaded
* Fixed an issue where the game was rendered before the **hero appearance mod** was loaded
* Included Chinese and Russian translations
Original engine bug fixes and various features based on the work by Crafty:
@@ -780,7 +874,7 @@ Original engine bug fixes and various features based on the work by Crafty:
Original engine bug fixes and various features based on the work by Crafty:
* Added a fix for a crash when clicking on empty space in the inventory list opened by **'Use Inventory Item On'** (backpack) action icon
* Added a fix for negative SPECIAL values in character creation
* Added a fix for negative SPECIAL values in the character creation
* Added a fix for the game hanging in an endless loop in combat mode when calling `anim` script functions inside `damage_p_proc`
* Added 3 new arguments to `HOOK_BARTERPRICE` hook script
@@ -891,7 +985,7 @@ Original engine bug fixes and various features based on the work by Crafty:
* Added a fix for the original engine issue that caused party members to have incorrect stats when they level up while on drugs
* Added a fix for the unlimited ammo exploit
* Added a fix for negative values in Skilldex window
* Added a fix for the clickability issue in the pipboy and an exploit that allows resting in places where you shouldn't be able to
* Added a fix for the clickability issue in the pipboy and an exploit that allows resting in restricted areas
* Added a fix to prevent **'Too Many Items'** bug from corrupting save files
* Added a fix for the exploit that you can gain stats from more than two doses of a specific chem after save/load
* Added a fix for the original engine issues with reverse order of items in memory relative to visual order in the inventory list
@@ -905,4 +999,4 @@ Original engine bug fixes and various features based on the work by Crafty:
* Added an option to allow 9 options (lines of text) to be displayed correctly in the dialog window
* Added an option to display additional points of damage from **Bonus HtH/Ranged Damage** perks in the inventory
__For changelogs prior to 3.7, please read the `sfall-readme.txt` in the [release files](https://github.com/sfall-team/sfall/releases).__
__For changelogs prior to version 3.7, please refer to the `sfall-readme.txt` in the [release files](https://github.com/sfall-team/sfall/releases).__
+7 -8
View File
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -645,14 +645,14 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@@ -664,12 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+1 -1
View File
@@ -37,7 +37,7 @@ Delete `ddraw.dll`, `ddraw.ini`, and `sfall.dat` from your Fallout directory.
This mod is configured via the `ddraw.ini` file, which can be opened with any text editor. Details of every configerable option are included in that file. Where a comment refers to a DX scancode, the complete list of codes can be found at the link below:\
https://kippykip.com/b3ddocs/commands/scancodes.htm
In a default installation using an unmodified copy of `ddraw.ini`, the middle mouse button will be set to switch between weapons and the mouse wheel will be set to scroll through any menus that respond to the up/down arrow keys. Holding Ctrl and hitting numpad keys 0 to 6 (with Num Lock off) will adjust the game speed. Holding left Ctrl will let you move a whole stack of items at once. Pressing left Shift will highlight items on the ground. The script extender and any engine fixes are also enabled. Most of the options that change gameplay in some way not originally intended by the developers are disabled.
In a default installation using an unmodified copy of `ddraw.ini`, the middle mouse button will be set to switch between weapons and the mouse wheel will be set to scroll through any menus that respond to the up/down arrow keys. Holding **Ctrl** and hitting numpad keys 0 to 6 (with Num Lock off) will adjust the game speed. Holding **left Ctrl** will let you move items between inventory lists by simply clicking on them. Pressing **left Shift** will highlight items on the ground, and holding the key will let you move an entire stack of items at once. The script extender and any engine fixes are also enabled. Most of the options that change gameplay in some way not originally intended by the developers are disabled.
For [__Wine__](https://www.winehq.org/) users:\
You need to set DLL overrides for `ddraw.dll` to __"native, builtin"__ in `winecfg` or use `WINEDLLOVERRIDES="ddraw=n,b"` to run Fallout from the command line. If you want to play alternative sound files, you'll also need to install GStreamer Good 32-bit plugins.
+33 -4
View File
@@ -2,11 +2,17 @@
;When adding extra perks to a mod, it's advisable to use the fake perk scripting functions rather than make
; modifications in this file, as some perks have hardcoded effects which may catch you out
;Set the bonus value to 0 in the 'PerksTweak' section for perks to get around this problem
;Since traits need to be picked before any scripts run, they have an additional NoHardcode option in this file which can
; be used to remove their hardcoded effects, and add new stat/skill effects
;Since traits need to be picked before any scripts run, they have an additional 'NoHardcode' option in this file
; which can be used to remove their hardcoded effects, and add new stat/skill effects
;##############################################################################
[PerksTweak]
;Changes the light level bonus for 'Night Vision' perk (ID 9)
;valid range: 0..100, 20 - default bonus
NightVisionBonus=20
;Changes the Outdoorsman skill bonus for 'Survivalist' perk (ID 16)
;125 - maximum bonus, 25 - default bonus
SurvivalistBonus=25
@@ -15,6 +21,20 @@ SurvivalistBonus=25
;25 - default bonus
MasterTraderBonus=25
;Changes the skill point bonus for 'Educated' perk (ID 18)
;125 - maximum bonus, 2 - default bonus
EducatedBonus=2
;Changes the hit point bonuses for 'Healer' perk (ID 19)
;999 - maximum bonus, 4 - default bonus
HealerMinBonus=4
;999 - maximum bonus, 10 - default bonus
HealerMaxBonus=10
;Changes the hit point bonus for 'Lifegiver' perk (ID 28)
;125 - maximum bonus, 4 - default bonus
LifegiverBonus=4
;Changes the Science and Repair skill bonus for 'Mr.Fixit' perk (ID 31)
;125 - maximum bonus, 10 - default bonus
MrFixitBonus=10
@@ -59,6 +79,15 @@ WeaponScopeRangeBonus=5
VaultCityInoculationsPoisonBonus=10
VaultCityInoculationsRadBonus=10
;Changes the distance bonus for 'Cautious Nature' perk (ID 80)
;Affects where critters spawn in 'surrounding' random encounters without a specified distance
;valid range: -12..20, 3 - default bonus
CautiousNatureBonus=3
;Changes the percentage bonus for 'Comprehension' perk (ID 81)
;50 - default bonus
ComprehensionBonus=50
;Changes the damage bonus per level for 'Demolition Expert' perk (ID 82)
;999 - maximum bonus, 10 - default bonus
DemolitionExpertBonus=10
@@ -72,8 +101,9 @@ GamblerBonus=20
HarmlessBonus=20
;Changes the damage bonus and the Doctor skill bonus for 'Living Anatomy' perk (ID 97)
;125 - maximum bonus, 5 - default bonus, 10 - default skill bonus
;125 - maximum bonus, 5 - default damage bonus
LivingAnatomyBonus=5
;125 - maximum bonus, 10 - default skill bonus
LivingAnatomyDoctorBonus=10
;Changes the Speech and Barter skill bonus for 'Negotiator' perk (ID 99)
@@ -141,7 +171,6 @@ Enable=0
;If the value is set to -99999, the variable will be ignored (similar to comment out that line)
;##############################################################################
;This is a modification to perk 119
[119]
Name=Example
+9
View File
@@ -1,4 +1,13 @@
[sfall]
;Table for overriding ASCII codes for keyboard character input when entering the player's name and saved game descriptions
;Only character codes in the ASCII range 33-126 can be overridden
;Character codes that do not need to be overridden can be omitted by using commas as delimiters
;You must also set a key for switching layouts using the XltKey option in ddraw.ini
;Default character code table for the English layout (letter codes only)
;XltTable=,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,,,,,,,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,,,,
;##############################################################################
SaveInCombat=Cannot save at this time.
KarmaGain=You gained %d karma.
KarmaLoss=You lost %d karma.
+4 -2
View File
@@ -1,9 +1,11 @@
sfall's main configuration options appear in ddraw.ini, but there are several other configuration files that it can read in for modding purposes.
Books.ini: Lets you override/add books to the game (associated object PIDs, skills and text messages)
Books.ini: Lets you override/add books to the game (associated object PIDs, skills, and text messages)
Perks.ini: Lets you override the name/description/frm image/other stats of perks and traits
Elevators.ini: Lets you override which elevators lead where
Elevators.ini: Lets you override which elevators lead to where
CriticalOverrides.ini: Lets you make modifications to the critical hit tables
Translations.ini: Contains some text strings which sfall displays, to allow their translation
Skills.ini: Lets you change the formula used for calculating skills
Stats.ini: Lets you change the formula used to calculate the derived stats
Tweaks.ini: Lets you override a few object PIDs used in the engine
Unarmed.ini: Lets you configure the requirements and effects of unarmed attacks
+67 -24
View File
@@ -1,5 +1,5 @@
;sfall configuration settings
;v3.8.43.1
;v3.8.48
[Main]
;Set to 1 if you want to use command line arguments to tell sfall to use another ini file
@@ -30,7 +30,7 @@ UseCommandLine=0
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Speed]
;Set to 1 to enable options related to the game speed adjustment (SpeedMulti#, SpeedKey#, SpeedModKey, and SpeedToggleKey)
;Set to 0 to disable everything in this section
Enable=1
;The speeds corresponding to each slot in percent. (i.e. 100 is normal speed)
@@ -105,6 +105,13 @@ FadeMultiplier=100
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Interface]
;Set to 1 to use the expanded world map interface
;Set to 2 to skip correcting the position of entrance markers on town maps
;You can use resized FRMs in 700x682 for town maps in the expanded world map interface
;Requires the hi-res patch and a new WORLDMAP.frm file in art\intrface\ (included in sfall.dat)
;The screen resolution must be set to at least 890x720
ExpandWorldMap=0
;Set to 1 to draw a dotted line while traveling on the world map (similar to Fallout 1)
WorldMapTravelMarkers=0
;Uncomment these lines to change the appearance of the markers
@@ -131,7 +138,7 @@ AllowSoundForFloats=0
;This does not effect the play_sfall_sound and stop_sfall_sound script functions
AllowDShowSound=0
;Set to 1 to override the default music path with data\sound\music\ if music_path is not present in the cfg
;Set to 1 to override the default music path with data\sound\music\ if music_path is not present in fallout2.cfg
;Set to 2 to overwrite all occurrences of the music path
OverrideMusicDir=1
@@ -203,7 +210,7 @@ SpeedKey9=0x00
;A key to hold down to move the window around when using DX9 graphics mode 5
;Set to 0 if you don't want to use a modifier key, or a DX scancode otherwise
;Set to -1 for either ctrl key, -2 for either alt key or -3 for either shift key
;Set to -1 for either Ctrl key, -2 for either Alt key, or -3 for either Shift key
WindowScrollKey=0
;A key to press to toggle the highlighting of all items on the ground on the current map
@@ -216,7 +223,7 @@ HighlightContainers=0
;Set to 1 to also highlight lootable corpses
HighlightCorpses=0
;Set the color of outlines, available colors:
;Set the color of outlines for items, available colors:
;1 - glowing red
;2 - red
;4 - grey
@@ -227,23 +234,39 @@ HighlightCorpses=0
;You can set a custom color from the game palette by multiplying the color index value by 256 (in 3.8.27 or later)
OutlineColor=16
;Set the color of outlines for containers
OutlineColorContainers=4
;Set the color of outlines for corpses
OutlineColorCorpses=4
;A key to press to reload your currently equipped weapon or use the active item
;Set to 0 if you don't want a reload key, or a DX scancode otherwise
ReloadWeaponKey=0
;A key to hold down to let you move/drop a whole stack of items at once without the 'Move Items' window
;Set to 0 if you don't want to use a modifier key, or a DX scancode otherwise
ItemFastMoveKey=29
;A key to hold down to let you move/drop an entire stack of items at once without the 'Move Items' window
;Set to 0 if you don't want a fast move key, or a DX scancode otherwise
ItemFastMoveKey=42
;Set to 1 to skip the 'Move Items' window when taking items from containers or corpses and not holding down ItemFastMoveKey
;Requires ItemFastMoveKey to be enabled
FastMoveFromContainer=0
;A key to hold down to let you move items between inventory lists by simply clicking on them
;In the inventory screen, items from the main inventory list will go to appropriate slots
;Set to 0 if you don't want a skip drag key, or a DX scancode otherwise
;Can be mapped to the same key as ItemFastMoveKey for a combined effect
ItemMoveSkipDragKey=29
;A key to press to open a debug game editor
;Set to 0 to disable, or a DX scancode otherwise
;Requires sfall debugging mode and FalloutDebug.exe from the modders pack
DebugEditorKey=0
;A key to press to switch the keyboard layout (uses character codes from the XltTable option in Translations.ini)
;Set to 1 for Num Lock, 2 for Caps Lock, 3 for Scroll Lock, or 0 to disable
XltKey=0
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Misc]
;Changes some of Fallout 2 engine functions to Fallout 1 behavior:
@@ -267,7 +290,7 @@ WorldMapTimeMod=100
WorldMapFPSPatch=1
;Controls the world map speed if WorldMapFPSPatch is 1. Higher values cause slower movement
;Default is 66 milliseconds
;Default is 66 milliseconds, and the maximum is 150
WorldMapDelay2=66
;Set to 1 to enable Ray's patch to make world map encounter rate independent of your travel speed
@@ -351,8 +374,8 @@ Movie17=credits.mve
;LocalMapXLimit=480
;LocalMapYLimit=400
;Set to 1 if you want the pipboy to be available at the start of the game
;Set to 2 to make the pipboy available by only skipping the vault suit movie check
;Set to 1 to make the pipboy and the vault suit available when the game starts
;Set to 2 to make only the pipboy available
PipBoyAvailableAtGameStart=0
;Set to 1 to double the number of available kill types
@@ -379,9 +402,9 @@ TownMapHotkeysFix=1
;Set to 1 to disable the Horrigan encounter
DisableHorrigan=0
;Set to 1 to disable the random element in NPC levelling
;This will cause all NPC party members to automatically level up as soon as the player reaches the requirements
NPCAutoLevel=0
;Set to 1 to disable the random element in party member leveling
;This will prevent party members from randomly leveling up early and instead level them up at defined intervals
PartyMemberNonRandomLevelUp=0
;Change the initial starting location and world map viewport
;Leave at -1 for default
@@ -445,11 +468,8 @@ PlayIdleAnimOnReload=0
;Default is 6. Set to 0 for a 12-hour timer
CorpseDeleteTime=6
;Set a number of milliseconds to idle each input loop
;Set to -1 to disable
;Set to 0 to idle only if other processes are waiting for processor time (WinXP/2000: if processes have equal priority)
;Set to 1 (or some higher number if needed) to prevent 100% CPU use. The maximum is 50
ProcessorIdle=-1
;Set to 1 to allow the game to go idle during each input loop, preventing 100% CPU usage
ProcessorIdle=0
;Set to 1 if using the hero appearance mod
;Set to 2 for backward compatibility with scripts that manually fix obj_art_fid/art_change_fid_num script functions for dude_obj
@@ -650,7 +670,7 @@ DialogPanelAnimDelay=33
PipboyTimeAnimDelay=50
;Set to 1 to let you use the command cursor to specify targets for party members to attack in combat
;The 'Attack Who' preference in the combat control panel of party members must be set to 'Whomever you want'
;The 'Disposition' setting in the combat control panel for party members must be set to 'Custom'
PartyOrderToAttack=0
;Changes the way weapon reloading works when you drag ammo onto a weapon in the inventory
@@ -663,6 +683,10 @@ ReloadReserve=-1
;Set to 1 to change the counter in the 'Move Items' window to start with maximum number, except in the barter screen
ItemCounterDefaultMax=0
;Set to 1 to enable money/caps auto-balancing in the barter screen
;When moving money/caps to or from the table, the 'Move Items' window will be pre-filled with the correct balancing amount
ItemCounterAutoCaps=0
;Set to 1 to leave the music playing in dialogue with talking heads
EnableMusicInDialogue=0
@@ -699,7 +723,7 @@ NumbersInDialogue=0
;Set to 1 to use Fallout's normal text font instead of DOS-like font on the world map
WorldMapFontPatch=0
;Set to 1 to use Fallout's normal text font for death screen subtitles
;Set to 1 to use Fallout's normal text font instead of DOS-like font for death screen subtitles
;Requires changing the color of subtitles in death.pal palette to white color (index 220) to display the text correctly
DeathScreenFontPatch=0
@@ -764,7 +788,7 @@ AIBestWeaponFix=1
;Set to 2 to allow NPCs to use only the drugs listed in chem_primary_desire and healing drugs (stimpaks and healing powder)
;Note: chem_primary_desire without fixes prevents the specified item from being consumed if all three values in the list are the same PID
;chem_primary_desire also works as a priority list of drug items the NPC will try to pick up in combat when they are on the ground
AIDrugUsePerfFix=0
AIDrugUsePerfFix=1
;Set to 1 to fix the bug of using First Aid/Doctor skills when using them on the player
;This will cause the party member to perform First Aid/Doctor skills when you use them on the player, but only if
@@ -777,15 +801,25 @@ PartyMemberSkillFix=0
;Set to -1 to disable the special death message when the global variable is set
SpecialDeathGVAR=491
;Set to 1 to disable the special handling of map IDs 19 and 37 in the engine when entering the maps
;Set to 1 to disable the engine's special handling of map IDs 19 and 37 when entering those maps
;Note that enabling this option will break the map changes in Modoc and Vault 15 in Fallout 2
DisableSpecialMapIDs=0
;Set to 1 to disable the special handling of city areas 45 and 46 in the engine when visiting Area 45:
;Set to 1 to disable the engine's special handling of city areas 45 and 46 when visiting Area 45:
;Area 45 automatically disappears from the world map, and Area 46 appears on the world map
;Note that enabling this option will break the location change of the 'Fake Vault 13' in Fallout 2
DisableSpecialAreas=0
;Set to 1 to disable the engine's processing of events related to Arroyo (areas 0 and 22)
;This also disables the playback of Hakunin dream sequences and the processing of global variables:
;GVAR_ENEMY_ARROYO (7), GVAR_TOWN_REP_ARROYO (47), GVAR_FALLOUT_2 (494)
DisableArroyoEvents=0
;Set to 1 to fix the issue with the division operator treating negative integers as unsigned
;Note: To perform the unsigned integer division, use the new 'div' operator
;This option is always enabled in 4.3.5/3.8.35 or later. The information is left for reference only
DivisionOperatorFix=1
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; Configuration ini files
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@@ -865,6 +899,15 @@ SkipCompatModeCheck=0
;-------
DebugMode=0
;Changes the font used for debug output in the internal debug window (DebugMode 1 or 3)
;Set to 1 to use Fallout's normal text font instead of DOS-like font
DebugWindowFont=0
;Changes the width of the internal debug window (valid range: 300..1920; default is 300)
DebugWindowWidth=300
;Changes the height of the internal debug window (valid range: 192..1080; default is 192)
DebugWindowHeight=192
;Set to 1 to hide error messages in debug output when a null value is passed to the function as an object
HideObjIsNullMsg=0
@@ -0,0 +1,429 @@
/*
This script reimplements the healing skills of the original game.
This version uses a refactored code with no less code duplication, but potentially some minor differences from vanilla.
You can use this to make any tweaks you want to these skills.
*/
#include "../../scripting/headers/define_lite.h"
#include "../../scripting/headers/define_extra.h"
#include "../../scripting/headers/sfall.h"
#include "../../scripting/headers/lib.arrays.h"
#include "../../scripting/headers/lib.math.h"
#define PID_FIRST_AID_KIT (47)
#define PID_DOCTORS_BAG (91)
#define PID_FIELD_MEDIC_KIT (408)
#define PID_PARAMEDICS_BAG (409)
#define DAM_CRIP (DAM_CRIP_ARM_LEFT bwor DAM_CRIP_ARM_RIGHT bwor DAM_CRIP_LEG_LEFT bwor DAM_CRIP_LEG_RIGHT bwor DAM_BLIND)
#define COMBAT_STATE_FLEEING (4)
#define critter_max_hp(cr) get_critter_stat(cr, STAT_max_hit_points)
#define critter_cur_hp(cr) get_critter_stat(cr, STAT_current_hp)
#define critter_has_dmg_flag(cr, flag) ((get_object_data(cr, OBJ_DATA_DAMAGE_FLAGS) bwand flag) != 0)
#define clear_critter_flag(cr, offset, flag) set_object_data(cr, offset, get_object_data(cr, offset) bwand bwnot(flag))
#define clear_critter_dmg_flag(cr, flag) clear_critter_flag(cr, OBJ_DATA_DAMAGE_FLAGS, flag)
#define clear_critter_combat_flag(cr, flag) clear_critter_flag(cr, OBJ_DATA_COMBAT_STATE, flag)
#define SKILLS_MAX_USES_PER_DAY (3)
variable times_skill_used, healable_damage_flags;
procedure skill_use_slot_available(variable skill) begin
variable slot, time, hoursSinceLastUsage, timesUsed;
// Lazy init array
if (not times_skill_used) then
times_skill_used := create_array_map;
if (not times_skill_used[skill]) then
times_skill_used[skill] := create_array_list(SKILLS_MAX_USES_PER_DAY);
timesUsed := times_skill_used[skill];
for (slot := 0; slot < SKILLS_MAX_USES_PER_DAY; slot++) begin
if (timesUsed[slot] == 0) then
return slot;
end
time := game_time;
hoursSinceLastUsage = (time - timesUsed[0]) / ONE_GAME_HOUR;
if (hoursSinceLastUsage <= 24) then begin
return -1;
end
return SKILLS_MAX_USES_PER_DAY - 1;
end
procedure skill_use_slot_add(variable skill) begin
variable i, timesUsed,
slot := skill_use_slot_available(skill);
if (slot == -1) then
return -1;
timesUsed := times_skill_used[skill];
if (timesUsed[slot] != 0) then begin
// Shift all earlier use times to make use for the new time.
for (i := 0; i < slot; i++) begin
timesUsed[i] := timesUsed[i + 1];
end
end
timesUsed[slot] = game_time;
return 0;
end
procedure critter_is_dead(variable critter) begin
if (not critter) then
return false;
if (obj_type(critter) != OBJ_TYPE_CRITTER) then
return false;
if (critter_cur_hp(critter) <= 0) then
return true;
if (is_critter_dead(critter) != 0) then
return true;
return false;
end
procedure critter_body_type(variable critter) begin
if (not critter) then begin
debug_msg("\nError: critter_body_type: pobj was NULL!");
return CR_BODY_BIPED;
end
if (obj_type(critter) != OBJ_TYPE_CRITTER) then
return CR_BODY_BIPED;
return proto_data(obj_pid(critter), cr_body_type);
end
procedure critter_is_crippled(variable critter) begin
if (not critter) then
return false;
if (obj_type(critter) != OBJ_TYPE_CRITTER) then
return false;
return critter_has_dmg_flag(critter, DAM_CRIP);
end
procedure get_skill_xp(variable skill) begin
switch (skill) begin
case SKILL_FIRST_AID: return 25;
// case SKILL_REPAIR: return 0; // no exp for repair skill in vanilla!
case SKILL_DOCTOR: return 50;
default: return 0;
end
end
procedure show_skill_use_messages(variable skill, variable successCount := 1) begin
variable baseExp, xpToAdd, before, after;
if (successCount <= 0) then return;
baseExp = get_skill_xp(skill);
if (baseExp == 0) then return;
xpToAdd = successCount * baseExp;
before = get_pc_stat(PCSTAT_experience);
give_exp_points(xpToAdd);
after = get_pc_stat(PCSTAT_experience);
display_msg(sprintf(mstr_skill(505), after - before));
end
variable sfall_ini_RemoveCriticalTimelimits := -2;
/**
* Exactly like FO2 roll_check function, but without returning "how_much".
* @arg {int} rollMod
* @arg {int} critSuccessMod
*/
procedure roll_check(variable rollMod, variable critSuccessMod) begin
variable
delta := rollMod - random(1, 100),
roll, criticalsAllowed;
if (sfall_ini_RemoveCriticalTimelimits == -2) then
sfall_ini_RemoveCriticalTimelimits := get_ini_setting("ddraw.ini|Misc|RemoveCriticalTimelimits");
criticalsAllowed := (sfall_ini_RemoveCriticalTimelimits > 0) or (game_time >= ONE_GAME_DAY);
if (delta < 0) then begin
return ROLL_CRITICAL_FAILURE
if (criticalsAllowed and random(1, 100) <= -delta / 10)
else ROLL_FAILURE;
end
return ROLL_CRITICAL_SUCCESS
if (criticalsAllowed and random(1, 100) <= delta / 10 + critSuccessMod)
else ROLL_SUCCESS;
end
// 530: damaged eye
// 531: crippled left arm
// 532: crippled right arm
// 533: crippled right leg
// 534: crippled left leg
#define display_uncrippled_msg(dmgFlagIdx, prefixMsgId) display_msg(sprintf(mstr_skill(prefixMsgId), mstr_skill(530 + dmgFlagIdx)))
/**
* A refactored version of skill_use function from the engine, for use with healing skills only. Returns true if skill use was actually attempted.
* @arg {ObjectPtr} user
* @arg {ObjectPtr} target
* @arg {int} skill - First Aid, Doctor or Repair
* @arg {int} skillBonus
*/
procedure use_healing_skill(variable user, variable target, variable skill, variable skillBonus) begin
variable curHp, maxHp, healingAttempts, isRobot, isRepair, isFirstAid;
display_msg(string_format("use_healing_skill: user = %s, target = %s, bonus = %d, skill = %d", obj_name(user), obj_name(target), skillBonus, skill));
isRobot := (critter_body_type(target) == CR_BODY_ROBOTIC);
isRepair := (skill == SKILL_REPAIR);
if (isRepair and not isRobot) then begin
// You cannot repair that.
display_msg(mstr_skill(553));
return false;
end
if (skill_use_slot_available(skill) == -1) then begin
// 590: You've taxed your ability with that skill. Wait a while.
// 591: You're too tired.
// 592: The strain might kill you.
display_msg(mstr_skill(590 + random(0, 2)));
return false;
end
if (critter_is_dead(target)) then begin
// 512: You can't heal the dead.
// 513: Let the dead rest in peace.
// 514: It's dead, get over it.
display_msg(mstr_skill(512 + random(0, 2)));
return false;
end
isFirstAid := (skill == SKILL_FIRST_AID);
curHp := critter_cur_hp(target);
maxHp := critter_max_hp(target);
healingAttempts := 1;
if (curHp < maxHp or (not isFirstAid and critter_is_crippled(target))) then begin
variable skillUseSlotAdded, roll, i, prefixMsg,
critChance := get_critter_stat(user, STAT_crit_chance) + skillBonus;
fade_out;
// Heal crippled limbs.
if (not isFirstAid and (not isRepair or not isRobot) and critter_is_crippled(target)) then begin
// Lazy init healable flags
if (not healable_damage_flags) then
healable_damage_flags := array_fixed([
DAM_BLIND,
DAM_CRIP_ARM_LEFT,
DAM_CRIP_ARM_RIGHT,
DAM_CRIP_LEG_RIGHT,
DAM_CRIP_LEG_LEFT
]);
for (i := 0; i < len_array(healable_damage_flags); i++) begin
if (not critter_has_dmg_flag(target, healable_damage_flags[i])) then
continue;
healingAttempts += 1;
roll := roll_vs_skill(user, skill, critChance);
if (roll == ROLL_SUCCESS or roll == ROLL_CRITICAL_SUCCESS) then begin
clear_critter_dmg_flag(target, healable_damage_flags[i]);
clear_critter_combat_flag(target, COMBAT_STATE_FLEEING);
// 520: You heal your %s.
// 521: You heal the %s.
display_uncrippled_msg(i, 520 if (target == dude_obj) else 521);
call skill_use_slot_add(skill);
skillUseSlotAdded := true;
if (user == dude_obj) then
call show_skill_use_messages(skill);
end else begin
// 525: You fail to heal your %s.
// 526: You fail to heal the %s.
display_uncrippled_msg(i, 525 if (target == dude_obj) else 526);
end
end
end
// Restore hit points.
roll := (roll_vs_skill(user, skill, critChance) if isFirstAid else roll_check(has_skill(user, skill), critChance))
if (isRepair or not isRobot)
else ROLL_FAILURE;
if (roll == ROLL_SUCCESS or roll == ROLL_CRITICAL_SUCCESS) then begin
variable
minHpToHeal := (1 if isFirstAid else 4),
maxHpToHeal := (5 if isFirstAid else 10),
hpToHeal;
if (user == dude_obj and not isRepair) then begin
variable healerRank := has_trait(TRAIT_PERK, user, PERK_healer);
minHpToHeal += 4 * healerRank;
maxHpToHeal += 10 * healerRank;
end
hpToHeal = random(minHpToHeal, maxHpToHeal);
critter_heal(target, hpToHeal);
if (user == dude_obj) then begin
// You heal %d hit points.
display_msg(sprintf(mstr_skill(500), math_min(maxHp - curHp, hpToHeal)));
end
if (not skillUseSlotAdded) then
call skill_use_slot_add(skill);
clear_critter_combat_flag(target, COMBAT_STATE_FLEEING);
if (user == dude_obj) then
call show_skill_use_messages(skill);
end else begin
// You fail to do any healing.
display_msg(sprintf(mstr_skill(503), how_much(0)));
end
fade_in;
end else if (user == dude_obj) then begin
// 501: You look healty already
// 502: %s looks healthy already
display_msg(mstr_skill(501)
if (target == dude_obj)
else sprintf(mstr_skill(502), obj_name(target)));
end
if (user == dude_obj) then begin
game_time_advance((ONE_GAME_HOUR if (skill == SKILL_DOCTOR) else (30 * ONE_GAME_MINUTE)) * healingAttempts);
end
// TODO: not sure if this is needed
//exec_map_update_scripts
return true;
end
/**
* A partial copy of engine's protinst_use_item_on with code pertinent to healing skills. Returns value for set_sfall_return in useobjon_hook.
* @arg {ObjectPtr} user - item user
* @arg {ObjectPtr} target - target
* @arg {ObjectPtr} item - item
* @ret {bool}
*/
procedure protinst_use_item_on(variable user, variable target, variable item) begin
variable begin
messageId := -1;
skillBonus := 0;
skill := -1;
end
switch (obj_pid(item)) begin
case PID_DOCTORS_BAG: begin
// The supplies in the Doctor's Bag run out.
messageId = 900;
skillBonus = 20;
skill = SKILL_DOCTOR;
end
case PID_FIRST_AID_KIT: begin
// The supplies in the First Aid Kit run out.
messageId = 901;
skillBonus = 20;
skill = SKILL_FIRST_AID;
end
case PID_PARAMEDICS_BAG: begin
// The supplies in the Paramedic's Bag run out.
messageId = 910;
skillBonus = 40;
skill = SKILL_DOCTOR;
end
case PID_FIELD_MEDIC_KIT: begin
// The supplies in the Field Medic First Aid Kit run out.
messageId = 911;
skillBonus = 40;
skill = SKILL_FIRST_AID;
end
end
if (skill == -1) then
return -1;
if (combat_is_initialized) then begin
// You cannot do that in combat.
if (user == dude_obj) then
display_msg(mstr_proto(902));
return 0;
end
if (not use_healing_skill(user, target, skill, skillBonus)) then
return 0;
if (random(1, 10) != 1) then
return 0;
if (user == dude_obj) then
display_msg(mstr_proto(messageId));
return 1;
end
/*
Runs when:
a critter uses an object on another critter. (Or themselves)
a critter uses an object from inventory screen AND this object does not have "Use" action flag set and it's not active flare or explosive.
player or AI uses any drug
This is fired before the object is used, and the relevant use_obj_on script procedures are run. You can disable default item behavior.
NOTE: You can't remove and/or destroy this object during the hookscript (game will crash otherwise). To remove it, return 1.
Critter arg0 - The target
Critter arg1 - The user
int arg2 - The object used
int ret0 - overrides hard-coded handler and selects what should happen with the item (0 - place it back, 1 - remove it, -1 - use engine handler)
*/
procedure useobjon_hook begin
variable
target := get_sfall_arg,
user := get_sfall_arg,
item := get_sfall_arg,
useItemResult;
useItemResult := protinst_use_item_on(user, target, item);
if (useItemResult != -1) then
set_sfall_return(useItemResult);
end
/*
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). Suggested use - override First Aid/Doctor skills to buff/nerf them, override Steal skill to disallow observing NPCs inventories in some cases.
Does not run if the script of the object calls script_overrides for using the skill.
Critter arg0 - The user critter
Obj arg1 - The target object
int arg2 - skill being used
int arg3 - skill bonus from items such as first aid kits
int ret0 - overrides hard-coded handler (-1 - use engine handler, any other value - override; if it is 0, there will be a 10% chance of removing the used medical item)
*/
procedure useskill_hook begin
variable
user := get_sfall_arg,
target := get_sfall_arg,
skill := get_sfall_arg,
skillBonus := get_sfall_arg,
isSuccess;
if (skill == SKILL_FIRST_AID or skill == SKILL_DOCTOR or skill == SKILL_REPAIR) then begin
isSuccess := use_healing_skill(user, target, skill, skillBonus);
set_sfall_return(0 if isSuccess else 1);
end
end
procedure start begin
if (game_loaded) then begin
register_hook_proc(HOOK_USEOBJON, useobjon_hook);
register_hook_proc(HOOK_USESKILL, useskill_hook);
end
end
@@ -17,7 +17,7 @@
NOTE: this script requires compiler from sfall modderspack with -s option
(short circuit evaluation)
version 1.2
version 1.3
**/
@@ -38,6 +38,8 @@ variable alsoCorpse;
variable alsoCritter;
variable checkLOS;
variable outlineColor;
variable outlineColorContainers;
variable outlineColorCorpses;
variable motionScanner;
variable highlightFailMsg1;
variable highlightFailMsg2;
@@ -67,6 +69,12 @@ procedure GetOutlineColor(variable obj, variable isCritter) begin
if checkLOS and not DudeCanSee(obj) then
return 0;
if obj_type(obj) == OBJ_TYPE_CRITTER then
return outlineColorCorpses;
if obj_item_subtype(obj) == item_type_container then
return outlineColorContainers;
return outlineColor;
end
@@ -106,7 +114,7 @@ procedure KeyPressHandler begin
scanCode := get_sfall_arg,
scanner, charges;
if scanCode == highlightKey and not(get_game_mode bwand (INTFACELOOT bwor BARTER)) then begin
if scanCode == highlightKey and not(get_game_mode bwand bwnot(COMBAT bwor PCOMBAT)) then begin
if pressed then begin
set_global_script_repeat(REPEAT_FRAMES);
if motionScanner then begin
@@ -143,9 +151,9 @@ procedure CombatTurnHandler begin
end
end
// visual glitch fix, turn off highlight when opening loot/barter screens - for 3.8.29+
// visual glitch fix, turn off highlight when opening other interfaces - for 3.8.29+
procedure GameModeChangeHandler begin
if isHighlight and (get_game_mode bwand (INTFACELOOT bwor BARTER)) then begin
if isHighlight and (get_game_mode bwand bwnot(COMBAT bwor PCOMBAT)) then begin
call ToggleHighlight(false);
end
end
@@ -168,6 +176,10 @@ procedure start begin
checkLOS := GetConfig(configSection, "CheckLOS", 0);
outlineColor := GetConfig(configSection, "OutlineColor", 16);
if (outlineColor < 1) then outlineColor := 64;
outlineColorContainers := GetConfig(configSection, "OutlineColorContainers", 16);
if (outlineColorContainers < 1) then outlineColorContainers := 64;
outlineColorCorpses := GetConfig(configSection, "OutlineColorCorpses", 16);
if (outlineColorCorpses < 1) then outlineColorCorpses := 64;
motionScanner := GetConfig(configSection, "MotionScanner", 0);
highlightFailMsg1 := Translate("HighlightFail1", "You aren't carrying a motion sensor.");
@@ -179,7 +191,7 @@ procedure start begin
register_hook_proc(HOOK_INVENTORYMOVE, InventoryMoveHandler);
set_global_script_type(1);
end else begin
if isHighlight and not(get_game_mode bwand (INTFACELOOT bwor BARTER)) then begin
if isHighlight and not(get_game_mode bwand bwnot(COMBAT bwor PCOMBAT)) then begin
call ToggleHighlight(true);
end
end
@@ -15,7 +15,7 @@ Critters=0
; Set to 1 to only highlight objects in the player's line-of-sight
CheckLOS=1
; Set the color of outlines for items, corpses, and containers; available colors:
; Set the color of outlines for items; available colors:
; 1 - glowing red
; 2 - red
; 4 - grey
@@ -26,6 +26,12 @@ CheckLOS=1
; You can set a custom color from the game palette by multiplying the color index value by 256 (in 3.8.27 or later)
OutlineColor=16
; Set the color of outlines for containers
OutlineColorContainers=4
; Set the color of outlines for corpses
OutlineColorCorpses=4
; Motion Scanner mode:
; 0 - ignored
; 1 - requires Motion Sensor to be present in the player's inventory to activate highlighting
+4 -1
View File
@@ -1,3 +1,6 @@
These are some example mods I've put together. Each uses sfall features in a simple way, generally involving a single global script. The uncompiled versions of each script is included.
Further good examples of sfall scripts are available from Nirran's site: http://www.nirran.com/
Further good examples of sfall scripts are available from:
* FO2tweaks: https://github.com/BGforgeNet/FO2tweaks
* EcCo Gameplay Overhaul: https://github.com/phobos2077/fo2_ecco
* Nirran's site: http://www.nirran.com/
+13 -1
View File
@@ -287,7 +287,7 @@ Syntax which requires sfall for compiled scripts to be interpreted is marked by
```
__NOTE:__ When using incremental operators like `+=`, `*=`, `++`, `--` compiler will use additional temp variable to get an array at penultimate level in order to avoid making the same chain of `get_array` calls twice.
- (*) `foreach` loops: A shorthand method of looping over all elements in an array. Syntax is `foreach (<symbol> in <expression>)`.
- (*) `foreach` loops: A shorthand method of looping over all elements in an array. Syntax is `foreach (<symbol> in <expression>)`. You can declare variables in place by adding the `variable` keyword before the symbol name.
- new:
```
procedure bingle begin
@@ -348,6 +348,18 @@ There are several changes in this version of sslc which may result in problems f
### Changelog
**sfall 4.4.7:**
- fixed leftover stack data caused by the `break` statement
- added Linux & WebAssembly builds
**sfall 4.4.4:**
- fixed stringified procedure names shifting when the same name is called more than once
- syntax improvements:
- `foreach`: allow to declare variables for key & value header
- `foreach`: allow to use expressions after `in` that start with a symbol without mandatory parentheses
- variables: allow to declare variables anywhere a statement is expected
- expressions: display useful error messages when an expression is expected but nothing is parsed
**sfall 4.4:**
- fixed compiler crash when trying to define an exported procedure with variables
- fixed compiler giving "symbol or string expected" error when trying to call procedure using a string literal
+22 -1
View File
@@ -178,7 +178,7 @@
//#define RMOBJ_LOAD_WEAPON RMOBJ_ITEM_REMOVED_INVEN
// common prototype offsets for get/set_proto_data
#define PROTO_PID (1)
#define PROTO_PID (0)
#define PROTO_TEXTID (4)
#define PROTO_FID (8)
#define PROTO_LDIST (12)
@@ -306,6 +306,22 @@
#define PROTO_CR_AI_PACKET (408)
#define PROTO_CR_TEAM_NUM (412)
// scenery
#define PROTO_SC_MATERIAL (44)
// walls
#define PROTO_WL_MATERIAL (32)
// material types
#define MATERIAL_TYPE_GLASS (0)
#define MATERIAL_TYPE_METAL (1)
#define MATERIAL_TYPE_PLASTIC (2)
#define MATERIAL_TYPE_WOOD (3)
#define MATERIAL_TYPE_DIRT (4)
#define MATERIAL_TYPE_STONE (5)
#define MATERIAL_TYPE_CEMENT (6)
#define MATERIAL_TYPE_LEATHER (7)
// weapon calibers
#define CALIBER_NONE (0)
#define CALIBER_ROCKET (1)
@@ -516,6 +532,11 @@
#define CRITICAL_VALUE_FAIL_MSG (6) // This is shown instead of Message if the stat check fails.
#define DIFFICULTY_EASY (0)
#define DIFFICULTY_NORMAL (1)
#define DIFFICULTY_HARD (2)
/* Playback mode defines for the soundplay function */
#define soundraw (0x80000000) // sfall flag
#define Stereo8bit (soundstereo)
File diff suppressed because it is too large Load Diff
+88 -58
View File
@@ -4,25 +4,34 @@
#include "define_lite.h"
#include "define_extra.h"
#define PID_BOTTLE_CAPS (41)
/**
Inventory contents as temp array to be used in foreach
*/
* Inventory contents as temp array to be used in foreach
* @arg {ObjectPtr} critter
* @ret {list}
*/
procedure inven_as_array(variable critter) begin
variable i:=0, list;
list := temp_array(100, 4);
while (inven_ptr(critter, i)) do begin
if (i>=len_array(list)) then
resize_array(list, len_array(list) + 100);
list[i] := inven_ptr(critter, i);
variable i := 0, list, item;
list := temp_array(0, 4);
item := inven_ptr(critter, i);
while (item) do begin
resize_array(list, i + 1);
list[i] := item;
i++;
item := inven_ptr(critter, i);
end
resize_array(list, i);
return list;
end
/**
* Adds quantity of itemPid to invenObj and returns the created item object.
* @arg {ObjectPtr} invenObj - Object to add new item to.
* @arg {int} itemPid - PID of item.
* @arg {int} quantity
* @ret {ObjectPtr} - created item
*/
procedure add_items_pid(variable invenObj, variable itemPid, variable quantity) begin
variable item;
item := create_object(itemPid, 0, 0);
@@ -30,13 +39,22 @@ procedure add_items_pid(variable invenObj, variable itemPid, variable quantity)
return item;
end
// aliases:
/**
* Adds 1 item of a given pid to obj.
* @arg {ObjectPtr} obj - Object to add new item to.
* @arg {int} pid
* @ret {ObjectPtr}
*/
#define add_item_pid(obj, pid) add_items_pid(obj, pid, 1)
#ifndef critter_wearing_armor
#define critter_wearing_armor(x) (obj_item_subtype(critter_inven_obj(x,INVEN_TYPE_WORN)) == item_type_armor)
#endif
/**
* Makes critter remove his armor and put it back to his inventory.
* @arg {ObjectPtr} critter
*/
procedure unwield_armor(variable critter) begin
variable armor;
if (not(critter)) then return;
@@ -47,6 +65,28 @@ procedure unwield_armor(variable critter) begin
end
end
/**
* Makes critter put away given item if it's in armor or any item/weapon slot.
* @arg {ObjectPtr} critter
* @arg {ObjectPtr} item
*/
procedure inven_unwield_item(variable critter, variable item) begin
if (obj_type(critter) != OBJ_TYPE_CRITTER) then return;
if (critter_inven_obj(critter, INVEN_TYPE_WORN) == item) then begin
call unwield_armor(critter);
end else if ((critter_inven_obj(critter, INVEN_TYPE_LEFT_HAND) == item) or (critter_inven_obj(critter, INVEN_TYPE_RIGHT_HAND) == item)) then begin
inven_unwield(critter);
end
end
/**
* Removes items of given pid from given object's inventory. Returns number of actually removed items.
* @arg {ObjectPtr} invenObj - obj to remove items from
* @arg {int} itemPid - PID of item to remove
* @arg {int} quantity - maximum quantity of items to remove (-1 to remove all available items)
* @ret {int}
*/
procedure remove_items_pid(variable invenObj, variable itemPid, variable quantity) begin
variable begin
item;
@@ -61,80 +101,70 @@ procedure remove_items_pid(variable invenObj, variable itemPid, variable quantit
toRemoveQty := quantity;
while (quantity > 0) do begin
item := obj_carrying_pid_obj(invenObj, itemPid);
if (obj_type(invenObj) == OBJ_TYPE_CRITTER) then begin
if (critter_inven_obj(invenObj, INVEN_TYPE_WORN) == item) then begin
call unwield_armor(invenObj);
end else if ((critter_inven_obj(invenObj, INVEN_TYPE_LEFT_HAND) == item) or (critter_inven_obj(invenObj, INVEN_TYPE_RIGHT_HAND) == item)) then begin
inven_unwield(invenObj);
end
end
call inven_unwield_item(invenObj, item);
quantity -= rm_mult_objs_from_inven(invenObj, item, quantity);
destroy_object(item);
end
return toRemoveQty;
end
/**
* Remove one item from a given *item* stack object from *invenObj* inventory.
* For a critter, this will correctly remove item from armor/hand slot, if it is equipped.
* Note that *item* pointer will be invalid after this.
* @arg {ObjectPtr} invenObj - obj to remove from
* @arg {ObjectPtr} item - item (stack) object to remove
*/
procedure remove_item_obj(variable invenObj, variable item) begin
if (obj_type(invenObj) == 1) then begin
if (critter_inven_obj(invenObj,INVEN_TYPE_WORN) == item) then begin
call unwield_armor(invenObj);
end else if ((critter_inven_obj(invenObj, INVEN_TYPE_LEFT_HAND) == item) or (critter_inven_obj(invenObj, INVEN_TYPE_RIGHT_HAND) == item)) then begin
inven_unwield(invenObj);
end
end
call inven_unwield_item(invenObj, item);
rm_obj_from_inven(invenObj, item);
destroy_object(item);
end
// aliases:
/**
* Remove one item of a given *pid* from *obj* inventory.
* @arg {ObjectPtr} obj - obj to remove items from
* @arg {int} pid - PID of item to remove
* @ret {int}
*/
#define remove_item_pid(obj, pid) remove_items_pid(obj, pid, 1)
/**
* Remove all items of a given *pid* from *obj* inventory. Returns number of removed items.
* @arg {ObjectPtr} obj - obj to remove items from
* @arg {int} pid - PID of item to remove
* @ret {int}
*/
#define remove_all_items_pid(obj, pid) remove_items_pid(obj, pid, -1)
/**
Set item quantity in inventory, by item pid
* Ensures a given *quantity* of *itemPid* in *invenObj* inventory, adding or removing items as necessary.
* @arg {ObjectPtr} invenObj - obj to add/remove items to/from
* @arg {int} itemPid - PID of item to add/remove
* @arg {int} quantity
*/
procedure set_items_qty_pid(variable invenobj, variable itempid, variable quantity)
procedure set_items_qty_pid(variable invenObj, variable itemPid, variable quantity)
begin
variable begin
count;
obj;
end
count := obj_is_carrying_obj_pid(invenobj, itempid);
count := obj_is_carrying_obj_pid(invenObj, itemPid);
if (quantity > count) then begin
obj := create_object_sid(itempid, 0, 0, -1);
add_mult_objs_to_inven(invenobj, obj, quantity - count);
obj := create_object_sid(itemPid, 0, 0, -1);
add_mult_objs_to_inven(invenObj, obj, quantity - count);
end else if (quantity < count) then begin
call remove_items_pid(invenobj, itempid, count - quantity);
call remove_items_pid(invenObj, itemPid, count - quantity);
end
end
procedure reduce_merchant_loot(variable critter, variable moneyPercent, variable probArmor, variable probDrugs, variable probWeapons, variable probAmmo, variable probMisc) begin
variable inv, item, it, prob, tmp;
inv := inven_as_array(critter);
item_caps_adjust(critter, -(item_caps_total(critter) * moneyPercent / 100));
//display_msg("total items "+len_array(inv));
foreach item in inv begin
if (obj_pid(item) != PID_BOTTLE_CAPS) then begin
it := obj_item_subtype(item);
if (it == item_type_armor) then
prob := probArmor;
else if (it == item_type_drug) then
prob := probDrugs;
else if (it == item_type_weapon) then
prob := probWeapons;
else if (it == item_type_ammo) then
prob := probAmmo;
else
prob := probMisc;
if (random(0, 99) < prob) then begin
//display_msg("remove "+obj_name(item));
call remove_all_items_pid(critter, obj_pid(item));
end
end
end
end
/**
* Returns item in one of *critter*'s hand slots using given attack type.
* @arg {ObjectPtr} critter
* @arg {int} type - Attack Type, see ATKTYPE_* in define_extra.h
* @ret {ObjectPtr}
*/
procedure item_by_attack_type(variable critter, variable type) begin
variable slot;
if (type > 3 and type != ATKTYPE_LWEP_RELOAD and type != ATKTYPE_RWEP_RELOAD) then
+15 -1
View File
@@ -16,9 +16,23 @@ end
#define math_max(x, y) (x if x > y else y)
#define math_min(x, y) (x if x < y else y)
/**
* Returns true if x is within range: [from, to]
* @arg {any} x
* @arg {any} from
* @arg {any} to
* @ret {bool}
*/
#define math_in_range(x, from, to) (x >= from and x <= to)
/**
* Returns: a if val < a, b if val > b, otherwise val.
* @arg {any} val
* @arg {any} a
* @arg {any} b
* @ret {any}
*/
procedure math_clamp(variable val, variable a, variable b) begin
variable min, max;
if (a < b) then begin
+23 -4
View File
@@ -22,7 +22,11 @@ end*/
return var;
end*/
// Parse keyboard shortcut definition
/**
* Parses keyboard shortcut definition (key code + optional modifier key) from a string into an integer for later use in other hotkey procedures.
* @arg {string} string
* @ret {int}
*/
procedure parse_hotkey(variable string) begin
variable lst;
variable n;
@@ -35,7 +39,11 @@ procedure parse_hotkey(variable string) begin
return n;
end
// Check if shortcut is pressed
/**
* Checks if a given shortcut is currently pressed (see parse_hotkey).
* @arg {int} n - hotkey data parsed with *parse_hotkey*
* @ret {bool}
*/
procedure hotkey_pressed(variable n) begin
if (n < 0x10000) then
return key_pressed(n);
@@ -43,7 +51,12 @@ procedure hotkey_pressed(variable n) begin
return key_pressed(n bwand 0xFFFF) and key_pressed((n bwand 0xFFFF0000) / 0x10000);
end
// same as above, but suited for hs_keypress hook when keycode is already known
/**
* Checks if a shortcut is currently pressed, given that *key* is already pressed.
* @arg {int} n - hotkey data parsed with *parse_hotkey*
* @arg {int} key - DX scancode
* @ret {bool}
*/
procedure hotkey_pressed_now(variable n, variable key) begin
if (n < 0x10000) then
return key == n;
@@ -59,7 +72,13 @@ procedure hotkey_pressed_now(variable n, variable key) begin
end
end
// Loads ini section as map of keys and values parsed as integers (0 values will be skipped!)
/**
* Loads ini section as map of keys and values parsed as integers (0 values will be skipped!)
* @arg {string} file
* @arg {string} section
* @arg {bool} [fixArray=false] - if true, *fix_array* will be called automatically on resulting array
* @ret {map}
*/
procedure get_ini_section_int_to_int(variable file, variable section, variable fixArray := false) begin
variable ar, ar2 := temp_array_map, k, v;
ar := get_ini_section(file, section);

Some files were not shown because too many files have changed in this diff Show More