Merge branch 'develop'

This commit is contained in:
NovaRain
2019-12-25 09:29:35 +08:00
83 changed files with 2396 additions and 1612 deletions
+46 -33
View File
@@ -1,12 +1,12 @@
;sfall configuration settings
;v4.2.1
;v4.2.2
[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
[ExtraPatches]
@@ -80,6 +80,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
@@ -288,9 +292,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
@@ -341,9 +342,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
@@ -372,8 +370,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
@@ -435,6 +431,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
@@ -455,7 +454,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
@@ -522,18 +521,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
;Allows you to change some parameters for drugs and their addictions
;See the Drugs.ini in the modders pack for an example file
;DrugsFile=Drugs.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
@@ -614,17 +601,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)
@@ -723,6 +706,35 @@ 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
;Allows you to change some parameters for drugs and their addictions
;See the Drugs.ini in the modders pack for an example file
;DrugsFile=sfall\Drugs.ini
;Point to an ini file containing elevator data
;ElevatorsFile=sfall\Elevators.ini
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Scripts]
;Comma-separated list of masked paths to load global scripts from
@@ -730,10 +742,11 @@ CreditsAtBottom=0
;Paths outside of scripts folder are supported
GlobalScriptPaths=scripts\gl*.int,scripts\sfall\gl*.int
;Uncomment the option to specify a common folder path for all ini files used by scripts
;You will have to put all the available ini files of the mods in this directory
;Uncomment the option to specify an additional folder path for ini files used by scripts
;The game will search for the ini files relative to this directory
;If the file is not found, the search will proceed relative to the root directory of the game
;The maximum length of the specified path is 61 characters
;IniConfigFolder=IniConfig
;IniConfigFolder=mods\iniConfigs
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Debugging]
@@ -755,8 +768,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)); }
}
+2 -6
View File
@@ -54,9 +54,7 @@ procedure combatturn_handler begin
// set perks (only work with 4.1.8+)
foreach (perkID in perksList) begin
level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
if (level) then begin
critter_add_trait(critter, TRAIT_PERK, perkID, level);
end
if (level) then critter_add_trait(critter, TRAIT_PERK, perkID, level);
end
intface_redraw;
lightDist := get_object_data(critter, OBJ_DATA_LIGHT_DISTANCE);
@@ -83,9 +81,7 @@ procedure combatturn_handler begin
if (dude_obj != real_dude_obj) then begin
foreach (perkID in perksList) begin
level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
if (level) then begin
critter_rm_trait(critter, TRAIT_PERK, perkID, level);
end
if (level) then critter_rm_trait(critter, TRAIT_PERK, perkID, level);
end
end
if isShowTag then begin
+7 -1
View File
@@ -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
+21 -6
View File
@@ -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)
@@ -20,6 +19,7 @@
#define HEROWIN (0x40000)
#define DIALOGVIEW (0x80000)
#define COUNTERWIN (0x100000) // counter window for moving multiple items or setting a timer
#define SPECIAL (0x80000000)
//Valid arguments to register_hook
#define HOOK_TOHIT (0)
@@ -63,6 +63,8 @@
#define HOOK_SETLIGHTING (38)
#define HOOK_SNEAK (39)
#define HOOK_STDPROCEDURE (40)
#define HOOK_STDPROCEDURE_END (41)
#define HOOK_TARGETOBJECT (42)
//Valid arguments to list_begin
#define LIST_CRITTERS (0)
@@ -249,8 +251,9 @@
// sfall_funcX macros
#define add_extra_msg_file(name) sfall_func1("add_extra_msg_file", name)
#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 car_gas_amount sfall_func0("car_gas_amount")
@@ -276,23 +279,29 @@
#define get_object_ai_data(obj, aiParam) sfall_func2("get_object_ai_data", obj, aiParam)
#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_string_pointer(text) sfall_func1("get_string_pointer", text)
#define get_text_width(text) sfall_func1("get_text_width", text)
#define has_fake_perk_npc(npc, perk) sfall_func2("has_fake_perk_npc", npc, perk)
#define has_fake_trait_npc(npc, trait) sfall_func2("has_fake_trait_npc", npc, trait)
#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")
#define intface_show sfall_func0("intface_show")
#define inventory_redraw(invSide) sfall_func1("inventory_redraw", invSide)
#define item_make_explosive(pid, aPid, min, max) sfall_func4("item_make_explosive", pid, aPid, min, max)
#define item_make_explosive(pid, activePid, min, max) sfall_func4("item_make_explosive", pid, activePid, min, max)
#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_can_rest_on_map(map, elev, value) sfall_func3("set_can_rest_on_map", map, elev, value)
#define set_car_intface_art(artIndex) sfall_func1("set_car_intface_art", artIndex)
#define set_cursor_mode(mode) sfall_func1("set_cursor_mode", mode)
@@ -307,11 +316,17 @@
#define set_rest_heal_time(time) sfall_func1("set_rest_heal_time", time)
#define set_rest_mode(mode) sfall_func1("set_rest_mode", mode)
#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)
#define set_fake_perk_npc(npc, perk, level, image, desc) sfall_func5("set_fake_perk_npc", npc, perk, level, image, desc)
+50 -32
View File
@@ -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...)
@@ -513,6 +516,7 @@ HOOK_GAMEMODECHANGE (hs_gamemodechange.int)
Runs once every time when the game mode was changed, like opening/closing the inventory, character screen, pipboy, etc.
int arg1 - event type: 1 - when the player exits the game, 0 - otherwise
int arg2 - the previous game mode
-------------------------------------------
@@ -557,8 +561,8 @@ HOOK_USESKILLON (hs_useskillon.int)
Runs before using any skill on any object. Lets you override the critter that uses the skill.
NOTE: the user critter can't be overridden when using Steal skill.
Critter arg1 - The user critter (usually dude_obj)
Obj arg2 - The target object/critter
Critter arg1 - the user critter (usually dude_obj)
Obj arg2 - the target object/critter
int arg3 - skill being used
int ret1 - a new critter to override the user critter. Pass -1 to cancel the skill use, pass 0 to skip this return value
@@ -572,11 +576,11 @@ Runs when Fallout is checking all the tiles within the explosion radius for targ
The tile checking will be interrupted when 6 additional targets (critters) are received.
int arg1 - event type: 1 - when checking objects within the explosion radius without causing damage (e.g. the player drops an active explosive), 0 - otherwise
Critter arg2 - The attacker
int arg3 - The tile on which the explosion occurs
Critter arg2 - the attacker
int arg3 - the tile on which the explosion occurs
int arg4 - checked tile within the explosion radius
Obj arg5 - first found object on the checked tile as an additional target
Critter arg6 - The target critter, may be 0 or equal to the attacker
Critter arg6 - the target critter, may be 0 or equal to the attacker
int arg7 - 1 when using throwing weapons (e.g. grenades), 0 otherwise
int ret1 - overrides the found object on the checked tile, pass 0 to skip the object
@@ -591,20 +595,20 @@ Runs when:
2) AI decides whether it is safe to use area attack (burst, grenades), if he might hit friendlies.
Does not run for misses, non-combat damage like dynamite explosions, or if one of the damage formulas is selected in ddraw.ini.
Critter arg1 - The attacker
Critter arg2 - The target
Obj arg3 - The weapon used in the attack
int arg4 - Attack Type (see ATKTYPE_* constants)
int arg5 - Number of bullets actually hit the target (1 for melee attacks)
int arg6 - Target's Damage Resistance (DR) value (affected by critical hit effects, perks, traits, and special unarmed attacks)
int arg7 - Target's Damage Threshold (DT) value (affected by critical hit effects, perks, traits, and special unarmed attacks)
int arg8 - Bonus ranged damage from the perk
int arg9 - Damage Multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled)
int arg10 - Combat Difficulty multiplier (125 - rough, 100 - normal, 75 - wimpy; for player or party members it's always 100)
int arg11 - The calculated amount of damage (usually 0, required when using multiple hook scripts to calculate damage and using the set_sfall_arg function)
mixed arg12 - Computed attack results (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data)
Critter arg1 - the attacker
Critter arg2 - the target
Obj arg3 - the weapon used in the attack
int arg4 - attack type (see ATKTYPE_* constants)
int arg5 - number of bullets actually hit the target (1 for melee attacks)
int arg6 - target's Damage Resistance (DR) value (affected by critical hit effects, perks, traits, and special unarmed attacks)
int arg7 - target's Damage Threshold (DT) value (affected by critical hit effects, perks, traits, and special unarmed attacks)
int arg8 - bonus ranged damage from the perk
int arg9 - damage multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled)
int arg10 - combat difficulty multiplier (125 - rough, 100 - normal, 75 - wimpy; for player or party members it's always 100)
int arg11 - the calculated amount of damage (usually 0, required when using multiple hook scripts to calculate damage and using the set_sfall_arg function)
mixed arg12 - computed attack results (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data)
int ret1 - The returned amount of damage
int ret1 - the returned amount of damage
-------------------------------------------
@@ -635,13 +639,27 @@ int ret2 - overrides the duration time for the current result
-------------------------------------------
HOOK_STDPROCEDURE (hs_stdprocedure.int)
HOOK_STDPROCEDURE, HOOK_STDPROCEDURE_END (hs_stdprocedure.int)
Runs before Fallout executes a standard procedure (handler) in any script of any object.
Runs before or after Fallout engine executes a standard procedure (handler) in any script of any object.
NOTE: this hook will not be executed for "start", critter_p_proc, timed_event_p_proc, and map_update_p_proc procedures.
int arg1 - the number of the standard script handler (see define.h)
Obj arg2 - the object that owns this handler (self_obj)
Obj arg3 - the object that called this handler (source_obj, can be 0)
int arg4 - 1 after procedure execution (for HOOK_STDPROCEDURE_END), 0 otherwise
int ret1 - pass -1 to cancel the execution of the handler
int ret1 - pass -1 to cancel the execution of the handler (only for HOOK_STDPROCEDURE)
-------------------------------------------
HOOK_TARGETOBJECT (hs_targetobject.int)
Runs when the targeting cursor hovers over an object, or when the player tries to attack the target object.
You can override the target object or prevent the player from attacking the chosen target.
int arg1 - event type: 0 - when the targeting cursor hovers over the object, 1 - when trying to attack the target object
int arg2 - 1 when the target object is valid to attack, 0 otherwise
Obj arg3 - the target object
mixed ret1 - overrides the target object, or pass -1 to prevent the player from attacking the object
+75 -11
View File
@@ -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/array 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:
@@ -259,7 +263,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
@@ -449,6 +456,7 @@ Some utility/math functions are available:
> 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
- NOTE: all keys and their values will be of String type
> int sfall_func0("car_gas_amount")
- returns current amount of fuel in player's car (between 0 and 80000)
@@ -514,9 +522,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)
> void sfall_func3("item_make_explosive", int pid, int activePid, int damage)
> void sfall_func4("item_make_explosive", int pid, int activePid, int min, int max)
@@ -555,10 +564,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
@@ -596,8 +606,8 @@ Some utility/math functions are available:
> 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 FRM image in the active window created by vanilla CreateWin or sfall's create_win script function
- pathFile/artId: path to the FRM file (e.g. "art\\inven\\5mmap.frm"), or its FRM ID number (e.g. 117440550, see specification of the FID format)
- 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
@@ -627,12 +637,66 @@ optional argument:
- 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
+32 -4
View File
@@ -181,6 +181,37 @@ long GetScriptLocalVars(long sid) {
return (script) ? script->numLocalVars : 0;
}
// Returns window ID by x/y coordinate (hidden windows are ignored)
long __fastcall GetTopWindowID(long xPos, long yPos) {
fo::Window* win = nullptr;
long countWin = *(DWORD*)FO_VAR_num_windows - 1;
for (int n = countWin; n >= 0; n--) {
win = fo::var::window[n];
if (xPos >= win->wRect.left && xPos <= win->wRect.right && yPos >= win->wRect.top && yPos <= win->wRect.bottom) {
if (!(win->flags & fo::WinFlags::Hidden)) {
break;
}
}
}
return win->wID;
}
// Returns an array of objects within the specified radius from the source tile
void GetObjectsTileRadius(std::vector<fo::GameObject*> &objs, long sourceTile, long radius, long elev, long type = -1) {
for (long tile = 0; tile < 40000; tile++) {
fo::GameObject* obj = fo::func::obj_find_first_at_tile(elev, tile);
while (obj) {
if (type == -1 || type == obj->Type()) {
bool multiHex = (obj->flags & fo::ObjectFlag::MultiHex) ? true : false;
if (fo::func::tile_dist(sourceTile, obj->tile) <= (radius + multiHex)) {
objs.push_back(obj);
}
}
obj = fo::func::obj_find_next_at_tile();
}
}
}
//---------------------------------------------------------
//print text to surface
void PrintText(char *DisplayText, BYTE ColourIndex, DWORD Xpos, DWORD Ypos, DWORD TxtWidth, DWORD ToWidth, BYTE *ToSurface) {
@@ -211,14 +242,11 @@ DWORD GetTextHeight() {
//---------------------------------------------------------
//gets the length of a string using the currently selected font
DWORD GetTextWidth(char *TextMsg) {
DWORD TxtWidth;
DWORD GetTextWidth(const char *TextMsg) {
__asm {
mov eax, TextMsg;
call dword ptr ds:[FO_VAR_text_width]; //get text width
mov TxtWidth, eax;
}
return TxtWidth;
}
//---------------------------------------------------------
+5 -1
View File
@@ -76,12 +76,16 @@ bool IsPartyMember(fo::GameObject* critter);
// 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<fo::GameObject*> &objs, long sourceTile, long radius, long elev, long type);
// Print text to surface
void PrintText(char *displayText, BYTE colorIndex, DWORD x, DWORD y, DWORD textWidth, DWORD destWidth, BYTE *surface);
// gets the height of the currently selected font
DWORD GetTextHeight();
// gets the length of a string using the currently selected font
DWORD GetTextWidth(char *textMsg);
DWORD GetTextWidth(const char *textMsg);
// get width of Char for current font
DWORD GetCharWidth(char charVal);
// get maximum string length for current font - if all characters were maximum width
+13 -12
View File
@@ -445,15 +445,6 @@ enum class ScenerySubType : long
GENERIC = 5
};
enum ScriptTypes
{
SCRIPT_SYSTEM = 0,
SCRIPT_SPATIAL = 1,
SCRIPT_TIME = 2,
SCRIPT_ITEM = 3,
SCRIPT_CRITTER = 4,
};
// proto.h: stats //
enum Stat : long
@@ -505,8 +496,9 @@ enum Stat : long
STAT_real_max_stat = 38
};
namespace ScriptProc {
enum ScriptProc : long {
namespace Scripts {
enum ScriptProc : long
{
no_p_proc = 0,
start = 1,
spatial_p_proc = 2,
@@ -537,6 +529,15 @@ namespace ScriptProc {
combat_is_over_p_proc = 27,
count = 28
};
enum ScriptTypes : long
{
SCRIPT_SYSTEM = 0,
SCRIPT_SPATIAL = 1,
SCRIPT_TIME = 2,
SCRIPT_ITEM = 3,
SCRIPT_CRITTER = 4,
};
}
#define STAT_max_derived STAT_poison_resist
@@ -739,7 +740,7 @@ namespace WinFlags {
Transparent = 0x20,
UnknownFlag40 = 0x40,
UnknownFlag80 = 0x80,
scriptWindow = 0x100,
ScriptWindow = 0x100,
itsButton = 0x10000,
};
}
+12 -6
View File
@@ -17,7 +17,7 @@
*/
#pragma once
/*
/*
* FALLOUT2.EXE structs, function offsets and wrappers are included from here.
*/
@@ -55,6 +55,7 @@
Gets argument from stack to eax and puts its type to edx register
eax register must contain the script_ptr
jlabel - name of the jump label in case the value type is not INT
return: eax - arg value
*/
#define _GET_ARG_INT(jlabel) __asm { \
__asm mov edx, eax \
@@ -67,14 +68,19 @@
/*
Returns the value to the script
eax register must contain the script_ptr
eax and ebx register must contain the script_ptr
edx register must contain the returned value
rscript - register name for temporarily saving script_ptr
*/
#define _RET_VAL_INT(rscript) __asm { \
__asm mov rscript, eax \
#define _RET_VAL_INT __asm { \
__asm call fo::funcoffs::interpretPushLong_ \
__asm mov edx, VAR_TYPE_INT \
__asm mov eax, rscript \
__asm mov eax, ebx \
__asm call fo::funcoffs::interpretPushShort_ \
}
#define _J_RET_VAL_TYPE(type) __asm { \
__asm call fo::funcoffs::interpretPushLong_ \
__asm mov edx, type \
__asm mov eax, ebx \
__asm jmp fo::funcoffs::interpretPushShort_ \
}
+10 -4
View File
@@ -26,7 +26,7 @@ namespace fo
namespace func
{
// prints debug message to debug.log file for develop build
// Prints debug message to debug.log file for develop build
#ifndef NDEBUG
void __declspec(naked) dev_printf(const char* fmt, ...) {
__asm jmp fo::funcoffs::debug_printf_;
@@ -181,7 +181,7 @@ long __stdcall db_dir_entry(const char *fileName, DWORD *sizeOut) {
// prints message to debug.log file
void __declspec(naked) debug_printf(const char* fmt, ...) {
__asm jmp fo::funcoffs::debug_printf_
__asm jmp fo::funcoffs::debug_printf_;
}
// Displays message in main UI console window
@@ -242,8 +242,8 @@ DWORD __stdcall interpretAddString(Program* scriptPtr, const char* strval) {
WRAP_WATCOM_CALL2(interpretAddString_, scriptPtr, strval)
}
const char* __stdcall interpretGetString(Program* scriptPtr, DWORD dataType, DWORD strId) {
WRAP_WATCOM_CALL3(interpretGetString_, scriptPtr, dataType, strId)
const char* __fastcall interpretGetString(Program* scriptPtr, DWORD dataType, DWORD strId) {
WRAP_WATCOM_FCALL3(interpretGetString_, scriptPtr, dataType, strId)
}
// prints scripting error in debug.log and stops current script execution by performing longjmp
@@ -315,6 +315,12 @@ long __stdcall message_exit(MessageList *msgList) {
WRAP_WATCOM_CALL1(message_exit_, msgList)
}
long __fastcall tile_num(long x, long y) {
__asm push ebx; // don't delete (bug in tile_num_)
WRAP_WATCOM_FCALL2(tile_num_, x, x);
__asm pop ebx;
}
GameObject* __fastcall obj_blocking_at_wrapper(GameObject* obj, DWORD tile, DWORD elevation, void* func) {
__asm {
mov eax, ecx;
+4 -2
View File
@@ -45,7 +45,7 @@ const char* __stdcall critter_name(GameObject* critter);
// Change the name of playable character
void critter_pc_set_name(const char* newName);
// Checks if given file exist in DB
// Checks if given file exists in DB
bool __stdcall db_access(const char* fileName);
long __stdcall db_fclose(DbFile* file);
@@ -122,7 +122,7 @@ void __stdcall interpretPushLong(Program* scriptPtr, DWORD val);
// pushes value type to Data stack (must be preceded by InterpretPushLong)
void __stdcall interpretPushShort(Program* scriptPtr, DWORD valType);
const char* __stdcall interpretGetString(Program* scriptPtr, DWORD dataType, DWORD strId);
const char* __fastcall interpretGetString(Program* scriptPtr, DWORD dataType, DWORD strId);
DWORD __stdcall interpretAddString(Program* scriptPtr, const char* str);
@@ -165,6 +165,8 @@ long __stdcall message_load(MessageList *msgList, const char *msgFilePath);
// destroys message list
long __stdcall message_exit(MessageList *msgList);
long __fastcall tile_num(long x, long y);
GameObject* __fastcall obj_blocking_at_wrapper(GameObject* obj, DWORD tile, DWORD elevation, void* func);
GameObject* __stdcall obj_find_first_at_tile(long elevation, long tileNum);
+11 -2
View File
@@ -18,15 +18,19 @@
// because the compiler builds the better/optimized code when calling the engine functions
WRAP_WATCOM_FFUNC4(long, _word_wrap, const char*, text, int, maxWidth, DWORD*, buf, BYTE*, count)
WRAP_WATCOM_FFUNC3(void, correctFidForRemovedItem, GameObject*, critter, GameObject*, item, long, slotFlag)
WRAP_WATCOM_FFUNC7(long, createWindow, const char*, winName, long, x, long, y, long, width, long, height, long, bgColorIndex, long, flags)
WRAP_WATCOM_FFUNC7(long, createWindow, const char*, winName, DWORD, x, DWORD, y, DWORD, width, DWORD, height, long, color, long, flags)
WRAP_WATCOM_FFUNC3(void, display_inventory, long, inventoryOffset, long, visibleOffset, long, mode)
WRAP_WATCOM_FFUNC4(void, display_target_inventory, long, inventoryOffset, long, visibleOffset, DWORD*, targetInventory, long, mode)
WRAP_WATCOM_FFUNC3(FrmFrameData*, frame_ptr, FrmHeaderData*, frm, long, frame, long, direction)
WRAP_WATCOM_FFUNC3(void, intface_update_items, long, animate, long, modeLeft,long, modeRight)
WRAP_WATCOM_FFUNC3(long, item_add_force, GameObject*, critter, GameObject*, item, long, count)
WRAP_WATCOM_FFUNC7(void, make_straight_path_func, GameObject*, objFrom, DWORD, tileFrom, DWORD, tileTo, void*, rotationPtr, DWORD*, result, long, flags, void*, func)
WRAP_WATCOM_FFUNC4(long, mouse_click_in, long, x, long, y, long, x_end, long, y_end)
WRAP_WATCOM_FFUNC3(GameObject*, obj_blocking_at, GameObject*, object, long, tile, long, elevation)
WRAP_WATCOM_FFUNC4(long, obj_move_to_tile, GameObject*, object, long, tile, long, elevation, RECT*, rect)
WRAP_WATCOM_FFUNC3(long, obj_new_sid_inst, GameObject*, object, long, sType, long, scriptIndex)
WRAP_WATCOM_FFUNC3(long, object_under_mouse, long, crSwitch, long, inclDude, long, elevation)
WRAP_WATCOM_FFUNC4(void, register_object_call, long*, target, long*, source, void*, func, long, delay)
WRAP_WATCOM_FFUNC3(long, scr_get_local_var, long, sid, long, varId, long*, value)
WRAP_WATCOM_FFUNC3(long, scr_set_local_var, long, sid, long, varId, long, value)
WRAP_WATCOM_FFUNC3(long, tile_num_in_direction, long, tile, long, rotation,long, distance)
@@ -60,11 +64,13 @@ WRAP_WATCOM_FUNC1(long, folder_print_line, const char*, text)
WRAP_WATCOM_FUNC1(long, folder_print_seperator, const char*, text)
WRAP_WATCOM_FUNC1(long, game_get_global_var, long, globalVar)
WRAP_WATCOM_FUNC1(void, gdialogDisplayMsg, const char*, message)
WRAP_WATCOM_FUNC1(long, gmouse_3d_set_mode, long, mode)
WRAP_WATCOM_FUNC0(long, gmouse_3d_get_mode)
WRAP_WATCOM_FUNC1(void, gmouse_3d_set_mode, long, mode)
WRAP_WATCOM_FUNC1(long, gmouse_set_cursor, long, picNum)
WRAP_WATCOM_FUNC1(Window*, GNW_find, long, winRef)
WRAP_WATCOM_FUNC2(long, intface_get_attack, DWORD*, hitMode, DWORD*, isSecondary)
WRAP_WATCOM_FUNC0(long, intface_is_item_right_hand)
WRAP_WATCOM_FUNC0(long, intface_is_hidden)
// redraws the main game interface windows (useful after changing some data like active hand, etc.)
WRAP_WATCOM_FUNC0(void, intface_redraw)
WRAP_WATCOM_FUNC0(void, intface_toggle_item_state)
@@ -100,6 +106,7 @@ WRAP_WATCOM_FUNC6(long, make_path_func, GameObject*, objectFrom, long, tileFrom,
WRAP_WATCOM_FUNC0(long, new_obj_id)
// calculates bounding box (rectangle) for a given object
WRAP_WATCOM_FUNC2(void, obj_bound, GameObject*, object, BoundRect*, boundRect)
WRAP_WATCOM_FUNC1(long, obj_destroy, GameObject*, object)
WRAP_WATCOM_FUNC2(long, obj_erase_object, GameObject*, object, BoundRect*, boundRect)
WRAP_WATCOM_FUNC0(GameObject*, obj_find_first)
WRAP_WATCOM_FUNC0(GameObject*, obj_find_next)
@@ -141,6 +148,8 @@ WRAP_WATCOM_FUNC1(long, register_object_must_erase, GameObject*, object)
WRAP_WATCOM_FUNC3(long, register_object_take_out, GameObject*, object, long, holdFrameId, long, nothing)
WRAP_WATCOM_FUNC3(long, register_object_turn_towards, GameObject*, object, long, tileNum, long, nothing)
WRAP_WATCOM_FUNC2(long, roll_random, long, minValue, long, maxValue)
WRAP_WATCOM_FUNC2(long, scr_new, long*, scriptID, long, sType)
WRAP_WATCOM_FUNC1(long, scr_remove, long, scriptID)
WRAP_WATCOM_FUNC2(long, skill_dec_point_force, GameObject*, critter, long, skill)
WRAP_WATCOM_FUNC2(long, skill_inc_point_force, GameObject*, critter, long, skill)
WRAP_WATCOM_FUNC1(long, skill_is_tagged, long, skill)
+24 -5
View File
@@ -697,20 +697,39 @@ struct ScriptListInfoItem {
//for holding window info
#pragma pack(1)
struct Window {
long ref;
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;
};
struct sWindow {
char name[32];
long wID;
long width;
long height;
long unknown1;
long unknown2;
long unknown3;
BYTE *surface; // bytes frame data ref to palette
long buttonListP;
long unknown5;//buttonptr?
long unknown4;
long *buttons;
long numButtons;
long unknown5;
long unknown6;
long clearColour;
long flags;
long unknown7;
long drawFuncP;
long unknown8;
};
#pragma pack(1)
+9
View File
@@ -46,11 +46,13 @@
#define FO_VAR_curr_stack 0x59E96C
#define FO_VAR_currentWindow 0x51DCB8
#define FO_VAR_cursor_line 0x664514
#define FO_VAR_debug_func 0x51DF04
#define FO_VAR_dialogue_head 0x518850
#define FO_VAR_dialogue_state 0x518714
#define FO_VAR_dialogue_switch_mode 0x518718
#define FO_VAR_dialog_target 0x518848
#define FO_VAR_dialog_target_is_party 0x51884C
#define FO_VAR_display_win 0x631E4C
#define FO_VAR_displayMapList 0x41B560
#define FO_VAR_dropped_explosive 0x5190E0
#define FO_VAR_drugInfoList 0x5191CC
@@ -75,6 +77,7 @@
#define FO_VAR_game_global_vars 0x5186C0
#define FO_VAR_game_ui_disabled 0x5186B4
#define FO_VAR_game_user_wants_to_quit 0x5186CC
#define FO_VAR_gconfig_file_name 0x58E978
#define FO_VAR_gcsd 0x51094C
#define FO_VAR_gdBarterMod 0x51873C
#define FO_VAR_gDialogMusicVol 0x5187D8
@@ -148,6 +151,7 @@
#define FO_VAR_name_sort_list 0x56FCB0
#define FO_VAR_num_game_global_vars 0x5186C4
#define FO_VAR_num_map_global_vars 0x519574
#define FO_VAR_num_windows 0x6ADF24
#define FO_VAR_card_old_fid1 0x5709EC
#define FO_VAR_obj_dude 0x6610B8
#define FO_VAR_obj_seen 0x662445
@@ -210,6 +214,7 @@
#define FO_VAR_stack_offset 0x59E844
#define FO_VAR_stat_data 0x51D53C
#define FO_VAR_stat_flag 0x66452A
#define FO_VAR_sWindows 0x6727B0
#define FO_VAR_Tag_ 0x5708B0
#define FO_VAR_tag_skill 0x668070
#define FO_VAR_target_curr_stack 0x59E948
@@ -232,6 +237,7 @@
#define FO_VAR_trait_data 0x51DB84
#define FO_VAR_view_page 0x664520
#define FO_VAR_wd_obj 0x59E98C
#define FO_VAR_window 0x6ADE58
#define FO_VAR_wmAreaInfoList 0x51DDF8
#define FO_VAR_wmLastRndTime 0x51DEA0
#define FO_VAR_wmMaxMapNum 0x51DE10
@@ -248,10 +254,13 @@
// colors
#define FO_VAR_BlueColor 0x6A38EF
#define FO_VAR_DARK_GREY_Color 0x6A59D8
#define FO_VAR_DarkGreenColor 0x6A3A90
#define FO_VAR_DarkGreenGreyColor 0x6A3DF1
#define FO_VAR_DullPinkColor 0x6AB718
#define FO_VAR_GoodColor 0x6AB4EF
#define FO_VAR_GreenColor 0x6A3CB0
#define FO_VAR_LIGHT_GREY_Color 0x6A76BF
#define FO_VAR_PeanutButter 0x6A82F3
#define FO_VAR_RedColor 0x6AB4D0
#define FO_VAR_WhiteColor 0x6AB8CF
+11 -6
View File
@@ -27,17 +27,19 @@ VAR_(combat_state, DWORD)
VAR_(combat_turn_running, DWORD)
VAR_(combatNumTurns, DWORD)
VAR3(crit_succ_eff, CritInfo, 20, 9, 6) // 20 critters with 9 body parts and 6 effects each
VAR_(critter_db_handle, DWORD)
VAR_(critter_db_handle, PathNode*)
VAR_(critterClearObj, DWORD)
VAR_(crnt_func, DWORD)
VAR_(curr_font_num, DWORD)
VARA(curr_pc_stat, long, PCSTAT_max_pc_stat)
VAR_(curr_stack, DWORD)
VAR_(cursor_line, DWORD)
VAR_(DarkGreenColor, BYTE)
VAR_(DARK_GREY_Color, BYTE)
VAR_(DarkGreenColor, BYTE)
VAR_(DarkGreenGreyColor, BYTE)
VAR_(dialogue_state, DWORD)
VAR_(dialogue_switch_mode, DWORD)
VAR_(dialog_target, DWORD)
VAR_(dialog_target, GameObject*)
VAR_(dialog_target_is_party, DWORD)
VAR_(dropped_explosive, DWORD)
VARA(drugInfoList, DrugInfoList, 9)
@@ -95,6 +97,7 @@ VAR_(last_button_winID, DWORD)
VAR_(last_level, DWORD)
VAR_(Level_, DWORD)
VAR_(Lifegiver, DWORD)
VAR_(LIGHT_GREY_Color, BYTE)
VAR_(lipsFID, DWORD)
VAR_(list_com, DWORD)
VAR_(list_total, DWORD)
@@ -105,7 +108,7 @@ VAR_(main_ctd, DWORD)
VAR_(main_window, DWORD)
VAR_(map_elevation, DWORD)
VAR_(map_global_vars, long*) // array
VAR_(master_db_handle, DWORD)
VAR_(master_db_handle, PathNode*)
VAR_(max, DWORD)
VAR_(maxScriptNum, long)
VAR_(Meet_Frank_Horrigan, bool)
@@ -153,9 +156,9 @@ VAR_(pip_win, DWORD)
VAR_(pipboy_message_file, MessageList)
VAR_(pipmesg, DWORD)
VAR_(preload_list_index, DWORD)
VARA(procTableStrs, const char*, (int)ScriptProc::count) // table of procId (from define.h) => procName map
VARA(procTableStrs, const char*, (int)Scripts::ScriptProc::count) // table of procId (from define.h) => procName map
VARA(proto_msg_files, MessageList, 6) // array of 6 elements
VAR_(proto_main_msg_file, MessageList)
VAR_(proto_main_msg_file, MessageList)
VAR_(ptable, DWORD)
VAR_(pud, DWORD)
VAR_(queue, DWORD)
@@ -178,6 +181,7 @@ VARA(stack, DWORD, 10)
VARA(stack_offset, DWORD, 10)
VARA(stat_data, StatInfo, STAT_real_max_stat) // dynamic array
VAR_(stat_flag, DWORD)
VARA(sWindows, fo::sWindow, 16)
VAR_(Tag_, DWORD)
VAR_(tag_skill, DWORD)
VAR_(target_curr_stack, DWORD)
@@ -200,6 +204,7 @@ VAR_(title_font, DWORD)
VARA(trait_data, TraitInfo, TRAIT_count)
VAR_(view_page, DWORD)
VAR_(wd_obj, DWORD)
VARA(window, fo::Window*, 50)
VAR_(WhiteColor, BYTE)
VAR_(wmAreaInfoList, DWORD)
VAR_(wmLastRndTime, DWORD)
+9 -3
View File
@@ -68,8 +68,14 @@ void ResetBodyState() {
__asm mov weightOnBody, 0;
}
static void MusicVolInitialization() {
static void Initialization() {
*(DWORD*)FO_VAR_gDialogMusicVol = *(DWORD*)FO_VAR_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
@@ -1128,7 +1134,7 @@ end:
}
static void __declspec(naked) action_explode_hack() {
using fo::ScriptProc::destroy_p_proc;
using namespace fo::Scripts;
__asm {
mov edx, destroy_p_proc
mov eax, [esi + scriptId] // pobj.sid
@@ -2470,7 +2476,7 @@ void BugFixes::init()
#endif
// Missing game initialization
LoadGameHook::OnBeforeGameInit() += MusicVolInitialization;
LoadGameHook::OnBeforeGameInit() += Initialization;
// Fix vanilla negate operator on float values
MakeCall(0x46AB68, NegateFixHack);
-1
View File
@@ -17,7 +17,6 @@
*/
#include <math.h>
#include <vector>
#include "..\main.h"
#include "..\FalloutEngine\Fallout2.h"

Some files were not shown because too many files have changed in this diff Show More