Compare commits

..
25 Commits
Author SHA1 Message Date
NovaRain cc875291d1 Merge branch 'develop' 2018-02-13 09:50:43 +08:00
NovaRain 9e28f8bdfd Lined up some code in MiscPatches.cpp. 2018-02-12 21:07:02 +08:00
NovaRain b2894268f6 Reverted item highlighting mod to the previous status (commit 90485a205a). #132 2018-01-28 18:15:35 +08:00
NovaRain b3e2b8b5b8 Rearranged and simplified gl_highlighting.ssl from the previous commit a bit. 2018-01-17 21:22:37 +08:00
burner1024andNovaRain 3227966767 More highlighting (#130)
* allow to highlight alive critters

* allow to ignore NO_HIGHLIGHT flag

* don't highlight while in loot screen, so that it's not constantly toggled by shift-A ("Take All" hotkey)
2018-01-17 13:55:22 +08:00
NovaRain 9475b8c482 Fixed add_mult_objs_to_inven only adding 500 of an object when the value of "count" argument is over 99999. #129 2018-01-17 07:36:05 +08:00
NovaRain 8b356b1213 Fixed broken ExtraGameMsgFileList option. #127 2018-01-11 07:42:50 +08:00
NovaRain 90485a205a Changed item highlighting mod to only highlight lootable corpses. #126 2018-01-07 21:37:26 +08:00
NovaRain d5be2fdc9b Made sure the value of player's base EMP DR is set correctly. 2018-01-02 23:22:45 +08:00
NovaRain a705341e02 Updated version number and the year. 2018-01-02 10:16:32 +08:00
NovaRain ca3f59ad1e Fixed a bug in NPC combat control that kept increasing the perk rank of Gecko Skinning after the combat ended.
Condensed the code in ApplyHeaveHoFix a bit.
2018-01-02 09:58:30 +08:00
NovaRain 4d0c056e72 Merge branch 'develop' 2017-12-24 21:35:52 +08:00
NovaRain d388a5c3bb Fixed player's base EMP DR isn't properly initialized when creating a new character and then starting the game. 2017-12-15 07:32:18 +08:00
NovaRain 9b808cd008 Changed sneak_success to call is_pc_sneak_working_ engine function, which takes player's current sneaking status into account as well, instead of only returning the result of last sneak attempt. 2017-12-05 10:22:35 +08:00
NovaRain fd91be7ea2 Replaced data type hex values with proper VAR_TYPE_* defines for code readability. 2017-12-03 23:54:39 +08:00
NovaRain 4fdd1d3cd8 Added missing entry of block_combat script function in opcode list. 2017-12-03 02:36:00 +08:00
NovaRain 9cb2d3df3e Added the damage type offset of weapon proto to define_extra.h. 2017-11-27 14:14:31 +08:00
NovaRain 08242d77d5 Fixed a typo in hookscripts.txt. 2017-11-27 12:24:22 +08:00
NovaRain 68d0a3e894 Changed the if condition for ProcessorIdle to make sure out-of-bounds values not resulting in unexpected but valid values (ref. commit 50c91db5ea) 2017-11-26 02:08:09 +08:00
NovaRain 16ff0e9ca6 Added a new example mod gl_autodoors (by Mr.Stalin) to modderspack. #19 2017-11-08 21:23:15 +08:00
NovaRain 218ba3004c Tweaked the way DebugMode works, now only DebugMode=2 sends debug output to a debug.log file. Any other non-0 value sends debug output to the screen. #123 2017-11-07 10:46:24 +08:00
NovaRain 8473ce5210 Replaced some SafeWrite* usages in old code with corresponding HookCall/MakeCall/MakeJump for code readability. 2017-11-06 15:13:05 +08:00
NovaRain 38a3dba476 Added description and define of display_stats to notes.txt and sfall.h. 2017-11-06 14:03:22 +08:00
NovaRain 9c1d439153 Added "display_stats" script function #113 2017-11-06 10:16:02 +08:00
NovaRain bc38a02508 Enabled mouse scroll control in barter and loot screens when the cursor is hovering over other lists, also enabled scrolling through the display monitor (from Crafty) #120
Rearraged the code style in dinput.cpp.
Updated version number.
2017-10-25 11:50:37 +08:00
45 changed files with 836 additions and 580 deletions
+3 -3
View File
@@ -5,10 +5,10 @@
Key=42
; Set to 1 to also highlight containers
Containers=1
Containers=0
; Set to 1 to also highlight corpses
Corpses=1
; Set to 1 to also highlight lootable corpses
Corpses=0
; Set to 1 to only highlight objects in the player's line-of-sight
CheckLOS=0
+2 -2
View File
@@ -1,5 +1,5 @@
;sfall configuration settings
;v4.0.1
;v4.0.3
[Main]
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
@@ -72,7 +72,7 @@ Use32BitHeadGraphics=0
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Input]
;Set to 1 to enable the mouse scroll wheel to scroll through your inventory
;Set to 1 to enable the mouse scroll wheel to scroll through inventory, barter, and loot screens
UseScrollWheel=1
;The mouse Z position is divided by this modifier to calculate the number of inventory
Binary file not shown.
@@ -0,0 +1,77 @@
/*
Auto Doors mod for Fallout 2 by Mr.Stalin
-----------------------------------------
- allows the player to automatically open/walk through unlocked doors when not in combat
Requires sfall 3.7b or higher
NOTE: this script requires compiler from sfall modderspack with -s option
(short circuit evaluation)
*/
#include "..\headers\define.h"
#include "..\headers\command.h"
#include "..\headers\sfall\sfall.h"
#include "..\headers\sfall\define_extra.h"
procedure start;
procedure map_enter_p_proc;
procedure set_door_flag(variable state);
procedure combatturn_handler;
#define PORTAL (0)
#define DOOR_FLAGS (0x24)
variable only_once := 0;
procedure start begin
if game_loaded then begin
if (sfall_ver_major >= 4) then
register_hook_proc(HOOK_COMBATTURN, combatturn_handler);
else
set_global_script_repeat(60);
call map_enter_p_proc;
end else begin
if (only_once == 1 and combat_is_initialized) then begin
only_once := 2;
call set_door_flag(false);
end else if (only_once == 2 and not(combat_is_initialized)) then begin
only_once := 1;
if (sfall_ver_major >= 4) then
set_global_script_repeat(0);
call set_door_flag(FLAG_WALKTHRU);
end
end
end
procedure map_enter_p_proc begin
only_once := 1;
call set_door_flag(FLAG_WALKTHRU);
end
procedure set_door_flag(variable state) begin
variable objectMap, obj, objPid, arrayPid, i;
objectMap := list_as_array(LIST_SCENERY);
arrayPid := temp_array(1, 0);
foreach (obj in objectMap) begin
objPid := obj_pid(obj);
if (proto_data(objPid, sc_type) != PORTAL) or is_in_array(objPid, arrayPid) then
continue;
arrayPid[i] := objPid;
i++;
resize_array(arrayPid, i + 1);
set_proto_data(objPid, DOOR_FLAGS, state);
end
end
procedure combatturn_handler begin
if (only_once == 1) then
set_global_script_repeat(60);
end
@@ -0,0 +1,9 @@
Auto Doors mod for Fallout 2 by Mr.Stalin
-----------------------------------------
- allows the player to automatically open/walk through unlocked doors when not in combat
Requires sfall 3.7b or higher.
To use, copy gl_autodoors.int to your scripts folder.
Binary file not shown.
+3 -2
View File
@@ -4,7 +4,7 @@
Previously was part of sfall itself, now a separate mod.
Features:
- highlighting items, containers (optional) and dead bodies (optional) on the ground
- highlighting items, containers (optional) and lootable corpses (optional) on the ground
- configurable hotkey is used to trigger highlight
- only objects in direct line-of-sight of player are highlighted (optional)
- motion scanner is required to enable highlight (optional)
@@ -23,6 +23,7 @@
#define CRITTER_IS_DEAD (1)
#define PID_MOTION_SENSOR (59)
#define NO_HIGHLIGHT(obj) (get_flags(obj) bwand FLAG_NOHIGHLIGHT)
#define NO_STEAL(obj) (get_proto_data(obj_pid(obj), PROTO_CR_FLAGS) bwand CFLG_NOSTEAL)
variable configSection := "Highlighting";
variable highlightKey;
@@ -52,7 +53,7 @@ procedure ToggleHighlight(variable enable) begin
end
if (alsoCorpse) then begin
foreach obj in list_as_array(LIST_CRITTERS) begin
if critter_state(obj) == CRITTER_IS_DEAD then begin
if critter_state(obj) == CRITTER_IS_DEAD and not NO_STEAL(obj) then begin
call ToggleHighlightObject(obj, enable);
end
end
Binary file not shown.
+1
View File
@@ -42,6 +42,7 @@ end
procedure start begin
if game_loaded and (sfall_ver_major >= 4) then begin
set_perk_ranks(PERK_gecko_skinning_perk, 1);
controlMode := GetConfig("CombatControl", "Mode", 0);
if (controlMode > 2) then controlMode := 0;
if (controlMode > 0) then begin
@@ -115,6 +115,7 @@
#define PROTO_WP_ANIM (36)
#define PROTO_WP_DMG_MIN (40)
#define PROTO_WP_DMG_MAX (44)
#define PROTO_WP_DMG_TYPE (48)
#define PROTO_WP_RANGE_1 (52)
#define PROTO_WP_RANGE_2 (56)
#define PROTO_WP_PROJ_PID (60)
+1
View File
@@ -211,6 +211,7 @@
#define car_gas_amount sfall_func0("car_gas_amount")
#define critter_inven_obj2(obj, type) sfall_func2("critter_inven_obj2", obj, type)
#define display_stats sfall_func0("display_stats")
#define exec_map_update_scripts sfall_func0("exec_map_update_scripts")
#define get_cursor_mode sfall_func0("get_cursor_mode")
#define get_flags(obj) sfall_func1("get_flags", obj)
+1 -1
View File
@@ -309,7 +309,7 @@ Runs when retriving the damage rating of the players used weapon. (Which may be
int arg1 - The default min damage
int arg2 - The default max damage
Item arg3 - The weapin used. (0 if unarmed)
Item arg3 - The weapon used. (0 if unarmed)
Critter arg4 - The critter doing the attacking
int arg5 - The type of attack
int arg6 - non zero if this is an attack using a melee weapon
+6 -2
View File
@@ -299,8 +299,8 @@ Some utility/math functions are available:
- Additional game msg files added by ExtraGameMsgFileList setting will have consecutive fileIds assigned beginning from 0x2000. (e.g. if you set ExtraGameMsgFileList=foo,bar in ddraw.ini, foo.msg will be associated with 0x2000 and bar.msg with 0x2001.)
> int sneak_success
- returns 1 if last sneak attempt (roll against skill) was successful, 0 otherwise
- this is an internal engine variable wich is used to determine the perception range of critters (which you can override using HOOK_WITHINPERCEPTION)
- returns 1 if the player is currently sneaking, and last sneak attempt (roll against skill) was successful; 0 otherwise
- this calls an internal engine function which is used to determine the perception range of critters (which you can override using HOOK_WITHINPERCEPTION)
> int tile_light(int elevation, int tileNum)
- returns light intensity at the given tile in range from 0 to 65535
@@ -425,6 +425,10 @@ Some utility/math functions are available:
> void sfall_func1("set_cursor_mode", int mode)
- sets the current cursor mode
> void sfall_func0("display_stats")
- displays player stats in the inventory screen display window
- works only in opened inventory
------------------------
------ MORE INFO -------
------------------------
@@ -319,6 +319,7 @@
0x8248 - object get_last_target(object critter)
0x8249 - object get_last_attacker(object critter)
0x824a - void block_combat(int enable)
0x824b - int tile_under_cursor
0x824c - int gdialog_get_barter_mod
+1
View File
@@ -41,6 +41,7 @@ WRAP_WATCOM_FUNC1(Window*, GNW_find, long, winRef)
WRAP_WATCOM_FUNC0(long, intface_is_item_right_hand)
WRAP_WATCOM_FUNC0(void, intface_toggle_item_state)
WRAP_WATCOM_FUNC0(void, intface_use_item)
WRAP_WATCOM_FUNC0(long, is_pc_sneak_working)
WRAP_WATCOM_FUNC1(long, item_w_max_ammo, GameObject*, item)
WRAP_WATCOM_FUNC1(long, item_w_curr_ammo, GameObject*, item)
WRAP_WATCOM_FUNC1(long, item_weight, GameObject*, item)
+31 -18
View File
@@ -23,6 +23,7 @@
#include "main.h"
#include "Logging.h"
#include "FalloutEngine\Fallout2.h"
#include "Modules\Graphics.h"
#include "InputFuncs.h"
@@ -30,7 +31,7 @@
namespace sfall
{
static bool useScrollWheel;
bool useScrollWheel = true;
static DWORD wheelMod;
static bool reverseMouse;
@@ -131,21 +132,21 @@ void _stdcall TapKey(DWORD key) {
class FakeDirectInputDevice : public IDirectInputDeviceA {
private:
IDirectInputDeviceA* RealDevice;
DWORD DeviceType;
IDirectInputDeviceA* RealDevice;
DWORD DeviceType;
ULONG Refs;
bool formatLock;
DIDATAFORMAT oldFormat;
public:
/*** Constructor and misc functions ***/
FakeDirectInputDevice(IDirectInputDevice* device,DWORD type) {
RealDevice=device;
DeviceType=type;
Refs=1;
/*** Constructor and misc functions ***/
FakeDirectInputDevice(IDirectInputDevice* device,DWORD type) {
RealDevice = device;
DeviceType = type;
Refs = 1;
formatLock = false;
oldFormat.dwDataSize=0;
}
oldFormat.dwDataSize = 0;
}
/*** IUnknown methods ***/
HRESULT _stdcall QueryInterface(REFIID riid, LPVOID * ppvObj) {
@@ -220,13 +221,25 @@ public:
if (useScrollWheel) {
int count = 1;
if (MouseState.lZ > 0) {
if (wheelMod) count = MouseState.lZ / wheelMod;
if (count < 1) count = 1;
while (count--) TapKey(DIK_UP);
if (fo::var::gmouse_current_cursor == 2 || fo::var::gmouse_current_cursor == 3) {
__asm {
call fo::funcoffs::display_scroll_up_;
}
} else {
if (wheelMod) count = MouseState.lZ / wheelMod;
if (count < 1) count = 1;
while (count--) TapKey(DIK_UP);
}
} else if (MouseState.lZ < 0) {
if (wheelMod) count = (-MouseState.lZ) / wheelMod;
if (count < 1) count = 1;
while (count--) TapKey(DIK_DOWN);
if (fo::var::gmouse_current_cursor == 2 || fo::var::gmouse_current_cursor == 3) {
__asm {
call fo::funcoffs::display_scroll_down_;
}
} else {
if (wheelMod) count = (-MouseState.lZ) / wheelMod;
if (count < 1) count = 1;
while (count--) TapKey(DIK_DOWN);
}
}
}
if (middleMouseKey&&MouseState.rgbButtons[2]) {
@@ -323,7 +336,7 @@ public:
RealInput = Real; Refs = 1;
}
/*** IUnknown methods ***/
/*** IUnknown methods ***/
HRESULT _stdcall QueryInterface(REFIID riid, LPVOID* ppvObj) {
return RealInput->QueryInterface(riid, ppvObj);
}
@@ -347,7 +360,7 @@ public:
GUID GUID_SysMouse = { 0x6F1D2B60, 0xD5A0, 0x11CF, { 0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00} };
GUID GUID_SysKeyboard = { 0x6F1D2B61, 0xD5A0, 0x11CF, { 0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00} };
if (r != GUID_SysKeyboard&&r != GUID_SysMouse) {
if (r != GUID_SysKeyboard && r != GUID_SysMouse) {
return RealInput->CreateDevice(r, device, unused);
} else {
DWORD d;
+8 -1
View File
@@ -25,6 +25,8 @@
namespace sfall
{
extern bool useScrollWheel;
void SetMDown(bool down, bool right);
void SetMPos(int x, int y);
@@ -135,7 +137,7 @@ void GetMouse(int* x, int* y);
#define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */
#define DIK_YEN 0x7D /* (Japanese keyboard) */
#define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */
//#define DIK_CIRCUMFLEX 0x90 /* (Japanese keyboard) */
#define DIK_PREVTRACK 0x90 /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */
#define DIK_AT 0x91 /* (NEC PC98) */
#define DIK_COLON 0x92 /* (NEC PC98) */
#define DIK_UNDERLINE 0x93 /* (NEC PC98) */
@@ -182,6 +184,11 @@ void GetMouse(int* x, int* y);
#define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
#define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
/*
* Alternate names for keys originally not used on US keyboards.
*/
#define DIK_CIRCUMFLEX DIK_PREVTRACK /* Japanese keyboard */
void _stdcall ForceGraphicsRefresh(DWORD);
}
+3
View File
@@ -1389,6 +1389,9 @@ void BugFixes::init()
// Fix crash when calling partyMemberGetCurLevel_ on a critter that has no data in party.txt
MakeJump(0x495FF6, partyMemberGetCurLevel_hack);
// Fix for add_mult_objs_to_inven only adding 500 of an object when the value of "count" argument is over 99999
SafeWrite32(0x45A2A0, 0x1869F); // 99999
}
}
+1 -1
View File
@@ -34,7 +34,7 @@ static const char* ExtraLines[] = {
"#SFALL " VERSION_STRING,
"",
"sfall is free software, licensed under the GPL",
"Copyright 2008-2017 The sfall team",
"Copyright 2008-2018 The sfall team",
"",
"@Author",
"Timeslip",
+4 -4
View File
@@ -915,8 +915,8 @@ public:
};
HRESULT _stdcall FakeDirectDrawCreate2_graphics(void*, IDirectDraw** b, void*) {
ResWidth = *(DWORD*)0x004CAD6B;
ResHeight = *(DWORD*)0x004CAD66;
ResWidth = *(DWORD*)0x4CAD6B;
ResHeight = *(DWORD*)0x4CAD66;
if (!d3d9) {
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
@@ -995,14 +995,14 @@ void Graphics::init() {
} else {
FreeLibrary(h);
}
SafeWrite8(0x0050FB6B, '2');
SafeWrite8(0x50FB6B, '2');
dlogr(" Done", DL_INIT);
#undef _DLL_NAME
}
fadeMulti = GetConfigInt("Graphics", "FadeMultiplier", 100);
if (fadeMulti != 100) {
dlog("Applying fade patch.", DL_INIT);
SafeWrite32(0x00493B17, ((DWORD)&FadeHook) - 0x00493B1b);
HookCall(0x493B16, &FadeHook);
fadeMulti = ((double)fadeMulti) / 100.0;
dlogr(" Done", DL_INIT);
}

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