From cd3c220ef80f1e9ee2118a37ad503c5551a61b71 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Tue, 9 Nov 2021 10:01:17 +0800 Subject: [PATCH] Changed the option name of grave containers fix Edited the code of tile_num function wrapper. Reorganized the options in ddraw.ini. Updated web document. --- artifacts/config_files/Skills.ini | 2 +- artifacts/ddraw.ini | 130 +++++++++++++++--------------- artifacts/scripting/hooks.yml | 4 +- sfall/FalloutEngine/Functions.cpp | 3 +- sfall/Game/objects.cpp | 4 +- sfall/Game/objects.h | 2 +- sfall/Modules/Animations.cpp | 4 +- sfall/Modules/MiscPatches.cpp | 2 +- 8 files changed, 77 insertions(+), 74 deletions(-) diff --git a/artifacts/config_files/Skills.ini b/artifacts/config_files/Skills.ini index 87d70d01..37b59980 100644 --- a/artifacts/config_files/Skills.ini +++ b/artifacts/config_files/Skills.ini @@ -11,7 +11,7 @@ TagSkillBonus=20 ;Set to 3 to use both modes TagSkillMode=0 -;Set to 1 to base skill costs on spent points instead of current level +;Set to 1 to base skill costs on the number of additional points in a skill instead of the current level BasedOnPoints=0 ;Examples diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index b9f92c3b..52e6b957 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -384,7 +384,7 @@ SaveInCombatFix=1 ;Player's level is capped once the highest specified level is reached ;XPTable=50,100,200 -;Set to 1 to enable additional weapon animation codes from o to t +;Set to 1 to enable additional weapon animation codes from 'o' to 't' ;The 4 byte value at 0x39 of weapon protos may range from 0 to 15 rather than 0 to 10 ;Since the letters 'n' and 'r' are in use for other animations, an animation code of 11 corresponds to 's' and 15 to 't' AdditionalWeaponAnims=1 @@ -443,16 +443,6 @@ SkipOpeningMovies=0 ;Set to 0 to disable NPCsTryToSpendExtraAP=0 -;Set to 1 to fix the priority score calculation for choosing the best weapon for NPCs -;Note that enabling this option can affect the weapon of choice for some NPCs -AIBestWeaponFix=1 - -;Set to 1 to fix NPCs not taking chem_primary_desire in AI.txt as a preference list when using drugs in their inventory -;Set to 2 to allow NPCs to use only the drugs listed in chem_primary_desire and healing drugs (stimpaks and healing powder) -;Note: chem_primary_desire w/o fixes prevents the specified item PID from being consumed if all three values in the list are the same PID -;chem_primary_desire also works as a priority list of drug items the NPC will try to pick up in combat when they are on the ground -AIDrugUsePerfFix=0 - ;Allows the use of tiles over 80x36 in size. sfall will just split and resave them to art\tiles\zzz####.frm at startup ;Set to 1 to check all tiles on started (slow, but can also be useful for checking the correct size of your new tiles) ;Set to 2 if you provide a XLtiles.lst file in art\tiles\ containing a list of the tile indexes that need checking @@ -569,7 +559,7 @@ BoostScriptDialogLimit=0 ;Add 4 to the mode to limit the weight check to used items only ;You can use message number 542/543 in proto.msg and message number 35 in inventry.msg to set up custom messages for item size CritterInvSizeLimitMode=0 -CritterInvSizeLimit=100 +CritterInvSizeLimit=200 ;Some bit flags to alter behaviour of the motion sensor ;1 - Allow sensor use on automap when motion sensor is in pack rather than hands @@ -598,37 +588,6 @@ SuperStimExploitFix=0 InventoryApCost=4 QuickPocketsApCostReduction=2 -;Set to 1 to fix obj_can_see_obj script function to allow critters to see through objects with 'ShootThru' flag set and other critters in front of them -;Note that enabling this option can cause unexpected NPC behavior in some cases, e.g. initiating combat or dialogue when the player is behind certain obstacles -ObjCanSeeObj_ShootThru_Fix=0 - -;Set to 1 to fix the broken obj_can_hear_obj script function -ObjCanHearObjFix=0 - -;Set to 1 to enable the 'mood' argument of start_gdialog script function for talking heads -;If the argument value is -1, the mood will be determined by the local variable 0 of the script (vanilla behavior) -StartGDialogFix=0 - -;Set to 1 to fix attacker_results/target_results arguments and repurpose the unused called_shot/num_attacks arguments of attack_complex script function -;New behavior of the arguments: -;called_shot - additional damage when hitting the target -;num_attacks - the number of free action points on the first turn only -AttackComplexFix=0 - -;Set to 1 to make the create_object_sid script function run the 'start' procedure of attached script upon object creation -;By default, the 'start' procedure of attached script is executed after the current script procedure is finished -;Note that enabling this option may cause unexpected results with some existing game scripts -CreateObjectSidFix=0 - -;Set to 1 to fix the execution of the 'use_p_proc' procedure for grave type containers when they are in the open state -;By default, using open graves does not run the 'use_p_proc' procedure of attached script like other containers -;Note that enabling this option will cause problems for existing grave scripts -GraveUseProcFix=0 - -;Set to 1 to fix the issue with the division operator treating negative integers as unsigned -;Note: To perform the unsigned integer division, use the new 'div' operator -DivisionOperatorFix=1 - ;Set to 1 to enable the balanced bullet distribution formula for burst attacks ComputeSprayMod=0 @@ -694,7 +653,7 @@ EnableMusicInDialogue=0 DontTurnOffSneakIfYouRun=0 ;Changes the distance at which the player will switch to walking when trying to use objects (valid range: 0..3) -;Set to 0 to disable switching. (Default is 3) +;Default is 3. Set to 0 to disable switching UseWalkDistance=3 ;Changes the displayed message when you recover from the negative effects of radiation exposure @@ -707,14 +666,6 @@ ActiveGeigerMsgs=1 ;Set to 1 to fix the bug of being unable to sell used geiger counters or stealth boys CanSellUsedGeiger=1 -;Set to 1 to fix the issue with being able to charge the car by using cells on other scenery/critters -;Set to 0 if another mod you're using has custom vehicles -CarChargingFix=1 - -;Set to 1 to prevent the car from being lost when entering a location via the Town/World button and then leaving on foot -;Note that the global variable 633 (GVAR_CAR_PLACED_TILE) will be set to -1 when the player leaves a location -CarPlacedTileFix=1 - ;Set to 1 to skip weapon equip/unequip animations when performing various actions InstantWeaponEquip=0 @@ -744,6 +695,70 @@ DisplaySwiftLearnerExp=1 ;Set to 1 to display party member's current level/AC/addict flag on the combat control panel PartyMemberExtraInfo=0 +;Set to 1 to skip loading all game settings except the game/combat difficulty from saved games +;Set to 2 to also skip loading the game/combat difficulty settings +SkipLoadingGameSettings=0 + +;Changes the base value of the duration of the knockout effect (valid range: 35..100; default is 35) +;The formula for the duration in ticks is: 10 * (value - 3 * EN) +KnockoutTime=35 + +;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top +CreditsAtBottom=0 + +;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +; Critical modding options - the following options should be changed with caution +;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + +;Set to 1 to fix the issue with being able to charge the car by using cells on other scenery/critters +;Set to 0 if another mod you're using has custom vehicles +CarChargingFix=1 + +;Set to 1 to prevent the car from being lost when entering a location via the Town/World button and then leaving on foot +;Note that the global variable 633 (GVAR_CAR_PLACED_TILE) will be set to -1 when the player leaves a location +CarPlacedTileFix=1 + +;Set to 1 to fix obj_can_see_obj script function to allow critters to see through objects with 'ShootThru' flag set and other critters in front of them +;Note that enabling this option can cause unexpected NPC behavior in some cases, e.g. initiating combat or dialogue when the player is behind certain obstacles +ObjCanSeeObj_ShootThru_Fix=0 + +;Set to 1 to fix the broken obj_can_hear_obj script function +ObjCanHearObjFix=0 + +;Set to 1 to enable the 'mood' argument of start_gdialog script function for talking heads +;If the argument value is -1, the mood will be determined by the local variable 0 of the script (vanilla behavior) +StartGDialogFix=0 + +;Set to 1 to fix attacker_results/target_results arguments and repurpose the unused called_shot/num_attacks arguments of attack_complex script function +;New behavior of the arguments: +;called_shot - additional damage when hitting the target +;num_attacks - the number of free action points on the first turn only +AttackComplexFix=0 + +;Set to 1 to make the create_object_sid script function run the 'start' procedure of attached script upon object creation +;By default, the 'start' procedure of attached script is executed after the current script procedure is finished +;Note that enabling this option may cause unexpected results with some existing game scripts +CreateObjectSidFix=0 + +;Set to 1 to fix the execution of the 'use_p_proc' procedure for grave type containers when they are in the open state +;By default, using open graves does not run the 'use_p_proc' procedure of attached script like other containers +;Note that enabling this option will cause problems for existing grave scripts +GraveContainersFix=0 + +;Set to 1 to fix the issue with the division operator treating negative integers as unsigned +;Note: To perform the unsigned integer division, use the new 'div' operator +DivisionOperatorFix=1 + +;Set to 1 to fix the priority score calculation for choosing the best weapon for NPCs +;Note that enabling this option can affect the weapon of choice for some NPCs +AIBestWeaponFix=1 + +;Set to 1 to fix NPCs not taking chem_primary_desire in AI.txt as a preference list when using drugs in their inventory +;Set to 2 to allow NPCs to use only the drugs listed in chem_primary_desire and healing drugs (stimpaks and healing powder) +;Note: chem_primary_desire w/o fixes prevents the specified item PID from being consumed if all three values in the list are the same PID +;chem_primary_desire also works as a priority list of drug items the NPC will try to pick up in combat when they are on the ground +AIDrugUsePerfFix=0 + ;Set to 1 to fix the bug of using First Aid/Doctor skills when using them on the player ;This will cause the party member to apply his/her skills when you use First Aid/Doctor skills on the player, but only if ;the player is standing next to the party member @@ -751,10 +766,6 @@ PartyMemberExtraInfo=0 ;that overrides First Aid/Doctor functions has very limited usefulness PartyMemberSkillFix=0 -;Set to 1 to skip loading all game settings except the game/combat difficulty from saved games -;Set to 2 to also skip loading the game/combat difficulty settings -SkipLoadingGameSettings=0 - ;Overrides the global variable number used to show the special death message of the Modoc toilet explosion ;Set to -1 to disable the special death message when the global variable is set SpecialDeathGVAR=491 @@ -768,13 +779,6 @@ DisableSpecialMapIDs=0 ;Note that enabling this option will break the location change of the 'Fake Vault 13' in Fallout 2 DisableSpecialAreas=0 -;Changes the base value of the duration of the knockout effect (valid range: 35..100; default is 35) -;The formula for the duration in ticks is: 10 * (value - 3 * EN) -KnockoutTime=35 - -;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top -CreditsAtBottom=0 - ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ; Configuration ini files ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX diff --git a/artifacts/scripting/hooks.yml b/artifacts/scripting/hooks.yml index db2bd133..9b7aa1e6 100644 --- a/artifacts/scripting/hooks.yml +++ b/artifacts/scripting/hooks.yml @@ -292,8 +292,8 @@ id: HOOK_AMMOCOST doc: | Runs when calculating ammo cost for a weapon. Doesn't affect damage, only how much ammo is spent. - By default, weapon will shoot when at least 1 round is left, regardless of ammo cost calculations. - To add proper check for ammo before shooting and proper calculation of number of burst rounds (hook type 1 and 2 in arg3), set **CheckWeaponAmmoCost=1** in **Misc** section of ddraw.ini. + By default, weapons can make attacks when at least 1 ammo is left, regardless of ammo cost calculations. + To add proper check for ammo before attacking and proper calculation of the number of burst rounds (hook type 1 and 2 in arg3), set **CheckWeaponAmmoCost=1** in **Misc** section of ddraw.ini. ``` Item arg0 - The weapon diff --git a/sfall/FalloutEngine/Functions.cpp b/sfall/FalloutEngine/Functions.cpp index db1d66d6..dae50ff0 100644 --- a/sfall/FalloutEngine/Functions.cpp +++ b/sfall/FalloutEngine/Functions.cpp @@ -155,9 +155,8 @@ void __declspec(naked) interpretError(const char* fmt, ...) { } long __fastcall tile_num(long x, long y) { - __asm push ebx; // don't delete (bug in tile_num_) + __asm xor ebx, ebx; // don't delete (bug in tile_num_) WRAP_WATCOM_FCALL2(tile_num_, x, y); - __asm pop ebx; } GameObject* __fastcall obj_blocking_at_wrapper(GameObject* obj, DWORD tile, DWORD elevation, void* func) { diff --git a/sfall/Game/objects.cpp b/sfall/Game/objects.cpp index e8cf4239..84ab589b 100644 --- a/sfall/Game/objects.cpp +++ b/sfall/Game/objects.cpp @@ -31,7 +31,7 @@ fo::GameObject* __fastcall Objects::FindObjectFromID(long id, long type) { return nullptr; } -void Objects::init() { -} +//void Objects::init() { +//} } diff --git a/sfall/Game/objects.h b/sfall/Game/objects.h index 3cd3bfef..cabd3334 100644 --- a/sfall/Game/objects.h +++ b/sfall/Game/objects.h @@ -11,7 +11,7 @@ namespace game class Objects { public: - static void init(); + //static void init(); // Implementation of is_within_perception_ engine function with the HOOK_WITHINPERCEPTION hook static long is_within_perception(fo::GameObject* watcher, fo::GameObject* target, long hookType); diff --git a/sfall/Modules/Animations.cpp b/sfall/Modules/Animations.cpp index 16a8d9a2..a20a5ea3 100644 --- a/sfall/Modules/Animations.cpp +++ b/sfall/Modules/Animations.cpp @@ -616,8 +616,8 @@ void Animations::init() { MakeCall(0x419A17, art_alias_fid_hack); // Fix for grave type containers in the open state not executing the use_p_proc procedure - if (IniReader::GetConfigInt("Misc", "GraveUseProcFix", 0) != 0) { - dlog("Applying use_p_proc fix for grave type containers.", DL_INIT); + if (IniReader::GetConfigInt("Misc", "GraveContainersFix", 0)) { + dlog("Applying grave type containers fix.", DL_INIT); HookCall(0x49CFAC, obj_use_container_hook); SafeWrite16(0x4122D9, 0x9090); // action_get_an_object_ dlogr(" Done", DL_INIT); diff --git a/sfall/Modules/MiscPatches.cpp b/sfall/Modules/MiscPatches.cpp index 26d8c579..89ac8553 100644 --- a/sfall/Modules/MiscPatches.cpp +++ b/sfall/Modules/MiscPatches.cpp @@ -686,7 +686,7 @@ static void PartyMemberSkillPatch() { // Note: this will cause the party member to apply his/her skill when you use First Aid/Doctor skill on the player, but only if // the player is standing next to the party member. Because the related engine function is not fully implemented, enabling // this option without a global script that overrides First Aid/Doctor functions has very limited usefulness - if (IniReader::GetConfigInt("Misc", "PartyMemberSkillFix", 0) != 0) { + if (IniReader::GetConfigInt("Misc", "PartyMemberSkillFix", 0)) { dlog("Applying party member using First Aid/Doctor skill patch.", DL_INIT); HookCall(0x412836, action_use_skill_on_hook); dlogr(" Done", DL_INIT);