Compare commits

...
339 Commits
Author SHA1 Message Date
NovaRain 0bb63de958 Updated version number and changelog 2026-02-11 21:40:51 +08:00
NovaRain 70a8eb086f Removed unnecessary/unused return value in critter_mod_skill function 2026-02-11 20:16:09 +08:00
NovaRain 47dad66b58 Removed misleading parens from functions without args in documents 2026-01-27 16:37:49 +08:00
NovaRain 8ec4ed6a0a Code edits to SingleCore to make it run safer
Changed SingleCore to be disabled by default.
(its usage is questionable on newer systems.)
2026-01-16 10:10:28 +08:00
NovaRain 201ecd16f7 Code edits to ProcessorIdle
* include QS_RAWINPUT (0x400) for WinXP+.
* set the option enabled by default.
2026-01-15 09:41:13 +08:00
NovaRain ae3a8f85f5 Added settings about the mirrored shades to tweaks.ini
Updated the description of Fallout1Behavior.
2026-01-13 14:30:08 +08:00
NovaRain b6d8b14f90 Expanded the functionality of Fallout1Behavior
* FO1 initial in-game time is 7:21 rather than 8:24.
2026-01-10 20:36:11 +08:00
NovaRain edd6da5716 Fixed edge-scrolling speed in the world map
* commit 5feeff0 only fixed when in normal game maps.
2026-01-04 12:37:51 +08:00
NovaRain fe9d56030f Re-ordered Unarmed module init (sync with 4.x) 2026-01-03 20:45:25 +08:00
NovaRain 5feeff0c21 Fixed edge-scrolling speed when using the speed tweak
(closes #523)
2026-01-01 20:23:34 +08:00
NovaRain ea79147afe Cosmetic edits: updated year 2026-01-01 20:17:18 +08:00
NovaRain 6535a5f02e Added a safeguard to the single-frame death anims tweak
Updated version number.
2025-12-05 16:48:31 +08:00
NovaRain 265314083d Tweaked interface bar FRM
* to better sync with HRP's 800px one.

Updated resource files.
2025-11-12 22:50:25 +08:00
NovaRain 0367d28bc1 Edited the description of some legacy options to make them explicitly clear 2025-10-23 08:56:39 +08:00
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
NovaRain e706fba989 Updated changelog 2024-04-19 08:42:19 +08:00
NovaRain 884c00ffeb Reverted ScriptValue DataType from long to short (sync with 4.x)
Updated version number.
2024-04-18 22:23:39 +08:00
NovaRain 78ef06c8e6 Text edits to INI files 2024-04-18 20:48:58 +08:00
NovaRain d75d46d281 Updated changelog 2024-04-04 22:51:14 +08:00
NovaRain fc1d9dbfc2 Removed SpeedInterfaceCounterAnims=3 (now default behavior) 2024-04-01 17:21:34 +08:00
NovaRain b50dcaa151 Fixed xp exploit from canceling Here and Now perk
(when the player has Swift Learner perk)

Removed DisplaySwiftLearnerExp from ddraw.ini (always enabled)
2024-03-29 16:57:10 +08:00
NovaRain 53f427fcac Minor code edits 2024-03-28 08:35:15 +08:00
NovaRain 818c2eb6b2 Edits to gl_partycontrol and main.h
* it seems no need to "fix" Gecko Skinning perk anymore.
* use array to hold perk levels instead of calling has_trait twice.
2024-03-27 11:20:36 +08:00
NovaRain ad2b9ab0fb Added a new example mod gl_molotov 2024-03-26 12:15:15 +08:00
NovaRain 46349c5d69 Fixed add_extra_msg_file loading the same msg file more than once (#467)
Minor code edits.
Updated version number.
2024-03-22 12:09:14 +08:00
NovaRain 8a8455efea Added a new example mod gl_static_books 2024-03-14 10:20:42 +08:00
NovaRain 6e7ba2f5b9 Restored support for pre-SSE processors
(revert commit c9712f7)

* the codegen optimization from VS2010 isn't much (e.g. the number of
CMOVcc), so better to make 3.8.x focus on wider compatibility.
2024-03-14 10:17:43 +08:00
NovaRain da08bdbf83 Edits to sslc documents
* edited the description of command line options.
* removed old references of dos4gw.exe (only for pre-2.10) and FSE.
2024-03-11 10:10:03 +08:00
NovaRain dc97dad94c Fixed the clickability issue of the "Use Inventory Item On" action
* the game would execute the default action for the overlapped object
instead of the player using the item.

(ref. BGforgeNet/Fallout2_Restoration_Project#271)
2024-03-05 10:41:09 +08:00
NovaRain 82cf074845 Updated npcarmor.ini based on new NPC armor mod
(ref. BGforgeNet/Fallout2_NPC_Armor@ca93bb6)
2024-03-05 10:32:01 +08:00
NovaRain 8e95b2d8f6 Updated npcarmor.ini based on newer RPU (v27+) 2024-03-04 11:53:46 +08:00
NovaRain 81638168c2 Tweaked the log for loading global scripts
* it should be after the game scripts check.
2024-03-03 00:01:37 +08:00
NovaRain 56459ee5f0 Added additional check to AI weapon switching fix 2024-02-29 13:21:08 +08:00
NovaRain 35276dfe59 Added support for an external DirectDraw wrapper 2024-02-26 09:28:03 +08:00
NovaRain 0400671f38 Cosmetic edits: unified indentation of switch-case 2024-02-22 08:41:45 +08:00
NovaRain 30cb8b7ee9 Fixed critical hit message for super mutants
* judging from combat.msg, the fix has been applied to a wrong
bodypart since 2.8b.
2024-02-17 07:52:56 +08:00
NovaRain 273c44e788 Fixed the game disappearing from the taskbar after using Alt+Tab
Code change to the input patch.
Updated version number.
2024-02-16 09:30:16 +08:00
NovaRain 4ef8986bda Updated changelog 2024-02-12 20:45:37 +08:00
NovaRain dbf5e36b86 Added a fix to prevent integer overflow for inven item stacks
* This is more of a preventive fix because now it's easier to cause
integer overflow with add_mult_objs_to_inven. Also in case people
use save editor and set silly values to their items.
2024-02-12 09:57:22 +08:00
NovaRain 386d373376 Fixed the modulo operator for negative integers
* this changes the behavior of vanilla modulo operator to use signed
integer division to match how the fixed division operator works.
2024-01-25 10:20:41 +08:00
NovaRain 360037a2fd Changed the fix for add_mult_objs_to_inven
(to allow adding more than 99999 instances of an object in one go)
2024-01-24 09:45:05 +08:00
NovaRain a3c8f0f609 Added missing level cap to XPTable (fixed a hang) 2024-01-15 14:30:27 +08:00
NovaRain 7dda156ee7 Fixed log entry for PatchFileXX options
(also allow using ".\\", as it cannot escape the game folder.)
2024-01-11 21:40:34 +08:00
NovaRain 31a5dbc61c Updated version number and year 2024-01-02 10:31:08 +08:00
NovaRain c476e54db0 Added reg_anim_animate_and_move script function 2023-12-27 13:21:40 +08:00
NovaRain 95dc75da38 Fixed right arm critical hit messages for some critter types
(BGforgeNet/Fallout2_Restoration_Project#256)
2023-12-19 21:02:19 +08:00
NovaRain e276c59447 Tweaked the condition check for instadeath fix 2023-12-15 20:45:30 +08:00
NovaRain 1c3e2f2eb1 Fixed 0 dmg instadeath crits with HOOK_COMBATDAMAGE 2023-12-15 09:18:26 +08:00
NovaRain 3dcc26a739 Fixed skipping to lv99 when leveling up from lv97
(mentioned in Per's guide)

Minor code edits.
2023-12-04 21:53:26 +08:00
NovaRain 8ef6a66134 Use proper size directives in ASM code 2023-12-02 18:32:19 +08:00
NovaRain 0bba6ccb54 Engine now uses 'English' as the fallback language for the credits
Updated version number.
2023-11-30 22:44:17 +08:00
NovaRain 8f846eda6e Updated changelog for better clarity 2023-11-20 21:28:42 +08:00
NovaRain 572cbd059f Updated changelog 2023-11-20 10:20:02 +08:00
NovaRain f02ba1993b Fixed create_object_sid when passing 0 as the script index number
* would result in a crash. Now it allows creating an object with no
script (different from -1, which just doesn't touch default script).
2023-11-14 21:49:36 +08:00
NovaRain f800b7bb33 Tweaked the position of the ammo bar 2023-10-30 21:33:04 +08:00
NovaRain de3d6256e3 Fixed incorrect data for saved arrays
Updated version number.
2023-10-27 22:43:23 +08:00
NovaRain ae0f3d6fdc Fixed crash when calling start_gdialog outside talk_p_proc
(the fix was embedded in StartGDialogFix, now it works regardless of
the option.)
2023-10-19 15:18:17 +08:00
NovaRain f46ffb4ea5 Updated documents (mainly array functions) 2023-10-16 11:34:45 +08:00
NovaRain c7ecf1c070 Changed the "best armor" score calc to exclude EMP
(gameplay mod friendly)
2023-10-07 19:45:19 +08:00
NovaRain 8c277730bf Updated NPC combat control mod for player's Jinxed trait/perk
* controlled critters will now be "Jinxed" as well
2023-10-05 09:26:35 +08:00
NovaRain 898e7bb4e0 Removed AdditionalWeaponAnims from ddraw.ini (always enabled)
Updated version number.
2023-10-05 09:11:17 +08:00
NovaRain 3e955572be Corrected the description of CALCAPCOST hook 2023-09-30 17:18:51 +08:00
NovaRain 7fc5dc47b4 Fixed German translation 2023-08-26 01:41:58 +08:00
NovaRain 71e3ee4801 Improved compatibility with pre-SP4 Win2000
Moved the LoadLibrary call out of DllMain entry point.
Updated version number and changelog.
2023-08-24 21:42:27 +08:00
NovaRain 59eacce6be Updated changelog and other documents 2023-08-21 14:24:44 +08:00
NovaRain ff53d2515d Fixed UpdateHPStat() for not properly capping HP
* when a critter has modified base value of max HP in its proto.
2023-08-09 10:30:58 +08:00
NovaRain 8fd5182bb5 Renamed "string_pos" function to "string_find" 2023-08-09 08:57:03 +08:00
NovaRain 2677d9faa7 Fixed the backward compatibility of get_npc_level
(broken in commit 347dc85)
2023-08-04 09:15:01 +08:00
NovaRain 9fe3ed5d98 Headers update
- Synced a small number of defines from RPU headers
- Removed duplicate defines from define_lite
2023-07-31 20:55:34 +08:00
NovaRain e6610c4bbe Expanded the engine perk options in perks.ini 2023-07-31 20:54:54 +08:00
NovaRain 31630f6627 Added build instructions to readme 2023-07-27 08:24:47 +08:00
NovaRain 489f62f5cb Header fixes
- Fix conflict with RPU command_extra.h
- Fix undefined debug_array_str error
2023-07-24 08:36:28 +08:00
NovaRain 1f802cab6f Fixed incorrect int->float conversion in op_sub
Fixed ASM code in StealCheckHook from previous commit.
2023-07-23 08:21:37 +08:00
NovaRain 788593cdcc Backported the improvements of HOOK_STEAL
Edits to hookscripts.md and ddraw.ini.
2023-07-22 21:06:38 +08:00
NovaRain 680310f702 Re-added the check for valid objs to get/set_object_data
* disabled in combat for the combat data.
2023-07-19 20:56:31 +08:00
NovaRain 4f36136a39 Edited function and sslc docs 2023-07-17 20:54:57 +08:00
NovaRain 48355fa637 Minor code edits to BugFixes.cpp
Minor edits to some comments.
2023-07-14 09:46:53 +08:00
NovaRain 6af62af27d Backported "get_object_ai_data" script function
Updated headers and documents.
Edited error messages for some script functions.
2023-07-11 11:20:56 +08:00
NovaRain bd76a3ded7 Added upper/lower limits to the hit chance value
Edited hookscript docs.
2023-07-09 15:24:46 +08:00
NovaRain 3a08488895 Added "string_pos" function from 4.x
Added a check to PartyControl::OrderAttackPatch().
Updated function documents.
Updated scripting headers.
2023-07-05 22:20:14 +08:00
NovaRain 2941157174 Added NPC combat control mod to example mods
Updated item highlighting mod and NPC armor mod.
2023-07-03 15:35:03 +08:00
NovaRain 2148650313 Use explicit GetFileAttributesA function 2023-07-02 08:29:30 +08:00
NovaRain 6dee4e1183 Removed capping of console window position and size
* for multi-monitor setup, leaving only minimum size of 640x480.
2023-06-29 21:34:41 +08:00
NovaRain b2e60ba62e Backported IniConfigFolder option
* using C-string instead of std::string.
2023-06-28 08:52:28 +08:00
NovaRain a71c2c901a Removed unused bufSize argument from IniReader
Fixed return value of getString with buffer argument.
Increased max line length to 2048.
Added file check for books/drugs/enginetweaks ini files.
Fixed possible array index out of bound error in BarBoxes.
Added trimming to custom unarmed attack names.
2023-06-27 21:40:55 +08:00
NovaRain 4f3c1a60b4 Console window improvements
- Retain maximized/minimized state
- Save normal position when closing in maximized/minimized state
- Allow to move window in negative x direction
- Disable close button
- Save position if game was closed by pressing Alt+F4 in console window
2023-06-27 21:21:13 +08:00
NovaRain 9674c16928 Fixed position jumping for console window
Improved "string_format" script function.
Edited error messages for a few functions.
Updated documents.
2023-06-25 16:30:46 +08:00
NovaRain 0c035a05df op_create_spatial: fix spatial object having no scriptIndex upon creation
ConsoleWindow: prevent user from messing up window position & size
2023-06-24 09:07:10 +08:00
NovaRain 51cd2eab69 Unified the name of "GameRest" function in modules 2023-06-22 11:51:14 +08:00
NovaRain 323631835b Added arrary cache reset to get_ini_config
* prevent returning wrong arrays (left from previous session).

Removed "tr1" namespace (no needed for VS2010 and later).
Minor code edits.
2023-06-22 09:04:22 +08:00
NovaRain 135c26ab70 Load order: more informative logging
Code fixes to PartyControl.cpp and ConsoleWindow.cpp.

Updated version number in documents.

Updated changelog in sslc document, and removed the mention about
empty statements (it never worked).
2023-06-21 22:39:59 +08:00
NovaRain 34092900a6 Backported the module manager from 4.x 2023-06-20 11:16:30 +08:00
NovaRain c8fe92ef7d Updated document and sfall.h for get_ini_config 2023-06-19 22:18:01 +08:00
NovaRain b578aecc59 Backported INI parser from 4.x (part 2)
Added Config.cpp/h (core parser based on vanilla & Fallout CE).
Implemented the parser to IniReader.
Added "get_ini_config" function.
2023-06-19 22:15:37 +08:00
NovaRain b57a87f98f Backported INI parser from 4.x (part 1)
* Some misc code changes first.
* Changed saving game/console window positions in OnBeforeGameClose.
* Simplified arrays code a bit.
* Added binary string support to atoi.
2023-06-19 21:58:45 +08:00
NovaRain 2156f82184 Backported the buffer overflow fix for debug log from 4.x
Simplified ASM code in Premade.cpp a bit.
2023-06-17 22:01:36 +08:00
NovaRain be6947e3d2 Added code page setting for the console window 2023-06-15 23:28:04 +08:00
NovaRain f0784e2987 Updated the description in [ExtraPatches] for mods_order.txt
Tweaked the error log entry for mods_order.txt.
Minor code edits.
2023-06-15 13:40:12 +08:00
NovaRain 1a6a9e5ec1 Backported ConsoleWindow option from 4.x 2023-06-15 13:27:56 +08:00
NovaRain 0be6011c19 Removed debug message about missing critter art from displaying in-game
* to prevent unnecessary annoyance to generic players.

Added a safeguard to get_tile_fid.
Fixed crash in debug build due to stdcall not being specified.
2023-06-14 09:48:51 +08:00
NovaRain 6f45d45fcd Updated documents for hook/function changes 2023-06-13 12:33:28 +08:00
NovaRain f413bb8b9a Backported the new mods_order.txt mechanism 2023-06-13 12:12:07 +08:00
NovaRain e3907c3647 Allow passing string directly to set_sfall_return in HOOK_DESCRIPTIONOBJ
- HookScripts: track return types in addition to values
- Set allowNonIntReturn in hook code to allow non-int return values to be accepted
- Moved get_sfall_arg and set_sfall_return opcodes to the new table
2023-06-13 12:07:04 +08:00
NovaRain 007386caec Backported get_tile_fid improvements from 4.x 2023-06-13 12:05:00 +08:00
NovaRain c593269ee7 Fixed get_tile_fid function to work on elevation 1 and 2
* it now follows dude elevation.
2023-06-12 23:20:49 +08:00
NovaRain 1976461b72 Fixed invWieldFunc for non-weapon/armor items
Fixed lib.inven.h header from develop branch.
2023-06-12 22:50:21 +08:00
NovaRain 9fa123d15f Added get_combat_free_move metarule
Updated documents and headers.
Added PartyOrderToAttack to ddraw.ini.
2023-06-09 11:19:45 +08:00
NovaRain 3b6435d8a4 Backported HOOK_COMBATTURN from 4.2
* using pre-4.2.8 codebase

Replaced ControlCombat option with PartyOrderToAttack.
Updated documents.
2023-06-07 21:48:54 +08:00
NovaRain 7322634780 Backported three game hooks from 4.x:
* ROLLCHECK, BESTWEAPON, CANUSEWEAPON

Updated documents.
2023-06-06 21:46:03 +08:00
NovaRain 7f0398c618 Added options to override the names of sound files for game modes
Remove the worldmap/credits music override from Fallout1Behavior.
(was added in commit 41a1fea)

Minor edits to ddraw.ini.
2023-06-05 11:46:07 +08:00
NovaRain 4e3f065453 Updated headers and function document from 4.x 2023-06-05 11:03:51 +08:00
NovaRain 378bc8a126 Added set_combat_free_move metarule and 2 args to HOOK_STDPROCEDURE
Added a missing hack from 4.x to PartyControl.cpp.
2023-06-05 10:42:02 +08:00
NovaRain e92c994744 Added a new example mod gl_rest_encounter
Added a burst control example script.
2023-06-02 15:15:01 +08:00
NovaRain a1d0e59287 Fixed crash when using NumbersInDialogue
(revert commit 576bea2)
2023-06-01 15:58:23 +08:00
NovaRain 40f2050f8c Minor edits to ddraw.ini and define_extra.h 2023-05-29 15:22:45 +08:00
NovaRain c33c200b51 Sync header changes with develop branch 2023-05-25 09:37:54 +08:00
NovaRain 26693fd0ed Decoupled hook type 2 of HOOK_AMMOCOST from CheckWeaponAmmoCost
Edits to documents to reflect the hook change.
Changed CheckWeaponAmmoCost to be enabled by default.
Updated version number.
2023-05-20 10:59:26 +08:00
NovaRain 033c8bf8ef Randomized one extra bullet for side groups in burst attacks
* idea from phobos2077.

Added minimum value check to multipliers.
2023-05-19 09:54:49 +08:00
NovaRain ddf2854938 Added "set_spray_settings" function for scriptable burst
Added documentation for set_spray_settings.
Remove postbuild.cmd from git.
2023-05-19 09:51:58 +08:00
NovaRain 637de0e07d Fixed "divided by zero" error when returning 0 in AMMOCOST hook
* with CheckWeaponAmmoCost=1.

Added a value check to the return value of AMMOCOST hook.
Updated hookscripts.md to reflect this change.
2023-05-18 10:02:07 +08:00
NovaRain ff1c87f0c5 Updated gl_compute_damage example script from 4.x
* with script-based YAAM implementation.

Sync header changes with develop branch.

Changed AttackSubType enum "GUNS" to "RANGED".
(to be in line with define_extra.h, the naming is from RE/CE.)
2023-05-15 12:16:23 +08:00
NovaRain 66c0ed8cb2 Updated some defines
- ATKMODE defines removed to avoid confusion - these are really two 4-bit fields, not bit flags!
2023-05-14 08:24:02 +08:00
NovaRain f3bbfbfa28 Sync header changes with develop branch 2023-05-08 17:30:09 +08:00
NovaRain 41a1fead58 Expanded the functionality of Fallout1Behavior
* change the world map music and the credits music to match FO1 files.

Increased the maximum value of the combat speed slider.
Some minor code edits.
2023-04-30 09:21:53 +08:00
NovaRain a0cf633899 Tweaked set_pc/critter_base/extra_stat script functions
* before they didn't update derived stats when setting SPECIAL, for
the player it requires accessing the char screen to update.

Replaced some proto_ptr() usages with GetProto().
2023-04-22 23:46:16 +08:00
NovaRain a09611edc6 Backported the "order to attack" function from 4.x
Updated translation ini files.
Updated version number.
2023-04-19 10:35:59 +08:00
NovaRain 291370a96c Attempt for reproducible builds
* ducible.exe is built with v140_xp toolset and /arch:SSE.

Code edits to Interface.cpp.

* to avoid error C3068 for Debug config in VS2010.
2023-04-17 10:09:21 +08:00
NovaRain 576bea2aa9 Minor code edits to MiscPatches.cpp 2023-04-12 10:04:43 +08:00
NovaRain 765b19e045 Minor edit to the changelog 2023-03-29 14:32:33 +08:00
NovaRain f4fe4211e1 Fixed assorted typos in documents
Added an example ini to Ammo INI Loader mod.
Updated the changelog.
2023-03-27 20:35:24 +08:00
NovaRain 0c3d6004a7 Added support for closing the game by Alt+F4
Moved some code from Graphics.cpp to new WinProc files.
Patched dead code in memory in DamageMod.cpp.
2023-03-16 10:55:05 +08:00
NovaRain f6675cf241 Updated readme and added changelog (#451) 2023-03-13 14:23:10 +08:00
NovaRain 736c2cb6fe Backported "item_make_explosive" script function
Updated documents for the function.
Removed deprecated "register" keyword.
2023-03-10 21:08:05 +08:00
NovaRain 13445a1b83 Changed the copyright text format in the credits 2023-03-06 22:42:14 +08:00
NovaRain 4417947c56 Moved some code to the new submodule files
Fixed a crash bug with setting the DAM_BACKWASH flag for the attacker.
(from 6e10f62)
2023-03-06 22:28:39 +08:00
NovaRain 6903d59e6d Renamed some object flags 2023-03-05 10:21:17 +08:00
NovaRain 5e3e37f74c Added a tweak to the ammo info for Glovz's/YAAM
* to display correct ammo stats based on the formulas w/o editing
proto.msg manually.

Updated translation ini files.

Set the maximum number of screenshots to 10k (was 100k)

* 100k is impractical because the max files per directory on FAT32 is
65535 (only if all files are in 8.3 format) when the game came out.
2023-03-01 09:18:28 +08:00
NovaRain e090fd833b Removed CreditsAtBottom from ddraw.ini
* sfall built-in credits will be shown at the beginning when from the
main menu and at the end during the ending.
2023-02-26 23:31:48 +08:00
NovaRain 1ab8407407 Fixed incorrect death endings being shown
* can happen in vanilla FO2 when the player is lv10 or higher,
with a low chance.
2023-02-15 21:06:45 +08:00
NovaRain a4558993e0 Removed redundant "Done" strings from sfall log
* only when there are alternative states or for graphics/sound/scripting
2023-02-10 08:54:52 +08:00
NovaRain f1131b87c6 Tweaked how disabled unsafe opcodes work
* now disabled opcodes will just do nothing instead of causing the
script terminated.
2023-02-09 15:06:19 +08:00
NovaRain 465bc649be Removed StackEmptyWeapons from ddraw.ini (always enabled) 2023-02-02 12:39:06 +08:00
NovaRain 9db5f45545 Added a tweak to allow premade characters to have less than two traits
Fixed the player's traits not being displayed in certain unusual cases.
(with save editing or hex-edited GCD file)
2023-01-10 10:33:00 +08:00
NovaRain fb4770edc4 Increased the upper limit of ProcessorIdle 2023-01-07 23:07:31 +08:00
NovaRain 921f14f43f Cosmetic edits: updated/unified the copyright header years 2022-12-31 10:14:38 +08:00
NovaRain d013d59afd Edits to sfall_ver_* script functions
* they take no arguments and only return constants, simpler structure
in ASM is enough.
2022-12-26 08:50:56 +08:00
NovaRain 2828e08f68 Fixed broken read_string script function
* actually it has never worked.
2022-12-22 09:37:19 +08:00
NovaRain 0b08035b97 Fixed a crash bug in FullItemDescInBarter
* when weapon/ammo has no description, it'd trigger UB from strncpy_s.
2022-12-17 10:36:25 +08:00
NovaRain 62b0955807 Changed all fastcall wrappers to stdcall 2022-12-03 13:19:54 +08:00
NovaRain 67b46cd4a6 Backported three more hooks from 4.1:
* USESKILLON, ONEXPLOSION, SETLIGHTING.

Backported PartyMemberSkillFix option from 4.1.
Updated documents.
2022-12-01 08:41:05 +08:00
NovaRain bb13e3f219 Backported 5 game hooks from 4.1/4.2:
* SNEAK, STDPROCEDURE, STDPROCEDURE_END, TARGETOBJECT, ENCOUNTER.

Updated documents and example mods.
2022-11-29 14:27:10 +08:00
NovaRain 7ecdfe362f Backported three game hooks from 4.1:
* USEANIMOBJ, EXPLOSIVETIMER, DESCRIPTIONOBJ

Updated documents and example mods
2022-11-27 09:27:46 +08:00
NovaRain 4f34217625 Backported game hooks from 4.0.x
* COMBATTURN is not implemented.

Updated documents.
2022-11-26 09:57:01 +08:00
NovaRain f4666dad18 Minor edits to a few ASM hacks
(Changed 2-bytes null jcc to just 2 nop)
2022-11-16 12:19:22 +08:00
NovaRain 536e3b2741 Tweaked HOOK_INVENTORYMOVE for dropping caps
* before the amount was set in the dropped object only after the hook.

Edits to hookscripts.md.
2022-10-29 11:33:42 +08:00
NovaRain f4c72a4e6e Edited the format for window title
Reorganized RMOBJ_* defines in define_extra.h.
2022-10-27 17:21:57 +08:00
NovaRain db40eae68f Some format edits to documents
Updated version number.
2022-10-25 21:25:48 +08:00
NovaRain f1626e846a Changed the check for unavailable hooks
* easier to backport more discontinuous hooks if needed.
2022-10-19 10:59:17 +08:00
NovaRain 5429217c0a Minor edit to hookscripts.md 2022-10-18 08:59:14 +08:00
NovaRain 59aee239fe Fixed incorrect critter names for corpses
* happens when multiple critters based on the same proto with
different scripts attached are killed.

Tweaked the fix for create_object_sid function.
2022-10-09 23:25:51 +08:00
NovaRain d429af8011 Code correction to LoadOrder.cpp
Updated version number.
2022-09-28 10:18:19 +08:00
NovaRain ba186590bc Backported [ExtraPatches] section from 4.x
* in pre-4.1.9 configuration, without .dat autoloading.
2022-09-22 10:50:10 +08:00
NovaRain f94cadf767 Backported rest related script functions from 4.x
* set_rest_heal_time, set_rest_mode, get/set_can_rest_on_map
2022-09-20 09:14:08 +08:00
NovaRain aea263eddd Backported "dialog_message" script function
Updated documents for the function.
2022-08-19 09:12:48 +08:00
NovaRain b7fc0fb1d7 Fixed HOOK_REMOVEINVENOBJ to match RMOBJ_* defines
Edits to define_extra.h for RMOBJ_* defines
2022-08-14 11:04:46 +08:00
NovaRain b8c3f89279 Expanded set_pipboy_available function for mode 2 2022-08-11 21:27:19 +08:00
NovaRain 82eb78e185 Code edits to SpeedInventoryPCRotation
Updated version number.
2022-08-09 21:34:12 +08:00
NovaRain d8fafa85a9 Added support for editor.msg to message_str_game
Edits to header files.
2022-08-09 08:14:04 +08:00
NovaRain a121d09704 Corrected the language path for loading art files 2022-08-08 22:09:11 +08:00
NovaRain b0fa170ffd Combined AllowDShowSound=2 with mode 1
Removed MoreTiles from ddraw.ini (always enabled)
Minor edits to documents.
2022-08-08 09:10:53 +08:00
NovaRain c9712f75ee Dropped support for old pre-SSE processors
Changed buf_to_buf function to SSE implementation.

* affected old processors:
Intel - Pentium II, older Celeron (Covington/Mendocino)
AMD - older K7 (Athlon Classic/Thunderbird)
2022-07-30 00:45:42 +08:00
NovaRain 7f426608d2 Corrected comments in Functions.cpp 2022-07-27 22:12:39 +08:00
NovaRain 81af621b3c Changed the default number of sound buffers
Updated version number.
2022-07-26 08:28:59 +08:00
NovaRain 0ed00a0a41 Minor edits to sslc document 2022-07-22 22:23:27 +08:00
NovaRain 89eff96b69 Switch default Cat Jules appearance to leather jacket
* The original default/naked appearance (`nmprmb`) in RP only has very limited weapon anims.
2022-07-18 16:21:03 +08:00
NovaRain e24e616d5c Correction to previous commit 2022-07-07 08:28:37 +08:00
NovaRain 08d2ffe26d Fixed NPC stuck in a loop of reloading the solar scorcher
(happens when out of ammo and it's dark.)
2022-07-06 20:06:59 +08:00
NovaRain 225fa9cc57 Edits to document about set_self function
Updated version number.
2022-07-02 20:04:35 +08:00
NovaRain 511d594e7d Fixed float_msg script function
* didn't set purple/black text color correctly (was always grey)
2022-06-30 21:54:56 +08:00
NovaRain 0e0d884a97 Changed the mode 1 of NPC combat control
* now requires sfall debugging mode to control all critters.
2022-06-24 09:39:31 +08:00
NovaRain 2950140e3a Added a warning pop-up for the open file limit 2022-06-17 22:48:43 +08:00
NovaRain e70005dbd5 Added "get_terrain_name" script function
Updated documents for the function.
Minor edits to other code.
2022-06-14 21:09:31 +08:00
NovaRain 5ac91aec79 Minor edits to Perks.ini (120 CPL) and ddraw.ini 2022-06-10 09:04:49 +08:00
NovaRain 2578963f7d Added ladder climbing action to UseWalkDistance
Added notes to MainMenuFontColour description in ddraw.ini.
Updated version number.
2022-06-07 10:25:38 +08:00
NovaRain ce82348a15 Simplified the code for ControlCombatPIDList 2022-06-03 12:30:22 +08:00
NovaRain 74f3036b57 Minor code edits
* read FastShotFix setting only once.
2022-06-02 14:23:04 +08:00
NovaRain 7666b4e08f Replaced item_w_curr_ammo_ engine function
* a simplified one, without calling proto_ptr_ unnecessarily.

Related code edits to Combat.cpp & Inventory.cpp.
2022-06-01 12:53:30 +08:00
NovaRain b10fb8c162 Added a function to EngineUtils.cpp
Minor edits to ddraw.ini.
2022-05-28 21:41:49 +08:00
NovaRain e3628232c5 Tweaked how the graphics mode setting is read
Changed all checks with Graphics::mode in the same way as 4.x.
Added a couple of notes to ddraw.ini.
Minor code edits.
2022-05-27 13:18:29 +08:00
NovaRain 205602d85d Updated compiled HLSL shaders
* using the compiler from DXSDK June 2010.

Minor edits to documents.
2022-05-25 21:59:00 +08:00
NovaRain 89f454e825 Removed ComputeSprayMod from ddraw.ini
Updated version number.
2022-05-25 21:41:31 +08:00
NovaRain 977eae4c24 Fixed being able to push knocked down team members in combat 2022-05-23 12:02:11 +08:00
NovaRain 3cb013dfa3 Simplified the fix in commit e7e6175 2022-05-22 14:47:19 +08:00
NovaRain c0bee95aa4 Code edits to the previous commit 2022-05-20 15:33:47 +08:00
NovaRain 8ce87a3088 Changed Stats::UpdateHPStat() to update the current HP as well 2022-05-11 21:56:19 +08:00
NovaRain 5aadf41668 Fixed crash when the player equips an "overloaded" weapon
Fixed a bug in ReloadWeaponKey that could cause a hang.
(only triggerable due to the crash fix for overloaded weapons)
2022-05-05 10:41:44 +08:00
NovaRain 7d71917f7a Removed DivisionOperatorFix from ddraw.ini (always enabled) 2022-04-29 08:10:45 +08:00
NovaRain 9454ad75a3 Backported FO1 worldmap sfx addition from 4.x (#373)
Added some function offsets from 4.x.
2022-04-21 19:55:19 +08:00
NovaRain 4c7cfb11b6 Corrected placeholders for obsolete opcodes
Minor edit to documents.
Updated version number.
2022-04-20 09:51:54 +08:00
NovaRain 4460325f70 Minor edit to Credits.cpp 2022-04-11 09:57:17 +08:00
NovaRain c427604d8d Edited code comment in the previous commit
Code format edits to BugFixes.cpp.
2022-04-07 20:45:05 +08:00
NovaRain e7e6175084 Fixed item planting for non-biped critters with the "barter" flag set
(BGforgeNet/Fallout2_Unofficial_Patch#95)

Updated version number.
2022-04-04 21:34:01 +08:00
NovaRain 73e1faae92 Removed commented code in the previous commit
Edits to documents and README.md.
2022-03-28 14:57:37 +08:00
NovaRain bdb95c80ec Edits to hookscripts.md
Corrected a typo in arrays.md.
Removed redundant compiler txt files.
2022-03-21 22:51:57 +08:00
NovaRain a9a5627b83 Removed FadeBackgroundMusic option (cur. disabled)
* because the fix code doesn't work on all supported systems.
2022-03-21 08:45:38 +08:00
NovaRain e566db91bb Updated Ammo INI Loader example script mod
Updated version number.
2022-03-15 13:02:33 +08:00
NovaRain 8d6e6874ee Added .gitattributes with ssl syntax highlighting
Minor code edits to the built-in item highlighting function.
2022-03-11 20:32:55 +08:00
NovaRain 7cc25efb01 Code edits converge with 4.x 2022-02-20 08:56:43 +08:00
NovaRain b1323fc07a Code edits to Graphics.cpp & Logging.cpp
Minor edits to other code/documents.
Updated version number.
2022-02-17 10:26:42 +08:00
NovaRain 5fcf4aae50 Reverted the palette update method for DX9 mode to pre-3.8.31
* moving the processing to GPU (commit 932a9f3)

Improved the functionality of AllowDShowMovies:
now can take screenshots and press any key to skip AVI movies.

Code edits to Logging.cpp.
2022-02-14 12:49:10 +08:00
NovaRain 42afaa46ed Fixed the game printing an incorrect item name in some cases
Minor fixes in Graphics.cpp and InputFuncs.cpp.
2022-02-13 07:46:55 +08:00
NovaRain 8b858b6cb9 Reverted the limit on hit chance (commit 024e8b1)
* reason: the text length is depend on the frm.
2022-02-13 07:40:33 +08:00
NovaRain e8c952d082 Code correction on DX9 initialization
Some minor code edits.
2022-02-12 11:02:58 +08:00
NovaRain 024e8b1777 Added minimum and maximum limits to the hit chance
* to prevent display glitches (BGforgeNet/Fallout2_Unofficial_Patch#85)

Lowered the max number of PNG screenshots to 10K.
2022-02-11 15:07:20 +08:00
NovaRain 6b14d4f86e Fixed the screenshot for sfall DX9 mode
* Now the screenshots are saved in PNG format.

[TEST] Changed the DirectX 9 device creation mode.
2022-02-10 13:39:31 +08:00
NovaRain 6e10f624a3 Backported the code injection system for game hooks from 4.1
Split HookScripts.cpp/h to multiple sets in HookScripts\ as 4.x.

Reverted tile_num to stdcall (commit a5f57d4)
2022-02-08 22:30:06 +08:00
NovaRain bc380b978d Fixed the copyright line in the credits
Code edits to main.cpp and Graphics.cpp to converge with 4.x.
2022-02-01 09:40:33 +08:00
368 changed files with 23042 additions and 9199 deletions
+1
View File
@@ -0,0 +1 @@
*.ssl linguist-language=Pascal
+3
View File
@@ -26,6 +26,7 @@
*.exe
*.out
*.app
!ducible.exe
# NetBeans
nbproject/private/
@@ -46,6 +47,8 @@ nb-configuration.xml
*.user
*.userosscache
*.sln.docstates
*.VC.db
*.VC.opendb
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
+1012
View File
File diff suppressed because it is too large Load Diff
+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>.
+51 -3
View File
@@ -1,6 +1,10 @@
# sfall
A set of engine modifications for the classic game Fallout 2 in form of a DLL, which modifies executable in memory without changing anything in EXE file itself.
[![License](https://img.shields.io/badge/License-GPL--3.0-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Dev Build](https://github.com/phobos2077/sfall/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/phobos2077/sfall/actions/workflows/build.yml)
[![GitHub Pages](https://github.com/phobos2077/sfall/actions/workflows/gh-pages.yml/badge.svg)](https://github.com/phobos2077/sfall/actions/workflows/gh-pages.yml)
A set of engine modifications for the classic game Fallout 2 in the form of a DLL, which modifies executable in memory without changing anything in EXE file itself.
**Engine modifications include:**
- Better support for modern operating systems
@@ -9,8 +13,52 @@ A set of engine modifications for the classic game Fallout 2 in form of a DLL, w
- Many additional features for users, such as item highlight button, party member control, etc.
- Extended scripting capabilities for modders (many new opcodes to control sfall features as well as previously unavailable vanilla engine functions)
Original author: **Timeslip**
Original author: timeslip
Original description: A set of engine modifications for the classic game Fallout 2 by Interplay. Includes fixes for bugs in the original engine, allows Fallout to run correctly on modern operating systems, and adds additional features for modders.
Original description: A set of engine modifications for the classic game Fallout 2 by Interplay. Includes fixes for bugs in the original engine, allows fallout to run correctly on modern operating systems, and adds additional features for modders.
## Installation
- Download `sfall_*.7z` from the [release archive](https://sourceforge.net/projects/sfall/files/).
- Extract `ddraw.dll`, `ddraw.ini`, and `sfall.dat` to Fallout's base directory (i.e. the one that contains `fallout2.exe`).
- __Important Note:__\
If you are using a mod that already included sfall (e.g. killap's [Unofficial Patch](https://github.com/BGforgeNet/Fallout2_Unofficial_Patch) or [Restoration Project](https://github.com/BGforgeNet/Fallout2_Restoration_Project)), then that mod has probably included a custom modified `ddraw.ini`. In that case, overwriting it with sfall's vanilla `ddraw.ini` will be likely break your game. Instead, only overwrite `ddraw.dll`, and keep the mod's existing copy of `ddraw.ini`. (Or, if you know what you're doing, you can merge them together by hand.)
- The folder `translations` contains translations of some of the strings that sfall displays in the game. To use a translation, copy this folder to Fallout's base directory too, and then in `ddraw.ini` change the __TranslationsINI__ setting to `.\translations\<your language>.ini`.
## Uninstallation
Delete `ddraw.dll`, `ddraw.ini`, and `sfall.dat` from your Fallout directory.
## Usage
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 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.
## Build Instructions
### Prerequisites:
* Visual C++ 2010 Express SP1 or Visual Studio 2010 SP1.
* [DirectX SDK (February 2010)](https://archive.org/details/dxsdk_feb10). You will also need `dinput.lib` from DXSDK August 2007. The file can be found in the [DirectX SDK Collection repo](https://github.com/NovaRain/DXSDK_Collection).
* [DirectX Runtime (June 2010)](https://www.microsoft.com/en-us/download/details.aspx?id=8109).
### Steps:
1. Set up a `postbuild.cmd` using the template from the repo.
2. Open the solution file and build with the **Release** configuration.
3. If everything is set up correctly, you should have a new sfall `ddraw.dll` in your Fallout 2 directory.
## Additional info
* [Changelog](CHANGELOG.md)
* [Scripting Documentation](https://sfall-team.github.io/sfall/)
* Fallout Engine IDA Database: [for IDA Pro 6.8](https://www.dropbox.com/s/tm0nyx0lnk4yui0/Fallout_1_and_2_IDA68.rar?dl=1 "Download from Dropbox") | [for IDA Pro 7.0](https://www.dropbox.com/s/61srq09pn8grfpu/Fallout_1_and_2_IDA70.rar?dl=1 "Download from Dropbox") (comments are in Russian)
* [Fallout 2 Reference Edition](https://github.com/alexbatalov/fallout2-re)
+105 -16
View File
@@ -1,16 +1,65 @@
;This file handles modifications to perks and traits
;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
;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
;Changes the bonus for 'Master Trader' perk (ID 17)
;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
;Changes the skill bonuses for 'Medic' perk (ID 32)
;125 - maximum bonus, 10 - default bonus
MedicFirstAidBonus=10
MedicDoctorBonus=10
;Changes the Lockpick and Steal skill bonus for 'Master Thief' perk (ID 33)
;125 - maximum bonus, 15 - default bonus
MasterThiefBonus=15
;Changes the Speech skill bonus for 'Speaker' perk (ID 34)
;125 - maximum bonus, 20 - default bonus
SpeakerBonus=20
;Changes the Sneak skill bonus (when in darkness) for 'Ghost' perk (ID 38)
;125 - maximum bonus, 20 - default bonus
GhostBonus=20
;Changes the Outdoorsman skill bonus for 'Ranger' perk (ID 47)
;125 - maximum bonus, 15 - default bonus
RangerOutdoorsmanBonus=15
;Changes the distance bonus for 'Weapon Long Range' weapon perk (ID 58)
;2 - no bonus, 4 - default bonus
WeaponLongRangeBonus=4
@@ -30,13 +79,36 @@ 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
;Changes the damage bonus for 'Living Anatomy' perk (ID 97)
;125 - maximum bonus, 5 - default bonus
;Changes the Gambling skill bonus for 'Gambler' perk (ID 83)
;125 - maximum bonus, 20 - default bonus
GamblerBonus=20
;Changes the Steal skill bonus for 'Harmless' perk (ID 91)
;125 - maximum bonus, 20 - default bonus
HarmlessBonus=20
;Changes the damage bonus and the Doctor skill bonus for 'Living Anatomy' perk (ID 97)
;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)
;125 - maximum bonus, 10 - default bonus
NegotiatorBonus=10
;Changes the damage bonus for 'Pyromaniac' perk (ID 101)
;125 - maximum bonus, 5 - default bonus
@@ -50,10 +122,23 @@ SalesmanBonus=20
;valid range: 0..100, 50 - default percent
StonewallPercent=50
;Changes the Lockpick, Steal, and Traps skill bonus for 'Thief' perk (ID 105)
;125 - maximum bonus, 10 - default bonus
ThiefBonus=10
;Changes the strength bonus for 'Weapon Handling' perk (ID 106)
;0 - no bonus, 10 - maximum bonus, 3 - default bonus
WeaponHandlingBonus=3
;Changes the skill bonuses for 'Vault City Training' perk (ID 107)
;125 - maximum bonus, 5 - default bonus
VaultCityTrainingFirstAidBonus=5
VaultCityTrainingDoctorBonus=5
;Changes the Speech skill bonus for 'Expert Excrement Expeditor' perk (ID 116)
;125 - maximum bonus, 5 - default bonus
ExpertExcrementExpeditorBonus=5
;##############################################################################
[Perks]
;Set to 1 to enable the modifications for perks
@@ -64,24 +149,28 @@ Enable=0
;Image: The line number (0-indexed) of the corresponding FRM in skilldex.lst
;Ranks: The number of perk levels
;Level: The minimum required level
;Type: If 0, the perk checks only Skill1 for skill requirements; if 1, it checks Skill1 or Skill2; if 2, it checks both Skill1 and Skill2
;Type: If 0, the perk checks only Skill1 for skill requirements; if 1, it checks Skill1 or Skill2; if 2, it checks both
; Skill1 and Skill2
;Stat: The modified stat or -1 if you don't want to change any stats
;StatMag: The increased/decreased value to the modified stat
;Skill1/Skill2: The first/second skill (or -1 for none) to check, but if you set a specific bit 0x4000000 (67108864), it checks GVAR.
; For example, if Skill1=0x4000004, then the perk will check GVAR_BAD_MONSTER (0x4000000 + 4) on Skill1Mag value
;Skill1/Skill2: The first/second skill (or -1 for none) to check, but if you set a specific bit 0x4000000 (67108864),
; it checks the corresponding GVAR
; For example, if Skill1=0x4000004, the perk will check GVAR_BAD_MONSTER (0x4000000 + 4) on Skill1Mag value
;Skill1Mag/Skill2Mag: Positive value is used as the minimum requirements of the first/second skill/GVAR, and a negative value is interpreted as the maximum requirement.
; For example, with Skill1=0 and Skill1Mag=100, if player has small guns skill >= 100 and meets all other requirements, the perk will be available in the
; selection window; with Skill1=1 and Skill1Mag=-120, the perk will not be available if player has big guns skill >= 120
;Skill1Mag/Skill2Mag: Positive value is used as the minimum requirements of the first/second skill/GVAR, and a negative
; value is interpreted as the maximum requirement
; For example, with Skill1=0 and Skill1Mag=100, if player has small guns skill >= 100 and meets all other requirements,
; the perk will be available in the selection window; with Skill1=1 and Skill1Mag=-120, the perk will not be available
; if player has big guns skill >= 120
;STR-LCK: Positive values are used as minimum requirements of SPECIAL stats, and negative values are interpreted as maximum requirements.
; For some special perks processed by the engine (e.g. PERK_armor_powered and PERK_armor_combat), the values are not used as requirements
; but to add to corresponding SPECIAL stats
;STR-LCK: Positive values are used as minimum requirements of SPECIAL stats, and negative values are interpreted as
; maximum requirements
; For some special perks processed by the engine (e.g. PERK_armor_powered and PERK_armor_combat), the values are not
; used as requirements but to add to corresponding SPECIAL stats
;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
+16 -1
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.
@@ -11,6 +20,12 @@ PartyLvlMsg=Lvl:
PartyACMsg=AC:
PartyAddictMsg=Addict
NPCPickupFail=%s cannot pick up the item.
AmmoInfoGlovz=Div: DR/%d, DT/%d
AmmoInfoYAAM=DT Mod: %d
PartyOrderAttackHuman=I'll take care of it.|Okay, I got it.|Sounds like a plan.
PartyOrderAttackCreature=::Growl::
PartyOrderAttackRobot=::Beep::
[AppearanceMod]
RaceText=Race
@@ -32,4 +47,4 @@ DoneBtn=Done
;PowerKick=Power Kick:
;HipKick=Hip Kick:
;HookKick=Hook Kick:
;PiercingKick=Piercing kick:
;PiercingKick=Piercing Kick:
+8 -2
View File
@@ -2,7 +2,6 @@
[Main]
[Items]
;Override the PIDs of the standard healing drugs that AI will use in combat
;Set to -1 if you don't want AI to identify this item as a healing drug
@@ -10,4 +9,11 @@
;in the proto for other items, so AI will use them for healing in combat as well
STIMPAK=40
SUPER_STIMPAK=144
HEALING_POWDER=237
HEALING_POWDER=273
;Overrides the PID of the item that grants a +1 stat bonus when placed in an active item slot
;Default is 433. Set to -1 to prevent any item from granting the bonus
MIRROR_SHADES_PID=433
;The SPECIAL stat number (0..6) to which the bonus is applied
;Default is 3 (Charisma). Set to -1 to disable the item's effect
MIRROR_SHADES_STAT=3
+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
+196 -109
View File
File diff suppressed because it is too large Load Diff
+201
View File
@@ -0,0 +1,201 @@
;Example Ammo INI for vanilla damage formula
; PID_EXPLOSIVE_ROCKET
[1]
pid=14
ac_adjust=0
dr_adjust=-25
dam_mult=1
dam_div=1
; PID_10MM_JHP
[2]
pid=29
ac_adjust=0
dr_adjust=25
dam_mult=2
dam_div=1
; PID_10MM_AP
[3]
pid=30
ac_adjust=0
dr_adjust=-25
dam_mult=1
dam_div=2
; PID_44_MAGNUM_JHP
[4]
pid=31
ac_adjust=0
dr_adjust=20
dam_mult=2
dam_div=1
; PID_FLAMETHROWER_FUEL
[5]
pid=32
ac_adjust=-20
dr_adjust=25
dam_mult=1
dam_div=1
; PID_14MM_AP
[6]
pid=33
ac_adjust=0
dr_adjust=-50
dam_mult=1
dam_div=2
; PID_223_FMJ
[7]
pid=34
ac_adjust=-20
dr_adjust=-20
dam_mult=1
dam_div=1
; PID_5MM_JHP
[8]
pid=35
ac_adjust=0
dr_adjust=35
dam_mult=2
dam_div=1
; PID_5MM_AP
[9]
pid=36
ac_adjust=0
dr_adjust=-35
dam_mult=1
dam_div=2
; PID_ROCKET_AP
[10]
pid=37
ac_adjust=-15
dr_adjust=-50
dam_mult=1
dam_div=1
; PID_SMALL_ENERGY_CELL
[11]
pid=38
ac_adjust=0
dr_adjust=0
dam_mult=1
dam_div=1
; PID_MICRO_FUSION_CELL
[12]
pid=39
ac_adjust=0
dr_adjust=0
dam_mult=1
dam_div=1
; PID_SHOTGUN_SHELLS
[13]
pid=95
ac_adjust=-10
dr_adjust=0
dam_mult=1
dam_div=1
; PID_44_FMJ_MAGNUM
[14]
pid=111
ac_adjust=0
dr_adjust=-20
dam_mult=1
dam_div=1
; PID_9MM_BALL
[15]
pid=121
ac_adjust=0
dr_adjust=0
dam_mult=1
dam_div=1
; PID_BBS
[16]
pid=163
ac_adjust=0
dr_adjust=0
dam_mult=1
dam_div=1
; PID_ROBO_ROCKET_AMMO
[17]
pid=274
ac_adjust=0
dr_adjust=-25
dam_mult=1
dam_div=1
; PID_45_CALIBER_AMMO
[18]
pid=357
ac_adjust=0
dr_adjust=0
dam_mult=1
dam_div=1
; PID_2MM_EC_AMMO
[19]
pid=358
ac_adjust=-30
dr_adjust=-20
dam_mult=3
dam_div=2
; PID_4_7MM_CASELESS
[20]
pid=359
ac_adjust=-5
dr_adjust=-10
dam_mult=3
dam_div=2
; PID_9MM_AMMO
[21]
pid=360
ac_adjust=0
dr_adjust=10
dam_mult=1
dam_div=2
; PID_HN_NEEDLER_CARTRIDGE
[22]
pid=361
ac_adjust=-10
dr_adjust=0
dam_mult=1
dam_div=1
; PID_HN_AP_NEEDLER_CARTRIDGE
[23]
pid=362
ac_adjust=-10
dr_adjust=0
dam_mult=2
dam_div=1
; PID_7_62MM_AMMO
[24]
pid=363
ac_adjust=-5
dr_adjust=-10
dam_mult=1
dam_div=1
; PID_FLAMETHROWER_FUEL_MK_II
[25]
pid=382
ac_adjust=-20
dr_adjust=0
dam_mult=1
dam_div=1
Binary file not shown.
+12 -12
View File
@@ -1,14 +1,14 @@
/*
Ammo INI Loader mod for Fallout 2 by NovaRain
---------------------------------------------
Ammo INI Loader mod v1.1 for Fallout 2 by NovaRain
--------------------------------------------------
- modifies ammo protos with data from an INI file:
* AmmoGlovz.ini if DamageFormula=1 or 2 in ddraw.ini
* AmmoYAAM.ini if DamageFormula=5 in ddraw.ini
* AmmoMod.ini if not using any bulit-in damage formula
Requires sfall 3.5 or higher
Requires sfall 4.0/3.8.29 or higher
*/
@@ -23,7 +23,7 @@ variable ammoData;
variable enabled;
procedure start begin
variable i := 1, ammo, ammoPid, dmgMod;
variable i := 1, ammo, ammoSection, dmgMod;
if game_loaded then begin
enabled := get_ini_setting("ddraw.ini|Misc|DamageFormula");
if (enabled == 1 or enabled == 2) then
@@ -37,19 +37,19 @@ procedure start begin
if (enabled <= 0) then return;
ammoData := create_array_map;
ammoPid := enabled; // pid from the first section
while (ammoPid > 0) do begin
ammoSection := get_ini_section(ammoIni, "" + i);
while (ammoSection.pid > 0) do begin
ammo := create_array_map; // create permanent arrays
ammo.ac_adjust := get_ini_setting(ammoIni + "|" + i + "|ac_adjust");
ammo.dr_adjust := get_ini_setting(ammoIni + "|" + i + "|dr_adjust");
ammo.ac_adjust := atoi(ammoSection.ac_adjust);
ammo.dr_adjust := atoi(ammoSection.dr_adjust);
// dam_mult and dam_div must be positive integers
dmgMod := get_ini_setting(ammoIni + "|" + i + "|dam_mult");
dmgMod := atoi(ammoSection.dam_mult);
ammo.dam_mult := dmgMod if (dmgMod > 0) else 1;
dmgMod := get_ini_setting(ammoIni + "|" + i + "|dam_div");
dmgMod := atoi(ammoSection.dam_div);
ammo.dam_div := dmgMod if (dmgMod > 0) else 1;
ammoData[ammoPid] := ammo;
ammoData[atoi(ammoSection.pid)] := ammo;
i++;
ammoPid := get_ini_setting(ammoIni + "|" + i + "|pid");
ammoSection := get_ini_section(ammoIni, "" + i);
end
call map_enter_p_proc;
debug_msg("Ammo INI Loader mod: " + ammoIni + " - set " + (i - 1) + " ammo protos.");
+3 -3
View File
@@ -1,5 +1,5 @@
Ammo INI Loader mod for Fallout 2 by NovaRain
---------------------------------------------
Ammo INI Loader mod v1.1 for Fallout 2 by NovaRain
--------------------------------------------------
- modifies ammo protos with data from an INI file:
* AmmoGlovz.ini if DamageFormula=1 or 2 in ddraw.ini
@@ -7,6 +7,6 @@ Ammo INI Loader mod for Fallout 2 by NovaRain
* AmmoMod.ini if not using any bulit-in damage formula
Requires sfall 3.5 or higher.
Requires sfall 4.0/3.8.29 or higher.
To use, copy gl_ammomod.int to your scripts folder, and copy the INI files to the same directory as sfall.
@@ -0,0 +1,30 @@
/*
A basic example of how to use set_spray_settings function for script-based burst control
*/
#include "..\headers\define.h"
#include "..\headers\sfall\define_extra.h"
#include "..\headers\sfall\sfall.h"
procedure start;
procedure ammocost_handler;
procedure start begin
if game_loaded then begin
register_hook_proc(HOOK_AMMOCOST, ammocost_handler);
end
end
procedure ammocost_handler begin
variable
weapon := get_sfall_arg,
bullets := get_sfall_arg,
cost := get_sfall_arg,
event := get_sfall_arg;
if (event == 2 and weapon > 0) then begin // when calculating number of burst rounds
if (obj_pid(weapon) == PID_ASSAULT_RIFLE) then begin
set_spray_settings(1, 1, 1, 1); // burst attack will not hit other targets
end
end
end
@@ -1,28 +1,69 @@
/*
Example algorithm of how the game engine calculates combat damage
This script reimplements the combat damage calculation of the original game.
Use this to implement your own damage formula!
*/
#include "..\headers\define.h"
#include "..\headers\command.h"
#include "..\headers\sfall\sfall.h"
#include "..\headers\sfall\define_extra.h"
#include "../sfall/define_lite.h"
#include "../sfall/define_extra.h"
#include "../sfall/sfall.h"
#define DAMAGE_FORMULA_VANILLA (0)
#define DAMAGE_FORMULA_GLOVZ (1)
#define DAMAGE_FORMULA_GLOVZ2 (2)
#define DAMAGE_FORMULA_YAAM (5)
procedure start;
procedure compute_damage_F2;
procedure item_w_damage_hook;
procedure combatdamage_handler;
procedure itemdamage_handler;
procedure calc_damage_YAAM(variable weapon, variable rounds, variable armorDT, variable armorDR, variable bonusRangedDamage, variable multiplyDamage, variable difficulty);
procedure item_w_subtype(variable weapon, variable hit_mode);
procedure get_ammo_value(variable weapon, variable param);
variable item_w_damage;
variable
damage_formula,
item_damage_min,
item_damage_max,
item_damage_weapon,
item_damage_attacker;
procedure start begin
if game_loaded then begin
register_hook_proc(HOOK_COMBATDAMAGE, compute_damage_F2);
register_hook_proc(HOOK_ITEMDAMAGE, item_w_damage_hook);
damage_formula := get_ini_setting("ddraw.ini|Misc|DamageFormula");
register_hook_proc(HOOK_COMBATDAMAGE, combatdamage_handler);
register_hook_proc(HOOK_ITEMDAMAGE, itemdamage_handler);
end
end
procedure compute_damage_F2 begin
/*
HOOK_COMBATDAMAGE
Runs when:
1) Game calculates how much damage each target will get. This includes primary target as well as all extras (explosions and bursts). This happens BEFORE the actual attack animation.
2) AI decides whether it is safe to use area attack (burst, grenades), if he might hit friendlies.
Does not run for misses, or non-combat damage like dynamite explosions.
Critter arg0 - The target
Critter arg1 - The attacker
int arg2 - The amount of damage to the target
int arg3 - The amount of damage to the attacker
int arg4 - The special effect flags for the target (use bwand DAM_* to check specific flags)
int arg5 - The special effect flags for the attacker (use bwand DAM_* to check specific flags)
Item arg6 - The weapon used in the attack
int arg7 - The bodypart that was struck
int arg8 - Damage Multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled)
int arg9 - Number of bullets actually hit the target (1 for melee attacks)
int arg10 - The amount of knockback to the target
int arg11 - Attack Type (see ATKTYPE_* constants)
mixed arg12 - computed attack data (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data)
int ret0 - The damage to the target
int ret1 - The damage to the attacker
int ret2 - The special effect flags for the target
int ret3 - The special effect flags for the attacker
int ret4 - The amount of knockback to the target
*/
procedure combatdamage_handler begin
variable dmg_type, weapon_perk, dmg_thresh, dmg_resist, weapon_subtype, bonus_ranged, difficulty, i, dmg_mult, dmg_div, damage;
variable target, flags, knockback, amount;
@@ -40,6 +81,11 @@ procedure compute_damage_F2 begin
amountKnockback := get_sfall_arg,
hit_mode := get_sfall_arg;
if (ctdSource != item_damage_attacker or weapon != item_damage_weapon) then begin
debug_msg("! ERROR ! compute_damage: Expected attacker or weapon differs!");
return;
end
if (flagsSource bwand DAM_HIT) then begin
target := ctdTarget;
flags := flagsTarget;
@@ -50,7 +96,6 @@ procedure compute_damage_F2 begin
knockback := 0;
end
//amount := 0;
if target and (obj_type(target) == OBJ_TYPE_CRITTER) then begin
if weapon then begin
dmg_type := weapon_dmg_type(weapon);
@@ -77,7 +122,7 @@ procedure compute_damage_F2 begin
end
weapon_subtype := item_w_subtype(weapon, hit_mode); // item_w_subtype_
if (ctdSource != dude_obj) or (weapon_subtype != WEAPON_TYPE_GUNS) then
if (ctdSource != dude_obj) or (weapon_subtype != WEAPON_TYPE_RANGED) then
bonus_ranged := 0;
else
bonus_ranged := has_trait(TRAIT_PERK, ctdSource, PERK_bonus_ranged_damage) * 2;
@@ -90,27 +135,31 @@ procedure compute_damage_F2 begin
difficulty := 125;
end
// F2 default start
// Damage = (1 - (DR_armor + DR_ammo_adjust) * (((raw_damage * (dmg_mult * damageMultiplier)) / dmg_div) - dmg_thresh)
dmg_resist += get_ammo_value(weapon, PROTO_AM_DR_MOD); // item_w_dr_adjust_ (DR Adjust %)
if (dmg_resist < 100) then begin
if (dmg_resist < 0) then dmg_resist := 0;
if (damage_formula == DAMAGE_FORMULA_YAAM) then begin
amount := calc_damage_YAAM(weapon, rounds, dmg_thresh, dmg_resist, bonus_ranged, damageMultiplier, difficulty);
end else begin
// F2 default start
// Damage = (1 - (DR_armor + DR_ammo_adjust) * (((raw_damage * (dmg_mult * damageMultiplier)) / dmg_div) - dmg_thresh)
dmg_resist += get_ammo_value(weapon, PROTO_AM_DR_MOD); // item_w_dr_adjust_ (DR Adjust %)
if (dmg_resist < 100) then begin
if (dmg_resist < 0) then dmg_resist := 0;
dmg_mult := damageMultiplier * get_ammo_value(weapon, PROTO_AM_DMG_MULT); // item_w_dam_mult_ (Dmg mod A)
dmg_div := get_ammo_value(weapon, PROTO_AM_DMG_DIV); // item_w_dam_div_ (Dmg mod B)
dmg_mult := damageMultiplier * get_ammo_value(weapon, PROTO_AM_DMG_MULT); // item_w_dam_mult_ (Dmg mod A)
dmg_div := get_ammo_value(weapon, PROTO_AM_DMG_DIV); // item_w_dam_div_ (Dmg mod B)
for (i := 1; i <= rounds; i++) begin
damage := (item_w_damage + bonus_ranged) * dmg_mult; // item_w_damage_ (raw_damage)
if dmg_div then damage /= dmg_div;
for (i := 1; i <= rounds; i++) begin
damage := (random(item_damage_min, item_damage_max) + bonus_ranged) * dmg_mult; // item_w_damage_ (raw_damage)
if dmg_div then damage /= dmg_div;
damage := (((damage / 2) * difficulty) / 100) - dmg_thresh;
if (damage > 0) then begin
damage := damage - ((damage * dmg_resist) / 100); // reduce damage by the percentage of DR_armor + DR_Ammo
if (damage > 0) then amount += damage;
damage := (((damage / 2) * difficulty) / 100) - dmg_thresh;
if (damage > 0) then begin
damage := damage - ((damage * dmg_resist) / 100); // reduce damage by the percentage of DR_armor + DR_Ammo
if (damage > 0) then amount += damage;
end
end
end
// F2 default end
end
// F2 default end
if (ctdSource == dude_obj) then begin
if has_trait(TRAIT_PERK, ctdSource, PERK_living_anatomy_perk) and (critter_kill_type(ctdTarget) != KILL_TYPE_robot_kills)
@@ -140,11 +189,11 @@ procedure compute_damage_F2 begin
end
if (flagsSource bwand DAM_HIT) then begin
display_msg("amountTarget = " + amountTarget+ ", amount = " + amount);
display_msg("COMBATDAMAGE amountTarget = " + amountTarget+ ", amount = " + amount);
amountTarget := amount;
flagsTarget := flags;
end else begin
display_msg("amountSource = " + amountSource+ ", amount = " + amount);
display_msg("COMBATDAMAGE amountSource = " + amountSource+ ", amount = " + amount);
amountSource := amount;
flagsSource := flags;
end
@@ -154,40 +203,118 @@ procedure compute_damage_F2 begin
set_sfall_return(flagsTarget);
set_sfall_return(flagsSource);
set_sfall_return(amountKnockback);
set_sfall_arg(2, amountTarget);
set_sfall_arg(3, amountSource);
set_sfall_arg(4, flagsTarget);
set_sfall_arg(5, flagsSource);
set_sfall_arg(10, amountKnockback);
end
procedure item_w_damage_hook begin
variable
item_w_damage_min := get_sfall_arg,
item_w_damage_max := get_sfall_arg;
//weapon := get_sfall_arg,
//source := get_sfall_arg,
procedure calc_damage_YAAM(variable weapon, variable rounds, variable armorDT, variable armorDR, variable bonusRangedDamage, variable multiplyDamage, variable difficulty) begin
variable accumulatedDamage, ammoDiv, ammoMult, ammoDT, calcDT, _calcDT, calcDR, i, rawDamage, resistedDamage;
if (rounds <= 0) then begin
return 0;
end
ammoDiv := get_ammo_value(weapon, PROTO_AM_DMG_DIV);
ammoMult := get_ammo_value(weapon, PROTO_AM_DMG_MULT);
// Damage Multipler = Critical Multipler * Ammo Dividend
multiplyDamage *= ammoMult;
// Retrieve ammo DT (well, it's really Retrieve ammo DR, but since we're treating ammo DR as ammo DT...)
ammoDT := get_ammo_value(weapon, PROTO_AM_DR_MOD);
calcDT := armorDT - ammoDT;
_calcDT := calcDT;
if (calcDT >= 0) then begin
_calcDT := 0;
end else begin
// note that this should be a negative value
_calcDT *= 10;
calcDT := 0;
end
// DR = armor DR + DT (note that DT should be less than or equal to zero)
calcDR = armorDR + _calcDT;
if (calcDR < 0) then begin
calcDR = 0;
end else if (calcDR >= 100) then begin
return 0;
end
display_msg("YAAM: AmmoDT=" + ammoDT + ", DT=" + calcDT + "/" + armorDT + ", DR=" + calcDR + "/" + armorDR);
// Start of damage calculation loop
for (i := 0; i < rounds; i++) begin
rawDamage = random(item_damage_min, item_damage_max);
rawDamage += bonusRangedDamage;
rawDamage -= calcDT;
if (rawDamage <= 0) then
continue;
rawDamage *= multiplyDamage;
if (ammoDiv != 0) then begin
rawDamage /= ammoDiv;
end
rawDamage /= 2; // related to critical hit damage multiplier bonus
rawDamage *= difficulty; // combat difficulty setting (75 if wimpy, 100 if normal or if attacker is player, 125 if rough)
rawDamage /= 100;
resistedDamage = calcDR * rawDamage;
resistedDamage /= 100;
rawDamage -= resistedDamage;
if (rawDamage > 0) then begin
display_msg("YAAM: Bullet " + i + " dmg=" + rawDamage);
accumulatedDamage += rawDamage;
end
end
return accumulatedDamage;
end
/*
HOOK_ITEMDAMAGE
Runs when retrieving the damage rating of the player's used weapon. (Which may be their fists.)
int arg0 - The default min damage
int arg1 - The default max damage
Item arg2 - The weapon used (0 if unarmed)
Critter arg3 - The critter doing the attacking
int arg4 - The type of attack
int arg5 - non-zero if this is an attack using a melee weapon
int ret0 - Either the damage to be used, if ret1 isn't given, or the new minimum damage if it is
int ret1 - The new maximum damage
*/
procedure itemdamage_handler begin
item_damage_min := get_sfall_arg;
item_damage_max := get_sfall_arg;
item_damage_weapon := get_sfall_arg;
item_damage_attacker := get_sfall_arg;
//hit_mode := get_sfall_arg,
//isMelee := get_sfall_arg;
item_w_damage := (item_w_damage_min + (item_w_damage_max - item_w_damage_min) / 2);
display_msg("item_w_damage_ = " + item_w_damage);
set_sfall_return(item_w_damage);
display_msg("itemdamage: " + item_damage_min + "-" + item_damage_max);
end
procedure item_w_subtype(variable weapon, variable hit_mode) begin
variable attack_mode, type := WEAPON_TYPE_UNARMED;
if weapon and (hit_mode <= ATKTYPE_RWEP2) then begin
attack_mode := (get_proto_data(obj_pid(weapon), PROTO_IT_FLAGS));
attack_mode := weapon_attack_mode(obj_pid(weapon), hit_mode);
if (hit_mode == ATKTYPE_LWEP2) or (hit_mode == ATKTYPE_RWEP2) then
attack_mode := (attack_mode bwand 0xF0) / 16; // shift 4 bits to the right
else
attack_mode := (attack_mode bwand 0x0F);
if (attack_mode > ATKMODE_PRI_THROW) then
type := WEAPON_TYPE_GUNS;
else if (attack_mode == ATKMODE_PRI_THROW) then
if (attack_mode >= ATTACK_MODE_SINGLE) then
type := WEAPON_TYPE_RANGED;
else if (attack_mode == ATTACK_MODE_THROW) then
type := WEAPON_TYPE_THROWN;
else if (attack_mode > ATKMODE_PRI_KICK) then
else if (attack_mode >= ATTACK_MODE_SWING) then
type := WEAPON_TYPE_MELEE;
else if (attack_mode == ATTACK_MODE_NONE) then
type := WEAPON_TYPE_NONE;
end
return type;
@@ -0,0 +1,44 @@
/*
Example implementation of the algorithm of how the game engine sets the explosive timer.
*/
#include "..\..\scripting_docs\headers\sfall.h"
#include "..\..\scripting_docs\headers\define_lite.h"
// from CONDTION.H
#define ROLL_CRITICAL_FAILURE (0)
#define ROLL_FAILURE (1)
#define ROLL_SUCCESS (2)
#define ROLL_CRITICAL_SUCCESS (3)
procedure start;
procedure start begin
if game_loaded then begin
register_hook(HOOK_EXPLOSIVETIMER);
end else begin
variable
time := get_sfall_arg,
result := ROLL_CRITICAL_FAILURE;
if has_trait(TRAIT_PERK, dude_obj, PERK_demolition_expert_perk) then
result := ROLL_SUCCESS;
else begin
result := roll_vs_skill(dude_obj, SKILL_TRAPS, 0);
end
if (result) then begin
if (result == ROLL_FAILURE) then
time /= 2;
else begin // success or critical success
result := ROLL_SUCCESS;
end
end else begin // critical failure
time := 0;
result := ROLL_FAILURE;
end
set_sfall_return(time);
set_sfall_return(result); // failure/success
end
end
@@ -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

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