From 52ce39c26484898a40be368e1ca0c001ea581e78 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Tue, 2 Feb 2021 20:34:12 +0800 Subject: [PATCH] Added NPC armor mod to the example mods --- .../example_mods/NPCArmor/gl_npcarmor.int | Bin 0 -> 5044 bytes .../example_mods/NPCArmor/gl_npcarmor.ssl | 222 ++++++++++++++++++ .../NPCArmor/npcarmor - vanilla.ini | 82 +++++++ artifacts/example_mods/NPCArmor/npcarmor.ini | 89 +++++++ artifacts/example_mods/NPCArmor/readme.txt | 14 ++ 5 files changed, 407 insertions(+) create mode 100644 artifacts/example_mods/NPCArmor/gl_npcarmor.int create mode 100644 artifacts/example_mods/NPCArmor/gl_npcarmor.ssl create mode 100644 artifacts/example_mods/NPCArmor/npcarmor - vanilla.ini create mode 100644 artifacts/example_mods/NPCArmor/npcarmor.ini create mode 100644 artifacts/example_mods/NPCArmor/readme.txt diff --git a/artifacts/example_mods/NPCArmor/gl_npcarmor.int b/artifacts/example_mods/NPCArmor/gl_npcarmor.int new file mode 100644 index 0000000000000000000000000000000000000000..d05c5e1d11a477a0646b09783335688dfba87e7b GIT binary patch literal 5044 zcmZo*I>5-lz#!DX3!<3=8dw?x8l)N&8l)N&8>AYP8l)PO8&n!p8`KyW7&sXi7}yw4 z0CNMBD*>gU6kNOnDgdQe^%xi!m>C!tx}XA3imeYSz5pr!r8x2!7#Kh<+yWJVQk);4 zj8jk=N^$>yGVVcXD8-uuWqgCuP>Qbr%J{(`poan&7#Ji<3sMqGQsWbga`TJg6AKDb zixTsaQyCZ-cv4c+5=(PR+%i*&85nrL3IZ}yd=m>87&!6@lEDlHuEd;@@YKYD{5%E* zzS6w#%+#C|7+)kgBQ-f2YIJf&VqQAPT&QR{SW`SqSg1HPu_!qsJ~5{x9wNoSAd;C^ zmYP=%GBQ3RF)t-2wFnfCi78p7#U*K(DF{I^u*#DBqRQO-vQ&gPTX9KZQ3=EU|Ns9p zFfckX2o$F!=H%$+=BE_vW#(lvFfcIHFfcH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V2~hn5lKB934XEV`EgzvO`Tv7l2^KeMa0IDj zfTm(zNIM5q6P7?z5-cwnHQ7Q{8bRWL*9)44F2TfMX$ZA^#2wPmkYs@8C1^><7l9h$ zAoKYmKqR~b0Hr)|KI6TDQl^1@2=*DYrNk$Klx{)k@&wczT=HmTDW4mWaRW=Q(3Tsh zO$G@kVnYMsE^3m(a~e}1EgpUzNGLQ3fX!!VFhddtw;W>u*rW0d0{(YkUDnS;GOXc9WGD+b|n|o6`V+}0GB8X3=E*w z1Ejsg4b3+&8E$yH0-9goEl*I6F$bFra;YAe1+xQIi$UGQ{{~XRGQdItCJzlc{xnFw zLXH833TO;4z{0vgs0mUsK>W)KbtyxG5H!?zAR>YZV7Kr>{mX;oUs$`B7bDbRG9bS| zLLJ(UVnC7sn+tA9H9`CfvjgTIsG9`tfc%S*YM7utVT77v2#QS?EzT?=yuEFPfl7IFZ^1GsF2~VO_2T-qz}sm= 4 or sfall_ver_build >= 29) then begin + armorTypes := get_ini_section(modIni, "ArmorTypes"); + armorPidMap := create_array_map; + foreach (armorType: pids in armorTypes) begin + pids := string_split(pids, ","); + foreach (pid in pids) begin + armorPidMap[atoi(pid)] := armorType; + end + end + + defaultFids := get_ini_section(modIni, "Default"); + fix_array(defaultFids); + foreach (armorType: i in defaultFids) begin + defaultFids[armorType] := atoi(i); + end + + npcMap := create_array_map; + + i := 1; + sect := get_ini_section(modIni, ""+i); + while (sect.PID) do begin + npc := create_array_map; + npc["WeaponAnims"] := sect["WeaponAnims"]; + npc["Default"] := atoi(sect["Default"]); + foreach (armorType: pids in armorTypes) begin + if (sect[armorType]) then begin + npc[armorType] := atoi(sect[armorType]); + end + end + npcMap[atoi(sect.PID)] := npc; + + i += 1; + sect := get_ini_section(modIni, ""+i); + end + + call update_armor_apperance; + + register_hook_proc(HOOK_INVENWIELD, invenwield_handler); + register_hook_proc(HOOK_ADJUSTFID, adjustfid_handler); + register_hook_proc(HOOK_INVENTORYMOVE, inventorymove_handler); + + debug_msg("NPC armor appearance mod: Done."); + end +end + +procedure update_armor_apperance begin + variable npc, arItem, fid; + foreach (npc in party_member_list_critters) begin + if (npc == dude_obj) then continue; + arItem := critter_inven_obj(npc, INVEN_TYPE_WORN); + if (arItem) then begin + fid := check_armor_change(npc, arItem, true); + if (fid == -1 or art_exists(fid) == false) then continue; + art_change_fid_num(npc, fid); + end + end +end diff --git a/artifacts/example_mods/NPCArmor/npcarmor - vanilla.ini b/artifacts/example_mods/NPCArmor/npcarmor - vanilla.ini new file mode 100644 index 00000000..188d171a --- /dev/null +++ b/artifacts/example_mods/NPCArmor/npcarmor - vanilla.ini @@ -0,0 +1,82 @@ +;NPC armor appearance configuration for vanilla Fallout 2. Does not require any new graphics +;Party members will use player's armor appearance just like old B-Team mod + +;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] +Jacket = 16777229 +Leather = 16777228 +Metal = 16777230 +Combat = 16777226 +Power = 16777217 +AdvPower = 16777287 +Robe = 16777218 + +; Sulik +[1] +PID=16777313 +WeaponAnims=1,3,4,6 +Default=16777280 + +; Vic +[2] +PID=16777278 +WeaponAnims=1,5,7 +Default=16777307 + +; Cassidy +[3] +PID=16777305 +WeaponAnims=4,5,7 +Default=16777260 +Leather=16777260 + +; Myron +[4] +PID=16777376 +WeaponAnims=1,5 +Default=16777304 + +; Lenny +[5] +PID=16777323 +WeaponAnims=1,5,6 +Default=16777295 + +; Davin +[6] +PID=16777379 +WeaponAnims=1,2,5 +Default=16777264 + +; Miria +[7] +PID=16777380 +WeaponAnims=1,6 +Default=16777252 +Jacket=16777222 +Leather=16777221 +Metal=16777223 +Combat=16777219 diff --git a/artifacts/example_mods/NPCArmor/npcarmor.ini b/artifacts/example_mods/NPCArmor/npcarmor.ini new file mode 100644 index 00000000..4b38cd15 --- /dev/null +++ b/artifacts/example_mods/NPCArmor/npcarmor.ini @@ -0,0 +1,89 @@ +;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,14 +Default=16777280 +Jacket=16777321 +Leather=16777325 +Metal=16777323 +Combat=16777322 +Power=16777324 + +; Vic +[2] +PID=16777278 +WeaponAnims=1,5,7,13,14 +Default=16777307 +Jacket=16777329 +Leather=16777333 +Metal=16777331 +Combat=16777330 +Power=16777332 + +; Cassidy +[3] +PID=16777305 +WeaponAnims=4,5,7,13 +Default=16777354 +Jacket=16777351 +Leather=16777260 +Metal=16777327 +Combat=16777326 +Power=16777328 + +; Myron +[4] +PID=16777376 +WeaponAnims=1,5,14 +Default=16777304 +Combat=16777350 +Power=16777349 + +; Cat Jules (RP) +[5] +PID=16777720 +WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 +Default=16777353 +Jacket=16777346 +Leather=16777347 +Metal=16777348 +Combat=16777226 + +; Kitsune (RP) +[6] +PID=16777718 +WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 +Default=16777222 +Jacket=16777222 +Leather=16777221 +Metal=16777223 +Combat=16777219 diff --git a/artifacts/example_mods/NPCArmor/readme.txt b/artifacts/example_mods/NPCArmor/readme.txt new file mode 100644 index 00000000..fdd0048d --- /dev/null +++ b/artifacts/example_mods/NPCArmor/readme.txt @@ -0,0 +1,14 @@ +NPC Armor Appearance mod +------------------------ + +This is the same mod as the one included in sfall 4.x modders pack. Used to replace the scripted part of B-Team mod. +Appropriate graphics are required for this mod to work, or you can set party members to use player's armor appearance instead. +Can be adopted to any mod by adjusting armor PIDs, allowed weapon anim codes, NPC PIDs and NPC FIDs in INI file. + + +Requires sfall 3.8.29 or higher + +To use, copy gl_npcarmor.int to your scripts folder, and copy npcarmor.ini to the same directory as sfall. + +The default npcarmor.ini is set up for Restoration Project 2.3.3. +Check the included "npcarmor - vanilla.ini" for an example that does not require any new graphics.