mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5786cfb267 | ||
|
|
78dfb530a9 | ||
|
|
d588f2e691 | ||
|
|
daf7a82997 | ||
|
|
9ad2b19e1a | ||
|
|
4b66dd3682 | ||
|
|
4899aeece1 | ||
|
|
946266e367 | ||
|
|
438ea071fc | ||
|
|
89760235c7 | ||
|
|
321f1c6034 | ||
|
|
513338f160 | ||
|
|
08b92542f4 | ||
|
|
46013c94b0 | ||
|
|
7a4ab59089 | ||
|
|
e505e204cb | ||
|
|
7343754d53 | ||
|
|
ae1e17d359 | ||
|
|
32dbe5581d | ||
|
|
a93ad5a9ba | ||
|
|
874b047ce1 | ||
|
|
afa590c5a8 | ||
|
|
b89c52fcec | ||
|
|
ec2d323f75 | ||
|
|
586679b07f |
@@ -46,8 +46,6 @@ nb-configuration.xml
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
*.VC.db
|
||||
*.VC.opendb
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
@@ -11,4 +11,4 @@ SaveSfallDataFail=ERROR saving extended savegame information! Check if other pro
|
||||
[AppearanceMod]
|
||||
RaceText=Race
|
||||
StyleText=Style
|
||||
MainButtonText=Appearance
|
||||
MainButtonText=Appearance
|
||||
@@ -1,73 +0,0 @@
|
||||
|
||||
; 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
|
||||
Default=16777280
|
||||
Leather=16777325
|
||||
Power=16777324
|
||||
Metal=16777323
|
||||
Jacket=16777321
|
||||
Combat=16777322
|
||||
|
||||
; Vic
|
||||
[2]
|
||||
PID=16777278
|
||||
Default=16777307
|
||||
Jacket=16777329
|
||||
Combat=16777330
|
||||
Metal=16777331
|
||||
Power=16777332
|
||||
Leather=16777333
|
||||
|
||||
; Cassidy
|
||||
[3]
|
||||
PID=16777305
|
||||
Default=16777354
|
||||
Leather=16777260
|
||||
Power=16777328
|
||||
Metal=16777327
|
||||
Jacket=16777351
|
||||
Combat=16777326
|
||||
|
||||
; Myron
|
||||
[4]
|
||||
PID=16777376
|
||||
Default=16777304
|
||||
Leather=
|
||||
Power=16777349
|
||||
Combat=16777350
|
||||
|
||||
; Cat Jules
|
||||
[5]
|
||||
PID=16777734
|
||||
Default=16777353
|
||||
Leather=16777347
|
||||
Metal=16777348
|
||||
Jacket=16777346
|
||||
Combat=16777226
|
||||
|
||||
; Kitsune
|
||||
[6]
|
||||
PID=16777724
|
||||
Default=16777222
|
||||
Leather=16777221
|
||||
Metal=16777223
|
||||
Jacket=16777222
|
||||
Combat=16777219
|
||||
@@ -1,40 +0,0 @@
|
||||
[Highlighting]
|
||||
|
||||
; DX scandode 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 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
|
||||
+28
-8
@@ -1,5 +1,5 @@
|
||||
;sfall configuration settings
|
||||
;v4.0
|
||||
;v3.8.6
|
||||
|
||||
[Main]
|
||||
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
|
||||
@@ -127,6 +127,22 @@ SpeedKey9=0x00
|
||||
;Set to -1 for either ctrl key, -2 for either alt key or -3 for either shift key
|
||||
WindowScrollKey=0
|
||||
|
||||
;A key to press to toggle the highlighting of all items on the ground on the current map
|
||||
ToggleItemHighlightsKey=42
|
||||
|
||||
;Set to 1 to also highlight containers
|
||||
HighlightContainers=0
|
||||
|
||||
;Set the color of outlines, available colors:
|
||||
;0x01 - glowing red
|
||||
;0x02 - red
|
||||
;0x04 - grey
|
||||
;0x08 - glowing green
|
||||
;0x10 - bright yellow
|
||||
;0x20 - dark yellow
|
||||
;0x40 - purple
|
||||
OutlineColor=0x10
|
||||
|
||||
;A key to press to reload your currently equipped weapon
|
||||
ReloadWeaponKey=0
|
||||
|
||||
@@ -367,6 +383,7 @@ UseScrollingQuestsList=1
|
||||
|
||||
;Use this line to modify the list of cities and their associated global variables used for city reputations
|
||||
;Syntax is 'city id : global id', with each city/global pair separated by a comma.
|
||||
;CityRepsCount=19
|
||||
;CityRepsList=0:47,2:48,1:49,4:50,5:51,3:52,8:53,6:54,7:55,13:56,10:57,11:59,14:61,17:63,19:64,18:65,25:66,9:294,20:308
|
||||
|
||||
;Set this to a valid path to save a copy of the console contents
|
||||
@@ -381,6 +398,7 @@ SpeedInterfaceCounterAnims=0
|
||||
|
||||
;These lines allow you to control the karma frm's displayed on the character screen
|
||||
;Number of KarmaPoints should be 1 less than number of KarmaFRMs
|
||||
;KarmaFRMsCount=3
|
||||
;KarmaFRMs=47,48,49
|
||||
;KarmaPoints=-100,100
|
||||
|
||||
@@ -441,6 +459,7 @@ 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
|
||||
;2 - Motion sensor doesn't require charges
|
||||
;4 - Motion sensor is required to use the item highlight feature
|
||||
MotionScannerFlags=1
|
||||
|
||||
;Set to non-0 to adjust the maximum encounter table size
|
||||
@@ -513,6 +532,14 @@ DialogPanelAnimDelay=33
|
||||
;Controls the speed of pipboy alarm clock animations (lower - faster; valid range: 0..127)
|
||||
PipboyTimeAnimDelay=50
|
||||
|
||||
;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 ControlCombatPIDList line and set a comma delimited list of PIDs
|
||||
ControlCombat=0
|
||||
;ControlCombatPIDList=62,89,97,107,160,161
|
||||
|
||||
;Set to 1 to stack empty identical weapons, no matter what type of ammo was loaded before
|
||||
StackEmptyWeapons=0
|
||||
|
||||
@@ -551,13 +578,6 @@ NumbersInDialogue=0
|
||||
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
|
||||
CreditsAtBottom=0
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Scripts]
|
||||
;Comma-separated list of masked paths to load global scripts from
|
||||
;Only use single slash \ as directory separator
|
||||
;Paths outside of scripts folder are supported
|
||||
GlobalScriptPaths=scripts\gl*.int,scripts\sfall\gl*.int
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Debugging]
|
||||
;Extra sfall configuration settings that can be used by modders
|
||||
|
||||
Binary file not shown.
@@ -1,114 +0,0 @@
|
||||
/**
|
||||
|
||||
Item Highlight mod.
|
||||
|
||||
Previously was part of sfall itself, now a separate mod.
|
||||
Features:
|
||||
- highlighting items, containers (optional) and dead bodies (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)
|
||||
|
||||
NOTE: this script requires compiler from sfall modderspack with -s option
|
||||
(short circuit evaluation)
|
||||
|
||||
version 1.0
|
||||
|
||||
**/
|
||||
|
||||
#include "main.h"
|
||||
//#include "..\..\..\!SRC\headers\define.h"
|
||||
|
||||
#define CRITTER_IS_DEAD (1)
|
||||
#define PID_MOTION_SENSOR (59)
|
||||
#define NO_HIGHLIGHT(obj) (get_flags(obj) bwand FLAG_NOHIGHLIGHT)
|
||||
|
||||
variable configSection := "Highlighting";
|
||||
variable highlightKey;
|
||||
variable alsoContainer;
|
||||
variable alsoCorpse;
|
||||
variable checkLOS;
|
||||
variable outlineColor;
|
||||
variable motionScanner;
|
||||
variable highlightFailMsg1;
|
||||
variable highlightFailMsg2;
|
||||
|
||||
procedure ToggleHighlightObject(variable obj, variable enable) begin
|
||||
if obj and (not enable or not checkLOS or not obj_blocking_line(dude_obj, tile_num(obj), BLOCKING_TYPE_SHOOT)) then begin
|
||||
if (alsoContainer and obj_item_subtype(obj) == item_type_container) or (not NO_HIGHLIGHT(obj)) then begin
|
||||
if (enable) then set_outline(obj, outlineColor);
|
||||
else set_outline(obj, 0);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
procedure ToggleHighlight(variable enable) begin
|
||||
variable obj;
|
||||
foreach obj in list_as_array(LIST_GROUNDITEMS) begin
|
||||
if obj != outlined_object then begin
|
||||
call ToggleHighlightObject(obj, enable);
|
||||
end
|
||||
end
|
||||
if (alsoCorpse) then begin
|
||||
foreach obj in list_as_array(LIST_CRITTERS) begin
|
||||
if critter_state(obj) == CRITTER_IS_DEAD then begin
|
||||
call ToggleHighlightObject(obj, enable);
|
||||
end
|
||||
end
|
||||
end
|
||||
tile_refresh_display;
|
||||
end
|
||||
|
||||
procedure KeyPressHandler begin
|
||||
variable pressed := get_sfall_arg,
|
||||
scanCode := get_sfall_arg,
|
||||
scanner, charges;
|
||||
|
||||
if scanCode == highlightKey then begin
|
||||
if pressed then begin
|
||||
if motionScanner then begin
|
||||
scanner := obj_carrying_pid_obj(dude_obj, PID_MOTION_SENSOR);
|
||||
if scanner then begin
|
||||
if motionScanner >= 2 then begin
|
||||
charges := get_weapon_ammo_count(scanner);
|
||||
if charges > 0 then begin
|
||||
set_weapon_ammo_count(scanner, charges - 1);
|
||||
intface_redraw;
|
||||
call ToggleHighlight(true);
|
||||
end else begin
|
||||
display_msg(highlightFailMsg2);
|
||||
end
|
||||
end else begin
|
||||
call ToggleHighlight(true);
|
||||
end
|
||||
end else begin
|
||||
display_msg(highlightFailMsg1);
|
||||
end
|
||||
end else begin
|
||||
call ToggleHighlight(true);
|
||||
end
|
||||
end else begin
|
||||
call ToggleHighlight(false);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
procedure start begin
|
||||
if game_loaded and (sfall_ver_major >= 4) then begin
|
||||
call InitConfigs;
|
||||
|
||||
highlightKey := GetConfig(configSection, "Key", 0);
|
||||
alsoContainer := GetConfig(configSection, "Containers", 0);
|
||||
alsoCorpse := GetConfig(configSection, "Corpses", 0);
|
||||
checkLOS := GetConfig(configSection, "CheckLOS", 0);
|
||||
outlineColor := GetConfig(configSection, "OutlineColor", 16);
|
||||
if (outlineColor < 1) then outlineColor := 64;
|
||||
motionScanner := GetConfig(configSection, "MotionScanner", 0);
|
||||
|
||||
highlightFailMsg1 := Translate("HighlightFail1", "You aren't carrying a motion sensor.");
|
||||
highlightFailMsg2 := Translate("HighlightFail2", "Your motion sensor is out of charge.");
|
||||
|
||||
register_hook_proc(HOOK_KEYPRESS, KeyPressHandler);
|
||||
end
|
||||
end
|
||||
Binary file not shown.
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
|
||||
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
|
||||
|
||||
*/
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#define IS_ARMOR(item) (obj_type(item) == OBJ_TYPE_ITEM and obj_item_subtype(item) == item_type_armor)
|
||||
|
||||
variable
|
||||
modIni := "npcarmor.ini",
|
||||
defaultFids,
|
||||
armorPidMap, // maps armor PID to it's "type" - leather armor, metal, power armor, etc.
|
||||
npcMap;
|
||||
|
||||
procedure check_armor_change(variable critter, variable item, variable isWorn) begin
|
||||
variable npc, armorType, fid;
|
||||
if (npcMap[obj_pid(critter)]) then begin
|
||||
npc := npcMap[obj_pid(critter)];
|
||||
if (not isWorn) then begin
|
||||
// display_msg("No armor fid: " + npc["Default"]);
|
||||
return npc["Default"];
|
||||
end else if (item) then begin
|
||||
armorType := armorPidMap[obj_pid(item)];
|
||||
fid := npc[armorType] or defaultFids[armorType];
|
||||
if (fid == 0 or fid == -1) then fid := npc["Default"];
|
||||
// display_msg("Change fid: " + fid + ", npc: " + npc[armorType] + ", default:" + defaultFids[armorType]);
|
||||
return fid;
|
||||
end
|
||||
end
|
||||
return -1;
|
||||
end
|
||||
|
||||
// for NPCs when they change armor themselves
|
||||
procedure invenwield_handler begin
|
||||
variable critter, item, fid, slot, isWorn;
|
||||
critter := get_sfall_arg;
|
||||
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
|
||||
|
||||
// when changing armor from inventory while controlling other NPCs
|
||||
procedure adjustfid_handler begin
|
||||
variable fid, armor;
|
||||
if (dude_obj != real_dude_obj) then begin
|
||||
armor := critter_inven_obj(dude_obj, INVEN_TYPE_WORN);
|
||||
fid := check_armor_change(dude_obj, armor, armor != 0);
|
||||
if (fid != -1) then begin
|
||||
set_sfall_return(fid);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
procedure start begin
|
||||
variable sect, sects, armorTypes, armorType, npc, pid, pids, i;
|
||||
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
|
||||
pids := string_split(pids, ",");
|
||||
foreach (pid in pids) begin
|
||||
armorPidMap[atoi(pid)] := armorType;
|
||||
end
|
||||
end
|
||||
|
||||
npcMap := create_array_map;
|
||||
|
||||
i := 1;
|
||||
sect := get_ini_section(modIni, ""+i);
|
||||
while (sect.PID) do begin
|
||||
npc := create_array_map;
|
||||
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
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Binary file not shown.
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
|
||||
NPC Combat Control
|
||||
|
||||
Allows to take control of your party member or other NPCs during combat
|
||||
|
||||
NOTE: this script requires compiler from sfall modderspack with -s option
|
||||
(short circuit evaluation)
|
||||
|
||||
version 1.0
|
||||
|
||||
*/
|
||||
|
||||
#include "..\headers\define.h"
|
||||
#include "main.h"
|
||||
|
||||
variable
|
||||
configSection := "CombatControl",
|
||||
controlMode,
|
||||
pidList,
|
||||
hasGeckoSkinning := false;
|
||||
|
||||
|
||||
procedure combatturn_handler begin
|
||||
variable
|
||||
status := get_sfall_arg,
|
||||
critter := get_sfall_arg,
|
||||
arg3 := get_sfall_arg,
|
||||
pid;
|
||||
|
||||
// display_msg("Combat Turn: " + status + ", by " + obj_name(critter) + ", arg3: " + arg3);
|
||||
pid := obj_pid(critter);
|
||||
if (status == 1
|
||||
and (len_array(pidList) == 0 or scan_array(pidList, pid bwand 0xFFFFFF) != -1)
|
||||
and (controlMode == 1 or party_member_obj(pid))) then begin
|
||||
set_dude_obj(critter);
|
||||
if hasGeckoSkinning then critter_add_trait(critter, TRAIT_PERK, PERK_gecko_skinning_perk, 1);
|
||||
end else begin
|
||||
set_dude_obj(real_dude_obj);
|
||||
end
|
||||
end
|
||||
|
||||
procedure start begin
|
||||
if game_loaded and (sfall_ver_major >= 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);
|
||||
if has_trait(TRAIT_PERK, dude_obj, PERK_gecko_skinning_perk) then hasGeckoSkinning := true;
|
||||
|
||||
register_hook_proc(HOOK_COMBATTURN, combatturn_handler);
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,57 +0,0 @@
|
||||
|
||||
#include "..\scripting\headers\sfall.h"
|
||||
#include "..\scripting\headers\define_lite.h"
|
||||
#include "..\scripting\headers\define_extra.h"
|
||||
|
||||
#include "..\scripting\headers\lib.arrays.h"
|
||||
#include "..\scripting\headers\lib.strings.h"
|
||||
// #include "..\scripting\headers\lib.inven.h"
|
||||
|
||||
variable ini := "sfall-mods.ini";
|
||||
variable translationIni;
|
||||
|
||||
// Gets the integer value from ddraw.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 ddraw.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 ddraw.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 [];
|
||||
|
||||
return string_split(val, ",");
|
||||
end
|
||||
|
||||
// Gets the value from ddraw.ini as a temp array of ints
|
||||
procedure GetConfigListInt(variable section, variable key) begin
|
||||
variable arr, i, item;
|
||||
|
||||
arr := GetConfigList(section, key);
|
||||
for (i := 0; i < len_array(arr); i++) begin
|
||||
arr[i] := atoi(arr[i]);
|
||||
end
|
||||
return arr;
|
||||
end
|
||||
|
||||
// Translates given string using Translations.ini
|
||||
procedure Translate(variable id, variable def) begin
|
||||
variable str := get_ini_string(translationIni + "|Sfall|" + id);
|
||||
if not str or (strlen(str) == 0) then begin
|
||||
str := def;
|
||||
end
|
||||
return str;
|
||||
end
|
||||
|
||||
procedure InitConfigs begin
|
||||
translationIni := GetConfigStr("Main", "TranslationsINI", "./Translations.ini");
|
||||
end
|
||||
@@ -1,2 +0,0 @@
|
||||
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.
|
||||
@@ -39,32 +39,6 @@
|
||||
#define ATKMODE_SEC_BURST 112 // 0x00000070
|
||||
#define ATKMODE_SEC_FLAME 128 // 0x00000080
|
||||
|
||||
/* Object flags for get/set_flags */
|
||||
#define FLAG_MOUSE_3D (0x1)
|
||||
#define FLAG_WALKTHRU (0x4)
|
||||
#define FLAG_FLAT (0x8)
|
||||
#define FLAG_NOBLOCK (0x10)
|
||||
#define FLAG_LIGHTING (0x20)
|
||||
#define FLAG_TEMP (0x400)
|
||||
#define FLAG_MULTIHEX (0x800)
|
||||
#define FLAG_NOHIGHLIGHT (0x1000)
|
||||
#define FLAG_USED (0x2000)
|
||||
#define FLAG_TRANSRED (0x4000)
|
||||
#define FLAG_TRANSNONE (0x8000)
|
||||
#define FLAG_TRANSWALL (0x10000)
|
||||
#define FLAG_TRANSGLASS (0x20000)
|
||||
#define FLAG_TRANSSTEAM (0x40000)
|
||||
#define FLAG_TRANSENERGY (0x80000)
|
||||
#define FLAG_LEFT_HAND (0x1000000)
|
||||
#define FLAG_RIGHT_HAND (0x2000000)
|
||||
#define FLAG_WORN (0x4000000)
|
||||
#define FLAG_HIDDENITEM (0x8000000)
|
||||
#define FLAG_WALLTRANSEND (0x10000000)
|
||||
#define FLAG_LIGHTTHRU (0x20000000)
|
||||
#define FLAG_SEEN (0x40000000)
|
||||
#define FLAG_SHOOTTHRU (0x80000000)
|
||||
|
||||
|
||||
/* Critter Flags */
|
||||
#define CFLG_BARTER 2 // 0x00000002 - Barter (can trade with)
|
||||
#define CFLG_NOSTEAL 32 // 0x00000020 - Steal (cannot steal from)
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
//Recognised modes for set_shader_mode and get_game_mode
|
||||
#define WORLDMAP (0x1)
|
||||
#define LOCALMAP (0x2) //No point hooking this: would always be 1 at any point at which scripts are running
|
||||
#define DIALOG (0x4)
|
||||
#define ESCMENU (0x8)
|
||||
#define SAVEGAME (0x10)
|
||||
#define LOADGAME (0x20)
|
||||
#define COMBAT (0x40)
|
||||
#define OPTIONS (0x80)
|
||||
#define HELP (0x100)
|
||||
#define CHARSCREEN (0x200)
|
||||
#define PIPBOY (0x400)
|
||||
#define PCOMBAT (0x800)
|
||||
#define INVENTORY (0x1000)
|
||||
#define AUTOMAP (0x2000)
|
||||
#define SKILLDEX (0x4000)
|
||||
#define INTFACEUSE (0x8000)
|
||||
#define INTFACELOOT (0x10000)
|
||||
#define BARTER (0x20000)
|
||||
#define HEROWIN (0x40000)
|
||||
#define WORLDMAP (0x1)
|
||||
#define LOCALMAP (0x2) //No point hooking this: would always be 1 at any point at which scripts are running
|
||||
#define DIALOG (0x4)
|
||||
#define ESCMENU (0x8)
|
||||
#define SAVEGAME (0x10)
|
||||
#define LOADGAME (0x20)
|
||||
#define COMBAT (0x40)
|
||||
#define OPTIONS (0x80)
|
||||
#define HELP (0x100)
|
||||
#define CHARSCREEN (0x200)
|
||||
#define PIPBOY (0x400)
|
||||
#define PCOMBAT (0x800)
|
||||
#define INVENTORY (0x1000)
|
||||
#define AUTOMAP (0x2000)
|
||||
#define SKILLDEX (0x4000)
|
||||
|
||||
//Valid arguments to register_hook
|
||||
#define HOOK_TOHIT (0)
|
||||
@@ -46,9 +42,6 @@
|
||||
#define HOOK_WITHINPERCEPTION (23)
|
||||
#define HOOK_INVENTORYMOVE (24)
|
||||
#define HOOK_INVENWIELD (25)
|
||||
#define HOOK_ADJUSTFID (26)
|
||||
#define HOOK_COMBATTURN (27)
|
||||
#define HOOK_CARTRAVEL (28)
|
||||
|
||||
//Valid arguments to list_begin
|
||||
#define LIST_CRITTERS (0)
|
||||
@@ -165,19 +158,6 @@
|
||||
#define GAME_MSG_PRO_TILE (0x1004)
|
||||
#define GAME_MSG_PRO_MISC (0x1005)
|
||||
|
||||
#define OUTLINE_NONE (0)
|
||||
#define OUTLINE_RED_GLOW (0x01)
|
||||
#define OUTLINE_RED (0x02)
|
||||
#define OUTLINE_GREY (0x04)
|
||||
#define OUTLINE_GREEN_GLOW (0x08)
|
||||
#define OUTLINE_YELLOW (0x10)
|
||||
#define OUTLINE_DARK_YELLOW (0x20)
|
||||
#define OUTLINE_PURPLE (0x40)
|
||||
|
||||
#define CURSOR_MOVEMENT (0)
|
||||
#define CURSOR_COMMAND (1)
|
||||
#define CURSOR_TARGETING (2)
|
||||
|
||||
#define mstr_combat(x) (message_str_game(GAME_MSG_COMBAT, x))
|
||||
#define mstr_ai(x) (message_str_game(GAME_MSG_AI, x))
|
||||
#define mstr_scrname(x) (message_str_game(GAME_MSG_SCRNAME, x))
|
||||
@@ -209,25 +189,10 @@
|
||||
#define party_member_list_all party_member_list(1)
|
||||
|
||||
|
||||
#define car_gas_amount sfall_func0("car_gas_amount")
|
||||
#define critter_inven_obj2(obj, type) sfall_func2("critter_inven_obj2", obj, type)
|
||||
#define exec_map_update_scripts sfall_func0("exec_map_update_scripts")
|
||||
#define get_cursor_mode sfall_func0("get_cursor_mode")
|
||||
#define get_flags(obj) sfall_func1("get_flags", obj)
|
||||
#define get_ini_section(file, sect) sfall_func2("get_ini_section", file, sect)
|
||||
#define get_ini_sections(file) sfall_func1("get_ini_sections", file)
|
||||
#define get_outline(obj) sfall_func1("get_outline", obj)
|
||||
#define intface_hide sfall_func0("intface_hide")
|
||||
#define intface_is_hidden sfall_func0("intface_is_hidden")
|
||||
#define intface_redraw sfall_func0("intface_redraw")
|
||||
#define intface_show sfall_func0("intface_show")
|
||||
#define item_weight(obj) sfall_func1("item_weight", obj)
|
||||
#define outlined_object sfall_func0("outlined_object")
|
||||
#define real_dude_obj sfall_func0("real_dude_obj")
|
||||
#define set_car_intface_art(artIndex) sfall_func1("set_car_intface_art", artIndex)
|
||||
#define set_cursor_mode(mode) sfall_func1("set_cursor_mode", mode)
|
||||
#define set_dude_obj(critter) sfall_func1("set_dude_obj", critter)
|
||||
#define set_flags(obj, flags) sfall_func2("set_flags", obj, flags)
|
||||
#define set_outline(obj, color) sfall_func2("set_outline", obj, color)
|
||||
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
|
||||
#define tile_refresh_display sfall_func0("tile_refresh_display")
|
||||
|
||||
@@ -437,40 +437,3 @@ int arg3 - slot (INVEN_TYPE_*)
|
||||
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)
|
||||
|
||||
Runs after calculating character figure FID on the inventory screen, whenever the game decides that character appearance might change.
|
||||
Also happens on other screens, like barter.
|
||||
|
||||
NOTE: FID has following format: 0x0ABBCDDD, where A is object type, BB - animation code (always 0 in this case), C - weapon code, DDD - FRM index in LST file.
|
||||
|
||||
int arg1 - the vanilla fid calculated by the engine according to critter base FID and armor/weapon being used
|
||||
|
||||
int ret1 - overrides the calculated FID with provided value
|
||||
|
||||
-------------------------------------------
|
||||
|
||||
HOOK_COMBATTURN (hs_combatturn.int)
|
||||
|
||||
Runs before and after each turn in combat (for both PC and NPC).
|
||||
|
||||
int arg1 - event type: 1 - start of turn, 0 - normal end of turn, -1 - combat ended abruptly (by script or by pressing Enter during PC turn)
|
||||
int arg2 - critter doing the turn
|
||||
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)
|
||||
|
||||
Runs continously during worldmap travel on car.
|
||||
|
||||
int arg1 - vanilla car speed (between 3 and 8 "steps")
|
||||
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
|
||||
|
||||
@@ -372,59 +372,6 @@ Some utility/math functions are available:
|
||||
> void sfall_func0("exec_map_update_scripts")
|
||||
- executes map_update_p_proc for all objects on map and global/hook scripts as well
|
||||
|
||||
> int sfall_func1("item_weight", object)
|
||||
- gets the current weight of an object
|
||||
|
||||
> int sfall_func1("get_outline", object)
|
||||
- gets the current outline color for an object
|
||||
|
||||
> void sfall_func2("set_outline", object, int color)
|
||||
- sets the outline color of an object
|
||||
- 0 means or any value above 0x00FFFFFF disables the outline
|
||||
- call "tile_refresh_display" after changing outline of objects to properly redraw the scene
|
||||
|
||||
> int sfall_func1("get_flags", object)
|
||||
- gets the current value of object flags (see define_extra.h for available flags)
|
||||
|
||||
> void sfall_func2("set_flags", object, int flags)
|
||||
- sets the current flags of an object
|
||||
- all flags are rewritten with given integer, so first get current flags with "get_flags" and use bwor/bwand to set/remove specific flag
|
||||
|
||||
> void sfall_func0("tile_refresh_display")
|
||||
- redraws the game scene (tiles, walls, objects, etc.)
|
||||
|
||||
> object sfall_func0("outlined_object")
|
||||
- returns an object that is currently highlighted by hovering the mouse above it
|
||||
|
||||
> object sfall_func1("set_dude_obj", critter)
|
||||
- take control of a given critter
|
||||
- passing 0 will reset control back to "real" dude
|
||||
|
||||
> void sfall_func0("real_dude_obj")
|
||||
- returns the initial dude_obj after set_dude_obj was used
|
||||
|
||||
> array sfall_func1("get_ini_sections", string fileName)
|
||||
- returns an array of names of all sections in a given INI file
|
||||
|
||||
> array sfall_func2("get_ini_section", string fileName, string section)
|
||||
- returns an associative array of keys and values for a given INI file and section
|
||||
|
||||
> int sfall_func0("car_gas_amount")
|
||||
- returns current amount of fuel in player's car (between 0 and 80000)
|
||||
- to change fuel amount, use vanilla function: metarule(METARULE_GIVE_CAR_GAS, amount) - amount can be positive or negative
|
||||
|
||||
> void sfall_func1("set_car_intface_art", int artIndex)
|
||||
- changes the interface art (index in LST file) for the car image on worldmap screen
|
||||
- should be called before going to worldmap
|
||||
- vanilla art index is 0x1B1
|
||||
|
||||
> int sfall_func0("get_cursor_mode")
|
||||
- returns the current cursor mode (0 - movement cursor, 1 - command cursor, 2 - targeting cursor)
|
||||
- mode 4 to 10 are Skilldex skills (yellow targeting cursor)
|
||||
|
||||
> void sfall_func1("set_cursor_mode", int mode)
|
||||
- sets the current cursor mode
|
||||
|
||||
------------------------
|
||||
------ MORE INFO -------
|
||||
------------------------
|
||||
|
||||
@@ -16,24 +16,17 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "..\main.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "AI.h"
|
||||
#include "..\FalloutEngine\Fallout2.h"
|
||||
#include "..\SafeWrite.h"
|
||||
#include "FalloutEngine.h"
|
||||
#include "SafeWrite.h"
|
||||
|
||||
namespace sfall
|
||||
{
|
||||
#include <hash_map>
|
||||
|
||||
typedef std::unordered_map<DWORD, DWORD> :: const_iterator iter;
|
||||
typedef stdext::hash_map<DWORD, DWORD> :: const_iterator iter;
|
||||
|
||||
static std::unordered_map<DWORD,DWORD> targets;
|
||||
static std::unordered_map<DWORD,DWORD> sources;
|
||||
|
||||
static DWORD combatDisabled;
|
||||
static std::string combatBlockedMessage;
|
||||
static stdext::hash_map<DWORD,DWORD> targets;
|
||||
static stdext::hash_map<DWORD,DWORD> sources;
|
||||
|
||||
DWORD _stdcall AIGetLastAttacker(DWORD target) {
|
||||
iter itr=sources.find(target);
|
||||
@@ -59,19 +52,22 @@ static void __declspec(naked) combat_attack_hook() {
|
||||
push eax;
|
||||
call CombatAttackHook;
|
||||
popad;
|
||||
jmp fo::funcoffs::combat_attack_;
|
||||
jmp combat_attack_;
|
||||
}
|
||||
}
|
||||
|
||||
static DWORD CombatDisabled;
|
||||
static char CombatBlockedMessage[128];
|
||||
|
||||
static void _stdcall CombatBlocked() {
|
||||
fo::func::display_print(combatBlockedMessage.c_str());
|
||||
DisplayConsoleMessage(CombatBlockedMessage);
|
||||
}
|
||||
|
||||
static const DWORD BlockCombatHook1Ret1=0x45F6B4;
|
||||
static const DWORD BlockCombatHook1Ret2=0x45F6D7;
|
||||
static void __declspec(naked) BlockCombatHook1() {
|
||||
__asm {
|
||||
mov eax, combatDisabled;
|
||||
mov eax, CombatDisabled;
|
||||
test eax, eax;
|
||||
jz end;
|
||||
call CombatBlocked;
|
||||
@@ -84,10 +80,10 @@ end:
|
||||
|
||||
static void __declspec(naked) BlockCombatHook2() {
|
||||
__asm {
|
||||
mov eax, dword ptr ds:[FO_VAR_intfaceEnabled];
|
||||
mov eax, dword ptr ds:[_intfaceEnabled];
|
||||
test eax, eax;
|
||||
jz end;
|
||||
mov eax, combatDisabled;
|
||||
mov eax, CombatDisabled;
|
||||
test eax, eax;
|
||||
jz succeed;
|
||||
pushad;
|
||||
@@ -103,17 +99,18 @@ end:
|
||||
}
|
||||
|
||||
void _stdcall AIBlockCombat(DWORD i) {
|
||||
combatDisabled = i ? 1 : 0;
|
||||
if(i) CombatDisabled=1;
|
||||
else CombatDisabled=0;
|
||||
}
|
||||
|
||||
void AI::init() {
|
||||
void AIInit() {
|
||||
//HookCall(0x42AE1D, ai_attack_hook);
|
||||
//HookCall(0x42AE5C, ai_attack_hook);
|
||||
HookCall(0x426A95, combat_attack_hook);
|
||||
HookCall(0x42A796, combat_attack_hook);
|
||||
MakeJump(0x45F6AF, BlockCombatHook1);
|
||||
HookCall(0x4432A6, BlockCombatHook2);
|
||||
combatBlockedMessage = Translate("sfall", "BlockedCombat", "You cannot enter combat at this time.");
|
||||
GetPrivateProfileString("sfall", "BlockedCombat", "You cannot enter combat at this time.", CombatBlockedMessage, 128, translationIni);
|
||||
}
|
||||
|
||||
void _stdcall AICombatStart() {
|
||||
@@ -125,5 +122,3 @@ void _stdcall AICombatEnd() {
|
||||
targets.clear();
|
||||
sources.clear();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,18 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Module.h"
|
||||
|
||||
namespace sfall
|
||||
{
|
||||
|
||||
class AI : public Module {
|
||||
public:
|
||||
const char* name() { return "AI"; }
|
||||
void init();
|
||||
};
|
||||
|
||||
// TODO: use subscription instead
|
||||
void AIInit();
|
||||
void _stdcall AICombatStart();
|
||||
void _stdcall AICombatEnd();
|
||||
|
||||
@@ -35,5 +24,3 @@ DWORD _stdcall AIGetLastAttacker(DWORD target);
|
||||
DWORD _stdcall AIGetLastTarget(DWORD source);
|
||||
|
||||
void _stdcall AIBlockCombat(DWORD i);
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user