mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35d9b9439c | ||
|
|
a1968f7f86 | ||
|
|
85a5ee2a52 | ||
|
|
310c392759 | ||
|
|
3a24d0bdfd | ||
|
|
a9ad1a62eb | ||
|
|
d73859fa5f | ||
|
|
04043989c6 | ||
|
|
3b82232b46 | ||
|
|
5e704d206f | ||
|
|
5e65510797 | ||
|
|
b4dac84ddd | ||
|
|
cbc822c9e0 | ||
|
|
6cc68ed3de | ||
|
|
6d4aea216b | ||
|
|
569790acb2 | ||
|
|
7016690f99 | ||
|
|
eeb97a4299 | ||
|
|
66c237d297 | ||
|
|
3629c90fa9 | ||
|
|
1f99855500 | ||
|
|
cdf0bdf23e | ||
|
|
2c67058016 | ||
|
|
29f0affd72 | ||
|
|
e01569637d | ||
|
|
78f0ac473d | ||
|
|
bbe9a2d26d | ||
|
|
7bcb76e70c | ||
|
|
3348d8b716 | ||
|
|
4767ad2753 | ||
|
|
04ebbaa182 | ||
|
|
3c5dc6853a | ||
|
|
a70a776e46 | ||
|
|
83c3d6b1a8 | ||
|
|
6a566087ca | ||
|
|
e62b5c03db |
+49
-34
@@ -1,12 +1,12 @@
|
||||
;sfall configuration settings
|
||||
;v3.8.21
|
||||
;v3.8.22
|
||||
|
||||
[Main]
|
||||
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
|
||||
UseCommandLine=0
|
||||
|
||||
;Uncomment and point to a file to get alternate translations for some sfall messages
|
||||
;TranslationsINI=.\Translations.ini
|
||||
;TranslationsINI=sfall\Translations.ini
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Sound]
|
||||
@@ -64,6 +64,10 @@ Mode=0
|
||||
GraphicsWidth=0
|
||||
GraphicsHeight=0
|
||||
|
||||
;Uncomment the option to use a hardware shader (requires DX9 graphics mode 4 or 5)
|
||||
;The shader file <name>.fx must be placed in <GameRoot>\<master_patches>\shaders\ and must contain one technique with one or more passes
|
||||
;GlobalShaderFile=global.fx
|
||||
|
||||
;Set to 1 to do the palette conversion on the GPU
|
||||
;Set to 2 to do the palette conversion on the CPU
|
||||
;Set to 0 to pick automatically
|
||||
@@ -149,15 +153,18 @@ ToggleItemHighlightsKey=42
|
||||
;Set to 1 to also highlight containers
|
||||
HighlightContainers=1
|
||||
|
||||
;Set to 1 to also highlight lootable corpses
|
||||
HighlightCorpses=1
|
||||
|
||||
;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
|
||||
;1 - glowing red
|
||||
;2 - red
|
||||
;4 - grey
|
||||
;8 - glowing green
|
||||
;16 - bright yellow
|
||||
;32 - dark yellow
|
||||
;64 - purple
|
||||
OutlineColor=16
|
||||
|
||||
;A key to press to reload your currently equipped weapon
|
||||
;Set to 0 if you don't want a reload key, or a DX scancode otherwise
|
||||
@@ -271,9 +278,6 @@ Movie17=credits.mve
|
||||
;LocalMapXLimit=480
|
||||
;LocalMapYLimit=400
|
||||
|
||||
;To add additional perks to the game, uncomment the next line and set it to point to a file containing perk information
|
||||
;PerksFile=Perks.ini
|
||||
|
||||
;Set to 1 if you want the pipboy to be available at the start of the game
|
||||
;Set to 2 to make the pipboy available by only skipping the vault suit movie check
|
||||
PipBoyAvailableAtGameStart=0
|
||||
@@ -324,9 +328,6 @@ OverrideArtCacheSize=0
|
||||
;Set to 2 to block all saving in combat
|
||||
SaveInCombatFix=1
|
||||
|
||||
;Point to an ini file containing elevator data
|
||||
;ElevatorsFile=Elevators.ini
|
||||
|
||||
;Uncomment and set a comma delimited list of numbers to use a custom xp table.
|
||||
;Player's level is capped once the highest specified level is reached
|
||||
;XPTable=50,100,200
|
||||
@@ -355,8 +356,6 @@ AdditionalWeaponAnims=1
|
||||
;If the ExtraKillTypes option is enabled, this should be set to 3, with containing entries for any new types
|
||||
;Must be non-zero to use the edit/get/reset_critical script functions
|
||||
OverrideCriticalTable=2
|
||||
;To change the path and filename of the critical table file, uncomment the next line
|
||||
;OverrideCriticalFile=CriticalOverrides.ini
|
||||
|
||||
;Set to 1 to get notification of karma changes in the notification window
|
||||
DisplayKarmaChanges=0
|
||||
@@ -418,6 +417,9 @@ Doctor=293
|
||||
Science=293
|
||||
Repair=293
|
||||
|
||||
;Set to 1 to remove window position rounding for script-created windows
|
||||
RemoveWindowRounding=1
|
||||
|
||||
;Set to 1 to add scroll buttons to the pipboy quest list, and remove the quests per area limit
|
||||
;Set to 2 to use a different set of scroll buttons
|
||||
UseScrollingQuestsList=1
|
||||
@@ -438,7 +440,7 @@ UseScrollingQuestsList=1
|
||||
;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
|
||||
;ConsoleOutputPath="bingle.txt"
|
||||
;ConsoleOutputPath=console.txt
|
||||
|
||||
;Set to 1 to add additional pages of save slots
|
||||
ExtraSaveSlots=0
|
||||
@@ -497,14 +499,6 @@ FastShotFix=1
|
||||
;Set to 1 to boost the maximum number of script names from 1450 to 10000
|
||||
BoostScriptDialogLimit=0
|
||||
|
||||
;Allows you to edit the skill tables
|
||||
;Point the next line to an ini file containing the replacement skill data
|
||||
;SkillsFile=Skills.ini
|
||||
|
||||
;To change the relationship between SPECIAL stats and derived stats, uncomment the next line
|
||||
;See the Stats.ini in the modders pack for an example file
|
||||
;DerivedStats=Stats.ini
|
||||
|
||||
;These options modify the checks to see if a critter can carry an additional item, changing which items are counted towards the weight limit and adding an additional size check
|
||||
;Set the mode to 0 to disable the size check, 1 to apply to the PC only, 2 to apply to the PC and party members, or 3 to apply to all critters
|
||||
;Only the PC uses CritterInvSizeLimit. Other critters will use the unused stat (STAT_unused = 10) or have the size limit of 100 if the stat is not set
|
||||
@@ -586,17 +580,13 @@ ExplosionsEmitLight=0
|
||||
;MovieTimer_artimer3=270
|
||||
;MovieTimer_artimer4=360
|
||||
|
||||
;Set to 1 to enable the new arrays behavior
|
||||
;Set to 1 to enable the new arrays behavior (default behavior)
|
||||
;Set to 0 for backward compatibility with pre-3.4 scripts
|
||||
arraysBehavior=1
|
||||
|
||||
;Set to 1 to add proper checks if there is enough ammo to use weapons that use multiple ammo per shot
|
||||
CheckWeaponAmmoCost=0
|
||||
|
||||
;To add additional books to the game, uncomment the next line and point to a file containing book information
|
||||
;See the Books.ini in the modders pack for an example file
|
||||
;BooksFile=Books.ini
|
||||
|
||||
;Controls the speed of combat panel animations (lower - faster; valid range: 0..65535)
|
||||
CombatPanelAnimDelay=1000
|
||||
;Controls the speed of dialog panel animations (lower - faster; valid range: 0..255)
|
||||
@@ -686,6 +676,31 @@ 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
|
||||
|
||||
;To change the path and filename of the critical table file, uncomment the next line
|
||||
;OverrideCriticalFile=sfall\CriticalOverrides.ini
|
||||
|
||||
;To change the relationship between SPECIAL stats and derived stats, uncomment the next line
|
||||
;See the Stats.ini in the modders pack for an example file
|
||||
;DerivedStats=sfall\Stats.ini
|
||||
|
||||
;Allows you to edit the skill tables
|
||||
;Point the next line to an ini file containing the replacement skill data
|
||||
;SkillsFile=sfall\Skills.ini
|
||||
|
||||
;To add additional perks to the game, uncomment the next line and set it to point to a file containing perk information
|
||||
;PerksFile=sfall\Perks.ini
|
||||
|
||||
;To add additional books to the game, uncomment the next line and point to a file containing book information
|
||||
;See the Books.ini in the modders pack for an example file
|
||||
;BooksFile=sfall\Books.ini
|
||||
|
||||
;Point to an ini file containing elevator data
|
||||
;ElevatorsFile=sfall\Elevators.ini
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Debugging]
|
||||
;Extra sfall configuration settings that can be used by modders
|
||||
@@ -706,8 +721,8 @@ Enable=0
|
||||
;show_script_messages=1
|
||||
;show_tile_num=1
|
||||
;[sound]
|
||||
;debug=1
|
||||
;debug_sfxc=1
|
||||
;debug=0
|
||||
;debug_sfxc=0
|
||||
;-------
|
||||
DebugMode=0
|
||||
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
// Status: WIP
|
||||
|
||||
texture bloomMap;
|
||||
sampler s0;
|
||||
|
||||
sampler BloomSampler : samplerstate
|
||||
{
|
||||
Texture = bloomMap;
|
||||
MinFilter = Linear;
|
||||
MagFilter = Linear;
|
||||
AddressU = Clamp;
|
||||
AddressV = Clamp;
|
||||
};
|
||||
|
||||
// pseudo gauss blur
|
||||
static const float2 offsets[12] = {
|
||||
-0.326212, -0.405805,
|
||||
-0.840144, -0.073580,
|
||||
-0.695914, 0.457137,
|
||||
-0.203345, 0.620716,
|
||||
0.962340, -0.194983,
|
||||
0.473434, -0.480026,
|
||||
0.519456, 0.767022,
|
||||
0.185461, -0.893124,
|
||||
0.507431, 0.064425,
|
||||
0.896420, 0.412458,
|
||||
-0.321940, -0.932615,
|
||||
-0.791559, -0.597705,
|
||||
};
|
||||
|
||||
float w;
|
||||
float h;
|
||||
static const float2 resolution = float2(w, h);
|
||||
|
||||
// blur setting
|
||||
static const float blurFalloff = 8;
|
||||
static const float sharpness = 4;
|
||||
|
||||
float4 AdjustSaturation(float4 color, float saturation) {
|
||||
float grey = dot(color, float3(0.3, 0.59, 0.11));
|
||||
|
||||
return lerp(grey, color, saturation);
|
||||
}
|
||||
|
||||
float Brightness(float3 color)
|
||||
{
|
||||
return color.r * color.g - 0.75 * color.b;
|
||||
}
|
||||
|
||||
float3 BlurFunction(float2 uv, float brightness, inout float totalWeight)
|
||||
{
|
||||
float3 pointColor =(tex2Dlod(s0, float4(uv, 0, 0)).rgb);
|
||||
float diff = abs(brightness - Brightness(pointColor));
|
||||
float weight = exp2(-0.25 * blurFalloff - diff * sharpness);
|
||||
totalWeight += weight;
|
||||
|
||||
return pointColor * weight;
|
||||
}
|
||||
|
||||
float4 BlurPS(float2 uv : TEXCOORD0, uniform float2 delta) : COLOR0
|
||||
{
|
||||
float3 sumColor = (tex2D(s0, uv).rgb);
|
||||
float totalWeight = 1;
|
||||
float brightness = Brightness(sumColor);
|
||||
delta *= (1 / resolution);
|
||||
float radius = 1;
|
||||
|
||||
float2 pointUV = uv + delta * radius;
|
||||
sumColor += BlurFunction(pointUV, brightness, totalWeight);
|
||||
pointUV = uv - delta * radius;
|
||||
sumColor += BlurFunction(pointUV, brightness, totalWeight);
|
||||
|
||||
return float4((sumColor / totalWeight),1);
|
||||
// return AdjustSaturation(Color, 0.5);
|
||||
}
|
||||
|
||||
float4 BloomT(float2 texCoord : TEXCOORD0) : COLOR0 {
|
||||
float4 c = tex2D(s0, texCoord);
|
||||
float BloomThreshold = 0.2;
|
||||
|
||||
return saturate((c - BloomThreshold) / (1 - BloomThreshold));
|
||||
}
|
||||
|
||||
float4 Bloom(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0 {
|
||||
float BaseIntensity = 1.0;
|
||||
float BaseSaturation = 1;
|
||||
float BloomIntensity = 1; // 0.4
|
||||
float BloomSaturation = 0.5;
|
||||
float BlurPower = 0.01;
|
||||
float BloomThreshold = 0.5;
|
||||
|
||||
float4 original = tex2D(s0, texCoord);
|
||||
|
||||
// blur
|
||||
float4 sum = tex2D(s0, texCoord);
|
||||
for(int i = 0; i < 12; i++){
|
||||
sum += tex2D(s0, texCoord + BlurPower * offsets[i]);
|
||||
}
|
||||
sum /= 13;
|
||||
|
||||
original = AdjustSaturation(original, BaseSaturation) * BaseIntensity;
|
||||
sum = AdjustSaturation(sum, BloomSaturation) * BloomIntensity;
|
||||
|
||||
sum = saturate((sum - BloomThreshold) / (1 - BloomThreshold));
|
||||
|
||||
return sum + original;
|
||||
// return sum;
|
||||
}
|
||||
|
||||
technique Blur
|
||||
{
|
||||
// pass P2 { PixelShader = compile ps_2_0 BloomT(); }
|
||||
// pass P3 { PixelShader = compile ps_2_0 Bloom(); }
|
||||
Pass P0 { PixelShader = compile ps_3_0 BlurPS(float2(1, 0)); }
|
||||
Pass P1 { PixelShader = compile ps_3_0 BlurPS(float2(0, 1)); }
|
||||
}
|
||||
@@ -87,7 +87,6 @@
|
||||
#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)
|
||||
@@ -101,6 +100,13 @@
|
||||
#define CFLG_RANGED 8192 // 0x00002000 - Range (melee attack is possible at a distance)
|
||||
#define CFLG_NOKNOCKDOWN 16384 // 0x00004000 - Knock (cannot be knocked down)
|
||||
|
||||
/* Window Flags */
|
||||
#define WIN_FLAG_MOVEONTOP (0x4)
|
||||
#define WIN_FLAG_HIDDEN (0x8)
|
||||
#define WIN_FLAG_EXCLUSIVE (0x10)
|
||||
#define WIN_FLAG_TRANSPARENT (0x20)
|
||||
|
||||
|
||||
//remove inven obj defines
|
||||
#define RMOBJ_CONSUME_DRUG 4666772
|
||||
#define RMOBJ_CONTAINER 4683293 // same as RMOBJ_TRADE
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
//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)
|
||||
@@ -224,8 +223,9 @@
|
||||
#define ADD_PERK_MODE_REMOVE (4) // remove from the list of selectable perks
|
||||
|
||||
// sfall_funcX macros
|
||||
#define add_global_timer_event(time, fixedParam) sfall_func2("add_g_timer_event", time, fixedParam)
|
||||
#define add_iface_tag sfall_func0("add_iface_tag")
|
||||
#define add_trait(traitId) sfall_func1("add_trait", traitId)
|
||||
#define add_trait(traitID) sfall_func1("add_trait", traitID)
|
||||
#define art_cache_clear sfall_func0("art_cache_clear")
|
||||
#define attack_is_aimed sfall_func0("attack_is_aimed")
|
||||
#define create_win(winName, x, y, w, h) sfall_func5("create_win", winName, x, y, w, h)
|
||||
@@ -233,6 +233,8 @@
|
||||
#define critter_inven_obj2(obj, type) sfall_func2("critter_inven_obj2", obj, type)
|
||||
#define dialog_obj sfall_func0("dialog_obj")
|
||||
#define display_stats sfall_func0("display_stats")
|
||||
#define draw_image(pathFile, frame, x, y, noTrans) sfall_func5("draw_image", pathFile, frame, x, y, noTrans)
|
||||
#define draw_image_scaled(pathFile, frame, x, y, w, h) sfall_func6("draw_image_scaled", pathFile, frame, x, y, w, h)
|
||||
#define exec_map_update_scripts sfall_func0("exec_map_update_scripts")
|
||||
#define floor2(value) sfall_func1("floor2", value)
|
||||
#define get_current_inven_size(obj) sfall_func1("get_current_inven_size", obj)
|
||||
@@ -243,6 +245,9 @@
|
||||
#define get_metarule_table sfall_func0("get_metarule_table")
|
||||
#define get_object_data(obj, offset) sfall_func2("get_object_data", obj, offset)
|
||||
#define get_outline(obj) sfall_func1("get_outline", obj)
|
||||
#define get_sfall_arg_at(argNum) sfall_func1("get_sfall_arg_at", argNum)
|
||||
#define get_text_width(text) sfall_func1("get_text_width", text)
|
||||
#define hide_window(winName) sfall_func1("hide_window", winName)
|
||||
#define intface_hide sfall_func0("intface_hide")
|
||||
#define intface_is_hidden sfall_func0("intface_is_hidden")
|
||||
#define intface_redraw sfall_func0("intface_redraw")
|
||||
@@ -251,11 +256,14 @@
|
||||
#define item_weight(obj) sfall_func1("item_weight", obj)
|
||||
#define lock_is_jammed(obj) sfall_func1("lock_is_jammed", obj)
|
||||
#define loot_obj sfall_func0("loot_obj")
|
||||
#define metarule_exist(metarule) sfall_func1("metarule_exist", metarule)
|
||||
#define metarule_exist(metaruleName) sfall_func1("metarule_exist", metaruleName)
|
||||
#define npc_engine_level_up(toggle) sfall_func1("npc_engine_level_up", toggle)
|
||||
#define obj_under_cursor(crSwitch, inclDude) sfall_func2("obj_under_cursor", crSwitch, inclDude)
|
||||
#define obj_under_cursor(onlyCritter, includeDude) sfall_func2("obj_under_cursor", onlyCritter, includeDude)
|
||||
#define objects_in_radius(tile, radius, elev, type) sfall_func4("objects_in_radius", tile, radius, elev, type)
|
||||
#define outlined_object sfall_func0("outlined_object")
|
||||
#define real_dude_obj sfall_func0("real_dude_obj")
|
||||
#define remove_all_timer_events sfall_func0("remove_timer_event")
|
||||
#define remove_timer_event(fixedParam) sfall_func1("remove_timer_event", fixedParam)
|
||||
#define set_cursor_mode(mode) sfall_func1("set_cursor_mode", mode)
|
||||
#define set_flags(obj, flags) sfall_func2("set_flags", obj, flags)
|
||||
#define set_iface_tag_text(tag, text, color) sfall_func3("set_iface_tag_text", tag, text, color)
|
||||
@@ -264,9 +272,15 @@
|
||||
#define set_object_data(obj, offset, value) sfall_func3("set_object_data", obj, offset, value)
|
||||
#define set_outline(obj, color) sfall_func2("set_outline", obj, color)
|
||||
#define set_unique_id(obj) sfall_func1("set_unique_id", obj)
|
||||
#define unset_unique_id(obj) sfall_func2("set_unique_id", obj, -1)
|
||||
#define set_unjam_locks_time(time) sfall_func1("set_unjam_locks_time", time)
|
||||
#define set_window_flag(winID, flag, value) sfall_func3("set_window_flag", winID, flag, value)
|
||||
#define show_window(winName) sfall_func1("show_window", winName)
|
||||
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
|
||||
#define string_compare(str1, str2) sfall_func2("string_compare", str1, str2)
|
||||
#define string_compare_locale(str1, str2, codePage) sfall_func3("string_compare", str1, str2, codePage)
|
||||
#define string_format(format, a1, a2) sfall_func3("string_format", format, a1, a2)
|
||||
#define tile_by_position(x, y) sfall_func2("tile_by_position", x, y)
|
||||
#define tile_refresh_display sfall_func0("tile_refresh_display")
|
||||
#define unjam_lock(obj) sfall_func1("unjam_lock", obj)
|
||||
#define unset_unique_id(obj) sfall_func2("set_unique_id", obj, -1)
|
||||
#define unwield_slot(critter, slot) sfall_func2("unwield_slot", critter, slot)
|
||||
|
||||
@@ -30,6 +30,7 @@ The hook script equivalent of game_loaded; it returns 2 when the script is first
|
||||
|
||||
> mixed get_sfall_arg()
|
||||
Gets the next argument from sfall. Each time it's called it returns the next argument, or otherwise it returns 0 if there are no more arguments left.
|
||||
You can arbitrarily get the value of any argument using the sfall_func1("get_sfall_arg_at", argNum) function.
|
||||
|
||||
> array get_sfall_args()
|
||||
Returns all hook arguments as a new temp array.
|
||||
@@ -37,16 +38,16 @@ Returns all hook arguments as a new temp array.
|
||||
> void set_sfall_return(int value)
|
||||
Used to return the new values from the script. Each time it's called it sets the next value, or if you've already set all return values it does nothing.
|
||||
|
||||
> void set_sfall_arg(int argnum, int value)
|
||||
Changes argument value. The argument number (argnum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see below).
|
||||
> void set_sfall_arg(int argNum, int value)
|
||||
Changes argument value. The argument number (argNum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see below).
|
||||
|
||||
> void register_hook(int hooktype)
|
||||
> void register_hook(int hookID)
|
||||
Used from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, "start" proc will be executed in a current global script. You can use all above functions like normal.
|
||||
|
||||
> void register_hook_proc(int hook, procedure proc)
|
||||
> void register_hook_proc(int hookID, procedure proc)
|
||||
The same as register_hook, except that you specifically define which procedure in the current script should be called as a hook (instead of "start" by default). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script, no conflicts if you don't use "hs_*.int" scripts) and flexibility (you can place all related hook scripts for specific mod in a single script!).
|
||||
|
||||
> void register_hook_proc_spec(int hook, procedure proc)
|
||||
> void register_hook_proc_spec(int hookID, procedure proc)
|
||||
Works very similar to register_hook_proc, except that it registers the current script at the end of the hook script execution chain (i.e. the script will be executed after all previously registered scripts for the same hook, including the hs_*.int script). All scripts hooked to a single hook point with this function are executed in exact order of how they were registered, as opposed to the description below, which refers to using register_hook/register_hook_proc functions.
|
||||
|
||||
NOTE: you can hook several scripts to a single hook point, for example if it's different mods from different authors or just some different aspects of one larger mod. In this case scripts are executed in reverse order of how they were registered. When one of the scripts in a chain returns value with "set_sfall_return", the next script may override this value if calls "set_sfall_return" again. Sometimes you need to multiply certain value in a chain of hook scripts.
|
||||
@@ -68,7 +69,7 @@ This basically changes hook argument for the next script. Mod B code:
|
||||
So if you combine both mods together, they will run in chain and the end result will be a 75% from original hit chance (hook register order doesn't matter in this case, if you use "set_sfall_arg" in both hooks).
|
||||
|
||||
|
||||
The defines to use for the hooktype are in sfall.h.
|
||||
The defines to use for the hookID are in sfall.h.
|
||||
|
||||
-------------------------------------------
|
||||
----------- HOOK SCRIPT TYPES -------------
|
||||
@@ -188,9 +189,11 @@ Critter arg1 - The critter that just died
|
||||
|
||||
HOOK_FINDTARGET (hs_findtarget.int)
|
||||
|
||||
Runs when the ai is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the ai caps of the attacker. This hook replaces that sorting function, allowing you to sort the targets in some arbitrary way. Use sfall_return to give the 4 targets, in order of preference. If you want to specify less than 4 targets, fill in the extra spaces with 0's. Pass -1 to skip the return value.
|
||||
Runs when the ai is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the ai caps of the attacker.
|
||||
This hook replaces that sorting function, allowing you to sort the targets in some arbitrary way.
|
||||
|
||||
The return values can include critters that weren't in the list of possible targets, but the additional targets may still be discarded later on in the combat turn if they are out of the attackers perception or the chance of a successful hit is too low. The list of possible targets often includes duplicated entries.
|
||||
Use sfall_return to give the 4 targets, in order of preference. If you want to specify less than 4 targets, fill in the extra spaces with 0's or pass -1 to skip the return value.
|
||||
|
||||
critter arg1 - The attacker
|
||||
critter arg2 - A possible target
|
||||
@@ -285,10 +288,10 @@ int ret1 - the new AP cost
|
||||
-------------------------------------------
|
||||
|
||||
(DEPRECATED)
|
||||
hs_hexmoveblocking.int
|
||||
hs_hexaiblocking.int
|
||||
hs_hexshootblocking.int
|
||||
hs_hexsightblocking.int
|
||||
HOOK_HEXMOVEBLOCKING (hs_hexmoveblocking.int)
|
||||
HOOK_HEXAIBLOCKING (hs_hexaiblocking.int)
|
||||
HOOK_HEXSHOOTBLOCKING (hs_hexshootblocking.int)
|
||||
HOOK_HEXSIGHTBLOCKING (hs_hexsightblocking.int)
|
||||
|
||||
Runs when checking to see if a hex blocks movement or shooting. (or ai-ing, presumably...)
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ The input functions are only available if the user has the input hook turned on
|
||||
|
||||
The graphics functions are only available if the user is using graphics mode 4 or 5. Use graphics_funcs_available to check; it returns 1 if you can use them or 0 if you can't. Calling graphics functions when graphics_funcs_available returns 0 will do nothing.
|
||||
|
||||
load_shader takes a path relative to the data\shaders\ directory as an argument and returns a shader ID. That ID should be passed as the first argument to all other shader functions, and is valid until free_shader is called on the ID, the player loads a saved game or the player quits to the main menu.
|
||||
load_shader takes a path relative to the <GameRoot>\<master_patches>\shaders\ directory as an argument and returns a shader ID. That ID should be passed as the first argument to all other shader functions, and is valid until free_shader is called on the ID, the player loads a saved game or the player quits to the main menu.
|
||||
|
||||
get_shader_version gives you the highest shader version supported by the player's graphics cards. Possible return values are 11, 12, 13, 14, 20, 21 and 30.
|
||||
|
||||
@@ -153,12 +153,13 @@ array - array ID to be used with array-related functions (actually an integer)
|
||||
- accepts a pointer to an object and will remove the script from that object.
|
||||
|
||||
> void set_script(object, int scriptid)
|
||||
- accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as create_object_sid from sfall 3.6)
|
||||
- accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accepts the same values as create_object_sid)
|
||||
- If used on an object that is already scripted, it will remove the existing script first; you cannot have multiple scripts attached to a single object. Calling set_script on self_obj will have all sorts of wacky side effects, and should be avoided.
|
||||
- if you add 0x80000000 to the sid when calling set_script, map_enter_p_proc will be SKIPPED. The start proc will always be run.
|
||||
|
||||
> int get_script(object)
|
||||
- accepts a pointer to an object and returns its scriptID (line number in scripts.lst), or -1 if the object is unscripted.
|
||||
- accepts a pointer to an object and returns its scriptID (line number in scripts.lst), or 0 if the object is unscripted.
|
||||
- returns -1 on argument error.
|
||||
|
||||
> void set_self(int obj)
|
||||
- overrides the scripts self_obj for the next function call.
|
||||
@@ -218,6 +219,9 @@ Some additional reg_anim_* functions were introduced. They all work in the same
|
||||
> void reg_anim_turn_towards(object, tile/target, delay)
|
||||
- makes object change its direction to face given tile num or target object.
|
||||
|
||||
> void reg_anim_callback(procedure proc)
|
||||
- adds the given procedure to an animation sequence-list and executes it in the registered sequence.
|
||||
|
||||
> int metarule2_explosions(int arg1, int arg2, int arg3)
|
||||
was made as a dirty easy hack to allow dynamically change some explosion parameters (ranged attack). All changed parameters are reset to vanilla state automatically after each attack action. Following macros are available in sfall.h:
|
||||
|
||||
@@ -245,7 +249,10 @@ Some utility/math functions are available:
|
||||
- you can use this to search for a substring in a string like this: strlen(get_array(string_split(haystack, needle), 0))
|
||||
|
||||
> string substr(string, start, length)
|
||||
- cuts a substring from a string starting at "start" up to "length" characters. If start is negative - it indicates starting position from the end of the string (for example substr("test", -2, 2) will return last 2 charactes: "st"). If length is negative - it means so many characters will be omitted from the end of string (example: substr("test", 0, -2) will return string without last 2 characters: "te")
|
||||
- cuts a substring from a string starting at "start" up to "length" characters. The first character position is 0 (zero).
|
||||
- If start is negative - it indicates starting position from the end of the string (for example substr("test", -2, 2) will return last 2 charactes: "st").
|
||||
- If length is negative - it means so many characters will be omitted from the end of string (example: substr("test", 0, -2) will return string without last 2 characters: "te").
|
||||
- If length is zero - it will return a string from the starting position to the end of the string **New behavior** for sfall 4.2.2/3.8.22
|
||||
|
||||
> int strlen(string string)
|
||||
- returns string length
|
||||
@@ -472,9 +479,10 @@ Some utility/math functions are available:
|
||||
- adds one custom box to the current boxes, and returns the number of the added tag (-1 if the tags limit is exceeded)
|
||||
- The maximum number of boxes is limited to 126 tags
|
||||
|
||||
> void sfall_func0("inventory_redraw")
|
||||
> void sfall_func1("inventory_redraw", int invSide)
|
||||
- redraws inventory list in the inventory/use inventory item on/loot/barter screens
|
||||
- invSide specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens)
|
||||
- invSide specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens), -1 - both sides (same as without argument)
|
||||
|
||||
> int sfall_func1("get_current_inven_size", object)
|
||||
- returns the current inventory size of the container or the critter
|
||||
@@ -487,10 +495,11 @@ Some utility/math functions are available:
|
||||
> object sfall_func0("dialog_obj")
|
||||
- returns a pointer to the object (critter) the player is having a conversation or bartering with
|
||||
|
||||
> object sfall_func2("obj_under_cursor", bool crSwitch, bool inclDude)
|
||||
> object sfall_func2("obj_under_cursor", bool onlyCritter, bool includeDude)
|
||||
- returns the object under the cursor on the main game screen
|
||||
- crSwitch: True - only checks critters and ignores their cover (roof tiles, walls, scenery, etc.), False - checks all objects (can't check critters under objects)
|
||||
- passing False to the inclDude argument will ignore dude_obj
|
||||
- onlyCritter: True - only checks critters and ignores their cover (roof tiles, walls, scenery, etc.)
|
||||
False - checks all objects (can't check critters under objects)
|
||||
- passing False to the includeDude argument will ignore dude_obj
|
||||
|
||||
> object sfall_func0("loot_obj")
|
||||
- returns a pointer to the target object (container or critter) of the loot screen
|
||||
@@ -517,17 +526,83 @@ Some utility/math functions are available:
|
||||
- there is also a unique ID number range for the player and party members from 18000 to 83535
|
||||
- to assign a new ID number generated by the engine to the object (i.e. unassign a unique ID), call the function with two arguments and pass -1 for the flag argument
|
||||
|
||||
> void sfall_func5("draw_image", string/int pathFile/artId, int frame, int x, int y, bool noTransparent)
|
||||
> void sfall_func6("draw_image_scaled", string/int pathFile/artId, int frame, int x, int y, int width, int height)
|
||||
- displays the specified PCX or FRM image in the active window created by vanilla CreateWin or sfall's create_win script function
|
||||
- pathFile/artId: path to the PCX/FRM file (e.g. "art\\inven\\5mmap.frm"), or its FRM ID number (e.g. 117440550, see specification of the FID format)
|
||||
optional arguments:
|
||||
- frame: frame number, the first frame starts from zero
|
||||
- x/y: offset relative to the top-left corner of the window
|
||||
- width/height: image size, used to scale the image when displaying it. Pass -1 to either width or height to keep the aspect ratio when scaling
|
||||
- noTransparent: pass true to display an image without transparent background
|
||||
- NOTE: to omit optional arguments starting from the right, call the functions with different sfall_funcX (e.g. sfall_func4("draw_image", pathFile, frame, x, y))
|
||||
- if draw_image_scaled is called without x/y/width/height arguments, the image will be scaled to fit the window without transparent background
|
||||
|
||||
> void sfall_func2("unwield_slot", object critter, int slot)
|
||||
- unequips an item from the specified slot for a critter or the player
|
||||
- can take off player's equipped item when the inventory is opened, or the player is in the barter screen
|
||||
- slot: 0 - armor slot, 1 - right slot, 2 - left slot (see INVEN_TYPE_* in define.h)
|
||||
|
||||
> void sfall_func1("add_trait", int traitId)
|
||||
> void sfall_func1("add_trait", int traitID)
|
||||
- adds the specified trait to the player
|
||||
|
||||
> int sfall_func0("get_inven_ap_cost")
|
||||
- returns the current AP cost to access the inventory in combat
|
||||
|
||||
> void sfall_func2("add_g_timer_event", int time, int fixedParam)
|
||||
- adds a timer event that calls the timed_event_p_proc procedure in the current global script
|
||||
- time: the number of ticks after which the event timer is triggered
|
||||
- fixedParam: the value that is passed to the timed_event_p_proc procedure for the fixed_param function
|
||||
|
||||
> void sfall_func0("remove_timer_event")
|
||||
- clears all set timer events for the current global script
|
||||
|
||||
> void sfall_func1("remove_timer_event", int fixedParam)
|
||||
- removes all timer events with the specified 'fixedParam' value for the current global script
|
||||
|
||||
> mixed sfall_func1("get_sfall_arg_at", int argNum)
|
||||
- gets the value of hook argument with the specified argument number (first argument of hook starts from 0)
|
||||
|
||||
> void sfall_func0("hide_window")
|
||||
> void sfall_func1("hide_window", string winName)
|
||||
- hides the specified or currently active (selected) script window
|
||||
- winName: the window name, assigned to the window by the CreateWin/create_win function
|
||||
|
||||
> void sfall_func0("show_window")
|
||||
> void sfall_func1("show_window", string winName)
|
||||
- displays the specified hidden script window or the one previously hidden with the sfall_func0("hide_window") function
|
||||
- winName: the window name, assigned to the window by the CreateWin/create_win function
|
||||
|
||||
> void sfall_func3("set_window_flag", string/int winName/winID, int flag, bool value)
|
||||
- changes the specified flag for the created script or game interface window
|
||||
- winName: the window name, assigned to the window by the CreateWin/create_win function
|
||||
- winID: the ID number of the interface or script window obtained with the get_window_under_mouse function, or 0 for the current game interface
|
||||
- flag: the flag to change (see WIN_FLAG_* constants in define_extra.h)
|
||||
- value: true - set the flag, false - unset the flag
|
||||
|
||||
> int sfall_func1("get_text_width", string text)
|
||||
- returns the text width in pixels for the currently set font
|
||||
|
||||
> bool sfall_func2("string_compare", string str1, string str2)
|
||||
> bool sfall_func3("string_compare", string str1, string str2, int codePage)
|
||||
- compares two strings case-insensitive, and returns True if the two strings are matched
|
||||
- codePage: code page number to properly compare national characters in the range 128-255 of the ASCII code table
|
||||
available encodings: 1250-1252, 866
|
||||
|
||||
> string sfall_func3("string_format", string format, any val1, any val2, ...)
|
||||
- formats given value using standard syntax of C printf function (google "printf" for format details). However it is limited to formatting up to 4 values
|
||||
- formatting is only supported for %s and %d, and the format string is limited to 1024 characters
|
||||
|
||||
> array sfall_func3("objects_in_radius", int tile, int radius, int elevation)
|
||||
> array sfall_func4("objects_in_radius", int tile, int radius, int elevation, int type)
|
||||
- returns an array of objects of a type (see OBJ_TYPE_* constants in define_extra.h) within the specified radius from the given tile
|
||||
- passing -1 to the type argument or not specifying it will return all objects within the radius
|
||||
- the radius is limited to 50 hexes
|
||||
|
||||
> int sfall_func2("tile_by_position", int x, int y)
|
||||
- returns the tile number at the x, y position relative to the top-left corner of the screen
|
||||
- if the position is outside of the range of tiles, it will return -1
|
||||
|
||||
------------------------
|
||||
------ MORE INFO -------
|
||||
------------------------
|
||||
|
||||
@@ -358,6 +358,7 @@
|
||||
0x827c - any sfall_func6(string funcName, arg1, arg2, arg3, arg4, arg5, arg6)
|
||||
|
||||
0x827d - void register_hook_proc_spec(int hook, procedure proc)
|
||||
0x827e - void reg_anim_callback(procedure proc)
|
||||
|
||||
|
||||
* These functions require AllowUnsafeScripting to be enabled in ddraw.ini
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "main.h"
|
||||
|
||||
#include "AI.h"
|
||||
#include "Define.h"
|
||||
#include "FalloutEngine.h"
|
||||
#include "SafeWrite.h"
|
||||
|
||||
|
||||
+9
-8
@@ -12,12 +12,13 @@ DWORD arraysBehavior = 1; // 0 - backward compatible with pre-3.4, 1 - permanent
|
||||
|
||||
// arrays map: arrayId => arrayVar
|
||||
ArraysMap arrays;
|
||||
// auto-incremented ID
|
||||
DWORD nextArrayID = 1;
|
||||
// temp arrays: set of arrayId
|
||||
std::set<DWORD> tempArrays;
|
||||
std::set<DWORD> temporaryArrays;
|
||||
// saved arrays: arrayKey => arrayId
|
||||
ArrayKeysMap savedArrays;
|
||||
|
||||
// auto-incremented ID
|
||||
DWORD nextArrayID = 1;
|
||||
// special array ID for array expressions
|
||||
DWORD stackArrayId;
|
||||
|
||||
@@ -438,7 +439,7 @@ DWORD _stdcall CreateArray(int len, DWORD flags) {
|
||||
|
||||
DWORD _stdcall TempArray(DWORD len, DWORD flags) {
|
||||
DWORD id = CreateArray(len, flags);
|
||||
tempArrays.insert(id);
|
||||
temporaryArrays.insert(id);
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -452,11 +453,11 @@ void _stdcall FreeArray(DWORD id) {
|
||||
}
|
||||
|
||||
void DeleteAllTempArrays() {
|
||||
if (!tempArrays.empty()) {
|
||||
for (std::set<DWORD>::iterator it = tempArrays.begin(); it != tempArrays.end(); ++it) {
|
||||
if (!temporaryArrays.empty()) {
|
||||
for (std::set<DWORD>::iterator it = temporaryArrays.begin(); it != temporaryArrays.end(); ++it) {
|
||||
FreeArray(*it);
|
||||
}
|
||||
tempArrays.clear();
|
||||
temporaryArrays.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -686,7 +687,7 @@ errorResize:
|
||||
}
|
||||
|
||||
void _stdcall FixArray(DWORD id) {
|
||||
tempArrays.erase(id);
|
||||
temporaryArrays.erase(id);
|
||||
}
|
||||
|
||||
int _stdcall ScanArray(DWORD id, DWORD val, DWORD datatype, DWORD* resultType) {
|
||||
|
||||
+10
-5
@@ -1,8 +1,6 @@
|
||||
#include "main.h"
|
||||
|
||||
#include "BugFixes.h"
|
||||
#include "Define.h"
|
||||
#include "FalloutEngine.h"
|
||||
#include "BugFixes.h"
|
||||
#include "HookScripts.h"
|
||||
#include "LoadGameHook.h"
|
||||
#include "ScriptExtender.h"
|
||||
@@ -69,8 +67,15 @@ void ResetBodyState() {
|
||||
__asm mov weightOnBody, 0;
|
||||
}
|
||||
|
||||
void MusicVolInitialization() {
|
||||
// Missing game initialization
|
||||
void BugFixes_Initialization() {
|
||||
*(DWORD*)_gDialogMusicVol = *(DWORD*)_background_volume; // fix dialog music
|
||||
|
||||
// Restore calling original engine functions from HRP hacks (there is no difference in HRP functions)
|
||||
long long data = 0xC189565153;
|
||||
SafeWriteBytes(0x4D78CC, (BYTE*)&data, 5); // win_get_top_win_
|
||||
data = 0xC389565153;
|
||||
SafeWriteBytes(0x4CA9DC, (BYTE*)&data, 5); // mouse_get_position_
|
||||
}
|
||||
|
||||
// fix for vanilla negate operator not working on floats
|
||||
@@ -2439,7 +2444,7 @@ static void __declspec(naked) obj_shoot_blocking_at_hack1() {
|
||||
call critter_is_dead_;
|
||||
test eax, eax;
|
||||
jz endLoop;
|
||||
jmp CorpseShotBlockFix_continue_loop[1];
|
||||
jmp CorpseShotBlockFix_continue_loop[4];
|
||||
endLoop:
|
||||
mov eax, [edx];
|
||||
pop ebp;
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@ void BugFixesInit();
|
||||
void DrugsSaveFix(HANDLE file);
|
||||
bool DrugsLoadFix(HANDLE file);
|
||||
void ResetBodyState();
|
||||
void MusicVolInitialization();
|
||||
void BugFixes_Initialization();
|
||||
|
||||
extern int tagSkill4LevelBase;
|
||||
|
||||
+2
-3
@@ -17,7 +17,6 @@
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <vector>
|
||||
|
||||
#include "main.h"
|
||||
|
||||
@@ -243,7 +242,7 @@ static void __declspec(naked) determine_to_hit_func_hack() {
|
||||
}
|
||||
|
||||
static long __fastcall CheckDisableBurst(TGameObj* critter) {
|
||||
for (DWORD i = 0; i < noBursts.size(); i++) {
|
||||
for (size_t i = 0; i < noBursts.size(); i++) {
|
||||
if (noBursts[i] == critter->ID) {
|
||||
return 10; // Disable Burst (area_attack_mode - non-existent value)
|
||||
}
|
||||
@@ -354,7 +353,7 @@ void _stdcall SetHitChanceMax(TGameObj* critter, DWORD maximum, DWORD mod) {
|
||||
hitChanceMods.push_back(cm);
|
||||
}
|
||||
|
||||
void _stdcall SetNoBurstMode(TGameObj* critter, DWORD on) {
|
||||
void _stdcall SetNoBurstMode(TGameObj* critter, bool on) {
|
||||
if (critter == *ptr_obj_dude || critter->pid >> 24 != OBJ_TYPE_CRITTER) return;
|
||||
|
||||
long id = SetObjectUniqueID(critter);
|
||||
|
||||
+1
-1
@@ -29,6 +29,6 @@ void _stdcall KnockbackSetMod(TGameObj* object, DWORD type, float val, DWORD mod
|
||||
void _stdcall KnockbackRemoveMod(TGameObj* object, DWORD mode);
|
||||
void CombatInit();
|
||||
void Combat_OnGameLoad();
|
||||
void _stdcall SetNoBurstMode(TGameObj* critter, DWORD on);
|
||||
void _stdcall SetNoBurstMode(TGameObj* critter, bool on);
|
||||
void _stdcall DisableAimedShots(DWORD pid);
|
||||
void _stdcall ForceAimedShots(DWORD pid);
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include "Define.h"
|
||||
#include "FalloutEngine.h"
|
||||
#include "Logging.h"
|
||||
|
||||
|
||||
+47
-11
@@ -19,10 +19,9 @@
|
||||
#include <vector>
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include "FalloutEngine.h"
|
||||
#include "Arrays.h"
|
||||
#include "DebugEditor.h"
|
||||
#include "FalloutEngine.h"
|
||||
#include "ScriptExtender.h"
|
||||
|
||||
enum DECode {
|
||||
@@ -302,20 +301,25 @@ hide:
|
||||
}
|
||||
}
|
||||
|
||||
static char* artDbgMsg = "Error: file not found: %s\n";
|
||||
static char* artDbgMsg = "\nERROR: File not found: %s\n";
|
||||
static void __declspec(naked) art_data_size_hook() {
|
||||
__asm {
|
||||
test edi, edi;
|
||||
jz artNotExist;
|
||||
retn;
|
||||
artNotExist:
|
||||
mov eax, [esp + 0x124 - 0x1C + 4]; // filename
|
||||
push eax;
|
||||
mov edx, [esp + 0x124 - 0x1C + 4]; // filename
|
||||
push edx;
|
||||
push artDbgMsg;
|
||||
call debug_printf_;
|
||||
add esp, 8;
|
||||
BREAKPOINT; // break program
|
||||
retn;
|
||||
push edx; // filename
|
||||
push artDbgMsg;
|
||||
lea eax, [esp + 0x124 - 0x124 + 20]; // buf
|
||||
push eax;
|
||||
call sprintf_;
|
||||
add esp, 20;
|
||||
lea eax, [esp + 4];
|
||||
jmp display_print_;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,9 +332,30 @@ static void __declspec(naked) win_debug_hook() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) debug_log_hack() {
|
||||
__asm {
|
||||
push eax; // text
|
||||
push 0x5016EC; // fmt '%s'
|
||||
push ebx; // log file
|
||||
call fprintf_;
|
||||
add esp, 12;
|
||||
retn;
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) op_display_msg_hook() {
|
||||
__asm {
|
||||
cmp dword ptr ds:_debug_func, 0;
|
||||
jne debug;
|
||||
retn;
|
||||
debug:
|
||||
jmp config_get_value_;
|
||||
}
|
||||
}
|
||||
|
||||
static void DebugModePatch() {
|
||||
DWORD dbgMode = iniGetInt("Debugging", "DebugMode", 0, ddrawIniDef);
|
||||
if (dbgMode) {
|
||||
int dbgMode = iniGetInt("Debugging", "DebugMode", 0, ddrawIniDef);
|
||||
if (dbgMode > 0) {
|
||||
dlog("Applying debugmode patch.", DL_INIT);
|
||||
// If the player is using an exe with the debug patch already applied, just skip this block without erroring
|
||||
if (*((DWORD*)0x444A64) != 0x082327E8) {
|
||||
@@ -354,11 +379,22 @@ static void DebugModePatch() {
|
||||
if (iniGetInt("Debugging", "HideObjIsNullMsg", 0, ddrawIniDef)) {
|
||||
MakeJump(0x453FD2, dbg_error_hack);
|
||||
}
|
||||
// prints a debug message about missing art file for critters and interrupts game execution
|
||||
// prints a debug message about missing art file for critters to both debug.log and the message window
|
||||
HookCall(0x419B65, art_data_size_hook);
|
||||
|
||||
// Fix to prevent crashes when there is a '%' character in the printed message
|
||||
if (dbgMode > 1) {
|
||||
MakeCall(0x4C703F, debug_log_hack);
|
||||
BlockCall(0x4C7044); // just nop code
|
||||
}
|
||||
// replace calling debug_printf_ with _debug_func
|
||||
long long data = 0x51DF0415FFF08990; // mov eax, esi; call ds:_debug_func
|
||||
SafeWriteBytes(0x455419, (BYTE*)&data, 8); // op_display_msg_
|
||||
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
// Just for speeding up display_msg function (optional)
|
||||
HookCall(0x455404, op_display_msg_hook);
|
||||
}
|
||||
|
||||
static void DontDeleteProtosPatch() {
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
enum ObjType : char
|
||||
{
|
||||
OBJ_TYPE_ITEM = 0,
|
||||
OBJ_TYPE_CRITTER = 1,
|
||||
OBJ_TYPE_SCENERY = 2,
|
||||
OBJ_TYPE_WALL = 3,
|
||||
OBJ_TYPE_TILE = 4,
|
||||
OBJ_TYPE_MISC = 5,
|
||||
OBJ_TYPE_SPATIAL = 6
|
||||
};
|
||||
|
||||
enum ArtType : char
|
||||
{
|
||||
OBJ_TYPE_INTRFACE = 6,
|
||||
OBJ_TYPE_INVEN = 7,
|
||||
OBJ_TYPE_HEAD = 8,
|
||||
OBJ_TYPE_BACKGROUND = 9,
|
||||
OBJ_TYPE_SKILLDEX = 10
|
||||
};
|
||||
|
||||
// Some FO2 PIDs possibly used by engine
|
||||
enum ProtoId : long
|
||||
{
|
||||
@@ -369,6 +389,20 @@ enum RollResult
|
||||
ROLL_CRITICAL_SUCCESS = 0x3,
|
||||
};
|
||||
|
||||
enum WinButtonFlags : long
|
||||
{
|
||||
WIN_OwnerFlag = 0x1,
|
||||
WIN_UnknownFlag2 = 0x2,
|
||||
WIN_MoveOnTop = 0x4,
|
||||
WIN_Hidden = 0x8,
|
||||
WIN_Exclusive = 0x10,
|
||||
WIN_Transparent = 0x20,
|
||||
WIN_UnknownFlag40 = 0x40,
|
||||
WIN_UnknownFlag80 = 0x80,
|
||||
WIN_ScriptWindow = 0x100,
|
||||
WIN_itsButton = 0x10000,
|
||||
};
|
||||
|
||||
enum QueueType : long
|
||||
{
|
||||
drug_effect_event = 0, // critter use drug
|
||||
|
||||
@@ -42,7 +42,7 @@ static const DWORD AddPageOffset01Addrs[] = {
|
||||
void SavePageOffsets() {
|
||||
char SavePath[MAX_PATH], buffer[6];
|
||||
|
||||
sprintf_s(SavePath, MAX_PATH, filename, *(char**)_patches);
|
||||
sprintf_s(SavePath, MAX_PATH, filename, *ptr_patches);
|
||||
|
||||
_itoa_s(*ptr_slot_cursor, buffer, 10);
|
||||
WritePrivateProfileString("POSITION", "ListNum", buffer, SavePath);
|
||||
@@ -65,7 +65,7 @@ static void __declspec(naked) save_page_offsets(void) {
|
||||
void LoadPageOffsets() {
|
||||
char LoadPath[MAX_PATH];
|
||||
|
||||
sprintf_s(LoadPath, MAX_PATH, filename, *(char**)_patches);
|
||||
sprintf_s(LoadPath, MAX_PATH, filename, *ptr_patches);
|
||||
|
||||
*ptr_slot_cursor = iniGetInt("POSITION", "ListNum", 0, LoadPath);
|
||||
if (*ptr_slot_cursor > 9) {
|
||||
@@ -157,7 +157,7 @@ void SetPageNum() {
|
||||
}
|
||||
|
||||
// fill over text area with consol black colour
|
||||
for (unsigned int y = SaveLoadWin->width * 52; y < SaveLoadWin->width * 82; y = y + SaveLoadWin->width) {
|
||||
for (int y = SaveLoadWin->width * 52; y < SaveLoadWin->width * 82; y = y + SaveLoadWin->width) {
|
||||
memset(SaveLoadWin->surface + y + 170 - TxtMaxWidth / 2, 0xCF, TxtMaxWidth);
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ void DrawPageText() {
|
||||
}
|
||||
|
||||
// fill over text area with consol black colour
|
||||
for (unsigned int y = SaveLoadWin->width * 52; y < SaveLoadWin->width * 82; y = y + SaveLoadWin->width) {
|
||||
for (int y = SaveLoadWin->width * 52; y < SaveLoadWin->width * 82; y = y + SaveLoadWin->width) {
|
||||
memset(SaveLoadWin->surface + 50 + y, 0xCF, 240);
|
||||
}
|
||||
|
||||
|
||||
+284
-29
File diff suppressed because it is too large
Load Diff
+101
-17
@@ -24,6 +24,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Define.h"
|
||||
#include "FalloutStructs.h"
|
||||
|
||||
// Global variable offsets
|
||||
@@ -63,12 +64,15 @@
|
||||
#define _curr_font_num 0x51E3B0
|
||||
#define _curr_pc_stat 0x6681AC
|
||||
#define _curr_stack 0x59E96C
|
||||
#define _currentWindow 0x51DCB8
|
||||
#define _cursor_line 0x664514
|
||||
#define _debug_func 0x51DF04
|
||||
#define _dialog_target 0x518848
|
||||
#define _dialog_target_is_party 0x51884C
|
||||
#define _dialogue_head 0x518850
|
||||
#define _dialogue_state 0x518714
|
||||
#define _dialogue_switch_mode 0x518718
|
||||
#define _display_win 0x631E4C
|
||||
#define _displayMapList 0x41B560
|
||||
#define _dropped_explosive 0x5190E0
|
||||
#define _drugInfoList 0x5191CC
|
||||
@@ -91,6 +95,7 @@
|
||||
#define _game_global_vars 0x5186C0
|
||||
#define _game_ui_disabled 0x5186B4
|
||||
#define _game_user_wants_to_quit 0x5186CC
|
||||
#define _gconfig_file_name 0x58E978
|
||||
#define _gcsd 0x51094C
|
||||
#define _gdBarterMod 0x51873C
|
||||
#define _gDialogMusicVol 0x5187D8
|
||||
@@ -163,6 +168,7 @@
|
||||
#define _name_sort_list 0x56FCB0
|
||||
#define _num_game_global_vars 0x5186C4
|
||||
#define _num_map_global_vars 0x519574
|
||||
#define _num_windows 0x6ADF24
|
||||
#define _obj_dude 0x6610B8
|
||||
#define _obj_seen 0x662445
|
||||
#define _objectTable 0x639DA0
|
||||
@@ -222,6 +228,7 @@
|
||||
#define _stack_offset 0x59E844
|
||||
#define _stat_data 0x51D53C
|
||||
#define _stat_flag 0x66452A
|
||||
#define _sWindows 0x6727B0
|
||||
#define _Tag_ 0x5708B0
|
||||
#define _tag_skill 0x668070
|
||||
#define _target_curr_stack 0x59E948
|
||||
@@ -244,6 +251,7 @@
|
||||
#define _trait_data 0x51DB84
|
||||
#define _view_page 0x664520
|
||||
#define _wd_obj 0x59E98C
|
||||
#define _window 0x6ADE58
|
||||
#define _wmAreaInfoList 0x51DDF8
|
||||
#define _wmLastRndTime 0x51DEA0
|
||||
#define _wmMaxMapNum 0x51DE10
|
||||
@@ -256,10 +264,13 @@
|
||||
|
||||
// colors
|
||||
#define _BlueColor 0x6A38EF
|
||||
#define _DARK_GREY_Color 0x6A59D8
|
||||
#define _DarkGreenColor 0x6A3A90
|
||||
#define _DarkGreenGreyColor 0x6A3DF1
|
||||
#define _DullPinkColor 0x6AB718
|
||||
#define _GoodColor 0x6AB4EF
|
||||
#define _GreenColor 0x6A3CB0
|
||||
#define _LIGHT_GREY_Color 0x6A76BF
|
||||
#define _PeanutButter 0x6A82F3
|
||||
#define _RedColor 0x6AB4D0
|
||||
#define _WhiteColor 0x6AB8CF
|
||||
@@ -272,7 +283,7 @@ extern long* ptr_pc_traits; // 2 of them
|
||||
|
||||
extern DWORD* ptr_aiInfoList;
|
||||
extern DWORD* ptr_ambient_light;
|
||||
extern Art* ptr_art;
|
||||
extern sArt* ptr_art;
|
||||
extern DWORD* ptr_art_name;
|
||||
extern DWORD* ptr_art_vault_guy_num;
|
||||
extern DWORD* ptr_art_vault_person_nums;
|
||||
@@ -291,14 +302,17 @@ extern DWORD* ptr_combat_state;
|
||||
extern DWORD* ptr_combat_turn_running;
|
||||
extern DWORD* ptr_combatNumTurns;
|
||||
extern DWORD* ptr_crit_succ_eff;
|
||||
extern DWORD* ptr_critter_db_handle;
|
||||
extern PathNode** ptr_critter_db_handle;
|
||||
extern DWORD* ptr_critterClearObj;
|
||||
extern DWORD* ptr_crnt_func;
|
||||
extern DWORD* ptr_curr_font_num;
|
||||
extern DWORD* ptr_curr_pc_stat;
|
||||
extern DWORD* ptr_curr_stack;
|
||||
extern DWORD* ptr_cursor_line;
|
||||
extern DWORD* ptr_dialog_target;
|
||||
extern BYTE* ptr_DARK_GREY_Color;
|
||||
extern BYTE* ptr_DarkGreenColor;
|
||||
extern BYTE* ptr_DarkGreenGreyColor;
|
||||
extern TGameObj** ptr_dialog_target;
|
||||
extern DWORD* ptr_dialog_target_is_party;
|
||||
extern DWORD* ptr_drugInfoList;
|
||||
extern DWORD* ptr_edit_win;
|
||||
@@ -335,6 +349,7 @@ extern TGameObj** ptr_i_lhand;
|
||||
extern TGameObj** ptr_i_rhand;
|
||||
extern DWORD* ptr_i_wid;
|
||||
extern TGameObj** ptr_i_worn;
|
||||
extern DWORD* ptr_idle_func;
|
||||
extern DWORD* ptr_In_WorldMap;
|
||||
extern DWORD* ptr_info_line;
|
||||
extern DWORD* ptr_interfaceWindow;
|
||||
@@ -353,6 +368,7 @@ extern DWORD* ptr_last_button_winID;
|
||||
extern DWORD* ptr_last_level;
|
||||
extern DWORD* ptr_Level_;
|
||||
extern DWORD* ptr_Lifegiver;
|
||||
extern BYTE* ptr_LIGHT_GREY_Color;
|
||||
extern DWORD* ptr_lipsFID;
|
||||
extern DWORD* ptr_list_com;
|
||||
extern DWORD* ptr_list_total;
|
||||
@@ -363,7 +379,7 @@ extern DWORD* ptr_main_ctd;
|
||||
extern DWORD* ptr_main_window;
|
||||
extern DWORD* ptr_map_elevation;
|
||||
extern DWORD* ptr_map_global_vars;
|
||||
extern DWORD* ptr_master_db_handle;
|
||||
extern PathNode** ptr_master_db_handle;
|
||||
extern DWORD* ptr_max;
|
||||
extern long* ptr_maxScriptNum;
|
||||
extern DWORD* ptr_Meet_Frank_Horrigan;
|
||||
@@ -396,8 +412,8 @@ extern DWORD** ptr_partyMemberLevelUpInfoList;
|
||||
extern DWORD** ptr_partyMemberList; // each struct - 4 integers, first integer - objPtr
|
||||
extern DWORD* ptr_partyMemberMaxCount;
|
||||
extern DWORD** ptr_partyMemberPidList;
|
||||
extern DWORD* ptr_patches;
|
||||
extern DWORD* ptr_paths;
|
||||
extern char** ptr_patches;
|
||||
extern PathNode** ptr_paths;
|
||||
extern DWORD* ptr_pc_crit_succ_eff;
|
||||
extern DWORD* ptr_pc_kill_counts;
|
||||
extern char* ptr_pc_name;
|
||||
@@ -434,10 +450,11 @@ extern DWORD* ptr_stack;
|
||||
extern DWORD* ptr_stack_offset;
|
||||
extern DWORD* ptr_stat_data;
|
||||
extern DWORD* ptr_stat_flag;
|
||||
extern DWORD* ptr_sWindows; // total 16 sWindow struct
|
||||
extern DWORD* ptr_Tag_;
|
||||
extern DWORD* ptr_tag_skill;
|
||||
extern DWORD* ptr_target_curr_stack;
|
||||
extern DWORD* ptr_target_pud;
|
||||
extern DWORD** ptr_target_pud;
|
||||
extern DWORD* ptr_target_stack;
|
||||
extern DWORD* ptr_target_stack_offset;
|
||||
extern DWORD* ptr_target_str;
|
||||
@@ -456,6 +473,7 @@ extern DWORD* ptr_title_font;
|
||||
extern DWORD* ptr_trait_data;
|
||||
extern DWORD* ptr_view_page;
|
||||
extern DWORD* ptr_wd_obj;
|
||||
extern DWORD* ptr_window; // total 50 WINinfo*
|
||||
extern BYTE* ptr_WhiteColor;
|
||||
extern DWORD* ptr_wmAreaInfoList;
|
||||
extern DWORD* ptr_wmLastRndTime;
|
||||
@@ -487,6 +505,7 @@ extern const DWORD art_frame_data_;
|
||||
extern const DWORD art_frame_length_;
|
||||
extern const DWORD art_frame_width_;
|
||||
extern const DWORD art_get_code_;
|
||||
extern const DWORD art_get_name_;
|
||||
extern const DWORD art_id_;
|
||||
extern const DWORD art_init_;
|
||||
extern const DWORD art_lock_;
|
||||
@@ -512,6 +531,7 @@ extern const DWORD combat_turn_;
|
||||
extern const DWORD combat_turn_run_;
|
||||
extern const DWORD compute_damage_;
|
||||
extern const DWORD config_get_string_;
|
||||
extern const DWORD config_get_value_;
|
||||
extern const DWORD config_set_value_;
|
||||
extern const DWORD construct_box_bar_win_;
|
||||
extern const DWORD container_exit_;
|
||||
@@ -558,6 +578,7 @@ extern const DWORD debug_printf_;
|
||||
extern const DWORD debug_register_env_;
|
||||
extern const DWORD determine_to_hit_func_;
|
||||
extern const DWORD dialog_out_;
|
||||
extern const DWORD displayInWindow_;
|
||||
extern const DWORD display_inventory_;
|
||||
extern const DWORD display_print_; // eax - char* to display
|
||||
extern const DWORD display_scroll_down_;
|
||||
@@ -587,6 +608,7 @@ extern const DWORD executeProcedure_; // <eax> - programPtr, <edx> - procNumber
|
||||
extern const DWORD fadeSystemPalette_;
|
||||
extern const DWORD findVar_;
|
||||
extern const DWORD folder_print_line_;
|
||||
extern const DWORD fprintf_;
|
||||
extern const DWORD frame_ptr_;
|
||||
extern const DWORD game_exit_;
|
||||
extern const DWORD game_get_global_var_;
|
||||
@@ -708,6 +730,7 @@ extern const DWORD loadColorTable_;
|
||||
extern const DWORD LoadGame_;
|
||||
extern const DWORD loadProgram_; // loads script from scripts/ folder by file name and returns pointer to it: char* <eax> - file name (w/o extension)
|
||||
extern const DWORD LoadSlot_;
|
||||
extern const DWORD load_frame_;
|
||||
extern const DWORD loot_container_;
|
||||
extern const DWORD main_game_loop_;
|
||||
extern const DWORD main_init_system_;
|
||||
@@ -833,6 +856,7 @@ extern const DWORD register_clear_;
|
||||
extern const DWORD register_end_;
|
||||
extern const DWORD register_object_animate_; // int aObj<eax>, int aAnim<edx>, int delay<ebx>
|
||||
extern const DWORD register_object_animate_and_hide_; // int aObj<eax>, int aAnim<edx>, int delay<ebx>
|
||||
extern const DWORD register_object_call_;
|
||||
extern const DWORD register_object_change_fid_; // int aObj<eax>, int aFid<edx>, int aDelay<ebx>
|
||||
extern const DWORD register_object_funset_; // int aObj<eax>, int ???<edx>, int aDelay<ebx> - not really sure what this does
|
||||
extern const DWORD register_object_light_; // <eax>(int aObj<eax>, int aRadius<edx>, int aDelay<ebx>)
|
||||
@@ -894,6 +918,8 @@ extern const DWORD text_curr_;
|
||||
extern const DWORD text_font_;
|
||||
extern const DWORD text_object_create_;
|
||||
extern const DWORD tile_coord_; // eax - tilenum, edx (int*) - x, ebx (int*) - y
|
||||
extern const DWORD tile_dir_;
|
||||
extern const DWORD tile_dist_;
|
||||
extern const DWORD tile_num_;
|
||||
extern const DWORD tile_num_in_direction_;
|
||||
extern const DWORD tile_refresh_display_;
|
||||
@@ -903,6 +929,7 @@ extern const DWORD trait_get_;
|
||||
extern const DWORD trait_init_;
|
||||
extern const DWORD trait_level_;
|
||||
extern const DWORD trait_set_;
|
||||
extern const DWORD trans_cscale_;
|
||||
extern const DWORD use_inventory_on_;
|
||||
extern const DWORD _word_wrap_;
|
||||
extern const DWORD win_add_;
|
||||
@@ -912,6 +939,7 @@ extern const DWORD win_draw_;
|
||||
extern const DWORD win_draw_rect_;
|
||||
extern const DWORD win_enable_button_;
|
||||
extern const DWORD win_get_buf_;
|
||||
extern const DWORD win_get_top_win_;
|
||||
extern const DWORD win_hide_;
|
||||
extern const DWORD win_line_;
|
||||
extern const DWORD win_print_;
|
||||
@@ -919,6 +947,12 @@ extern const DWORD win_register_button_;
|
||||
extern const DWORD win_register_button_disable_;
|
||||
extern const DWORD win_register_button_sound_func_;
|
||||
extern const DWORD win_show_;
|
||||
extern const DWORD windowDisplayBuf_;
|
||||
extern const DWORD windowDisplayTransBuf_;
|
||||
extern const DWORD windowGetBuffer_;
|
||||
extern const DWORD windowHide_;
|
||||
extern const DWORD windowShow_;
|
||||
extern const DWORD windowWidth_;
|
||||
extern const DWORD wmFindCurSubTileFromPos_;
|
||||
extern const DWORD wmInterfaceScrollTabsStart_;
|
||||
extern const DWORD wmMapIsSaveable_;
|
||||
@@ -981,8 +1015,13 @@ extern const DWORD xvfprintf_;
|
||||
|
||||
// WRAPPERS:
|
||||
// TODO: move these to different namespace
|
||||
|
||||
// Prints debug message to debug.log file for develop build
|
||||
void DevPrintf(const char* fmt, ...);
|
||||
|
||||
long __stdcall ItemGetType(TGameObj* item);
|
||||
long __stdcall ItemSize(TGameObj* item);
|
||||
long __stdcall ItemWeight(TGameObj* item);
|
||||
|
||||
long __stdcall IsPartyMember(TGameObj* obj);
|
||||
long __stdcall PartyMemberGetCurrentLevel(TGameObj* obj);
|
||||
@@ -990,23 +1029,41 @@ long __stdcall PartyMemberGetCurrentLevel(TGameObj* obj);
|
||||
char* GetProtoPtr(long pid);
|
||||
char AnimCodeByWeapon(TGameObj* weapon);
|
||||
|
||||
// Displays message in main UI console window
|
||||
void DisplayConsoleMessage(const char* msg);
|
||||
const char* __stdcall GetMessageStr(DWORD fileAddr, DWORD messageId);
|
||||
// prints message to debug.log file
|
||||
void __declspec() DebugPrintf(const char* fmt, ...);
|
||||
|
||||
// Change the name of playable character
|
||||
void CritterPcSetName(const char* newName);
|
||||
// Displays message in main UI console window
|
||||
void __stdcall DisplayConsoleMessage(const char* msg);
|
||||
const char* __stdcall GetMessageStr(DWORD fileAddr, DWORD messageId);
|
||||
|
||||
// Returns the name of the critter
|
||||
const char* __stdcall CritterName(TGameObj* critter);
|
||||
|
||||
// Change the name of playable character
|
||||
void __stdcall CritterPcSetName(const char* newName);
|
||||
|
||||
// Checks if given file exists in DB
|
||||
bool __stdcall DbAccess(const char* fileName);
|
||||
|
||||
TGameObj* __stdcall ScrFindObjFromProgram(TProgram* program);
|
||||
|
||||
// Saves pointer to script object into scriptPtr using scriptID.
|
||||
// Returns 0 on success, -1 on failure.
|
||||
long __stdcall ScrPtr(long scriptId, TScript** scriptPtr);
|
||||
|
||||
long __stdcall ScrNew(long* scriptID, long sType);
|
||||
|
||||
long __stdcall ScrRemove(long scriptID);
|
||||
|
||||
// Returns the number of local variables of the object script
|
||||
long GetScriptLocalVars(long sid);
|
||||
|
||||
long __fastcall GetTopWindowID(long xPos, long yPos);
|
||||
|
||||
void GetObjectsTileRadius(std::vector<TGameObj*> &objs, long sourceTile, long radius, long elev, long type);
|
||||
|
||||
void __fastcall RegisterObjectCall(long* target, long* source, void* func, long delay);
|
||||
|
||||
long __fastcall ScrGetLocalVar(long sid, long varId, long* value);
|
||||
long __fastcall ScrSetLocalVar(long sid, long varId, long value);
|
||||
|
||||
@@ -1041,7 +1098,7 @@ void __stdcall InterpretPushLong(TProgram* scriptPtr, DWORD val);
|
||||
// pushes value type to Data stack (must be preceded by InterpretPushLong)
|
||||
void __stdcall InterpretPushShort(TProgram* scriptPtr, DWORD valType);
|
||||
|
||||
const char* __stdcall InterpretGetString(TProgram* scriptPtr, DWORD strId, DWORD dataType);
|
||||
const char* __fastcall InterpretGetString(TProgram* scriptPtr, DWORD dataType, DWORD strId);
|
||||
|
||||
DWORD __stdcall InterpretAddString(TProgram* scriptPtr, const char* str);
|
||||
|
||||
@@ -1049,25 +1106,34 @@ DWORD __stdcall InterpretAddString(TProgram* scriptPtr, const char* str);
|
||||
// USE WITH CAUTION
|
||||
void __declspec() InterpretError(const char* fmt, ...);
|
||||
|
||||
// prints message to debug.log file
|
||||
void __declspec() DebugPrintf(const char* fmt, ...);
|
||||
|
||||
// returns the name of current procedure by program pointer
|
||||
const char* __stdcall FindCurrentProc(TProgram* program);
|
||||
|
||||
// creates a window with the name and flags
|
||||
long __fastcall CreateWindowFunc(const char* winName, long x, long y, long width, long height, long bgColorIndex, long flags);
|
||||
long __fastcall CreateWindowFunc(const char* winName, DWORD x, DWORD y, DWORD width, DWORD height, long color, long flags);
|
||||
|
||||
// creates a button
|
||||
long __stdcall WinRegisterButton(DWORD winRef, long xPos, long yPos, long width, long height, long hoverOn, long hoverOff, long buttonDown, long buttonUp, BYTE* pictureUp, BYTE* pictureDown, long arg12, long buttonType);
|
||||
|
||||
void __stdcall DialogOut(const char* text);
|
||||
|
||||
void __fastcall WindowDisplayBuf(long x, long width, long y, long height, void* data, long noTrans);
|
||||
|
||||
void __fastcall DisplayInWindow(long w_here, long width, long height, void* data);
|
||||
|
||||
void __fastcall TransCscale(long i_width, long i_height, long s_width, long s_height, long xy_shift, long w_width, void* data);
|
||||
|
||||
long __fastcall GetGameConfigString(const char* outValue, const char* section, const char* param);
|
||||
|
||||
long __fastcall WordWrap(const char* text, int maxWidth, DWORD* buf, BYTE* count);
|
||||
|
||||
DWORD __stdcall AddWin(long x, long y, long width, long height, long bgColorIndex, long flags);
|
||||
void __stdcall ShowWin(DWORD winRef);
|
||||
void __stdcall HideWin(DWORD winRef);
|
||||
void __stdcall RedrawWin(DWORD winRef);
|
||||
void __stdcall DestroyWin(DWORD winRef);
|
||||
|
||||
long __stdcall WindowWidth();
|
||||
|
||||
void __fastcall DisplayInventory(long inventoryOffset, long visibleOffset, long mode);
|
||||
|
||||
@@ -1081,6 +1147,10 @@ long __stdcall TraitLevel(long traitID);
|
||||
|
||||
long __stdcall QueueFindFirst(TGameObj* object, long qType);
|
||||
|
||||
void __fastcall make_straight_path_func_wrapper(TGameObj* objFrom, DWORD tileFrom, DWORD tileTo, void* rotationPtr, DWORD* result, long flags, void* func);
|
||||
|
||||
TGameObj* __fastcall obj_blocking_at_wrapper(TGameObj* obj, DWORD tile, DWORD elevation, void* func);
|
||||
|
||||
TGameObj* __stdcall ObjFindFirst();
|
||||
|
||||
TGameObj* __stdcall ObjFindFirstAtTile(long elevation, long tileNum);
|
||||
@@ -1097,8 +1167,16 @@ void __stdcall MapDirErase(const char* folder, const char* ext);
|
||||
|
||||
TGameObj* __fastcall ObjBlockingAt(TGameObj* object, long tile, long elevation);
|
||||
|
||||
long __fastcall ObjNewSidInst(TGameObj* object, long sType, long scriptIndex);
|
||||
|
||||
long __fastcall TileNum(long x, long y);
|
||||
|
||||
long __fastcall TileNumInDirection(long tile, long rotation, long distance);
|
||||
|
||||
long __stdcall TileDist(long scrTile, long dstTile);
|
||||
|
||||
long __stdcall TileDir(long scrTile, long dstTile);
|
||||
|
||||
// for the backported AmmoCostHook from 4.x
|
||||
long __stdcall ItemWAnimWeap(TGameObj* item, DWORD hitMode);
|
||||
long __stdcall ItemWComputeAmmoCost(TGameObj* item, DWORD* rounds);
|
||||
@@ -1120,3 +1198,9 @@ void __fastcall IntfaceUpdateItems(long animate, long modeLeft, long modeRight);
|
||||
long __stdcall InvenUnwield(TGameObj* critter, long slot);
|
||||
|
||||
long __fastcall ItemAddForce(TGameObj* critter, TGameObj* item, long count);
|
||||
|
||||
long __fastcall MouseClickIn(long x, long y, long x_end, long y_end);
|
||||
|
||||
const char* __stdcall ArtGetName(long artFID);
|
||||
|
||||
long __stdcall LoadFrame(const char* filename, FrmFile** frmPtr);
|
||||
|
||||
+61
-24
@@ -36,7 +36,7 @@ struct TInvenRec {
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
/* 15 */
|
||||
/* 15 */
|
||||
#pragma pack(push, 1)
|
||||
struct TGameObj {
|
||||
long ID;
|
||||
@@ -113,7 +113,7 @@ struct TScript {
|
||||
long self_obj_id;
|
||||
long local_var_offset;
|
||||
long num_local_vars;
|
||||
long scr_return;
|
||||
long return_value;
|
||||
long action;
|
||||
long fixed_param;
|
||||
TGameObj *self_obj;
|
||||
@@ -128,27 +128,6 @@ struct TScript {
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
enum ScriptTypes
|
||||
{
|
||||
SCRIPT_SYSTEM = 0,
|
||||
SCRIPT_SPATIAL = 1,
|
||||
SCRIPT_TIME = 2,
|
||||
SCRIPT_ITEM = 3,
|
||||
SCRIPT_CRITTER = 4,
|
||||
};
|
||||
|
||||
/* 24 */
|
||||
enum ObjectTypes
|
||||
{
|
||||
OBJ_TYPE_ITEM = 0,
|
||||
OBJ_TYPE_CRITTER = 1,
|
||||
OBJ_TYPE_SCENERY = 2,
|
||||
OBJ_TYPE_WALL = 3,
|
||||
OBJ_TYPE_TILE = 4,
|
||||
OBJ_TYPE_MISC = 5,
|
||||
OBJ_TYPE_SPATIAL = 6,
|
||||
};
|
||||
|
||||
/* 25 */
|
||||
#pragma pack(push, 1)
|
||||
struct TProgram {
|
||||
@@ -171,7 +150,7 @@ struct TProgram {
|
||||
#pragma pack(pop)
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct Art {
|
||||
struct sArt {
|
||||
long flags;
|
||||
char path[16];
|
||||
char* names;
|
||||
@@ -190,6 +169,13 @@ struct BoundRect {
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct DbFile {
|
||||
long fileType;
|
||||
void* handle;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct FrmFile {
|
||||
long id; //0x00
|
||||
@@ -236,6 +222,57 @@ public:
|
||||
} FrmHeaderData;
|
||||
#pragma pack(pop)
|
||||
|
||||
//fallout2 path node structure
|
||||
#pragma pack(push, 1)
|
||||
struct PathNode {
|
||||
char* path;
|
||||
void* pDat;
|
||||
long isDat;
|
||||
PathNode* next;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
//for holding window info
|
||||
#pragma pack(push, 1)
|
||||
struct WINinfo {
|
||||
long wID;
|
||||
long flags;
|
||||
RECT wRect;
|
||||
long width;
|
||||
long height;
|
||||
long clearColour;
|
||||
long rand1;
|
||||
long rand2;
|
||||
BYTE *surface; // bytes frame data ref to palette
|
||||
long *buttonsList;
|
||||
long unknown5; // buttonptr?
|
||||
long unknown6;
|
||||
long *menuBar;
|
||||
long *drawFunc;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct sWindow {
|
||||
char name[32];
|
||||
long wID;
|
||||
long width;
|
||||
long height;
|
||||
long unknown1;
|
||||
long unknown2;
|
||||
long unknown3;
|
||||
long unknown4;
|
||||
long *buttons;
|
||||
long numButtons;
|
||||
long unknown5;
|
||||
long unknown6;
|
||||
long clearColour;
|
||||
long flags;
|
||||
long unknown7;
|
||||
long unknown8;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct Queue {
|
||||
DWORD time;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user