From 92b010f362353a042a11351eb770a049f726604d Mon Sep 17 00:00:00 2001 From: NovaRain Date: Tue, 23 May 2017 22:28:42 +0800 Subject: [PATCH] Added check for sfall version for gl_partycontrol and gl_npcarmor. Changed version string because sfall 4.0 will be released in 'beta' stage first. Minor edits to some documents. --- artifacts/mods/gl_npcarmor.int | Bin 2618 -> 2642 bytes artifacts/mods/gl_npcarmor.ssl | 28 ++++++++++++++-------------- artifacts/mods/gl_partycontrol.int | Bin 1598 -> 1622 bytes artifacts/mods/gl_partycontrol.ssl | 20 ++++++++++---------- artifacts/mods/readme.txt | 3 ++- artifacts/scripting/hookscripts.txt | 13 ++++--------- sfall/version.h | 4 ++-- 7 files changed, 32 insertions(+), 36 deletions(-) diff --git a/artifacts/mods/gl_npcarmor.int b/artifacts/mods/gl_npcarmor.int index 2af91c20683fd3734ddfd3a2e33104c8421ebcde..3006723a002a25309c3ee979131097d131735213 100644 GIT binary patch delta 220 zcmdlba!F*vVn!w=oyiLs+a_x>&0st-`3Tct#v_|Mn3EY9&rN>A@=@BVF{MHJ03!nf z>yHMB2K@%9CIJwSfu+H0@&i_7-g^@m85kJ0fXO411=uVZpH22+Yh+BCe1=UHMfStw zZ*2OE8I#r6LmA5^*Rbm|dQ4u!-pF`lvL1&#qupdb4sCX*X_Ff`n3EY9PfdQq@{w7oF=g@(R%PB> z6Brp77&d^(1Cuq_EE&&DPGW1+_G(}`!1(|F|NjR-@(fM7V4AT(7_1Um*PF?F?D~uW zlkM0;8GlWl!miI~F!>03BjcLMZXEKAYLnAAwArERC(q!JXH=TJgTs{n0N6Z+1|zU} q2PXgF&}Q5*S%cG;amM5_&TvM7$>%to;rb-Fh*rvqRJX diff --git a/artifacts/mods/gl_npcarmor.ssl b/artifacts/mods/gl_npcarmor.ssl index 2543ea3b..f73298e5 100644 --- a/artifacts/mods/gl_npcarmor.ssl +++ b/artifacts/mods/gl_npcarmor.ssl @@ -1,14 +1,14 @@ -/* +/* NPC Armor Appearance mod - + Used to replace the scripted part of B-Team mod. Appropriate graphics are required for this mod to work. Can be adopted to any mod by adjusting armor PIDs, NPC PIDs and NPC FIDs in INI file. - + NOTE: this script requires compiler from sfall modderspack with -s option (short circuit evaluation) - + version 1.0 */ @@ -48,12 +48,12 @@ procedure invenwield_handler begin item := get_sfall_arg; slot := get_sfall_arg; isWorn := get_sfall_arg; - + if (critter and item and slot == INVEN_TYPE_WORN) then begin fid := check_armor_change(critter, item, isWorn); if (fid != -1) then begin art_change_fid_num(critter, fid); - end + end end end @@ -72,16 +72,16 @@ end procedure start begin variable sect, sects, armorTypes, armorType, npc, pid, pids, i; - if game_loaded then begin + if game_loaded and (sfall_ver_major >= 4) then begin register_hook_proc(HOOK_INVENWIELD, invenwield_handler); register_hook_proc(HOOK_ADJUSTFID, adjustfid_handler); - + defaultFids := get_ini_section(modIni, "Default"); fix_array(defaultFids); foreach (armorType: i in defaultFids) begin defaultFids[armorType] := atoi(i); end - + armorPidMap := create_array_map; armorTypes := get_ini_section(modIni, "ArmorTypes"); foreach (armorType: pids in armorTypes) begin @@ -90,9 +90,9 @@ procedure start begin armorPidMap[atoi(pid)] := armorType; end end - + npcMap := create_array_map; - + i := 1; sect := get_ini_section(modIni, ""+i); while (sect.PID) do begin @@ -101,14 +101,14 @@ procedure start begin foreach (armorType: pids in armorTypes) begin if (sect[armorType]) then begin npc[armorType] := atoi(sect[armorType]); - end + end end npcMap[atoi(sect.PID)] := npc; - + i += 1; sect := get_ini_section(modIni, ""+i); end end - + end diff --git a/artifacts/mods/gl_partycontrol.int b/artifacts/mods/gl_partycontrol.int index 1c4415f61cf1bb0a920e3b6c079beda95d469d43..6e70b76da6523a21c3a2ea1129c9baa99b745620 100644 GIT binary patch delta 83 zcmdnTbB$+1A*-@oV@iYc0Y(M})}9852K@%9CIJwSfu+H$K_A3o-8Q*~RiE+6A6p<$V@C delta 59 zcmcb{vyW#(AuG39V@iYm0Y(M})_Iesu= 4) then begin controlMode := GetConfig("CombatControl", "Mode", 0); if (controlMode > 2) then controlMode := 0; if (controlMode > 0) then begin pidList := GetConfigListInt("CombatControl", "PIDList"); fix_array(pidList); - + register_hook_proc(HOOK_COMBATTURN, combatturn_handler); end end diff --git a/artifacts/mods/readme.txt b/artifacts/mods/readme.txt index bcfa2240..ce09d696 100644 --- a/artifacts/mods/readme.txt +++ b/artifacts/mods/readme.txt @@ -1 +1,2 @@ -To install each mod, copy *.int file into your \data\scripts\ folder. \ No newline at end of file +To install each mod, copy *.int file into your \data\scripts\ folder. +For gl_npcarmor.int, you also need to copy npcarmor.ini to your Fallout directory. diff --git a/artifacts/scripting/hookscripts.txt b/artifacts/scripting/hookscripts.txt index 9131a020..f70144ca 100644 --- a/artifacts/scripting/hookscripts.txt +++ b/artifacts/scripting/hookscripts.txt @@ -19,9 +19,9 @@ procedure tohit_hook_handler begin end procedure start begin - if game_loaded then begin - register_hook_proc(HOOK_TOHIT, tohit_hook_handler); - end + if game_loaded then begin + register_hook_proc(HOOK_TOHIT, tohit_hook_handler); + end end @@ -427,7 +427,7 @@ HOOK_INVENWIELD (hs_invenwield.int) Runs before wielding or unwielding an armor or a weapon by a critter (except when using inventory by PC). An example usage would be to change critter art depending on armor being used or to dynamically customize weapon animations. -NOTE: when replacing a previously wielded armor or weapon, the unwielding hook will not be executed. +NOTE: when replacing a previously wielded armor or weapon, the unwielding hook will not be executed. If you need to rely on this, try checking if armor/weapon already equipped when wielding hook is executed. Critter arg1 - critter @@ -437,7 +437,6 @@ int arg4 - 1 when wielding, 0 when unwielding int ret1 - overrides hard-coded handler (-1 - use engine handler, any other value - override) - NOT RECOMMENDED - ------------------------------------------- HOOK_ADJUSTFID (hs_adjustfid.int) @@ -451,7 +450,6 @@ int arg1 - the vanilla fid calculated by the engine according to critter bas int ret1 - overrides the calculated FID with provided value - ------------------------------------------- HOOK_COMBATTURN (hs_combatturn.int) @@ -464,7 +462,6 @@ int arg3 - unknown boolean argument int ret1 - pass 1 at the start of turn to skip the turn, pass -1 at the end of turn to force end of combat - ------------------------------------------- HOOK_CARTRAVEL (hs_cartravel.int) @@ -476,5 +473,3 @@ int arg2 - vanilla fuel consumption (100 and below) int ret1 - car speed override (pass -1 if you just want to override fuel consumption) int ret2 - fuel consumption override - - diff --git a/sfall/version.h b/sfall/version.h index 1c81d685..d37f5f8d 100644 --- a/sfall/version.h +++ b/sfall/version.h @@ -28,9 +28,9 @@ #define VERSION_REV 0 #ifdef WIN2K -#define VERSION_STRING "4.0 win2k" +#define VERSION_STRING "4.0 beta1 win2k" #else -#define VERSION_STRING "4.0" +#define VERSION_STRING "4.0 beta1" #endif #define CHECK_VAL (4)