Page 14 of 15

Re: Hooks

Posted: Sun Apr 24, 2022 3:20 pm
by JeremyaFr
UPDATE

Hello,
The random crashes are now fixed.

The crashes were related to the engines count limit in the opt limit hook. There were missing offsets/hooks implementations. The result was that there was a memory write to a memory location that was not allocated by the hook. This memory location was used by the other DLLs (hooks or system). Since Windows Vista, when a dll is loaded, the base offset of the dll is random (for security reasons). That's why there were crashes in random DLLs. I've implemented the missing offsets in the opt limit hook. The crashes are now fixed.

Re: Hooks

Posted: Mon Apr 25, 2022 5:01 am
by Bman
Confirmed. All is working fine now. Thank you very much Jeremy. 👍

Re: Hooks

Posted: Sat Apr 30, 2022 2:33 am
by COLBudManstrong
Hello. This is primarily directed to JeremyaFr, but if anyone else might have any advice, feel free to chime in.

I have a base GOG version install of XWA (v2.02, but also have run XWAHacker-QT first), and was wondering if I can just use the hooks standalone, or if need anything from XWA Upgrade? From what I've gathered reading this thread, Jeremy's Git repo, and the Wiki page https://www.xwaupgrade.com/wiki/index.php?title=Hooks, I should be able to use them standalone.

I was wanting to use the joystick related hooks to fix an issue with my Xbox One controller's right joystick/rudder control being based on the vertical axis, rather than horizontal. My understanding is using the related hooks, plus a proper XwaJoystickConfig JoystickConfig.txt file should fix that.

I had tried downloading the XWA Hooks Setup installer from the Downloads page, then moving all of the items into the main XWA game folder as instructed. I then ran the XwaJoystickConfig program, saved a JoystickConfig.txt file to my game folder, and moved the other XwaJoystickConfig files to my game folder as well.

Running XWINGALLIANCE.EXE after all of that though didn't seem to make any changes. I would get Windows dialog errors about an FPS hook not being loaded correctly, so I removed the D3D related hooks, which resolved that. That lead me to believe the hooks were being loaded at the very least. But again, I wasn't able to see any changes being applied regarding joystick input, based on my JoystickConfig.txt settings.

Just wondering if anyone might be able to point me in the right direction, or clarify proper setup if I've done something wrong as mentioned above. Thanks!

Re: Hooks

Posted: Sat Apr 30, 2022 1:56 pm
by JeremyaFr
Hello,
Yes, you can use the hooks on a vanilla version of XWA (v 2.02 without any mod).

The Hooks' Wiki page hasn't been updated for a while. XwaHooksSetup generates a text file named "Hooks_Readme.txt" in the "Setup" directory. This file is generated from the GitHub repository and is always up-to-date.

Can you post the exact error message you get? There is probably an incompatibility between two installed components. What are your settings in XwaHacker?

Re: Hooks

Posted: Sat Apr 30, 2022 3:16 pm
by COLBudManstrong
Thank you for clarifying that Jeremy. I seem to have things working now, and will include a brief explanation of the steps I followed, plus screenshots of the error I mentioned seeing, and my current configuration settings.

I ended up reinstalling the game this morning to make sure I had a fresh base, then ran XwaHooksSetup and moved those files into the main game folder first. I then ran XwaJoystickConfig from the main game folder, and changed the roll axis to `4` and saved that out. I can't remember exactly if I then tried running XWA first, or then xwahacker-qt, but regardless, the joystick config now works. I think I had enabled FF in the in game options and maybe one other controller related change. I also don't remember seeing XWAJoysticConfig option in game last night, which seems to confirm the hooks were working for me when I had tried it. (Screenshot attached)

I did run into that same FPS Hook error again when trying to run the game, I believe after running xwahacker-qt. (Screenshot attached) I was also having an issue with the game crashing when setting the resolution to 2560x1440, which I wasn't last night. But running xwahacker-qt again, setting it to 1080p, then back to 1440p seemed to resolved that.

It seems things are all working now, and the process was fresh XWA install, XwaHookSetup, XwaJoystickConfig, then xwahacker-qt for resolution, but that's just my experience. It would seem the FPS increase/hook is not working, given that error, and xwahacker's in game FPS hack only returning 60fps. But I can keep messing around with that (And 60fps is better than 24 :P ).

Re: Hooks

Posted: Sat Apr 30, 2022 3:38 pm
by JeremyaFr
The error "To call the hook that sets full FPS" comes from the time hook (hook_time.dll). Have you changed the FPS limit in XWAHacker?

Re: Hooks

Posted: Sat Apr 30, 2022 4:38 pm
by COLBudManstrong
Yes, I had set the 118 fps option that XWAHacker allows as I have a 165hz monitor, but 60fps is fine if there's no workaround.

Re: Hooks

Posted: Sat Apr 30, 2022 4:42 pm
by JeremyaFr
Setting the fps limit in XWAHacker is not needed. The time hook already removes the fps limit. With the hook, the limit is now 240. The fps is limited to 60 in the hangar.

Re: Hooks

Posted: Sat Apr 30, 2022 5:38 pm
by COLBudManstrong
That makes sense. Should I reset the FPS Limit in xwahacker to a certain value to let the hook take over?

Re: Hooks

Posted: Sat Apr 30, 2022 5:41 pm
by JeremyaFr
Just keep the original 30 FPS.

Re: Hooks

Posted: Sat Apr 30, 2022 6:14 pm
by COLBudManstrong
JeremyaFr wrote:
Sat Apr 30, 2022 5:41 pm
Just keep the original 30 FPS.
That did the trick. Thank you for all of your help!

Re: Hooks

Posted: Mon May 02, 2022 4:36 am
by Bman
I could be wrong but I thought xwahacker -qt is not even needed anymore. You can just use the hook_resolution.cfg file (or the section inside the hooks.ini file) to set your monitor's maximum screen dimension in pixels. The in-game video menu resolution also doesn't really matter since the hook feeds that data into it. The part I'm not sure about is the scaling of FOV /HUD ratio.

Re: Hooks

Posted: Fri May 06, 2022 6:39 pm
by JeremyaFr
UPDATE

Hello,
I've updated XwaHooksSetup.

Now the tool will also download the WIP hooks to a separate directory ("Hooks_WIP").

Re: Hooks

Posted: Sun May 22, 2022 8:35 pm
by JeremyaFr
UPDATE

Hello,
I've updated the mission tie hook.

I've added settings to set the red alert in hangar, to auto switch to turret, to skip hyperspaced messages.

To override the mission data, create a file named "[MissionDir]\[Mission].txt" or create a section named "[mission_tie]" in "[MissionDir]\[Mission].ini".

To define the red alert in hangar, set "IsRedAlertEnabled = 1". The default setting enables IsRedAlertEnabled for mission id 20.
To skip hyperspaced messages, "set SkipHyperspacedMessages = 1". The default setting enables SkipHyperspacedMessages for mission id 49.
To force the player in turret, set "ForcePlayerInTurret = 1". The default setting enables ForcePlayerInTurret for mission id 1.

Re: Hooks

Posted: Sun May 22, 2022 9:05 pm
by AngeI
JeremyaFr wrote:
Sun May 22, 2022 8:35 pm
UPDATE

Hello,
I've updated the mission tie hook.

I've added settings to set the red alert in hangar, to auto switch to turret, to skip hyperspaced messages.

To override the mission data, create a file named "[MissionDir]\[Mission].txt" or create a section named "[mission_tie]" in "[MissionDir]\[Mission].ini".

To define the red alert in hangar, set "IsRedAlertEnabled = 1". The default setting enables IsRedAlertEnabled for mission id 20.
To skip hyperspaced messages, "set SkipHyperspacedMessages = 1". The default setting enables SkipHyperspacedMessages for mission id 49.
To force the player in turret, set "ForcePlayerInTurret = 1". The default setting enables ForcePlayerInTurret for mission id 1.
@JeremyaFr just to reiterate what was said in TFTC discord:

hook_mission_tie.dll is causing crash to desktop in TFTC, even the stable version. Multiple missons start crashing, usually a few sceonds after launching from the hangar.

example:

Code: Select all

Faulting application name: XwingAlliance.exe, version: 2.0.0.2, time stamp: 0x3765a9b7
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x0000008f
Faulting process id: 0x4458
Faulting application start time: 0x01d86e1ed8bb9c87
Faulting application path: D:\Games\XWA Copies\TFTC v1.2\XwingAlliance.exe
Faulting module path: unknown
Report Id: 4148629c-3c8c-4a28-b42f-ddf46c8729fb
Faulting package full name: 
Faulting package-relative application ID:

Code: Select all

Application: XwingAlliance.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: exception code c0000005, exception address 0000008F
Stack:

Re: Hooks

Posted: Mon May 23, 2022 7:44 pm
by JeremyaFr
UPDATE

Hello,
I've updated the mission tie hook.

I've fixed a crash with the skip hyperspaced messages feature.

Re: Hooks

Posted: Mon Jun 27, 2022 6:16 am
by marcop000
Hi @JeremyaFr ,

The inflight messages chars limit was incresed on Yogeme:

https://github.com/MikeG621/YOGEME/issues/69

but actually the limit of XWA is 68 chars that is insufficent to translate TFTC in (German, French, Italian and Spanish).

Can you please increase this limit to 80/90 chars for example ?

Thank you !!

Re: Hooks

Posted: Thu Jul 28, 2022 7:12 pm
by JeremyaFr
UPDATE

Hello,
I've updated XwaHooksSetup.

Now the readme will be split between setup and readme files.

Re: Hooks

Posted: Sat Jul 30, 2022 9:25 am
by JeremyaFr
UPDATE

Hello,
I've updated XwaHooksSetup.

I've fixed a bug with the Examples directory when it doesn't contain files at the root.

Re: Hooks

Posted: Thu Dec 08, 2022 5:28 pm
by JeremyaFr
UPDATE

Hello,
I've updated the main hook.

I've added a GenerateDumpFilesOnCrash setting.
When the game crashes a dump file will be generated if the GenerateDumpFilesOnCrash setting is set to 1. The default value is 1.

Re: Hooks

Posted: Sun Jan 15, 2023 9:32 pm
by JeremyaFr
UPDATE

Hello,
I've updated the weapon color hook.

The hook now supports object replacement.

Re: Hooks

Posted: Mon Apr 10, 2023 12:29 pm
by JeremyaFr
UPDATE

Hello,
I've updated the hooks.

I've added support for object replacement in:
- hook_dock
- hook_engine_sound
- hook_exterior
- hook_interdictor
- hook_jamming
- hook_reticle
- hook_shield
- hook_slam
- hook_weapon_rate

Re: Hooks

Posted: Sat Apr 15, 2023 5:54 pm
by JeremyaFr
UPDATE

Hello,
I've updated the opt limit hook.

Now in the Tech Library, the game will always show the most detailed model.

Re: Hooks

Posted: Fri Dec 01, 2023 2:06 pm
by JeremyaFr
UPDATE

Hello,
I've updated the hooks to fix issues with skirmish missions.

Re: Hooks

Posted: Thu Dec 14, 2023 3:26 am
by Timbo8504
Does the craft count hook modify the number of objects (mines/asteroids) that can be present? Or is it still the default 128 for objects?