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.
This commit is contained in:
NovaRain
2017-05-23 22:28:42 +08:00
parent c2e6d743a3
commit 92b010f362
7 changed files with 32 additions and 36 deletions
Binary file not shown.
+14 -14
View File
@@ -1,14 +1,14 @@
/* /*
NPC Armor Appearance mod NPC Armor Appearance mod
Used to replace the scripted part of B-Team mod. Used to replace the scripted part of B-Team mod.
Appropriate graphics are required for this mod to work. 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. 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 NOTE: this script requires compiler from sfall modderspack with -s option
(short circuit evaluation) (short circuit evaluation)
version 1.0 version 1.0
*/ */
@@ -48,12 +48,12 @@ procedure invenwield_handler begin
item := get_sfall_arg; item := get_sfall_arg;
slot := get_sfall_arg; slot := get_sfall_arg;
isWorn := get_sfall_arg; isWorn := get_sfall_arg;
if (critter and item and slot == INVEN_TYPE_WORN) then begin if (critter and item and slot == INVEN_TYPE_WORN) then begin
fid := check_armor_change(critter, item, isWorn); fid := check_armor_change(critter, item, isWorn);
if (fid != -1) then begin if (fid != -1) then begin
art_change_fid_num(critter, fid); art_change_fid_num(critter, fid);
end end
end end
end end
@@ -72,16 +72,16 @@ end
procedure start begin procedure start begin
variable sect, sects, armorTypes, armorType, npc, pid, pids, i; 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_INVENWIELD, invenwield_handler);
register_hook_proc(HOOK_ADJUSTFID, adjustfid_handler); register_hook_proc(HOOK_ADJUSTFID, adjustfid_handler);
defaultFids := get_ini_section(modIni, "Default"); defaultFids := get_ini_section(modIni, "Default");
fix_array(defaultFids); fix_array(defaultFids);
foreach (armorType: i in defaultFids) begin foreach (armorType: i in defaultFids) begin
defaultFids[armorType] := atoi(i); defaultFids[armorType] := atoi(i);
end end
armorPidMap := create_array_map; armorPidMap := create_array_map;
armorTypes := get_ini_section(modIni, "ArmorTypes"); armorTypes := get_ini_section(modIni, "ArmorTypes");
foreach (armorType: pids in armorTypes) begin foreach (armorType: pids in armorTypes) begin
@@ -90,9 +90,9 @@ procedure start begin
armorPidMap[atoi(pid)] := armorType; armorPidMap[atoi(pid)] := armorType;
end end
end end
npcMap := create_array_map; npcMap := create_array_map;
i := 1; i := 1;
sect := get_ini_section(modIni, ""+i); sect := get_ini_section(modIni, ""+i);
while (sect.PID) do begin while (sect.PID) do begin
@@ -101,14 +101,14 @@ procedure start begin
foreach (armorType: pids in armorTypes) begin foreach (armorType: pids in armorTypes) begin
if (sect[armorType]) then begin if (sect[armorType]) then begin
npc[armorType] := atoi(sect[armorType]); npc[armorType] := atoi(sect[armorType]);
end end
end end
npcMap[atoi(sect.PID)] := npc; npcMap[atoi(sect.PID)] := npc;
i += 1; i += 1;
sect := get_ini_section(modIni, ""+i); sect := get_ini_section(modIni, ""+i);
end end
end end
end end
Binary file not shown.
+10 -10
View File
@@ -1,12 +1,12 @@
/* /*
NPC Combat Control NPC Combat Control
Allows to take control of your party member or other NPCs during combat Allows to take control of your party member or other NPCs during combat
NOTE: this script requires compiler from sfall modderspack with -s option NOTE: this script requires compiler from sfall modderspack with -s option
(short circuit evaluation) (short circuit evaluation)
version 1.0 version 1.0
*/ */
@@ -17,18 +17,18 @@ variable
configSection := "CombatControl", configSection := "CombatControl",
controlMode, controlMode,
pidList; pidList;
procedure combatturn_handler begin procedure combatturn_handler begin
variable variable
status := get_sfall_arg, status := get_sfall_arg,
critter := get_sfall_arg, critter := get_sfall_arg,
arg3 := get_sfall_arg, arg3 := get_sfall_arg,
pid; pid;
// display_msg("Combat Turn: " + status + ", by " + obj_name(critter) + ", arg3: " + arg3); // display_msg("Combat Turn: " + status + ", by " + obj_name(critter) + ", arg3: " + arg3);
pid := obj_pid(critter); pid := obj_pid(critter);
if (status == 1 if (status == 1
and (len_array(pidList) == 0 or scan_array(pidList, pid bwand 0xFFFFFF) != -1) and (len_array(pidList) == 0 or scan_array(pidList, pid bwand 0xFFFFFF) != -1)
and (controlMode == 1 or party_member_obj(pid))) then begin and (controlMode == 1 or party_member_obj(pid))) then begin
set_dude_obj(critter); set_dude_obj(critter);
@@ -38,13 +38,13 @@ procedure combatturn_handler begin
end end
procedure start begin procedure start begin
if game_loaded then begin if game_loaded and (sfall_ver_major >= 4) then begin
controlMode := GetConfig("CombatControl", "Mode", 0); controlMode := GetConfig("CombatControl", "Mode", 0);
if (controlMode > 2) then controlMode := 0; if (controlMode > 2) then controlMode := 0;
if (controlMode > 0) then begin if (controlMode > 0) then begin
pidList := GetConfigListInt("CombatControl", "PIDList"); pidList := GetConfigListInt("CombatControl", "PIDList");
fix_array(pidList); fix_array(pidList);
register_hook_proc(HOOK_COMBATTURN, combatturn_handler); register_hook_proc(HOOK_COMBATTURN, combatturn_handler);
end end
end end
+2 -1
View File
@@ -1 +1,2 @@
To install each mod, copy *.int file into your <Fallout Dir>\data\scripts\ folder. To install each mod, copy *.int file into your <Fallout Dir>\data\scripts\ folder.
For gl_npcarmor.int, you also need to copy npcarmor.ini to your Fallout directory.
+4 -9
View File
@@ -19,9 +19,9 @@ procedure tohit_hook_handler begin
end end
procedure start begin procedure start begin
if game_loaded then begin if game_loaded then begin
register_hook_proc(HOOK_TOHIT, tohit_hook_handler); register_hook_proc(HOOK_TOHIT, tohit_hook_handler);
end end
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). 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. 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. If you need to rely on this, try checking if armor/weapon already equipped when wielding hook is executed.
Critter arg1 - critter 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 int ret1 - overrides hard-coded handler (-1 - use engine handler, any other value - override) - NOT RECOMMENDED
------------------------------------------- -------------------------------------------
HOOK_ADJUSTFID (hs_adjustfid.int) 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 int ret1 - overrides the calculated FID with provided value
------------------------------------------- -------------------------------------------
HOOK_COMBATTURN (hs_combatturn.int) 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 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) 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 ret1 - car speed override (pass -1 if you just want to override fuel consumption)
int ret2 - fuel consumption override int ret2 - fuel consumption override
+2 -2
View File
@@ -28,9 +28,9 @@
#define VERSION_REV 0 #define VERSION_REV 0
#ifdef WIN2K #ifdef WIN2K
#define VERSION_STRING "4.0 win2k" #define VERSION_STRING "4.0 beta1 win2k"
#else #else
#define VERSION_STRING "4.0" #define VERSION_STRING "4.0 beta1"
#endif #endif
#define CHECK_VAL (4) #define CHECK_VAL (4)