Compare commits

..
500 Commits
Author SHA1 Message Date
NovaRain 3acf051b49 Renamed all metarule functions with mf_ prefix 2020-05-21 09:42:02 +08:00
NovaRain 0137504f3f Renamed all script opcode handlers with op_ prefix 2020-05-19 10:05:27 +08:00
NovaRain ebcd505561 Minor code fixes in AI.cpp:
* Fixed NPCs being unable to select a burst attack mode if the line of
fire was blocked.

* Changed the return point of combat_ai_hook_FleeFix to run
ai_check_drugs_ first.

Changed the debug message about missing art file for critters to be
displayed in game only when in sfall debugging mode.
2020-05-19 09:50:23 +08:00
NovaRain 24cb02b7d8 Fixed ai_move_away_ engine function
Some minor fixes.
2020-05-10 10:03:04 +08:00
NovaRain 48ce358451 Backported SkipLoadingGameSettings option from 4.x 2020-05-08 10:38:32 +08:00
NovaRain c293a826bc Cosmetic changes to the code:
Use double underscore for stdcall and "asm" keyword.
2020-05-07 12:30:22 +08:00
NovaRain 0da7c7b266 Minor code edits to Combat.cpp 2020-05-07 11:20:32 +08:00
NovaRain d74df7fc78 Added checking AP cost to ai_pick_hit_mode_ engine function 2020-05-07 09:49:57 +08:00
NovaRain df816bcd47 Added a tweak for finding new targets for PMs
* before they would "forget" their current target when trying to find
new ones (only 3), now the current target is included as one of
potential targets.

Tweaked the code of MultiHexPathingFix.
2020-05-05 12:15:30 +08:00
NovaRain 068988caad Added internal implementation of engine functions with hooks:
* item_w_mp_cost_ with CALCAPCOST
* is_within_perception_ with WITHINPERCEPTION
2020-05-01 10:29:27 +08:00
NovaRain 24c9499021 Added combat rating check to "Snipe" distance preference fix
Added a fix to reduce friendly fire in burst attacks.
Updated the info of TGameObj struct.
2020-05-01 08:01:24 +08:00
NovaRain 7f3de8d19a Minor code edits/fixes 2020-04-30 10:28:31 +08:00
NovaRain 87f7fe4a54 Moved code from main.cpp to new PlayerModel/MiscPatches.cpp 2020-04-28 12:43:54 +08:00
NovaRain 01ba18100e Added a fix for AI behavior for "Snipe" distance preference
Added a check for for the weapon range and the distance to the target
when AI is choosing weapon attack modes.
2020-04-28 10:58:24 +08:00
NovaRain 8b26573073 Changed the fix for AI target selection in commit f0f00a7
* NPCs will reload the weapon in the same turn (and attack if have
enough AP left) if weapon is empty while selecting targets.

Moved some leftover code in main.cpp to KillCounter.cpp & Elevators.cpp.

Misc code edits.
2020-04-27 14:32:39 +08:00
NovaRain 1839790dfb Fixed AllowDShowSound=2 not working
Limited NumSoundBuffers to the max of 32.
Fixed replacing Body_Torso with Body_Uncalled (from commit 62f890d)
Corrected the code in the previous commit.
2020-04-23 12:42:20 +08:00
NovaRain cb1d5d359f Added a tweak to the miss message in combat
* if the main target has Flat flag set, remove the message about hitting
another object.

Reorganized the code of misc patches in main.cpp.
2020-04-22 11:40:11 +08:00
NovaRain b781e117a2 Improved the fix for placing PID_CORPSE_BLOOD obj on the lower layer
(didn't work correctly after re-entering the map.)

Fixed CorpseDeleteTime not setting the timer correctly.
2020-04-21 10:55:56 +08:00
NovaRain a7d9716b68 Moved some engine structs to FalloutStructs.h
Some code edits regarding variable/struct types.
2020-04-20 12:06:13 +08:00
NovaRain cdd2bfe338 Reverted incorrect code change of SpeedPatch.cpp in previous commit.
Some code edits to Explosions.cpp and Perks.cpp.
2020-04-19 10:21:20 +08:00
NovaRain 7decec4a2c Added use_item_on_dude macro to sfall.h
Various code edits:
* Implemented more HookCalls/MakeCalls/SafeWriteBatch in code.
* Moved return/jump address consts into their respective functions.
2020-04-18 21:25:54 +08:00
NovaRain e3af4f5754 Fixed ReloadWeaponKey for using any non-weapon item (#84) 2020-04-18 11:25:46 +08:00
NovaRain 1b61bca702 Fixed "loot_obj" script function 2020-04-18 09:03:16 +08:00
NovaRain f0f00a77ea Fixed AI target selection for no ammo or target out of range cases 2020-04-18 09:01:29 +08:00
NovaRain 58d41487fd Re-fixed automatically ending combat
Updated version number.
2020-04-18 08:59:28 +08:00
NovaRain 73ccba22bf Implemented HookCalls/MakeCalls templates
* same as SafeWriteBatch, only accept address arrays due to no support
for list initialization in VS2010.
2020-04-11 08:19:32 +08:00
NovaRain 1f8b3636f3 Implemented SafeWriteBatch template from 4.x
* only the version that accepts address array due to no support
for list initialization in VS2020.
2020-04-08 10:42:59 +08:00
NovaRain b7e80d445e Fixed NPCs not fully reloading a weapon sometimes
* NPCs use only one box per reload. If the weapon has more ammo
capacity than a box of ammo (e.g. miniguns and BB gun), it'll take
several tries for them to fully reload it.
2020-04-05 08:25:00 +08:00
NovaRain e404684f58 Reverted the change for ResetState() in 993555
* reason: the skills didn't get initialized properly if loading a save
from the main menu before starting any game. And some inits in 3.8
also require running ResetState() before any game, so reverting is
probably the easiest solution before I break more stuff.

Backported some code setup from 4.x for Combat.cpp & Skills.cpp.
2020-04-04 18:06:04 +08:00
NovaRain 4c78ba595c Moved static addresses into respective funcs in BugFixes & main.cpp 2020-04-03 23:19:10 +08:00
NovaRain 1f1d6eb6f0 Some code correction in BugFixes
Minor edits to documents.
2020-04-03 12:33:48 +08:00
NovaRain 9935553bce Reduced unnecessary game reset execution 2020-04-02 23:20:04 +08:00
NovaRain cd4d3b5b2f Some code/document edits 2020-04-02 12:00:52 +08:00
NovaRain a61ff5b626 Edited the description of RadEffectsRemovalMsg option 2020-04-01 22:10:55 +08:00
NovaRain bc2e8e4362 Backported the code of DeathAnim1/2 hook from 4.x
Updated hookscripts.txt to reflect the change.
2020-04-01 10:57:54 +08:00
NovaRain 136404a723 Fixed loading savegame for "NPC turns into a container" bug fix
Added RadEffectsRemovalMsg option for radiation fixes.

Some code correction in Graphics.cpp.
2020-03-31 21:54:49 +08:00
NovaRain 1a17ac5ac8 Added ActiveGeigerMsgs option and radiation fixes
Changed "Radiated" to be highlighted in red color when the player is
under the influence of negative effects of radiation.

Some edits to macros in HookScripts.cpp.
2020-03-30 21:15:19 +08:00
NovaRain 07543dd29d Fixed a crash when using older versions of HRP
Fixed potential crash/bug when alt-tab out of game and get back.
Edited OnDeath hook to minimize its hook points to the engine (from 4.x)
Minor edits to ddraw.ini.
2020-03-26 14:13:22 +08:00
NovaRain 4243bead5d Attempted to fix the crash with sfall array and missing script (#281)
Replaced all pushad/popad in script opcodes with pushaop/popaop macros.
2020-03-25 20:22:54 +08:00
NovaRain f80e933889 Rewrote some script functions in PerksOps.hpp
* funcs: get_perk_available, set_perk_name/desc, set_selectable_perk,
set_fake_perk/trait.

Minor code refactoring in ObjectsOps.hpp.
2020-03-25 12:26:26 +08:00
NovaRain 7cbde234c6 Rewrote various script functions in _WRAP_OPCODE
* funcs: reg_anim_*, sqrt, sin, cos, tan, arctan, get/set_weapon_ammo_*,
list_*, strlen, atoi, atof, typeof, string_split.
2020-03-24 12:12:34 +08:00
NovaRain f6ae7c5f2c Fixed stuttering when playing avi movies
Fixed a crash when playing mve movies without the hi-res patch.

Minor edits to ddraw.ini and function notes.txt.
2020-03-24 10:55:28 +08:00
NovaRain 58060a8c5f Simplified the pushad/popad in _WRAP_OPCODE macro
Refactored ASM code of art_exists and sneak_success functions.
Rewrote set_critter_current_ap and set_sfall_arg with _WRAP_OPCODE.
2020-03-23 13:52:28 +08:00
NovaRain 22140e2a0c Added performance patches, some code moved to main.cpp
Minor edits to ddraw.ini.

Tweaked the names in AsmMacros.h.
2020-03-22 09:27:24 +08:00
NovaRain 1c6f8cc255 Refactored sfall_ver_* and charcode functions 2020-03-20 12:32:05 +08:00
NovaRain e479609581 Added a new "fullscreen windowed" DX9 mode
Added saving the position of the game window to ddraw.ini
2020-03-20 12:30:41 +08:00
NovaRain ab11c0422a Refactored ASM code of script opcode handlers
Included call_offset_xx functions for AllowUnsafeScripting=2
2020-03-19 12:57:19 +08:00
NovaRain 09752c98a4 Attempted to fix the crash in commit 0ba3b62
* the crash happens when the game loses focus.
2020-03-17 14:48:50 +08:00
NovaRain aab04764ae Added a new value to AllowUnsafeScripting
* for disabling the memory address check in write_xxx unsafe functions.
2020-03-17 13:39:05 +08:00
NovaRain 0ba3b62eff Improved and fixed the playback of alternative sound files
Added a new mode to play_sfall_sound script function.
2020-03-17 13:08:47 +08:00
NovaRain 0c0d1dd73e Fixed the return value of play_sfall_sound function
* before it returned a raw pointer instead of the ID number of the
played sound.
2020-03-12 11:58:48 +08:00
NovaRain 0fd45aa37a Moved allowDShowSound code from Movies.cpp to Sound.cpp 2020-03-12 10:06:56 +08:00
NovaRain 00a6e4f0f9 Fixed set_palette function broken in the previous commit 2020-03-10 10:07:59 +08:00
NovaRain 36ef55ddd0 Refactored ASM code of script handlers in MiscOps.hpp
Minor code edits.
2020-03-07 16:02:23 +08:00
NovaRain db2435416d Minor code edits 2020-02-29 18:59:44 +08:00
NovaRain 0120e46782 Added a new value to the 'mark_state' arg of mark_area_known function
* 3 - uncovers locations without highlighting their sub-tiles.
(Fallout 1 behavior)
2020-02-29 08:40:45 +08:00
NovaRain eddefd6bd5 Fixed Fill_W not uncovering all tiles to the left (#287) 2020-02-28 07:43:14 +08:00
NovaRain f9cbab3d55 Fixed a crash or animation glitch of the critter in combat (beta fix)
* when an explosion from explosives and the AI attack animation are
performed simultaneously.
2020-02-25 11:38:43 +08:00
NovaRain e3168946ba Minor code fix for Graphics.cpp
Added notes/correction to hookscripts.txt.
2020-02-22 15:50:06 +08:00
NovaRain 8bb660ff11 Fixed the player's money not being displayed after barter (#286)
Restored TownMapHotkeysFix option.

Updated version number.
2020-02-22 15:37:36 +08:00
NovaRain 8a7d9cbd78 Re-ordered the code in ScriptExtender.cpp
* for removing some unnecessary static func declarations at the top.

Moved Set/GetAppearanceGlobals() to HeroAppearance.cpp like 4.x.
2020-02-10 22:22:02 +08:00
NovaRain 008fdb12b7 Minor code improvement in Graphics.cpp 2020-02-09 09:29:43 +08:00
NovaRain 3609f2e309 Renamed dinput.cpp/input.h to InputFuncs.cpp/h 2020-02-08 11:59:00 +08:00
NovaRain 517c2e6825 Updated stdafx.h and other code/doc files 2020-02-08 08:48:02 +08:00
NovaRain 4bc687922a Reverted part of changes in the previous commit 2020-02-07 19:17:24 +08:00
NovaRain 5230ca9cbf Edited some wording in ddraw.ini and Define.h 2020-02-07 10:05:59 +08:00
NovaRain 5a5c65291d Fixed trying to loot corpses with the "NoSteal" flag (#280) 2020-02-06 10:52:19 +08:00
NovaRain e153819bcd Added the description for 'div' operator to notes.txt 2020-02-05 23:21:15 +08:00
NovaRain 8ab5b9b7e7 Replaced all MAXINT with INT_MAX in QuestList.cpp (#279)
Added WINVER and _WIN32_WINNT defines to stdafx.h.
2020-02-05 16:18:51 +08:00
NovaRain abe3b01213 Fixed playing game movies with width less than 640px in DX9 mode
Fixed palette updating.
2020-02-05 09:47:25 +08:00
NovaRain 15019ffe81 Some code edits to ExtraSaveSlots.cpp 2020-02-04 16:28:21 +08:00
NovaRain eacd1e5682 Moved engine function defines from HeroAppearance to FalloutEngine 2020-02-04 10:55:09 +08:00
NovaRain 84204d97d8 Simplified the code in HeroAppearance.cpp 2020-02-03 11:23:20 +08:00
NovaRain 3b85596ca1 Renamed all Op.hpp to Ops.hpp 2020-02-02 21:54:10 +08:00
NovaRain 21bf1056ac Added DivisionOperatorFix option for signed integer division (#278)
* it changes the behavior of vanilla division operator to use signed
integer division. Before it used signed division for floats but
unsigned for integers.

Added a new "div" operator for unsigned integer division.
Moved mathematical script functions from ScriptUtils.hpp to new MathOps.
Added include guard to sfall.h and main.h in modders pack.
2020-02-02 21:49:54 +08:00
NovaRain 1354467059 Fixed the barter button on the dialog window (from rotators repo)
* when first entering the dialog, it didn't animate on click.
2020-02-02 15:44:47 +08:00
NovaRain 8d720185a7 Reverted part of changes in previous commit 2020-02-02 13:50:01 +08:00
NovaRain 87864d9ef6 Fixed palette in DX9 mode 2020-02-01 14:08:46 +08:00
NovaRain 0d5c88fded Implemented the optimization for receiving/passing script args from 4.x
* combined related engine interpreter functions into a single function
for aligning the compiled ASM code better.

Minor edits to dinput.cpp.
2020-01-31 20:29:29 +08:00
NovaRain 555b3a9504 Fixed the timer event execution in global scripts 2020-01-31 01:41:25 +08:00
NovaRain f8cd74cc49 Minor changes to some other code and documents. 2020-01-31 01:23:32 +08:00
NovaRain 408661f42b Rewrote and rename "dialog_box" to "message_box"
Added support for '\n' control character to create_message_window.

Fix the playback of the speech sound file for the death screen.
2020-01-28 13:14:58 +08:00
NovaRain 893847cc6a Added "dialog_box" script function
Added a new attrType value to "get_window_attribute" function.

Tweaked the arg type check for "force_encounter_with_flags" function.
2020-01-27 20:52:01 +08:00
NovaRain 6b1fffded1 Fixed the timing of setting some game mode flags
* now WORLDMAP, PIPBOY, INVENTORY, INTFACEUSE, and INTFACELOOT are
toggled after creating/before deleting their corresponding interface
windows.

Fixed the array out of bounds bug in Skills.cpp.
2020-01-27 10:42:51 +08:00
NovaRain 3b2e23fda6 Backported FO1 worldmap features from 4.x
* WorldMapTravelMarkers, WorldMapTerrainInfo options.
* set_terrain_name, set_town_title script functions.
2020-01-26 09:26:41 +08:00
NovaRain c9b1a1b583 Edited FalloutEngine using 4.x's EngineUtils & Variables_def as ref 2020-01-25 18:01:55 +08:00
NovaRain d13cd9267d Reordered ResetState() sequence in LoadGameHook.cpp
* in the same order as 4.x modules.

Merged and renamed some "reset" functions.
2020-01-24 22:38:55 +08:00
NovaRain 5a638f48ff Added some engine variables to pointer defines.
Removed redundant PlayAcm() from HeroAppearance.cpp.
2020-01-24 10:03:39 +08:00
NovaRain df1d147a4f Removed TownMapHotkeysFix from ddraw.ini (always enabled)
Also move its code from Worldmap.cpp to BugFixes.cpp.
2020-01-23 23:34:21 +08:00
NovaRain e733954e65 Removed DisplaySecondWeaponRange from ddraw.ini (always enabled)
Minor edits to some code and documents.
2020-01-23 20:35:18 +08:00
NovaRain 36b3b6a2c7 Added "get_window_attribute" script function (#276) 2020-01-22 21:23:12 +08:00
NovaRain ceba5d1da2 Added a flashing icon to the Horrigan encounter
Minor edits to some code and documents.
2020-01-22 10:27:11 +08:00
NovaRain d6486008f4 Expanded the functionality of Fallout1Behavior
* calling endgame_movie now plays Movie11 or Movie12 depending on
the player's gender before the credits.

Added new flags to force_encounter_with_flags function.
2020-01-21 21:40:36 +08:00
NovaRain 9f140cf3ca Added a blinking icon to force_encounter/with_flags functions
* currently an icon is always shown for scripted force encounters.
2020-01-20 11:51:17 +08:00
NovaRain f2670deb6f Minor edits to Console.cpp and Logging.cpp
Added procedure and macros for unsigned integer comparison to lib.math.h.
2020-01-19 12:20:18 +08:00
NovaRain 6e6e01ea7f Simplified the code of string_to_case function
Minor edits to some code and documents.
2020-01-17 21:56:12 +08:00
NovaRain dccd735454 Improved the avi playback function 2020-01-17 21:48:54 +08:00
NovaRain 21004e3e63 Combined tolower/toupper in previous commit to "string_to_case" 2020-01-16 20:35:49 +08:00
NovaRain d12db2be28 Added "tolower", "toupper" script functions 2020-01-16 09:46:27 +08:00
NovaRain 3d335231a2 Replaced <hash_map><set> with <unordered_map><unordered_set> 2020-01-10 21:33:32 +08:00
NovaRain d4eb1ee539 Moved the Combat Block patch from AI.cpp to Combat.cpp
Removed palette animations enablement from Interface.cpp.
2020-01-10 11:12:34 +08:00
NovaRain 61c0964c98 Moved engine func defines from various files to FalloutEngine.cpp
(HeroAppearance.cpp, Message.cpp, Sound.cpp)
2020-01-09 22:36:58 +08:00
NovaRain 58532fd902 Fixed duplicate critters being added to the target list for AI
Edited hookscripts.txt to mention the fix.

Some code correction.
2020-01-09 11:41:50 +08:00
NovaRain aafc030f8e Code refactoring in main.cpp (from MiscPatches in 4.x)
Updated compiler document.
2020-01-08 16:59:07 +08:00
NovaRain c652982a06 Added sslc documents to repo 2020-01-06 14:14:22 +08:00
NovaRain 1e0b048e9e Re-fixed setting DIALOG game mode flag 2020-01-06 00:19:36 +08:00
NovaRain 28dc256f61 Fixed the timing of setting DIALOG game mode flag
Renamed win_* related functions in FalloutEngine.

Minor code edits to Inventory & Worldmap following develop branch.
2020-01-05 10:05:39 +08:00
NovaRain 18e1e06d28 Merged message struct defines in Inventory.cpp & Message.cpp
Changed GetMessageStr() and MsgSearch() to take proper MSGList struct.

Edited some code to reflect the changes above.
2020-01-04 01:21:48 +08:00
NovaRain 6871e6f673 Minor edits to Worldmap.cpp & Interface.cpp (from 4.x) 2020-01-02 00:43:13 +08:00
NovaRain 9ef670161d Reverted the change on x offset in previous commit 2019-12-29 08:42:08 +08:00
NovaRain c26cd45b5b Increased the width of the total weight display in the inventory
(moved from the CritterInvSizeLimitMode option)

Minor format edits to README.md.
2019-12-29 01:58:02 +08:00
NovaRain 0b5c61cb72 Backported AutoQuickSave and AutoQuickSavePage options from 4.x
Updated version number and year.
2019-12-28 09:27:45 +08:00
NovaRain 11261ca9be Merged db_* engine function defines in HeroAppearance and Tiles
Edited both source files according to new defines.
2019-12-28 09:14:12 +08:00
NovaRain 4d435ca143 Backported WRAP_WATCOM_CALL macros from 4.x for engine function defines 2019-12-28 09:03:27 +08:00
NovaRain 35d9b9439c Included Define.h in FalloutEngine.h
* it removes the need to include Define.h separately across the code.
(similar to Fallout2.h in 4.x code)

Added StrNormalizePath() to Utils.cpp.
2019-12-25 09:25:36 +08:00
NovaRain a1968f7f86 Minor edits to the built-in item highlighting function
Removed the redundant struct define in Tiles.cpp.

Added a comment to ScriptUtils.hpp.
2019-12-24 20:58:03 +08:00
NovaRain 85a5ee2a52 Some edits to hookscripts.txt & function notes.txt 2019-12-24 00:57:16 +08:00
NovaRain 310c392759 Added lootable corpses to the built-in item highlighting 2019-12-23 21:22:15 +08:00
NovaRain 3a24d0bdfd Replaced _stricmp in previous commit with strcmp.
Minor edits to Inventory.cpp.
2019-12-16 15:46:09 +08:00
NovaRain a9ad1a62eb Tweaked the path to load global shaders in the previous commit
* although 3.8 doesn't have the path issue as 4.x due to the lack of
loading custom .dat, it's better to unify the path in this case.

Refactored the code for DataLoadOrderPatch in the same way as 4.x.
2019-12-15 10:31:50 +08:00
NovaRain d73859fa5f Applied proper ptr_patches to some code 2019-12-14 11:41:43 +08:00
NovaRain 04043989c6 Restored loading global shaders at game start from pre-3.0
Added GlobalShaderFile option to ddraw.ini.
Added an example global shader file to modderspack.
Minor edits to HeroAppearance.cpp.
2019-12-14 11:05:12 +08:00
NovaRain 3b82232b46 Edited the description of the functions in the previous commit
Rewrote ASM code for tile_under_cursor script function.
2019-12-14 00:35:05 +08:00
NovaRain 5e704d206f Added "objects_in_radius" and "tile_by_position" script functions 2019-12-13 10:56:15 +08:00
NovaRain 5e65510797 Rewrote the code of some hook in 4.x style
* TOHIT, AFTERHITROLL, REMOVEINVENOBJ
2019-12-11 15:55:29 +08:00
NovaRain b4dac84ddd Rewrote some script functions in ObjectsOps in C++
* remove_script, set/get_script, set_critter_burst_disable.

Changed the return value of get_script to 0 for unscripted objects.
2019-12-09 11:07:40 +08:00
NovaRain cbc822c9e0 Minor edits to code 2019-12-07 09:56:43 +08:00
NovaRain 6cc68ed3de Re-fixed the previous commit
Replaced calling full substring with a simplified one for get_array.
2019-12-05 09:49:07 +08:00
NovaRain 6d4aea216b Fix for printing game messages to debug log 2019-12-04 13:07:04 +08:00
NovaRain 569790acb2 Code refactoring for ASM code in opcodes 2019-12-04 11:37:44 +08:00
NovaRain 7016690f99 Added "string_format" script function
Rewrote ASM code of opcode handlers in MemoryOp.hpp.
2019-12-03 10:52:56 +08:00
NovaRain eeb97a4299 Some code refactoring 2019-12-01 12:10:33 +08:00
NovaRain 66c237d297 Refactored the code for "substr" script function
* fixed the crashing bug and added a new behavior.

Changed the error message due to missing critter frame (again):
* replaced the interruption with printing the error message to in-game
message window.
2019-11-29 12:13:36 +08:00
NovaRain 3629c90fa9 Simplified _RET_VAL_INT2 in AsmMacros.h (from dev)
Changed related ASM code in various script functions.

Minor refactoring on some script functions.
2019-11-29 12:10:08 +08:00
NovaRain 1f99855500 Changed the error msg due to missing critter frame
* now the game only "crashes" when both Enable and DebugMode are
enabled in [Debugging] in ddraw.ini.
2019-11-28 14:43:00 +08:00
NovaRain cdf0bdf23e Refactored script function handlers
Changed error return values of list_begin/next to the same as dev.
2019-11-28 14:42:07 +08:00
NovaRain 2c67058016 Code refactoring for opcodes/metarules
* added proper arg validation for some opcodes using WRAP_OPCODE macro.
* changed return values of some opcodes/metarules to be the same as dev.
2019-11-28 10:24:40 +08:00
NovaRain 29f0affd72 Re-fixed commit e62b5c0 (correct variant) 2019-11-26 07:49:31 +08:00
NovaRain e01569637d Backported additional check in DialogHook from 4.x
Renamed inLoop/saveInCombatFix variables in LoadGameHook.cpp.
2019-11-25 09:58:12 +08:00
NovaRain 78f0ac473d Restored calling original engine functions from HRP hacks. 2019-11-25 07:29:29 +08:00
NovaRain bbe9a2d26d Added "get_text_width" and "string_compare" script functions
Rewrote set_dm/df_model, set_movie_path functions with WRAP_OPCODE.
2019-11-23 20:32:57 +08:00
NovaRain 7bcb76e70c Restored and fixed RemoveWindowRounding option
Reorganized ddraw.ini a bit.
2019-11-21 00:58:41 +08:00
NovaRain 3348d8b716 Backported "draw_image" and "draw_image_scaled" functions from 4.1 2019-11-19 20:51:22 +08:00
NovaRain 4767ad2753 Fixed a crash bug in CorpseLineOfFireFix (from commit d9a440f)
Minor edits to HookScripts/FalloutEngine.
2019-11-19 14:27:19 +08:00
NovaRain 04ebbaa182 Added three new script window functions:
"show_window", "hide_window", "set_window_flag"

Updated documents.
2019-11-17 08:40:18 +08:00
NovaRain 3c5dc6853a Added "get_sfall_arg_at" script function
Improved the functionality of "inventory_redraw" function.
2019-11-16 22:54:09 +08:00
NovaRain a70a776e46 Tweaked/fixed reg_anim_callback function 2019-11-15 10:01:39 +08:00
NovaRain 83c3d6b1a8 Added "reg_anim_callback" script function(opcode)
Updated documents.
2019-11-14 13:02:10 +08:00
NovaRain 6a566087ca Implemented executing timed_event_p_proc in sfall global scripts
Added "add_g_timer_event" and "remove_timer_event" script functions
for timed_event_p_proc in global scripts.

Fixed the check on the 'hidden' flag for previous commit.
2019-11-11 10:01:38 +08:00
NovaRain e62b5c03db Added a fix for scripted interface windows
* prevents player's movement when clicking on the window.

* the mouse cursor will not be toggled when the cursor hovers over
a hidden window.

Updated version number.
2019-11-10 18:24:43 +08:00
NovaRain 29da6d7071 Minor edits to FalloutStructs.h
Removed unnecessary AfterAttackCleanup on reset in LoadGameHook.cpp.
Fixed Debug build configuration in project file.
2019-11-05 09:27:41 +08:00
NovaRain ec4a58e19e Updated define_extra.h
Added define of OBJ_DATA_SCRIPT_INDEX to define_extra.h.
Moved Stats related reset code from ScriptExtender.cpp to Stats.cpp.
2019-11-04 21:28:06 +08:00
NovaRain b023999c5e Updated script mods. 2019-11-03 10:10:11 +08:00
NovaRain ee711d8f81 Added "get_inven_ap_cost" script function 2019-11-02 10:26:28 +08:00
NovaRain d26a06872a Backported the advanced BarBoxes features from 4.x:
* Added BoxBarCount option.
* Added "set_iface_tag_text" and "add_iface_tag" script functions.
* Now number of simultaneously displayed boxes depends on game res.
* Updated documents.
2019-11-01 21:14:03 +08:00
NovaRain c4f8912490 Added support for displaying item AP cost up to 19
* Requires an extended MVENUM.frm in the art\intrface\ directory to
display properly (will be included in modderspack).
2019-10-31 12:47:57 +08:00
NovaRain d9a440f667 Fixed PM's weapon being misplaced after level up
Moved some codes from Worldmap.cpp to new Interface.cpp (same as 4.x).

Moved some option codes from main.cpp to other modules.

Removed CorpseLineOfFireFix from ddraw.ini (always enabled).
2019-10-31 11:42:20 +08:00
NovaRain 49bc2d3241 Some code fixes/edits. 2019-10-29 10:45:46 +08:00
NovaRain d07603f1b0 Renamed AnimationsAtOnceLimit.cpp/h to Animations
Renamed SuperSave.cpp/h to ExtraSaveSlots (same as 4.x)
2019-10-28 09:51:20 +08:00
NovaRain 76346c24b3 Added a debug message about missing art file for critters 2019-10-25 10:24:40 +08:00
NovaRain dee3e2f596 Minor code edit to previous commit 2019-10-23 09:37:10 +08:00
NovaRain 648eb9b2f1 Engine now uses 'English' as the fallback language for all msg files 2019-10-22 15:56:04 +08:00
NovaRain fcbf4d3972 Cleanup in vcxproj file 2019-10-22 10:27:59 +08:00
NovaRain 3ef6056a77 Added "add_trait" script function
Replaced some C-style casting with pre-defined ptr_* variables.
2019-10-20 19:31:08 +08:00
NovaRain ac10bce231 Moved code from main.cpp to new LoadOrder/Karma.cpp
Slightly refactored list_* functions with 4.x codebase.

Changed the initialization order in main.cpp to 4.x's.
2019-10-18 11:15:10 +08:00
NovaRain 6780a21b07 Fixed amount argument for critter_add/rm_trait functions 2019-10-17 10:27:28 +08:00
NovaRain 25fabde434 Replaced GetPrivateProfileInt/String with wrapper functions
Fixed crash when a name in PremadePaths exceeds 11 characters.
2019-10-16 14:29:04 +08:00
NovaRain da7cd2a060 Implemented new ini reading funcs (part 2)
Refactored Premade.cpp, Reputations.cpp, KarmaFRMs in main.cpp, and
XPTable in Stats.cpp using 4.x implementation.
2019-10-15 21:57:49 +08:00
NovaRain 8924257aee Added a new flag to MainMenuFontColour option
* set bit 1 of the first byte to only change the color of version text
(old behavior)
2019-10-15 11:58:49 +08:00
NovaRain 90ef9e273d Implemented new ini reading funcs in various codes 2019-10-14 23:55:54 +08:00
NovaRain b447e8e9b8 Rewrote set_xp_mod function with WRAP_OPCODE.
Cleanup in ASM scripting handlers code.

Code edits to Perks.cpp and Stats.cpp.
2019-10-14 21:36:25 +08:00
NovaRain 3744c0b165 Added optional options to the perks ini file
* to toggle modification sections for perks and traits.

Backported ini reading functions from 4.x to main.cpp, and edited
related code in Perks.cpp (need to implement to other source later)

Added error/warning icons to message boxes.
2019-10-14 15:30:46 +08:00
NovaRain c98af496b3 Added command_lite.h header file to modderspack 2019-10-11 00:53:22 +08:00
NovaRain c7eaff7ff5 Fixed art_change_fid_num when the hero appearance mod is enabled
* before it set player's FID incorrectly if PC is in other appearance.

Prevented the player from equipping a weapon when player's current
appearance doesn't have the animation for it.

Fixed the player name while controlling other critters.

Edited texts for some error message boxes.
2019-10-10 12:00:30 +08:00
NovaRain 37acec7115 Added "unwield_slot" script function
Re-fixed obj_art_fid for player's FID (commit 36523d8)
2019-10-08 10:56:49 +08:00
NovaRain f6ec543f40 Fixed inven_unwield script function
* now it updates the interface slot for the player properly.

Fixed some code in PartyControl.cpp.
2019-10-07 13:34:35 +08:00
NovaRain 5cfd5f99e3 Moved object unique id code from ScriptExtender to new Objects.cpp/h
Backported set_unjam_locks_time function from 4.0.
2019-10-07 09:36:46 +08:00
NovaRain dafee58c77 Fixed arg1 of HOOK_INVENWIELD when calling move_obj_inven_to_obj
Moved get/set_proto_data functions from MiscOps.hpp to ObjectsOps.hpp.
2019-10-05 07:53:50 +08:00
NovaRain 4cf0c6688f Improved the implementation of HOOK_INVENWIELD
* it now runs for the player and NPCs when removing equipped items.
* added an additional argument.

Fixed drop_obj script function not removing the equipped armor properly
for the player and party members.
2019-10-04 22:04:05 +08:00
NovaRain 27ec2d24fe Fixed move_obj_inven_to_obj script function
* it didn't remove the equipped armor properly for the player and party
members, resulting in broken armor stats.

Added a check for valid objects to get/set_object_data functions.

Some code edits to HeroAppearance.cpp.
2019-09-30 07:51:43 +08:00
NovaRain e3a3ff2540 Improved file searching for hero appearance mod (#251)
* now it will search files in .dat files and folders simultaneously.

* files in folders have higher priority than .dat files.
2019-09-28 10:52:48 +08:00
NovaRain e6a51f965f Removed NPCStage6Fix from ddraw.ini (always enabled)
Moved the code of NPCStage6Fix to BugFixes.cpp.
(to its original relative location, right above MultiHexPathingFix)

Reorganized some code in BugFixes.cpp.

Tweaked the error printing for ResizeArray in Arrays.cpp.
2019-09-27 20:51:34 +08:00
NovaRain 552a2a185e Refactored code in Arrays.cpp and fixed save_array() script function. 2019-09-24 16:50:50 +08:00
NovaRain 04d47d10ad Some minor changes:
* Improved the display of the car fuel gauge on the world map interface.

* Expanded set_critter_stat function to allow changing STAT_unused and
STAT_dmg_* stats for the player, and STAT_unused for other critters.

* Changed AllowUnsafeScripting to not require sfall debugging mode.

* Changed NPCStage6Fix to be enabled by default.

* Added a new value to AIBestWeaponFix to change the priority multiplier
for having weapon perk to 3x.

Updated version number.
2019-09-24 16:01:39 +08:00
NovaRain 749e248c8b Changed CorpseLineOfFireFix to be enabled by default 2019-09-15 07:18:13 +08:00
NovaRain 52290b09d2 Removed duplicate code from intface_redraw_ engine function
Minor edits to code/documents.
2019-09-14 08:56:05 +08:00
NovaRain a6a8e2e42f Backported HEROWIN, DIALOGVIEW, COUNTERWIN game mode flags from 4.x
Updated UI hotkeys example mod.
2019-09-13 08:09:07 +08:00
NovaRain 9693c0d439 Added "register_hook_proc_spec" script function
Updated documents to address the new function.
2019-09-12 22:23:02 +08:00
NovaRain aa22575ec9 Backported optimization for global/hook scripts execution from 4.x 2019-09-11 13:18:20 +08:00
NovaRain 8f4fd1dec8 Fixed AllowLargeTiles option (broken in 3.8.18)
(due to commit f7fa62a)
2019-09-10 10:09:15 +08:00
NovaRain d26097e9ae Fixed some code in AnimationsAtOnceLimit.cpp
Renamed F1EngineBehavior option to Fallout1Behavior.
2019-09-10 06:53:48 +08:00
NovaRain 4bb9828f3e Added F1EngineBehavior option to change some of F2 engine funcs to F1
* disables playing the final movie/credits after the endgame slideshow.
* disables halving the weight for power armor items.

Moved FastShotFix and Ray's combat_p_proc fix from main.cpp to other
files.
2019-09-09 15:19:37 +08:00
NovaRain 2d2f539826 Added a call to load f2_res.dll library from sfall code
Fixed code that depends on HRP addresses in Tiles.cpp.
2019-09-08 10:46:53 +08:00
NovaRain 97bd2cee18 Changed CriticalOverrides.ini to be parsed only once at game start
* before the ini was always reparsed after each game load/reset. This
should improve the performance.
2019-09-07 21:24:19 +08:00
NovaRain 62f890d287 Removed the dependency of Body_Torso from Body_Uncalled hit modifier
Re-added BodyHit_Torso to ddraw.ini.
Reverted set_bodypart_hit_modifier function to pre-3.7.4 behavior.
2019-09-07 20:16:50 +08:00
NovaRain 4b28829983 Renamed Knockback.cpp/h to Combat.cpp/h and reorganized some code:
* Moved PickpocketMod to skills.cpp.
* Moved CheckWeaponAmmoCost to Combat.cpp.
2019-09-07 12:13:31 +08:00
NovaRain cbb739bd7c Added options for tweaking some engine perks to the perks ini file
Minor code edits to main.cpp and ObjectsOps.hpp.
2019-09-06 13:13:40 +08:00
NovaRain e00d02f1f0 Added a compute damage example script.
Updated compiled scripts due to main.h changes.
2019-09-01 11:38:34 +08:00
NovaRain c9e0feeb32 Increased the width of the car fuel gauge to 2px 2019-09-01 09:03:09 +08:00
NovaRain 272e58d873 Tweaked reordering the execution of functions before exiting the map
Added event clearing for active explosives before exiting the map.

Minor code edit to BARTERPRICE hook.
2019-08-31 20:01:51 +08:00
NovaRain 20cb24b385 Fixed some args in HOOK_BARTERPRICE hook when trading with PM
And added a new argument to indicate trading with a party member.

Refactored register_hook/register_hook_proc with _WRAP_OPCODE.
2019-08-27 22:31:10 +08:00
NovaRain 071581effc Replaced 'Take All' hotkey mod with UI hotkeys mod
Minor edits to code/documents.
2019-08-26 21:53:11 +08:00
NovaRain 155c14f4e7 Fixed player stuck at "climbing" frame after ladder climbing animation
Removed the previous fix about player's direction.

Minor code refactoring in AnimationsAtOnceLimit.cpp (from 4.x)
2019-08-25 10:25:30 +08:00
NovaRain c6d612f4a7 Added MainMenuBigFontColour option to change button text color
Changed the fix for player's direction after climbing ladder (61aa11)
2019-08-23 10:35:17 +08:00
NovaRain 61aa1104a1 Fixed player's position if entrance tile is blocked when entering a map
Fixed player's direction after leaving a map via ladder/stairs.

Fixed MainMenuFontColour not changing the font color for the copyright
text on the main menu (#261)

Code correction in main.cpp.
2019-08-22 13:32:18 +08:00
NovaRain 2bd8a6223d Added OverrideCriticalFile option for specifying alternative crit file
Added code for preparing clearing map_update_event in queue.

Fixed a crash bug in message_str_game function when passing a negative
fileId value.

Corrected/edited some code.
2019-08-20 16:47:37 +08:00
NovaRain 99bc47e3f8 Minor edits to Message.cpp and define_extra.h. 2019-08-17 20:56:48 +08:00
NovaRain 07ff16af75 Added an additional 'Energy Weapon' flag to ext flags in weapon protos
* it forces the weapon to use EW skill regardless of its damage type.

Placed an object with PID 0x5000004 (corpse blood) to the lower z-layer
of the tile.
2019-08-16 15:17:59 +08:00
NovaRain a7ea2a9a81 Set DAM_BACKWASH_ flag for attacker before calling combat damage (#246) 2019-08-14 14:36:35 +08:00
NovaRain 2bbb020a80 Fixed the lost car bug with using the Town/World button
(http://www.nma-fallout.com/threads/fallout-2-vehicle-bug.217993/)
2019-08-13 13:59:20 +08:00
NovaRain 81ba15d451 Rewrote the code of force_encounter functions
Added a new flag to force_encounter_with_flags.
2019-08-12 21:12:28 +08:00
NovaRain 36523d89e5 Fixed obj_art_fid for dude_obj when the hero appearance mod is enabled 2019-08-12 00:13:50 +08:00
NovaRain 53bb9ea5c7 Fixed create_message_window script function
* prevent it from creating multiple message windows.

Capped StartMonth/StartDay in case people didn't notice "0-indexed".
Minor fix for assigning an ID to objects when loading a map.
Small optimization for sfall gl/hs scripts.
2019-08-11 11:04:57 +08:00
NovaRain c0f9f142c4 Added a tweak for weapon perk modifier to AIBestWeaponFix
Minor edits to code/documents.
Updated version number.
2019-08-09 11:59:45 +08:00
NovaRain 8b9ffd08a8 Minor edits to ddraw.ini 2019-07-18 09:27:28 +08:00
NovaRain b26208141f Changed DebugMode to not require enabling sfall debugging mode
Changed version to 3.8.19.1 as maintenance release.
2019-07-17 10:10:28 +08:00
NovaRain 147382de25 Minor code edits to LoadGameHook, PartyControl, ScriptExtender.cpp 2019-07-16 13:01:44 +08:00
NovaRain 9529208c7c Fixed the error handling on loading sfallgv.sav
* to improve backward compatibility with older saved games.
2019-07-15 20:51:29 +08:00
NovaRain fc3b7180af Backported the code of COMBATDAMAGE hook from 4.x
Moved instadeath crit fix from COMBATDAMAGE hook to BugFixes.cpp.
Completed the compute_attack struct.
Updated version number.
2019-07-15 09:59:58 +08:00
NovaRain f53aa16923 Excluded Awareness from perks resetting in PartyControl.cpp 2019-07-14 10:46:56 +08:00
NovaRain ce19262283 Excluded barter mode for ItemCounterDefaultMax
Renamed GetCurrentLoops function to "GetLoopFlags".
Minor edits to document/code.
2019-07-10 11:05:28 +08:00
NovaRain e43762b45f Added assignment of unique IDs to items/critters for event queue
* to prevent event queue being added to the incorrect object on the map.
2019-07-09 21:50:46 +08:00
NovaRain ceb9c41e3d Changed the implementation of the bug fix in commit f1ef55d
Added additional fix for "NPC turns into a container" bug.
2019-07-09 10:50:00 +08:00
NovaRain 0aee36f77d Fixed bugs related to knockout/knockdown critters
Fixed knocked down critters not playing stand up animation when the
combat ends.

Fixed dead NPCs reloading their weapons when the combat ends.
2019-07-06 22:34:20 +08:00
NovaRain 9c41ddd243 Fixed the execution of functions before exiting map in commit f13e6bd 2019-07-06 01:57:09 +08:00
NovaRain f38d87e0ee Added KnockoutTime option to change the duration of the knockout effect.
Fixed op_lookup_string_proc_ engine function not searching the last
procedure in a script.
2019-07-04 12:11:00 +08:00
NovaRain 5fa418ae08 Added reassignment of IDs for critters upon first loading a map
* for fixing mapper not checking existing object IDs and generating
duplicated ones for new critters added on a map.
2019-07-03 15:13:46 +08:00
NovaRain c6c66a4b58 Added a check for the DAM_KNOCKED_OUT flag
to wield_obj_critter/inven_unwield script functions.

Added climbing ladders to "interrupted player's movement in combat" fix.
2019-07-03 12:14:23 +08:00
NovaRain feeae8c750 Added debug log entries to PartyControl.cpp as 4.x 2019-07-01 13:12:10 +08:00
NovaRain 58a67d58cb Added SkipOpeningMovies=2 to also skip the splash screen
Changed the order of some code in main.cpp.
Renamed IsDebug variable to "isDebug".
2019-06-29 20:11:53 +08:00
NovaRain 96881c19a3 Fixed combat not ending automatically when there are no hostiles. 2019-06-26 06:15:35 +08:00
NovaRain c18828b61b Changed DataLoadOrderPatch to be 1 by default.
Replaced most of NULL with nullptr, since VS2010 supports it.
Some code edits to MiscOps.hpp and ScriptUtils.hpp.
2019-06-24 12:25:32 +08:00
NovaRain b1e78bb61c Rewrote get/set_pc/critter_*_stat funcs in C++.
* this slightly improved their error handling.

Concentrated the error msg for invalid args of opcodes.
2019-06-23 11:23:42 +08:00
NovaRain bcb0228ed3 Fixed fade in/out of the screen in DX9 mode. 2019-06-18 09:27:39 +08:00
NovaRain a75e634c96 Fixed Scout perk being taken into account for mark_area_known function.
* technically it should only effect the visibility of tiles when you're
exploring on the world map.

Fixed the incorrect coordinates for small/medium location circles when
highlighting their sub-tiles (one of bugs listed in #228)

Moved the fix for the position of the target marker from Worldmap.cpp to
BugFixes.cpp.

Slightly adjusted the position/size for Local variables button in debug
editor.
2019-06-17 11:24:57 +08:00
NovaRain c4f6c762c4 Added viewing and modifying local vars for critters to the debug editor. 2019-06-15 10:09:50 +08:00
NovaRain 5ccd1534f4 Added "metarule_exist" script function.
Limited the maximum number of extra game msg files to 4096 (from 4.x).
Code edit to Message.cpp and ScriptUtils.hpp.
2019-06-14 23:32:01 +08:00
NovaRain 8e0190939e Minor edit to error messages in MiscOps.hpp. 2019-06-12 09:14:12 +08:00
NovaRain 0f7a8592a9 Fixed the interrupted player's movement in combat.
* it happens when the player try to use objects with Bonus Move APs
available. The distance has to be greater than remaining normal APs.

Replaced calling db_dir_entry_ with db_access_ in HeroAppearance.cpp.
2019-06-10 09:45:52 +08:00
NovaRain e9f3fd5039 Fixed the position of the target maker for location circles. 2019-06-09 11:35:30 +08:00
NovaRain 6cc988aef5 Fixed the reserve movement fix in commit f1ef55d.
* before the reserve movement didn't work correctly if the player has
free move AP (yellow, from Bonus Move) left.
2019-06-09 07:26:32 +08:00
NovaRain e50369c18d Fixed the up/down button images in the world map interface. 2019-06-08 23:56:20 +08:00
NovaRain f1ef55d22d Fixed anim_move_to_tile_ ignoring the distance argument.
* this also fixes the broken "reserve movement" feature.
2019-06-08 09:46:30 +08:00
NovaRain d1fe920cf7 Fixed a few bugs in WorldMapSlots option.
Updated version number.
2019-06-06 10:21:36 +08:00
NovaRain 9a331c918c Fixed a bug in knockback modifier functions that could crash the game (#237)
Updated version number.
2019-06-02 08:52:42 +08:00
NovaRain 56fd9706a4 Minor edit to gl_ammomod example script. 2019-05-31 09:11:25 +08:00
NovaRain b46892cb66 Improved the fix for the removal of PM corpses.
* to prevent save file corruption (one of bugs listed in #228). Now
party member's corpse is removed in the same way as all other critter
corpses.

Simplified the ASM code of combat_ai_hack (take 2).
2019-05-30 10:34:15 +08:00
NovaRain 7663a47fbb Fixed the code for removal of party member's corpse when loading the map. 2019-05-29 09:37:28 +08:00
NovaRain a9aeac1f6f Fixed AI not checking min HP properly for using stims.
Edited the code of InventoryApCost in Inventory.cpp.
Minor edits to some other code.
2019-05-28 11:18:11 +08:00
NovaRain 6db496e66c Code edits to Perks.cpp/PerksOp.hpp/ScriptExtender.cpp. 2019-05-27 12:10:34 +08:00
NovaRain daf6585ba3 Simplified the ASM code of combat_ai_hack. 2019-05-24 20:01:19 +08:00
NovaRain 1f6dac09b8 Rewrote the fix to allow fleeing NPC to use drugs.
Code edits to Perks.cpp/PerksOp.hpp.
2019-05-24 10:43:46 +08:00
NovaRain af6038ee0c Removed LoadProtoMaxLimit option from ddraw.ini.
* now the proto limit is always handled by set_proto_data function when
needed, since the related issue was originally from using it to process
lots of protos at once.
2019-05-23 17:06:40 +08:00
NovaRain 2c7548f164 Fixed getting perks/traits from the real dude_obj while controlling other NPCs.
Added "real_dude_obj" script function and updated documents.
2019-05-22 12:59:27 +08:00
NovaRain 301ccba45f Rewrote NPC fleeing fix.
Removed DialogOptions9Lines option from ddraw.ini.
2019-05-22 10:48:41 +08:00
NovaRain 899dc2422d Increased the max text width of the info card in the char screen.
* the increased the width is according to the max width of one char in
font (uppercase A seems to be the widest with 8 px).

Adjusted code format in Console.cpp.
2019-05-20 11:36:03 +08:00
NovaRain 0e69ef4af1 Added two fixes for NPC fleeing in combat.
* added fix to allow fleeing NPC to use drugs.
* fixed NPC stuck in fleeing mode when the hit chance of a target was
too low.
2019-05-19 15:40:21 +08:00
NovaRain f6d27b71aa Slightly simplified the code of NPCStage6Fix.
Moved NPCsTryToSpendExtraAP to AI.cpp.
2019-05-19 08:24:31 +08:00
NovaRain 520f939afa Improved the fix in previous commit.
* now ignoring the inv capacity only happens in combat for preventing
AI inf loop. The vanilla behavior still applies outside of combat.
* added a correct message for NPC not being able to pick up an item.
2019-05-18 11:09:04 +08:00
NovaRain fa1e5eddc9 Fixed two item pickup issues for NPC.
* message for the player is displayed when the NPC cannot pick up item.
* if in combat, NPC will also be stuck in a loop of picking up item.

Fixed HideObjIsNullMsg option.
2019-05-17 10:03:48 +08:00
NovaRain 3b8878e647 Implemented an ASM patch for Win2K build to remove VS2008 requirement.
* tested DX9 modes, hookscripts, and combat control in VM environment.

Removed Cpp11_emu.h file.
Replaced some define macros with enums.
2019-05-15 23:42:35 +08:00
NovaRain 5353ab0ad6 Backported the code of four hookscripts from 4.x.
* FINDTARGET, BARTERPRICE, WITHINPERCEPTION, and INVENTORYMOVE. For
unifying the behavior of common hooks between 3.8 and 4.x.

Added the example script of WITHINPERCEPTION from 4.x.
Updated gl_highlighting_lite.
2019-05-14 11:42:21 +08:00
NovaRain 20ffc39f95 Added a tweak to op_use_obj_on_obj_hack in BugFixes (from Mr.Stalin)
Minor edits to some code.
2019-05-14 06:41:13 +08:00
NovaRain 8482618291 Rewrote Ray's combat_p_proc fix.
Refactored the code of SwitchHandHook with backporting from 4.x.
Minor code edits.
2019-05-13 11:37:02 +08:00
NovaRain f7fa62a078 Refactored the code in Tiles.cpp.
Removed the font check in create_message_window script function.
2019-05-11 10:04:47 +08:00
NovaRain 1891612f38 Reverted the change in Tiles.cpp from previous commit. 2019-05-10 10:44:34 +08:00
NovaRain efe00b9faf Changed the names of FRM structures.
Fixed get FID type in Inventory.cpp.
2019-05-09 10:20:47 +08:00
NovaRain 2059a3da8c Backported 3 script functions from 4.1:
* dialog_obj, loot_obj, and npc_engine_level_up.
2019-05-08 21:04:18 +08:00
NovaRain ec3bc8c21c Moved Test_ForceFloats to [Debugging] section.
* Since it's never mentioned anywhere, should be OK moving it before
the formal release.

Minor code edits to Tiles.cpp.
2019-05-07 23:08:47 +08:00
NovaRain c1ec4057a6 Code edits on Graphics.cpp & ScriptExtender.cpp.
Minor edits on some other code.
Added the missing Test_ForceFloats option to ddraw.ini.
2019-05-07 14:04:36 +08:00
NovaRain 5d9008f407 Minor code edits on Graphics/Movies/TalkingHeads.cpp 2019-05-05 10:59:49 +08:00
NovaRain 64e4daeb02 Code refactoring in Arrays.cpp & ScriptArrays.hpp.
Added new example mods gl_ammomod & gl_highlighting_lite to modderspack.
Renamed Bugs.cpp to BugFixes.cpp.
2019-05-05 10:11:36 +08:00
NovaRain 40ed445956 Simplified the iterator in party member protos patch.
Added initialization and delete for repList, as in 4.x.
2019-05-03 10:14:00 +08:00
NovaRain cbd3964ae5 Moved worldmap related code from main.cpp to the new Worldmap.cpp. 2019-05-02 21:02:49 +08:00
NovaRain 34628c0ea5 Unset the read-only attribute for party member's .sav proto files
Slightly changed the implementation of previous commit.
2019-05-02 14:33:09 +08:00
NovaRain f2f260e743 Backported the patch for party member base protos. 2019-05-02 09:28:28 +08:00
NovaRain f13e6bd9f3 Reordered the execution of functions before exiting the map
* partyMemberSaveProtos and queue_leaving_map are now called after
executing map_exit_p_proc procedure.
2019-05-01 11:37:11 +08:00
NovaRain 8ef05d205a Fixed the argument value of dialogue_reaction script function 2019-04-30 11:18:42 +08:00
NovaRain 3c255085ed Replaced ASM code in various opcodes with macros (from Mr.Stalin)
Unified the directory separator in documents.
Updated version number.
2019-04-30 10:38:39 +08:00
NovaRain 7500e6b637 Updated set_unique_id defines in sfall.h. 2019-04-24 20:26:26 +08:00
NovaRain 560eead694 Rewrote Force Encounter script function code.
Changed set_global_script_repeat/type & set_self to use fastcall.
Minor edits to BugFixes.cpp and ddraw.ini.
2019-04-24 15:06:07 +08:00
NovaRain 45baeff397 Minor code edits to some opcodes. 2019-04-23 11:40:28 +08:00
NovaRain 2df1dfbadc Fixed and improved Use32BitHeadGraphics option:
* Fixed the position of the talking head texture when the game res is
larger than 640x480.

* Added the support to use textures without the need of patching
talking head FRM files.
2019-04-23 07:35:18 +08:00
NovaRain cbe31e845c Renamed heads/ddraw2 to TalkingHeads/Graphics.
Added necessary defines to prepare TalkingHeads backporting.
Some code edits to AI.cpp, MainMenu.cpp, movies.cpp.
2019-04-22 23:03:03 +08:00
NovaRain 2e2d3f7946 Renamed AmmoMod.cpp/h to DamageMod. 2019-04-19 09:24:17 +08:00
NovaRain 854adc2afc Reverted some changes in previous commit.
* Now weapons with knockback modifiers applied still stack with others
in the inventory.
2019-04-17 10:34:13 +08:00
NovaRain 0c8794661c Further implementation of unique ID.
* weapons with knockback modifiers applied will have a special ID
(negative value) that work as a temporary UID for the current game
session.

Added checks on object types to functions in Combat module.
Added the second argument to set_unique_id script function.
2019-04-16 20:53:41 +08:00
NovaRain ceb55cdfa9 Fixed the start procedure not being called correctly
* If the required standard script procedure is missing, the procedure
above the start proc is called instead of the start (from Crafty)

Added a id reversion mechanism to remove_weapon_knockback.
2019-04-15 13:04:15 +08:00
NovaRain 6791b15af1 Added "set_unique_id" script function.
Minor edit to Perks.cpp.
Added DevXP config to project files.
2019-04-14 07:35:52 +08:00
NovaRain ff4f5d7e73 Updated proto offsets in define_extra.h.
Minor edit to HookScripts.cpp.
2019-04-10 09:50:59 +08:00
NovaRain 564c48354a Backported the code of AmmoCost hook from 4.x.
* Mainly for fixing the issues with CheckWeaponAmmoCost. Because it's
easier to backport the whole set of code than working on the old
implementation. Shouldn't affect the performance much.

Also backported the CheckWeaponAmmoCost code from 4.x.
Updated hookscripts.txt to reflect the change.
Now the debug editor starts at the center of the screen.
2019-04-09 09:53:56 +08:00
NovaRain 4232be088c Fixed setting array values in the debug editor.
Some code corrections.
2019-04-06 08:31:14 +08:00
NovaRain 9ec8a12288 Added setting array values for the debug editor.
Updates to sfall debug editor (part 1)
2019-04-05 13:03:08 +08:00
NovaRain b97c5fd65d Updated sfall debug editor (from Mr.Stalin)
Formatted the code of sfall debug editor.
2019-04-04 10:37:09 +08:00
NovaRain 5c377ad3df Added support for the new 'automap=yes/no' parameter to maps.txt
* This parameter overrides the hardcoded values for displaying the map
in the pipboy automaps for the first 160 maps (from Mr.Stalin)
2019-04-03 22:10:19 +08:00
NovaRain 3c47288e70 Fixed "out of bounds" bug when printing the automap list. 2019-04-01 21:22:27 +08:00
NovaRain 5d7ee90f71 Fixed a duplicate obj_dude script being created when loading a saved game.
Added a fix to prevent the reserved object IDs of the player and party members from being generated for other objects.
Moved SkipOpeningMovies to movies.cpp.
Added log entries for various Init() functions in main.cpp.
Renamed timer.cpp/h to SpeedPatch.cpp/h.
2019-03-31 23:02:56 +08:00
NovaRain 6193afff11 Added DisableSpecialMapIDs option (from Mr.Stalin)
Fixed the overflow of the automap tables when the number of maps in maps.txt is more than 160.
2019-03-30 11:09:35 +08:00
NovaRain b4800361e6 Replaced the fix in the previous commit with a fix for unexplored areas being revealed on the automap when entering a map. 2019-03-28 12:03:28 +08:00
NovaRain 0debe89a27 Fixed player's position when entering a map.
This also fixed the issue with getting player's position in the map_enter_p_proc procedure.
2019-03-27 20:08:38 +08:00
NovaRain aae34d5d82 Fixed the argument numbering in error messages when validating arguments.
Changed BlockCall to use the long NOP.
Minor edits on some code.
Update version number.
2019-03-26 22:46:25 +08:00
NovaRain 26e814581f Changed hero_select_win function to require an AppHeroWin.frm file in the art\intrface\ folder (from Mr.Stalin) 2019-03-25 21:01:23 +08:00
NovaRain a62a4d6911 Added SpecialDeathGVAR option to override the global variable number for special death.
Minor fix for Stats.ini.
2019-03-17 10:38:32 +08:00
NovaRain 20746abba2 Fixed range for object ID.
Minor edits to documents.
2019-03-16 08:53:20 +08:00
NovaRain e11755cb2d Added CorpseDeleteTime option (from Mr.Stalin)
Fixed some functionality issues of fake perks.
2019-03-15 19:20:30 +08:00
NovaRain 83b0862db6 Fixed the removal of party member's corpse (from Mr.Stalin)
Now items in party member's inventory are not removed along with the corpse.
2019-03-14 13:44:38 +08:00
NovaRain 386b5a6678 Fixed critters not being healed over time when entering the map if 'dead_bodies_age=No' is set in maps.txt.
Added additional checks for the amounts to properly compare the effects of drugs.
2019-03-13 11:55:33 +08:00
NovaRain 5bd69dfee2 Tweaked the code of the fix in previous commit. 2019-03-13 00:09:46 +08:00
NovaRain a388a9e602 Fixed NPC stuck in a loop of reloading melee/unarmed weapons when out of ammo (from Mr.Stalin) 2019-03-12 11:50:22 +08:00
NovaRain 69bea44481 Fixed broken get_perk_available script function. 2019-03-11 11:31:36 +08:00
NovaRain e2fc1ee0ec Minor edits on Perks.cpp and related code. 2019-03-11 10:22:17 +08:00
NovaRain 912abbd213 Fix item_d_load_subfix in the previous commit. 2019-03-06 21:28:08 +08:00
NovaRain 653b419be6 Backported the fix of active drug pids from the develop branch. 2019-03-06 09:35:53 +08:00
NovaRain 4480ecfcad Tweaked the code of item_d_take_drug_hack in Bugs.cpp. 2019-03-05 12:41:51 +08:00
NovaRain 08b9d98d3b Fixed the screen not returning to the player when moving a controlled critter to another elevation of the map.
Refactored some code in Bugs.cpp.
2019-03-04 12:55:34 +08:00
NovaRain c20e709659 Moved RemoveCriticalTimelimits to Criticals.cpp. 2019-03-03 12:02:19 +08:00
NovaRain 68a345f398 Moved the code of set_map_time_multi to WorldmapOps.hpp, and NPCAutoLevel to PartyControl.cpp.
Removed validate_test example function from release builds.
2019-02-27 12:27:22 +08:00
NovaRain 730cd212a4 Fixed a crash bug when trying to use explosives if using a books ini file.
Fixed some bugs in BugFixes.cpp.
2019-02-25 23:54:47 +08:00
NovaRain ce0f5ea8c9 Added a new argument to REMOVEINVENOBJ hook (from Mr.Stalin) 2019-02-25 20:44:49 +08:00
NovaRain 2ce1c0f36e Fixed inconsistent return value of get_npc_level.
Some edits to documents.
2019-02-25 12:32:56 +08:00
NovaRain 72e370117e Expanded get/inc_npc_level functions to accept party member PIDs (from Mr.Stalin)
Some code correction in Skills.cpp.
2019-02-24 20:14:36 +08:00
NovaRain 6ab45bbc3c Fixed incorrect skill point cost for negative skill levels when using a skills ini file (from Mr.Stalin) 2019-02-23 22:21:37 +08:00
NovaRain 7bcf06c227 Fixed the negative skill points of a skill not being taken into account when calculating the skill level (from Mr.Stalin, #202)
Fixed the return value of has_skill function for incorrect skill numbers.
2019-02-21 10:57:53 +08:00
NovaRain bc8f7477c7 Fixed the reserved item FRM being displayed in the top-left corner when in the loot/barter screens. 2019-02-20 10:04:54 +08:00
NovaRain f5c570ddc1 Removed MultiPatches from ddraw.ini, now it's always enabled.
Minor edits to main.cpp and Arrays.cpp.
Updated version number.
2019-02-19 12:07:40 +08:00
NovaRain 504f66f002 Moved DontDeleteProtos option from main.cpp to DebugEditor.cpp.
Updated Auto Doors script mod from Mr.Stalin and ddraw.ini.
2019-02-11 13:59:37 +08:00
NovaRain 76f2301b6c Minor edits to speed tweak and documents. 2019-02-10 09:56:28 +08:00
NovaRain 4788ac757b Formatted code in Arrays.cpp and added checks for the integrity of sfallgv.sav when loading a saved game.
Fixed unregistering hook procedure.
2019-02-09 09:55:43 +08:00
NovaRain a71b33aab1 Fixed crash when saving the game with speed tweak enabled. 2019-02-09 08:09:25 +08:00
NovaRain 222f3eaf68 Refactored and fixed speed patch related code (from Mr.Stalin)
Rewrote ASM code of WorldMapFpsPatch functions.
2019-02-08 12:53:13 +08:00
NovaRain 823d2b92f7 Minor refactoring of ScriptValue and some script function handlers. 2019-02-06 12:00:30 +08:00
NovaRain f478e9a1f9 Changed sfall to stop loading save if there's error on data files.
Minor simplified a couple of assembly in LoadGameHook.cpp.
2019-02-06 09:33:02 +08:00
NovaRain 8718b86440 Refactored error handling of saving/loading sfall save data files. 2019-02-05 11:11:56 +08:00
NovaRain 67adb9b592 Revert the change of get_year code to pure assembly.
Minor edits to main.cpp.
2019-02-04 17:55:16 +08:00
NovaRain ca5781a44a Refactored world map related code/funcs in main.cpp (from Mr.Stalin)
Fixed TimeLimit option and removed the pointless value of -2 (now it works the same as -3).
Fixed the slow mouse cursor on the world map when WorldMapFPSPatch is enabled.
2019-02-03 09:32:16 +08:00
NovaRain 4edf36a1dc Removed some more unnecessary memset code.
Added note on effect flags to CriticalOverrides.ini.
2019-01-31 09:12:15 +08:00
NovaRain 4a5f556cd3 Removed some unnecessary memset code.
Minor code corrections.
2019-01-30 00:15:12 +08:00
NovaRain 2b7754746c Refactored code in Books.cpp.
Increased the maximum number of books in BooksFile to 50.
Moved scattered Cpp11_emu.h includes from various cpp files to main.h.
2019-01-29 11:11:03 +08:00
NovaRain 8a4a83c8f8 Added HideObjIsNullMsg option to [Debugging].
Moved DebugEditor option from MiscPatches.cpp to DebugEditor.cpp.
2019-01-27 10:43:54 +08:00
NovaRain c04df22c48 Added two bug fixes for loading a game saved in combat mode (from Mr.Stalin) 2019-01-27 09:22:03 +08:00
NovaRain 8e0ccc576c Fixed pickup_obj/drop_obj/use_obj script functions (from Mr.Stalin)
Fixed a crash when calling use_obj/use_obj_on_obj functions without using set_self in global scripts.
2019-01-25 00:31:23 +08:00
NovaRain 42566cc9da Added AttackComplexFix option (from Mr.Stalin) 2019-01-23 09:33:54 +08:00
NovaRain 9e1c68e78d Fixed bugs in attack_complex and critter_mod_skill script functions. 2019-01-22 17:06:36 +08:00
NovaRain 9765396b08 Fixed set_self function for use_obj_on_obj, attack, attack_complex vanilla functions (from Mr.Stalin) (#214) 2019-01-22 09:47:19 +08:00
NovaRain b008502e13 Added error message when the name for sfall global variable is not equal to 8 characters.
Fixed error in FileSystem.cpp from the previous commit.
Updated version number.
2019-01-21 13:55:42 +08:00
NovaRain d71efe5b82 Corrected code in FileSystem.cpp (from Mr.Stalin)
Added fix for db_freadInt_ engine function from BugFixes.cpp when enabling UseFileSystemOverride.
2019-01-20 22:16:38 +08:00
NovaRain 120888e5ed Added "art_cache_clear" script function. 2019-01-20 09:10:58 +08:00
NovaRain 7b5075042d Fixed and refactored code in FileSystem.cpp (from Mr.Stalin) 2019-01-20 00:20:51 +08:00
NovaRain 12ad41043d Refactored ASM code in FileSystem.cpp (from Mr.Stalin) 2019-01-17 10:10:38 +08:00
NovaRain e509932add Added support for returning integer values to abs math function.
Minor code refactoring in Skills.cpp.
2019-01-16 11:38:49 +08:00
NovaRain ba3ad33587 Fixed a bug that broke the calculation of the skill point cost for increasing skill levels (#226)
Updated version number for hot fix.
2019-01-14 09:34:19 +08:00
NovaRain 6e74c3166a Refactored ASM code in Sound.cpp (from Mr.Stalin)
Minor fix for "path_find_to" script function.
Changed the two wrapper functions in ObjectsOps.hpp using dev branch as ref.
Changed some code in ObjectsOps.hpp for edited wrapper functions.
Moved obj_under_cursor to ObjectsOps.hpp.
Reformatted Karma/Worldmap related code in main.cpp as in dev branch.
2019-01-08 13:28:00 +08:00
NovaRain e320acce0b Expanded create/temp_array functions to allow creating a new "lookup" type of associative array (from Mr.Stalin) 2019-01-08 06:52:00 +08:00
NovaRain 4f48926105 Added support for sorting associative arrays by keys or values (from Mr.Stalin) 2019-01-07 15:13:22 +08:00
NovaRain 5611931063 Fixed a crash bug when using sorting functions on an associative array(map) (from Mr.Stalin) 2019-01-06 11:59:09 +08:00
NovaRain f00022fed6 Moved ModifiedIni to main.cpp. 2019-01-04 21:08:30 +08:00
NovaRain 78815425e2 Refactored ASM code in KillCounter.cpp.
Reformatted and tweaked code in Explosions.cpp.
2019-01-03 11:07:57 +08:00
NovaRain 9ddddcc120 Changed INVENTORYMOVE hook to be called before displaying the 'Move Items' window for drag and drop ammo on weapons. 2019-01-03 09:35:26 +08:00
NovaRain 11c15cec93 Refactored some ASM code in BurstMods.cpp, Inventory.cpp, Credits.cpp, AnimationsAtOnceLimit.cpp. 2019-01-01 10:27:40 +08:00
NovaRain f36bd6fb61 Improved the functionality of ElevatorsFile to allow to change the FRM images of the elevator panel and create new elevator types (from Mr.Stalin) 2018-12-31 10:10:06 +08:00
NovaRain 26ab38c6c3 Changed critical table to be loaded before global scripts.
Removed redundant ClearGlobals() in LoadGameHook.cpp (already run in ResetState(1) above)
Updated version number and year.
2018-12-30 10:08:47 +08:00
NovaRain 9b50e6be1e Added UseWalkDistance option (from Mr.Stalin) (#46) 2018-12-28 20:06:55 +08:00
NovaRain 2427634ee8 Added a fix to the following script functions to ensure they set the correct object: (from Mr.Stalin)
set_critter_burst_disable, set_critter_pickpocket_mod, set_critter_skill_mod, set_critter_hit_chance_mod, set_*_knockback
2018-12-28 10:04:22 +08:00
NovaRain 36d1d0a5fc Refactored HeroAppearance.cpp (from Mr.Stalin) 2018-12-27 16:03:13 +08:00
NovaRain 486f00cdf4 Refactored assembler code in Skills.cpp. 2018-12-26 10:23:21 +08:00
NovaRain b6fd424665 Added missing return values for HOOK_INVENWIELD. 2018-12-25 10:02:39 +08:00
NovaRain 3d679db758 Added a fix to prevent sfall from loading global scripts with an extension that exceeds three characters (from Mr.Stalin)
Replaced some pushad/popad opcodes with pushadc/popadc ASM macros.
2018-12-25 01:25:37 +08:00
NovaRain 92e1f919d9 Refactored SafeWrite.cpp. 2018-12-20 09:37:47 +08:00
NovaRain d259e8c903 Formatted code in HeroAppearance.cpp. 2018-12-18 07:54:19 +08:00
NovaRain dea0e596c3 Minor code edit on main.cpp. 2018-12-17 09:44:36 +08:00
NovaRain 90b39f3dde Replaced some values with constants in Perks.cpp. 2018-12-16 11:39:56 +08:00
NovaRain c80224f661 Simplified and reformatted code in Perks.cpp (from Mr.Stalin)
Replaced some 'strcpy_s' usages to 'strncpy_s' in Perks.cpp.
2018-12-15 18:55:40 +08:00
NovaRain d7d8de5e1a Added "get/set_object_data" script functions (from Mr.Stalin)
Changed read_byte, read_short, read_int, and read_string functions to not require AllowUnsafeScripting.
2018-12-05 10:17:26 +08:00
NovaRain 0a21e4abfa Fixed a bug in the hero appearance mod that caused the player to disappear after saving the game when player's base FID is greater than 255.
Replaced old SafeWrite usages with corresponding Hook/MakeCall functions in HeroAppearance.cpp.
2018-12-04 09:45:55 +08:00
NovaRain 1340eeb0d3 Fixed the return values of a hook getting corrupted if another hook was called during the execution of the current hook (from Mr.Stalin)
Added a fix to prevent hook scripts from being executed when the depth limit is exceeded.
2018-12-03 20:43:03 +08:00
NovaRain a350fed4d1 Added a fix for unable to sell/give items in barter screen when the player/party member is overloaded (from Mr.Stalin)
Added a variant of MakeCall/Jump with 3 arguments to replace some SafeWrite 0x90 code for trailing NOPs.
2018-11-30 11:35:14 +08:00
NovaRain 402d4f40f2 Changed some MakeJump usages to MakeCall in Stats.cpp, Knockback.cpp, and main.cpp.
(see Mr.Stalin's comments in commit c990b6701d)
2018-11-29 09:56:41 +08:00
NovaRain 0f49c7f68d Refactored the code in Knockback.cpp.
Edited part of HookScripts.cpp (ref. commit 0a3745f8f5)
Minor edits to some code files.
2018-11-28 21:35:47 +08:00
NovaRain deb0299776 Added an option to fix AI not taking chem_primary_desire in AI.txt as drug use preference when using drugs in their inventory (from Mr.Stalin)
Minor edits to some code files.
2018-11-26 09:59:14 +08:00
NovaRain 4bb3fa0275 Merged two Glovz's fix functions and reorganized Glovz's/YAAM code layout a bit.
Fixed a bug in Stats.cpp that caused critical hits to ignore critical table roll value and only have the lowest level effect.
Minor edits to MainMenu.cpp.
2018-11-20 23:44:27 +08:00
NovaRain da31455cef Fixed missing AC/DR mod stats when examining ammo in barter screen.
Added an option to display full item description for weapon/ammo in barter screen.
Minor code correction in ScriptExtender.cpp.
Minor edits to document.
Updated version number.
2018-11-20 07:23:25 +08:00
NovaRain 4da10e2fdb Fixed the missing return value of -1 for HOOK_USEOBJON. 2018-11-16 06:34:47 +08:00
NovaRain 5426d043c1 Fixed unable to click the pop-up message box when death from radiation was triggered during resting. 2018-11-14 07:14:39 +08:00
NovaRain 719cec74d1 Added a fix to display a pop-up message box about death from radiation. 2018-11-13 21:37:48 +08:00
NovaRain 627fe11c29 Fixed determine_to_hit_func_ engine function taking distance into account when called from determine_to_hit_no_range_ (from Mr.Stalin) 2018-11-12 13:14:07 +08:00
NovaRain dcca405b89 Added an additional mode to SpeedInterfaceCounterAnims (from Mr.Stalin)
Refactored the code of Stats.cpp.
Unified stat_level_ usages in Inventory.cpp, LoadGameHook.cpp and skills.cpp.
2018-11-10 10:08:08 +08:00
NovaRain cce9437d19 Removed the pop-up message box about not finding the original ddraw.dll, now the error is reported in the log file.
Added a note about setting a custom background for the character screen to the hero appearance mod.
2018-11-09 10:01:10 +08:00
NovaRain 09b3bf3aed Added DisplaySwiftLearnerExp option (from Crafty)
Minor edits to some documents/code.
2018-11-07 09:39:11 +08:00
NovaRain 08a891a0fc Added "obj_under_cursor" script function.
Backported some script functions from 4.0: lock_is_jammed, unjam_lock.
2018-11-04 09:14:02 +08:00
NovaRain e9df81ac78 Changed PartyMemberExtraInfo to not show "Addict" text (in dark green) on the combat control panel if the party member is not addicted to drugs. 2018-11-02 22:49:14 +08:00
NovaRain 3e982be4b6 Removed RemoveWindowRounding option because it doesn't affect anything. 2018-11-01 09:54:37 +08:00
NovaRain 8a888f387d Adjusted the position of ExtraSaveSlots page buttons a bit. 2018-10-31 07:16:17 +08:00
NovaRain 712b4de5f7 Changed the debug editor to require sfall debugging mode.
Some minor code edits.
2018-10-29 11:14:30 +08:00
NovaRain a3b456cf0a Added a new return value to HOOK_KEYPRESS to override the pressed key (from Crafty)
Added check for map being loaded to KeyPress/MouseClick hooks.
2018-10-28 08:51:01 +08:00
NovaRain 9f689863d7 Added a new setting to DebugMode to send debug output to both the screen and the debug log (from Crafty)
Simplified the code for ObjCanSeeObj_ShootThru_Fix a bit (from Mr.Stalin)
Changed sfall to not to create sfallfs.sav when UseFileSystemOverride is disabled.
2018-10-27 09:46:35 +08:00
NovaRain b5306406b3 Replaced some __cdecl calling conventions with __fastcall.
(from Mr.Stalin - Reason: The compiler can use the arguments for its own purposes, which can spoil the stored value on the stack.)
Added extra notes for some options to ddraw.ini.
2018-10-26 06:51:52 +08:00
NovaRain ce3b9c172c Minor edit to the fade patch. 2018-10-24 12:00:52 +08:00
NovaRain b8a77d77fb Added missing functions from the source library ddraw.dll to export from sfall (from Mr.Stalin)
Simplified the code in SuperSave.cpp.
Minor edits to ddraw.ini.
2018-10-23 11:50:55 +08:00
NovaRain a01da656c7 Fixed showing game movies and subtitles for DX9 mode when not using the hi-res patch, and added logging messages for DX9 mode (from Mr.Stalin)
Changed DisplayNPCExtraInfo to PartyMemberExtraInfo.
2018-10-19 11:07:30 +08:00
NovaRain 5eda8dd7a0 Backported a new mode of metarule2_explosions from 4.0. 2018-10-17 22:30:07 +08:00
NovaRain c05babeda7 Added DisplayNPCExtraInfo option to ddraw.ini for previous commit. 2018-10-17 09:34:14 +08:00
NovaRain cc2b95d64e Added displaying party member's current level & AC & addict flag info to the combat control panel (from Mr.Stalin)
Added additional notes to HOOK_COMBATDAMAGE in hookscripts.txt (#204)
2018-10-16 10:14:32 +08:00
NovaRain fb62bd51b5 Simplified some byte writing in a few options. 2018-10-15 09:57:55 +08:00
NovaRain f4d7ccef40 Fixed typo in the previous commit. 2018-10-14 10:15:02 +08:00
NovaRain 85bb34377c Added missing argument validation to refactored fs_* opcodes.
Minor edits to Criticals.cpp.
2018-10-14 10:06:06 +08:00
NovaRain af24c6eae4 Fixed the exploit that allows you to gain excessive skill points from Tag! perk before leaving the character screen (from Mr.Stalin) 2018-10-12 19:27:04 +08:00
NovaRain 930f463000 Backported expanded is_iface_tag_active function from 4.0, and refactored show/hide_iface_tag functions as well.
Minor edits to a couple of documents.
2018-10-11 23:56:11 +08:00
NovaRain e1aefcc1ed Refactored BonusHtHDamageFix/DisplayBonusDamage code in AmmoMod.cpp (from Mr.Stalin)
Fixed DisplayBonusDamage not being applied on Melee Damage stat in the character screen when BonusHtHDamageFix is enabled.
Reimplemented INTFACEUSE/INTFACELOOT/BARTER game mode flags, and backported inventory_redraw script function from 4.0.
2018-10-11 11:19:22 +08:00
NovaRain 25554ff0b2 Added FastMoveFromContainer as the auxiliary option for ItemFastMoveKey (from Mr.Stalin)
Refactored the code of StackEmptyWeapons.
Added missing argument validation for backported script functions.
2018-10-10 18:27:54 +08:00
NovaRain dad0860d6e Changed implementation of StartGDialogFix, additionally fixed the game crash if calling start_gdialog function outside of talk_p_proc procedure for talking heads.
Fixed "Heave Ho!" perk increasing strength stat above 10 when determining the max range of thrown weapons.
Moved SpecialUnarmedAttacksFix to BugFixes.cpp and simplified the code.
Added comments to old ApplyHeaveHoFix in Perks.cpp.
Backported some non-hook related script functions from 4.0: item_weight, get/set_outline, get/set_flags, tile_refresh_display, outlined_object, get/set_cursor_mode, display_stats, get/set_map_enter_position, attack_is_aimed.
2018-10-10 17:24:05 +08:00
NovaRain a7e492a80f Backported get/set_proto_data changes and LoadProtoMaxLimit option from the develop branch.
Added more definitions to define_extra.h.
2018-10-08 21:45:16 +08:00
NovaRain d9b748c261 Backported UseScrollingQuestsList imporvements from 4.1.
Added sound effect to ExtraSaveSlots page buttons (from Mr.Stalin)
2018-10-06 23:18:07 +08:00
NovaRain 0aad511e3e Refactored ASM code in ScriptExtender.cpp according to the develop branch, and edited the code style.
Moved NegateFix to Bugs.cpp and simplified its code.
2018-10-05 10:13:01 +08:00
NovaRain d117296990 Backported "create_win" script function and InterfaceDontMoveOnTop option from the developt branch.
Updated version number.
2018-10-02 12:15:48 +08:00
NovaRain e672db53c7 Backported AllowDShowSound improvements from the develop branch:
* Added volume control support for alternative sound files.
* Added mode 2 to play alternative music files even if original acm files are not present in the music folder.
* Added AllowDShowMovies option to separate avi files playback from enabling DX9 mode.
* Fixed initialization bug when DX9 mode is disabled.
* Small refactoring on ASM code.

Added missing FadeMultiplier option to ddraw.ini.
2018-10-01 12:16:42 +08:00
NovaRain 25bbd91fc5 Fixed the mood argument of start_gdialog function being ignored for talking heads (from Crafty)
Fixed the broken obj_can_hear_obj script function (from Mr.Stalin)
Simplified the code of disabling losing unused perks.
2018-09-30 16:31:29 +08:00
NovaRain 8db528330b Fixed the max text width of player name in inventory.
Added an 8 lines limit to the underline position fix.
Some minor ASM code edits.
Minor edit to document.
2018-09-25 14:17:45 +08:00
NovaRain f761f7834e Refactored fs_* opcodes with ASM macros and opcode handlers. 2018-09-25 12:29:33 +08:00
NovaRain f6c4e5133c Fixed ai_retrieve_object_ engine function not returning the requested object when there are different objects with the same ID (from Mr.Stalin)
Added info about map_*_p_proc procedures to the global script section in notes.txt.
2018-09-23 08:15:52 +08:00
NovaRain 2e30c86467 Added "get_current_inven_size" script function. 2018-09-21 19:27:57 +08:00
NovaRain 1679f7c59d Backported CritterInvSizeLimitMode related fixes/improvements from the develop branch:
* Changed item_total_weight/item_c_curr_size engine functions to return the weight and size of equipped(hidden) items on NPCs when exchanging/bartering items.
* Fixed CritterInvSizeLimitMode not properly checking the weight of equipped items when mode is set to 4+.
* Added inventory size check to "Take All" button.
* Added additional note to CritterInvSizeLimitMode in ddraw.ini, and changed CritterInvSizeLimit to its default value.
2018-09-20 09:48:27 +08:00
NovaRain 9a4cbd4fa9 Excluded inventory size features for NPCs when CritterInvSizeLimitMode is set to PC only. 2018-09-16 10:25:45 +08:00
NovaRain 0c561ba677 Backported refactored CritterInvSizeLimitMode option from the develop branch (from Mr.Stalin)
Added party member's current/max inventory size info to the combat control panel.
Removed redundant functions from FalloutEngine.cpp.
2018-09-15 11:41:46 +08:00
NovaRain 20ccdacee8 Fixed the underline position in the inventory display window when the item name is longer than one line (from Mr.Stalin)
Simplified the code of SuperStimExploitFix and corrected the return value for the change.
2018-09-12 22:45:58 +08:00
NovaRain d44663ce76 Backported two bug fixes from the develop branch:
* Fixed broken get/reset_critical_table functions (from Mr.Stalin)
* Fixed the encounter description being displayed in two lines instead of one (from Crafty)
2018-09-11 16:15:25 +08:00
NovaRain a196160258 Changed the fix for multihex critter moving in combat to a more proper one (from Mr.Stalin)
Added AIBestWeaponFix option to ddraw.ini.
2018-09-02 18:07:05 +08:00
NovaRain 55a97a5793 Fixed multihex critters moving too close and overlapping their targets in combat (from Crafty)
Fixed critters not checking weapon perks properly when searching for the best weapon (from Mr.Stalin)
2018-08-21 07:18:35 +08:00
NovaRain 3eaa64ee16 Added extra comment for CarChargingFix to ddraw.ini. 2018-08-14 23:57:29 +08:00
NovaRain aa9257ab1c Fixed obj_can_see_obj not checking if source and target objects are on the same elevation before calling is_within_perception_ (from Mr.Stalin) 2018-08-10 22:37:55 +08:00
NovaRain 81a8fd4863 Added a fix for the display issue in the pipboy when a quest list is too long with UseScrollingQuestsList diabled (from Mr.Stalin)
Added a fix for the clickability issue of holodisk list in the pipboy (from Mr.Stalin)
2018-08-06 21:10:09 +08:00
NovaRain ed260ad7e5 Minor edit to the description of CityRepsList in ddraw.ini, to avoid misunderstanding.
Updated version number.
2018-07-28 22:33:28 +08:00
NovaRain 9dce3c8d62 Fixed an issue with file IDs of additional game msg files being shifted when a file in ExtraGameMsgFileList is missing. 2018-07-24 09:39:26 +08:00
NovaRain f28a179c78 Added more info to the comments of various keys in [Input] section in ddraw.ini. 2018-06-12 20:53:03 +08:00
NovaRain 540abbe273 Fixed a bug in DisplaySecondWeaponRange that didn't display correct weapon range when the secondary mode is aimed (e.g. spear and throwing knife)
Added more info about unwielding in HOKK_INVENWIELD to hookscripts.txt.
2018-06-11 13:47:20 +08:00
NovaRain 8dda3940d0 Added ItemFastMoveKey and ItemCounterDefaultMax options from 4.0 develop branch (commit aaa76cb3d1)
Set ReloadReserve to be disabled by default.
2018-06-06 06:54:55 +08:00
NovaRain 44b9b24490 Minor edits to documents. 2018-06-04 21:28:05 +08:00
NovaRain dafbc357b2 Added more detail to the comment of previous commit. 2018-06-02 18:13:33 +08:00
Mr.StalinandNovaRain 02572a5193 Fix bug "walking dead" for critters in combat mode after their death. (#160) 2018-06-02 18:10:49 +08:00
NovaRain cab19b5ca0 Fixed the backported code in commit d6952a0c93 not working when enabling AnimationsAtOnceLimit.
Reorganized the layout of AnimationsAtOnceLimit.cpp to be more in-line with 4.0 code.
2018-06-02 08:21:19 +08:00
NovaRain d6952a0c93 Backported the fix for the crash when the critter goes through a door with animation trigger from commit 56945c7437. 2018-06-01 23:42:52 +08:00
NovaRain b996867d65 Minor edit to the code in Explosions.cpp. 2018-05-30 21:21:23 +08:00
NovaRain bd18c240f9 Simplified the ASM code of get_mouse_buttons() a bit. 2018-05-30 09:37:58 +08:00
NovaRain 2ad28e3086 Added WorldMapFontPatch option to use Fallout's normal text font instead of DOS-like font on the world map. (#48) 2018-05-30 09:33:40 +08:00
NovaRain ef5ff4e90f Expanded get_mouse_buttons function to return a value for the middle mouse button (from Mr.Stalin) 2018-05-29 09:32:16 +08:00
NovaRain 0a672c1e10 Added MoreTiles option to increase the limit of FRM images for tiles from 4096 to 16383 (from Crafty)
Added sfall log messages to both options in Tiles.cpp and edited the code style.
2018-05-28 10:15:02 +08:00
NovaRain 01214633f4 Simplified the code in BarBoxes.cpp.
Updated version number.
Fixed a minor typo in function notes.txt.
2018-05-27 16:42:34 +08:00
NovaRain 334e98c4c1 Backported DisplaySecondWeaponRange option from 'develop' branch.
Improved DisablePipboyAlarm so that when the player press Z key they won't see a blank Pipboy screen.
Simplified the HookCall usages in TimeLimit option.
2018-05-27 16:09:21 +08:00
NovaRain 78a29ad556 Simplified the code from commit 716bfd4156. 2018-05-15 20:23:34 +08:00
NovaRain e5d14ff845 Minor edit to FixCharScrnBack() in HeroAppearance.cpp. 2018-05-14 21:16:44 +08:00
mr.StalinandNovaRain 716bfd4156 Hero Appearance mod: Loads the custom background frm for the character windows. (#150)
AppChCrt.frm (for the character creation) and AppChEdt.frm (for the character screen) should be placed in art/intrface, and the image size must be 640x480.
2018-05-14 09:56:56 +08:00
NovaRain 9b67db7208 Fixed broken get_attack_type function (from Mr.Stalin and Crafty)
Replaced some SafeWriteX usages with SafeMemSet for writing serial NOPs.
Minor edits to documents.
2018-05-08 15:39:39 +08:00
NovaRain e92ded34e4 Added "floor2" script function to work with ceil (#109)
Added the missing description of ceil to notes.txt.
Disabled ceil marco in lib.math.h.
Removed duplications in Utils.h.
2018-04-28 11:16:10 +08:00
NovaRain 1689542165 Fixed the last additional notification boxes to the interface being missing (#140) 2018-04-26 10:11:22 +08:00
NovaRain 2c86201db9 Updated README.txt for info about additional headers/libraries.
(cherry picked from commit e474ba1660)
2018-04-21 09:19:20 +08:00
NovaRain d7c9acf713 Added set_ini_setting to documents, and updated info for get_ini_setting.
Updated credits.
Replacing a couple of strcpy usages with strcpy_s.
2018-04-21 08:49:56 +08:00
mr.StalinandNovaRain 399da0d322 Scripting function "set_ini_setting" for FuncX [sfall v3.8] (#139)
* Added new script function "set_ini_setting" for FuncX (#85)

* Small fix for sf_set_ini_setting function.

* Refactoring code for set/get_ini* functions.
2018-04-21 08:42:12 +08:00
NovaRain 774adaa3b0 Revert "Fixed a bug when using HOOK_ITEMDAMAGE and calling item_w_damage_ engine function at the same time. It would result in player self-damaging when attacking targets."
This reverts commit b4d174d91b.
2018-04-13 20:43:33 +08:00
NovaRain b4d174d91b Fixed a bug when using HOOK_ITEMDAMAGE and calling item_w_damage_ engine function at the same time. It would result in player self-damaging when attacking targets.
Set DataLoadOrderPatch to be enabled by default, for preventing partial of a game crash issue due to unusual game folders setup. #136
2018-04-13 11:09:37 +08:00
NovaRain 3291f6fe17 Added a fix for being at incorrect hex after map change when the exit hex in source map is at the same position as some exit hex in destination map (from Crafty) #134 2018-04-02 23:22:46 +08:00
NovaRain 84f442ca08 Rewrote the fix for player's base EMP DR as an engine-level fix (from Crafty) 2018-04-01 12:48:13 +08:00
NovaRain f5c35eb639 Fixed typos in hookscripts.txt. 2018-03-23 23:10:17 +08:00
NovaRain 514894ed59 Fixed typos in sfall function notes.txt. 2018-03-23 22:06:02 +08:00
NovaRain 204810d067 Fixed the long existing slotdat.ini function in ExtraSaveSlots.
Reduced duplication in ExtraSaveSlots code.
Unified the indent style in ExtraSaveSlots.cpp.
Updated version number.
2018-03-16 12:49:39 +08:00
NovaRain ec4ba13a28 Fixed add_mult_objs_to_inven only adding 500 of an object when the value of "count" argument is over 99999. #129 2018-01-17 07:37:03 +08:00
NovaRain 14a6ef7fc6 Made sure the value of player's base EMP DR is set correctly. 2018-01-02 23:25:27 +08:00
NovaRain c3a74070ca Updated version number and the year.
Set the copyright string in the same way as 4.0 build.
2018-01-02 10:26:32 +08:00
NovaRain 302fd4bb51 Condensed the code in ApplyHeaveHoFix a bit. 2018-01-02 10:02:04 +08:00
NovaRain c7520c71cf Fixed player's base EMP DR isn't properly initialized when creating a new character and then starting the game. 2017-12-15 07:34:10 +08:00
NovaRain 45632d6887 Changed sneak_success to call is_pc_sneak_working_ engine function, which takes player's current sneaking status into account as well, instead of only returning the result of last sneak attempt. 2017-12-05 10:25:11 +08:00
NovaRain 866c9165c0 Replaced hex values with proper VAR_TYPE_* defines for code readability. 2017-12-03 23:29:28 +08:00
NovaRain 813abbf452 Added missing entry of block_combat script function in opcode list. 2017-12-03 02:40:36 +08:00
NovaRain c6864e01f6 Added the damage type offset of weapon proto to define_extra.h.
Fixed a typo in hookscripts.txt.
Added a new example mod gl_autodoors (by Mr.Stalin) to modderspack. #19
2017-11-28 00:30:29 +08:00
NovaRain 0eab48932a Tweaked the way DebugMode works, now only DebugMode=2 sends debug output to a debug.log file. Any other non-0 value sends debug output to the screen. #123 2017-11-07 10:44:57 +08:00
NovaRain 6c3efc5b84 Replaced some SafeWrite* usages in old code with corresponding HookCall/MakeCall/MakeJump for code readability.
Edited code style in Perks.cpp.
2017-11-06 15:21:08 +08:00
NovaRain cb8d7dc94a Enabled mouse scroll control in barter and loot screens when the cursor is hovering over other lists, also enabled scrolling through the display monitor (from Crafty) #120
Rearraged the code style in dinput.cpp.
Updated version number.
2017-10-25 11:40:46 +08:00
NovaRain 5786cfb267 Fix crash when calling partyMemberGetCurLevel_ on a critter that has no data in party.txt.
Updated version number.
2017-10-18 14:56:38 +08:00
NovaRain 78dfb530a9 Moved LoadHeroAppearance() from MainMenuHook to NewGame2. No reason to run it on the main menu where player appearance can't display. 2017-09-19 15:27:08 +08:00
NovaRain d588f2e691 Edited code style in HeroAppearance.cpp/h, also removed some redundant blank lines. 2017-09-19 10:43:31 +08:00
NovaRain daf7a82997 Added descriptions for the variables in Perks.ini.
(cherry picked from commit 848f29b468)
2017-09-12 15:39:39 +08:00
NovaRain 9ad2b19e1a Removed the redundant LoadHeroAppearance calling.
(now it's called during LoadGame_, which is earlier than LoadGame2_After)
2017-09-09 18:59:21 +08:00
NovaRain 4b66dd3682 Reverted LoadGame to previous revision, but also kept EndLoadHook and changed it to only call LoadHeroAppearance.
(attempted to fix issue #117 and #94)
2017-09-05 09:21:22 +08:00
NovaRain 4899aeece1 Changed new function names in the previous commit to PascalCase style. 2017-09-01 09:45:33 +08:00
NovaRainandGitHub 946266e367 Merge pull request #107 from FakelsHub/crafty_features/combat_proc
Added calls to unimplemented script procedures: combat_is_starting_p_proc/combat_is_over_p_proc (from Crafty)
2017-09-01 09:40:47 +08:00
NovaRain 438ea071fc Removed the backported new modes for get_game_mode in commit a93ad5a9ba. 2017-08-24 21:46:42 +08:00
NovaRain 89760235c7 Removed unimplemented HEROWIN game mode from header files.
Cleared some obsoleted/unused code from main.cpp & LoadGameHook.cpp.
2017-08-23 13:42:58 +08:00
NovaRain 321f1c6034 Fixed the double damage effect of Silent Death perk not being applied to critical hits (from Crafty) 2017-08-21 23:18:32 +08:00
NovaRain 513338f160 Fixed incorrect argument description for get/set_proto_data in sfall opcode list.txt.
Removed incorrect PROTO_CR_FLAGS value in define_extra.h (was actually critter's IN), and renamed PROTO_CR_ACTION_FLAGS to its correct name #112

(cherry picked from commit ad17773ace)
2017-08-21 11:33:37 +08:00
NovaRain 08b92542f4 Fixed the incorrect description in HOOK_COMBATDAMAGE.
(cherry picked from commit 85cdd8973e)
2017-08-19 08:49:56 +08:00
NovaRain 46013c94b0 Added SSL library files and define_lite.h (from 4.0 development branch) 2017-08-18 15:52:14 +08:00
NovaRain 7a4ab59089 Added missing description for set_car_current_town.
Removed trailing spaces in MetaruleOp.hpp.
2017-08-13 11:38:18 +08:00
NovaRain e505e204cb Two bug fixes from Crafty:
1. Fixed the displayed message when the attack randomly hits a target that is not a critter and has a script attached.
2. Fixed damage_p_proc being called for misses if the target is not a critter.
2017-08-07 13:24:11 +08:00
NovaRain 7343754d53 Fixed Bonus Move APs being replenished when you save and load the game in combat (from Crafty)
Replaced all usages of MakeCall with 3 arguments with either MakeJump or MakeCall (2 arguments) to improve code readability (ref. commit 96fa2668cc)
2017-07-26 23:13:40 +08:00
NovaRain ae1e17d359 Added a note for argnum in set_sfall_arg().
Fixed incorrect set_sfall_arg usage in the example.
Removed a redundant line in sfall opcode list.txt.
2017-07-25 23:14:50 +08:00
NovaRain 32dbe5581d Replaced hs_*.int scripts in example mods with normal global scripts with register_hook.
(cherry picked from commit e7e286013f)
2017-07-06 21:04:51 +08:00
NovaRain a93ad5a9ba Added new modes for get_game_mode to match Crafty's (backported from 4.0 development branch, commit c32dc7664e) 2017-06-22 09:41:05 +08:00
NovaRain 874b047ce1 Added Attack Type argument for HOOK_COMBATDAMAGE (from Crafty) #100 2017-06-14 12:45:13 +08:00
NovaRain afa590c5a8 Minor edits to ddraw.ini. 2017-06-02 11:49:02 +08:00
NovaRain b89c52fcec Added DontTurnOffSneakIfYouRun option to prevent the player from running while sneaking without Silent Running perk (from Crafty)
Added sfall log text for DisablePipboyAlarm.
2017-05-26 10:10:16 +08:00
NovaRain ec2d323f75 Changed LoadGame2_After to be called before LoadGame state is ended (backported from 4.0 development branch, commit c2e6d743a3)
Updated version number.
Minor edits to scripting documents.
2017-05-23 21:05:04 +08:00
Mr.Stalin 586679b07f Added scripting procedure handlers combat_is_starting_p_proc/combat_is_over_p_proc from Crafry. 2017-05-12 18:28:46 +03:00
290 changed files with 32343 additions and 36189 deletions
-2
View File
@@ -46,8 +46,6 @@ nb-configuration.xml
*.user
*.userosscache
*.sln.docstates
*.VC.db
*.VC.opendb
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
+3 -2
View File
@@ -158,12 +158,13 @@
//
this.bCrittersLvar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.bCrittersLvar.Enabled = false;
this.bCrittersLvar.Location = new System.Drawing.Point(119, 401);
this.bCrittersLvar.Location = new System.Drawing.Point(118, 401);
this.bCrittersLvar.Name = "bCrittersLvar";
this.bCrittersLvar.Size = new System.Drawing.Size(99, 23);
this.bCrittersLvar.Size = new System.Drawing.Size(100, 23);
this.bCrittersLvar.TabIndex = 7;
this.bCrittersLvar.Text = "Local variables";
this.bCrittersLvar.UseVisualStyleBackColor = true;
this.bCrittersLvar.Click += new System.EventHandler(this.bCrittersLvar_Click);
//
// DebugEditor
//
+42 -1
View File
@@ -38,7 +38,7 @@ namespace FalloutClient {
private static ByteConverter converter = new ByteConverter();
private enum Mode { Globals, MapVars, SGlobals, Arrays, Critters }
private enum Mode { Globals, MapVars, SGlobals, Arrays, Critters, LocalVars }
private readonly EditorConnection connection;
private Mode mode;
@@ -47,6 +47,7 @@ namespace FalloutClient {
private readonly Dictionary<uint, string> CritNames = new Dictionary<uint, string>();
private void Redraw() {
bCrittersLvar.Enabled = false;
bEdit.Enabled = false;
Column2.ReadOnly = false;
Column3.ReadOnly = false;
@@ -96,6 +97,7 @@ namespace FalloutClient {
Column2.HeaderText = "PID";
Column3.HeaderText = "Pointer";
bEdit.Enabled = true;
bCrittersLvar.Enabled = true;
for (int i = 0; i < connection.Critters.Length / 2; i++) {
uint modcrit = (connection.Critters[i, 0] & 0xfffff);
string name = CritNames.ContainsKey(modcrit) ? CritNames[modcrit] : "";
@@ -333,6 +335,45 @@ namespace FalloutClient {
}
}
private void bCrittersLvar_Click(object sender, EventArgs e) {
if (dataGridView1.SelectedRows.Count == 0) return;
int i = (int)dataGridView1.SelectedRows[0].Tag;
connection.WriteDataType(DataTypeSend.RetrieveCritter);
connection.WriteInt(i);
BinaryReader br = new BinaryReader(new System.IO.MemoryStream(connection.ReadBytes(33 * 4)));
br.BaseStream.Position = 30 * 4;
int sid = br.ReadInt32();
br.Close();
if (sid != -1) {
connection.WriteDataType(DataTypeSend.GetLocal);
connection.WriteInt(sid);
int totalVar = connection.ReadInt();
string[] values = new string[totalVar];
if (totalVar > 0) {
br = new BinaryReader(new System.IO.MemoryStream(connection.ReadBytes(totalVar * 4)));
for (int j = 0; j < totalVar; j++) {
values[j] = br.ReadInt32().ToString();
}
br.Close();
}
values = EditorWindow.ShowEditor(this, values);
if (values != null) {
int countVar = values.Length;
MemoryStream ms = new MemoryStream(countVar * 4);
BinaryWriter bw = new BinaryWriter(ms);
for (int j = 0; j < countVar; j++) bw.Write(int.Parse(values[j]));
connection.WriteDataType(DataTypeSend.SetLocal);
connection.WriteInt(sid);
connection.WriteInt(countVar);
connection.WriteBytes(ms.GetBuffer(), 0, countVar * 4);
bw.Close();
}
} else {
MessageBox.Show("This critter has no script attached.");
}
}
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) {
bEdit.PerformClick();
}
+16
View File
@@ -29,6 +29,7 @@
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.checkBox = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
@@ -100,11 +101,24 @@
this.Column3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column3.Width = 150;
//
// checkBox
//
this.checkBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBox.AutoSize = true;
this.checkBox.Location = new System.Drawing.Point(103, 341);
this.checkBox.Name = "checkBox";
this.checkBox.Size = new System.Drawing.Size(91, 17);
this.checkBox.TabIndex = 3;
this.checkBox.Text = "Values in Hex";
this.checkBox.UseVisualStyleBackColor = true;
this.checkBox.Click += new System.EventHandler(this.checkBox_Click);
//
// EditorWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(458, 371);
this.Controls.Add(this.checkBox);
this.Controls.Add(this.dataGridView1);
this.Controls.Add(this.bCancel);
this.Controls.Add(this.bSave);
@@ -115,6 +129,7 @@
this.Text = "Edit Values";
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -126,5 +141,6 @@
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
private System.Windows.Forms.CheckBox checkBox;
}
}
+64 -6
View File
@@ -8,15 +8,34 @@ namespace FalloutClient {
public partial class EditorWindow : Form
{
private readonly DataType[] types;
private readonly string[] values;
private readonly DataType[] types = null;
private string[] values;
private bool save;
private static bool valueInHex = false;
private void ConvertValues(bool toHex) {
for (int i = 0; i < values.Length; i++) {
if (toHex) {
if (types == null || types[i] == DataType.Int) {
int val = int.Parse(values[i]);
values[i] = "0x" + val.ToString("x").ToUpper();
}
} else {
if (types == null || types[i] == DataType.Int) {
values[i] = Convert.ToInt32(values[i], 16).ToString();
}
}
}
}
private EditorWindow(string[] names, DataType[] types, string[] values, bool isMap) {
this.types = types;
this.values = values;
InitializeComponent();
checkBox.Checked = EditorWindow.valueInHex;
dataGridView1.SuspendLayout();
if (valueInHex) ConvertValues(true);
if (names == null)
for (int i = 0; i < types.Length; i++) {
string element = i.ToString();
@@ -31,15 +50,46 @@ namespace FalloutClient {
public static string[] ShowEditor(DebugEditor form, string[] names, DataType[] types, string[] values, bool isMap = false) {
EditorWindow editor = new EditorWindow(names, types, values, isMap);
editor.ShowDialog();
if (editor.save)
if (editor.save) {
if (valueInHex) editor.ConvertValues(false);
return editor.values;
else
return null;
}
return null;
}
private EditorWindow(string[] values) {
this.values = values;
InitializeComponent();
checkBox.Checked = EditorWindow.valueInHex;
dataGridView1.SuspendLayout();
if (valueInHex) ConvertValues(true);
for (int i = 0; i < values.Length; i++) {
dataGridView1.Rows.Add(i.ToString(), "Int", values[i]);
}
dataGridView1.ResumeLayout();
}
public static string[] ShowEditor(DebugEditor form, string[] lvalues) {
EditorWindow editor = new EditorWindow(lvalues);
editor.ShowDialog();
if (editor.save) {
if (valueInHex) editor.ConvertValues(false);
return editor.values;
}
return null;
}
private bool CheckInput(DataType type, string str) {
switch (type) {
case DataType.Int:
if (valueInHex) {
try {
Convert.ToInt32(str, 16);
return true;
} catch (Exception) {
return false;
}
}
int i;
return int.TryParse(str, out i);
case DataType.Float:
@@ -51,7 +101,7 @@ namespace FalloutClient {
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) {
string str = (string)dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
if (str != null && CheckInput(types[e.RowIndex], str))
if (str != null && CheckInput(((types != null) ? types[e.RowIndex] : DataType.Int), str))
values[e.RowIndex] = str;
else
dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = values[e.RowIndex];
@@ -65,5 +115,13 @@ namespace FalloutClient {
save = true;
Close();
}
private void checkBox_Click(object sender, EventArgs e) {
valueInHex = checkBox.Checked;
ConvertValues(valueInHex);
for (int i = 0; i < values.Length; i++) {
dataGridView1.Rows[i].Cells[2].Value = values[i];
}
}
}
}
+2
View File
@@ -29,6 +29,8 @@ namespace FalloutClient {
SetSGlobal = 4,
GetArray = 9,
SetArray = 10,
GetLocal = 11,
SetLocal = 12,
Exit = 254
}
}
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("4.1.7.0")]
[assembly: AssemblyFileVersion("4.1.7.0")]
[assembly: AssemblyVersion("4.1.9.0")]
[assembly: AssemblyFileVersion("4.1.9.0")]
+4 -4
View File
@@ -1,8 +1,8 @@
# 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.
A set of engine modifications for the classic game Fallout 2 in form of a DLL, which modifies executable in memory without changing anything in EXE file itself.
Engine modifications include:
**Engine modifications include:**
- Better support for modern operating systems
- Externalizing many settings like starting map and game time, skills, perks, critical hit tables, books, etc.
- Bug fixes
@@ -10,7 +10,7 @@ Engine modifications include:
- 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.
-30
View File
@@ -1,30 +0,0 @@
; Allows you to configure advanced settings for drugs.
; Maximum 50 drugs are allowed
; Note: for vanilla drugs, you can only override the values of NumEffect and AddictTime parameters
[main]
; set to 1 to change Jet addiction to be removed after the time expires
JetWithdrawal=0
; total number of drugs in this file
Count=0
; count starts from 1
[1]
; drug item PID
PID=0
; set a limit on the count of first and second delayed effects when using the drug, i.e. if the queue has delayed effects from the drug,
; and their count is greater or equal to NumEffects, it is not possible to obtain new effects from using the drug
; this count is 4 for Buffout/Mentats/Psycho/Jet
; set -1 to leave this parameter unchanged
NumEffects=-1
; the duration of the addiction effect in game minutes (i.e. 1440 = 24 game hours)
; set to 0 to use the default time (7 days for all drugs except Jet)
AddictTime=0
; the number of the global variable from vault13.gam responsible for displaying addiction in the character screen
; set to 0 if the addiction is not required
GvarID=0
; the index number from editor.msg to display the title of the addiction (the description uses the index number of TextID + 100)
TextID=-1
; the line number (0-indexed) of the corresponding FRM in skilldex.lst
FrmID=-1
+32 -43
View File
@@ -7,6 +7,30 @@
; have an additional NoHardcode option in this file which can
; be used to remove their hardcoded effects, and add new stat/skill effects
[PerksTweak]
;Change the penalty distance and distance bonus for 'Weapon Scope Range' weapon perk
;0 - no penalty, 8 - default penalty
WeaponScopeRangePenalty=8
;2 - no bonus, 5 - default bonus
WeaponScopeRangeBonus=5
;Changes the distance bonus for 'Weapon Long Range' weapon perk
;2 - no bonus, 4 - default bonus
WeaponLongRangeBonus=4
;Changes the hit chance bonus for 'Weapon Accurate' weapon perk
;0 - no bonus, 200 - maximum bonus, 20 - default bonus
WeaponAccurateBonus=20
;Changes the strength bonus for 'Weapon Handling' perk
;0 - no bonus, 10 - maximum bonus, 3 - default bonus
WeaponHandlingBonus=3
;##############################################################################
[Perks]
;Set to 1 to enable the modifications for perks
Enable=0
;Name=The name of the perk (max 63 characters)
;Desc=The description of the perk (max 255 characters)
;Image=The line number (0-indexed) of the corresponding FRM in skilldex.lst
@@ -35,18 +59,11 @@
;If the value is set to -99999, the variable will be ignored (similar to comment out that line)
;You can add simple extra perks with ID numbers from 119 to 255
; that do not require using scripting functions to change player stats, and can also be used for Armor perks
;These parameters are only for extra perks
;Stat1-Stat2 = same as Stat
;Stat1Mag-Stat2Mag = same as StatMag
;Skill3-Skill5 = The skill to be modified (or -1 for none)
;Skill3Mod-Skill5Mod = The increased/decreased value to the modified skill
;This is a modification to vanilla perk 0
[0]
;##############################################################################
;This is a modification to perk 119
[119]
Name=Example
Desc=This is an example perk description
Desc=This is an example perk~Second line
Image=72
Ranks=1
Level=1
@@ -65,38 +82,10 @@ INT=0
AGL=0
LCK=0
;Example for creating extra perks
[119]
Name=Extra Perk
Desc=This perk can change player stats and skills
Image=72
Ranks=1
Level=2
Type=0
Stat=-1
StatMag=0
Skill1=-1
Skill1Mag=0
Skill2=-1
Skill2Mag=0
STR=0
PER=0
END=0
CHR=0
INT=0
AGL=0
LCK=0
; for extra perks only
Stat1=-1
Stat1Mag=0
Stat2=-1
Stat2Mag=0
Skill3=-1
Skill3Mod=0
Skill4=-1
Skill4Mod=0
Skill5=-1
Skill5Mod=0
;##############################################################################
[Traits]
;Set to 1 to enable the modifications for traits
Enable=0
;This is a modification to trait 0
[t0]
-91
View File
@@ -1,91 +0,0 @@
;WeaponAnims codes
; 1 - Knife (D)
; 2 - Club (E)
; 3 - Sledgehammer (F)
; 4 - Spear (G)
; 5 - Pistol (H)
; 6 - SMG (I)
; 7 - Rifle (J)
; 8 - Big Gun (K)
; 9 - Minigun (L)
; 10 - Rocket Launcher (M)
; 11-15 - sfall additional weapon animation codes
; This section maps 7 armor types to corresponding armor item PIDs
[ArmorTypes]
Jacket = 74,265
Leather = 1,379
Metal = 2,240,380
Power = 3,232
AdvPower = 348,349
Combat = 17,239,381
Robe = 113,524
; Default armor FIDs (the same for all NPCs)
[Default]
Power=16777217
AdvPower=16777287
Robe=16777218
; Sulik
[1]
PID=16777313
WeaponAnims=1,3,4,6
Default=16777280
Leather=16777325
Power=16777324
Metal=16777323
Jacket=16777321
Combat=16777322
; Vic
[2]
PID=16777278
WeaponAnims=1,5,7
Default=16777307
Jacket=16777329
Combat=16777330
Metal=16777331
Power=16777332
Leather=16777333
; Cassidy
[3]
PID=16777305
WeaponAnims=4,5,7
Default=16777354
Leather=16777260
Power=16777328
Metal=16777327
Jacket=16777351
Combat=16777326
; Myron
[4]
PID=16777376
WeaponAnims=1,5
Default=16777304
Leather=
Power=16777349
Combat=16777350
; Cat Jules
[5]
PID=16777734
WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
Default=16777353
Leather=16777347
Metal=16777348
Jacket=16777346
Combat=16777226
; Kitsune
[6]
PID=16777724
WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
Default=16777222
Leather=16777221
Metal=16777223
Jacket=16777222
Combat=16777219
-57
View File
@@ -1,57 +0,0 @@
[Highlighting]
; DX scancode of a key to press to highlight items on the ground
; 42 - SHIFT key
Key=42
; Set to 1 to also highlight containers
Containers=1
; Set to 1 to also highlight lootable corpses
Corpses=1
; Set to 1 to only highlight objects in the player's line-of-sight
CheckLOS=0
; Set the color of outlines, available colors:
; 1 - glowing red
; 2 - red
; 4 - grey
; 8 - glowing green
; 16 - bright yellow
; 32 - dark yellow
; 64 - purple
OutlineColor=16
; Motion Scanner mode:
; 0 - ignored
; 1 - requires Motion Scanner present in player inventory to activate highlighting
; 2 - requires Motion Scanner and also requires 1 charge on every use (depleted scanner will not work anymore)
MotionScanner=0
[CombatControl]
;Allows you to directly control other critters in combat
;Set to 0 to disable
;Set to 1 to control all critters in combat
;Set to 2 to control all party members
;If you want to control only specific critters, uncomment the PIDList line and set a comma delimited list of PIDs
Mode=0
;PIDList=62,89,97,107,160,161
;Choose a notification box to display the name of the controlled critter above the interface bar
;Must be between 5 and (4 + the value of BoxBarCount in ddraw.ini)
;For sfall 4.1.6+ the number for the notification box is set automatically, so just use any value
;Set to 0 to disable
DisplayName=0
;Set the color of display name, available colors:
;0 - green
;1 - red
;2 - white
;3 - yellow
;4 - dark yellow
;5 - blue
;6 - purple
;7 - dull pink
DisplayNameColor=0
+177 -130
View File
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,206 @@
/*
Example algorithm of how the game engine calculates combat damage
*/
#include "..\headers\define.h"
#include "..\headers\command.h"
#include "..\headers\sfall\sfall.h"
#include "..\headers\sfall\define_extra.h"
procedure start;
procedure compute_damage_F2;
procedure item_w_damage_hook;
procedure item_w_subtype(variable weapon, variable hit_mode);
procedure get_ammo_value(variable weapon, variable param);
variable item_w_damage;
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);
end
end
procedure compute_damage_F2 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;
variable
ctdTarget := get_sfall_arg,
ctdSource := get_sfall_arg,
amountTarget := get_sfall_arg,
amountSource := get_sfall_arg,
flagsTarget := get_sfall_arg,
flagsSource := get_sfall_arg,
weapon := get_sfall_arg,
bodypart := get_sfall_arg,
damageMultiplier := get_sfall_arg,
rounds := get_sfall_arg,
amountKnockback := get_sfall_arg,
hit_mode := get_sfall_arg;
if (flagsSource bwand DAM_HIT) then begin
target := ctdTarget;
flags := flagsTarget;
knockback := 1;
end else begin
target := ctdSource;
flags := flagsSource;
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);
weapon_perk := get_proto_data(obj_pid(weapon), PROTO_WP_PERK);
end else begin
dmg_type := DMG_normal_dam;
weapon_perk := -1;
end
dmg_thresh := get_critter_stat(target, STAT_dmg_thresh + dmg_type);
dmg_resist := get_critter_stat(target, STAT_dmg_resist + dmg_type);
if (flags bwand DAM_BYPASS) and (dmg_type != DMG_emp) then begin
dmg_thresh := dmg_thresh * 20 / 100;
dmg_resist := dmg_resist * 20 / 100;
end else begin
if (weapon_perk == PERK_weapon_penetrate)
or (hit_mode == ATKTYPE_PALMSTRIKE or hit_mode == ATKTYPE_PIERCINGSTRIKE
or hit_mode == ATKTYPE_HOOKKICK or hit_mode == ATKTYPE_PIERCINGKICK) then
dmg_thresh := dmg_thresh * 20 / 100;
if ctdSource == dude_obj and has_trait(TRAIT_TRAIT, ctdSource, TRAIT_finesse) then
dmg_resist += 30;
end
weapon_subtype := item_w_subtype(weapon, hit_mode); // item_w_subtype_
if (ctdSource != dude_obj) or (weapon_subtype != WEAPON_TYPE_GUNS) then
bonus_ranged := 0;
else
bonus_ranged := has_trait(TRAIT_PERK, ctdSource, PERK_bonus_ranged_damage) * 2;
difficulty := 100;
if (has_trait(TRAIT_OBJECT, ctdSource, OBJECT_TEAM_NUM) != has_trait(TRAIT_OBJECT, dude_obj, OBJECT_TEAM_NUM)) then begin
if (combat_difficulty == 0) then
difficulty := 75;
else if (combat_difficulty == 2) then
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;
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;
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
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)
and (critter_kill_type(ctdTarget) != KILL_TYPE_alien_kills) then
amount += 5;
if has_trait(TRAIT_PERK, ctdSource, PERK_pyromaniac_perk) and (dmg_type == DMG_fire) then
amount += 5;
end
if knockback and ((get_flags(target) bwand FLAG_MULTIHEX) == 0)
and (dmg_type == DMG_explosion or weapon == 0 or weapon_subtype == WEAPON_TYPE_MELEE)
and ((get_proto_data(obj_pid(target), PROTO_CR_FLAGS) bwand CFLG_NOKNOCKDOWN) == 0) then begin // critter_flag_check_
damage := 0;
if (target == dude_obj) and has_trait(TRAIT_PERK, target, PERK_stonewall_perk) then begin
damage := 1;
if (random(0, 100) < 50) then knockback := 0;
end
if knockback then begin
if (weapon_perk == PERK_weapon_knockback) then
amountKnockback := amount / 5;
else
amountKnockback := amount / 10;
if damage then amountKnockback /= 2;
end
end
end
if (flagsSource bwand DAM_HIT) then begin
display_msg("amountTarget = " + amountTarget+ ", amount = " + amount);
amountTarget := amount;
flagsTarget := flags;
end else begin
display_msg("amountSource = " + amountSource+ ", amount = " + amount);
amountSource := amount;
flagsSource := flags;
end
set_sfall_return(amountTarget);
set_sfall_return(amountSource);
set_sfall_return(flagsTarget);
set_sfall_return(flagsSource);
set_sfall_return(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,
//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);
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));
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
type := WEAPON_TYPE_THROWN;
else if (attack_mode > ATKMODE_PRI_KICK) then
type := WEAPON_TYPE_MELEE;
end
return type;
end
procedure get_ammo_value(variable weapon, variable param) begin
variable pid := -1, value := 0; // default DR value
if weapon then begin
pid := get_weapon_ammo_pid(weapon);
if (pid > -1) then value := get_proto_data(pid, param);
end
if (pid == -1 and param != PROTO_AM_DR_MOD) then value := 1; // default value for Mult/Div
return value;
end
@@ -1,44 +0,0 @@
/*
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,116 @@
// Status: WIP
texture bloomMap;
sampler s0;
sampler BloomSampler : samplerstate
{
Texture = bloomMap;
MinFilter = Linear;
MagFilter = Linear;
AddressU = Clamp;
AddressV = Clamp;
};
// pseudo gauss blur
static const float2 offsets[12] = {
-0.326212, -0.405805,
-0.840144, -0.073580,
-0.695914, 0.457137,
-0.203345, 0.620716,
0.962340, -0.194983,
0.473434, -0.480026,
0.519456, 0.767022,
0.185461, -0.893124,
0.507431, 0.064425,
0.896420, 0.412458,
-0.321940, -0.932615,
-0.791559, -0.597705,
};
float w;
float h;
static const float2 resolution = float2(w, h);
// blur setting
static const float blurFalloff = 8;
static const float sharpness = 4;
float4 AdjustSaturation(float4 color, float saturation) {
float grey = dot(color, float3(0.3, 0.59, 0.11));
return lerp(grey, color, saturation);
}
float Brightness(float3 color)
{
return color.r * color.g - 0.75 * color.b;
}
float3 BlurFunction(float2 uv, float brightness, inout float totalWeight)
{
float3 pointColor =(tex2Dlod(s0, float4(uv, 0, 0)).rgb);
float diff = abs(brightness - Brightness(pointColor));
float weight = exp2(-0.25 * blurFalloff - diff * sharpness);
totalWeight += weight;
return pointColor * weight;
}
float4 BlurPS(float2 uv : TEXCOORD0, uniform float2 delta) : COLOR0
{
float3 sumColor = (tex2D(s0, uv).rgb);
float totalWeight = 1;
float brightness = Brightness(sumColor);
delta *= (1 / resolution);
float radius = 1;
float2 pointUV = uv + delta * radius;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
pointUV = uv - delta * radius;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
return float4((sumColor / totalWeight),1);
// return AdjustSaturation(Color, 0.5);
}
float4 BloomT(float2 texCoord : TEXCOORD0) : COLOR0 {
float4 c = tex2D(s0, texCoord);
float BloomThreshold = 0.2;
return saturate((c - BloomThreshold) / (1 - BloomThreshold));
}
float4 Bloom(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0 {
float BaseIntensity = 1.0;
float BaseSaturation = 1;
float BloomIntensity = 1; // 0.4
float BloomSaturation = 0.5;
float BlurPower = 0.01;
float BloomThreshold = 0.5;
float4 original = tex2D(s0, texCoord);
// blur
float4 sum = tex2D(s0, texCoord);
for(int i = 0; i < 12; i++){
sum += tex2D(s0, texCoord + BlurPower * offsets[i]);
}
sum /= 13;
original = AdjustSaturation(original, BaseSaturation) * BaseIntensity;
sum = AdjustSaturation(sum, BloomSaturation) * BloomIntensity;
sum = saturate((sum - BloomThreshold) / (1 - BloomThreshold));
return sum + original;
// return sum;
}
technique Blur
{
// pass P2 { PixelShader = compile ps_2_0 BloomT(); }
// pass P3 { PixelShader = compile ps_2_0 Bloom(); }
Pass P0 { PixelShader = compile ps_3_0 BlurPS(float2(1, 0)); }
Pass P1 { PixelShader = compile ps_3_0 BlurPS(float2(0, 1)); }
}
@@ -1,8 +1,8 @@
/**
Item Highlight mod.
Item Highlight mod (Lite version)
Previously was part of sfall itself, now a separate mod.
A cut-down version of the mod included in sfall 4.x, offers a bit more features than the built-in function.
Features:
- highlighting items, containers (optional) and lootable corpses (optional) on the ground
- configurable hotkey is used to trigger highlight
@@ -10,6 +10,8 @@
- motion scanner is required to enable highlight (optional)
- motion scanner charges are decreased on each use (optional)
Requires sfall 3.8.12 or higher
NOTE: this script requires compiler from sfall modderspack with -s option
(short circuit evaluation)
@@ -98,27 +100,13 @@ procedure KeyPressHandler begin
end
end
procedure CombatTurnHandler begin
if isHighlight then begin
isHighlight := false;
call ToggleHighlight(false);
end
end
procedure GameModeChangeHandler begin
if isHighlight and (get_game_mode bwand (INTFACELOOT bwor BARTER)) then begin
isHighlight := false;
call ToggleHighlight(false);
end
end
procedure InventoryMoveHandler begin
// remove item outline when player picks up the item
if (isHighlight and get_sfall_arg == 7) then set_outline(get_sfall_arg, 0);
end
procedure start begin
if game_loaded and (sfall_ver_major >= 4) then begin
if game_loaded and (sfall_ver_major < 4) then begin
call InitConfigs;
highlightKey := GetConfig(configSection, "Key", 0);
@@ -133,8 +121,6 @@ procedure start begin
highlightFailMsg2 := Translate("HighlightFail2", "Your motion sensor is out of charge.");
register_hook_proc(HOOK_KEYPRESS, KeyPressHandler);
register_hook_proc(HOOK_COMBATTURN, CombatTurnHandler);
register_hook_proc(HOOK_GAMEMODECHANGE, GameModeChangeHandler);
register_hook_proc(HOOK_INVENTORYMOVE, InventoryMoveHandler);
end
end
@@ -1,30 +1,48 @@
#ifndef MAIN_H
#define MAIN_H
#include "..\scripting\headers\sfall.h"
#include "..\scripting\headers\define_lite.h"
#include "..\scripting\headers\define_extra.h"
#include "..\scripting\headers\dik.h"
/*
#include "..\scripting\headers\lib.arrays.h"
#include "..\scripting\headers\lib.strings.h"
// #include "..\scripting\headers\lib.inven.h"
#include "..\scripting\headers\lib.inven.h"
*/
variable ini := "sfall-mods.ini";
variable translationIni;
// Gets the integer value from ini
// Gets the integer value from the specified ini
procedure GetIniConfig(variable section, variable key, variable def, variable inifile) begin
variable val := get_ini_setting(inifile + "|" + section + "|" + key);
if val == -1 then val := def;
return val;
end
// Gets the string value from the specified ini
procedure GetIniConfigStr(variable section, variable key, variable def, variable inifile) begin
variable val := get_ini_string(inifile + "|" + section + "|" + key);
if val == -1 or val == "" then val := def;
return val;
end
// Gets the integer value from sfall-mods.ini
procedure GetConfig(variable section, variable key, variable def) begin
variable val := get_ini_setting(ini + "|" + section + "|" + key);
if val == -1 then val := def;
return val;
end
// Gets the string value from ini
// Gets the string value from sfall-mods.ini
procedure GetConfigStr(variable section, variable key, variable def) begin
variable val := get_ini_string(ini + "|" + section + "|" + key);
if val == -1 or val == "" then val := def;
return val;
end
// Gets the value from ini as a temp array of strings
// Gets the value from sfall-mods.ini as a temp array of strings
procedure GetConfigList(variable section, variable key) begin
variable val := get_ini_string(ini + "|" + section + "|" + key);
if val == -1 or val == "" then return [];
@@ -32,7 +50,7 @@ procedure GetConfigList(variable section, variable key) begin
return string_split(val, ",");
end
// Gets the value from ini as a temp array of ints
// Gets the value from sfall-mods.ini as a temp array of ints
procedure GetConfigListInt(variable section, variable key) begin
variable arr, i, item;
@@ -53,5 +71,7 @@ procedure Translate(variable id, variable def) begin
end
procedure InitConfigs begin
translationIni := GetConfigStr("Main", "TranslationsINI", "./Translations.ini");
translationIni := GetIniConfigStr("Main", "TranslationsINI", "Translations.ini", "ddraw.ini");
end
#endif
@@ -0,0 +1,21 @@
Item Highlight mod (Lite version) for sfall 3.8.x
-------------------------------------------------
A cut-down version of the mod included in sfall 4.x, offers a bit more features than the built-in function.
Features:
- highlighting items, containers (optional) and lootable corpses (optional) on the ground
- configurable hotkey is used to trigger highlight
- only objects in direct line-of-sight of player are highlighted (optional)
- motion scanner is required to enable highlight (optional)
- motion scanner charges are decreased on each use (optional)
Requires sfall 3.8.12 or higher.
To use, copy gl_highlighting_lite.int to your scripts folder, and copy sfall-mods.ini to the same directory as sfall.
Also, you should disable the built-in function in ddraw.ini (ToggleItemHighlightsKey=0).
Note that due to the lack of newer game hooks in sfall 3.8.x, there are some minor visual glitches with the lite version:
- items will be kept highlighted when entering combat while holding the highlight key.
- when you pick up items while holding the highlight key, they will be kept highlighted if you drop them on the ground (fixed for 3.8.18+).
Both glitches can bo solved by pressing and releasing the highlight key again.

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