Hooks

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderator: JeremyaFr

Post Reply

Re: Hooks

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Apr 24, 2020 4:06 pm

UPDATE

The crash was caused by a conflict between the mission tie hook and the mission object hook. The same offset was hooked in both hook.

I've fixed the conflict in the misson object hook.

Please redownload the mission object hook.

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7824
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Fri Apr 24, 2020 10:31 pm

JeremyaFr wrote:
Fri Apr 24, 2020 4:06 pm
UPDATE

The crash was caused by a conflict between the mission tie hook and the mission object hook. The same offset was hooked in both hook.

I've fixed the conflict in the misson object hook.

Please redownload the mission object hook.
Both hooks seem to be working fine now :) Thanks for the quick fix
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7824
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Sun Apr 26, 2020 3:27 pm

JeremyaFr wrote:
Fri Apr 24, 2020 4:06 pm
UPDATE
I've fixed the conflict in the misson object hook.

Please redownload the mission object hook.
Hi again :)
I think you need a small change In the default hook_mission_objects.cfg file.
Right now it's set to UnlimitedTurretLaser = 1 which is forever powered lasers.
Should be set to 0 by default in your download versions or it affects gameplay.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sun Apr 26, 2020 3:52 pm

Just checked in a vanilla game, gunner cockpit lasers are unlimited

It's only in the actual cockpit the laser bars decrease
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Apr 26, 2020 6:43 pm

I will keep the setting to 1 as it is how the vanilla game works.
Set it to 0 may increase the missions difficulty.

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7824
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Mon Apr 27, 2020 1:59 pm

Don't worry it was a misunderstanding in something I was testing.
Was getting weird results. It's all good now.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon May 04, 2020 1:01 pm

UPDATE

Hello,
I've updated the exterior hook.

Now you can set a lod distance for MFD target on a craft basis.

Suppose that the craft is "FlightModels\[Model].opt".

To set the MFD lod distance, create a file named "FlightModels\[Model]Exterior.txt" or create a section named "[Exterior]" in "FlightModels\[Model].ini".
The format is:
LodDistance = value

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7824
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Tue May 05, 2020 3:24 pm

Hi Jeremy. Can I suggest something like a master hook update list please?
There are so many updates lately and fixes that aren't always clear it's hard to keep up sometimes.
For example in the start of this thread a small list of which hooks have been updated, what and when to help make it obvious.
Example:

Hook_Weapon_Color.dll - Updated 5/5/20 - Bugs fixed
Hook_Textures_Tag - Updated 10/3/20 - Bugs fixed
Reticule Hook created - Updated 30/4/20


I know you often update the start of the individual thread but it's not always clear when it updated.
Obviously people can download all the hooks again as needed but not everyone will know it's needed.
Sorry if it's just me but I think it would help people a lot to keep track simply. Especially as most hooks won't get updated unless the relevant craft is updated online or a large patch.
Thanks, keep up your amazing work :)
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue May 05, 2020 4:14 pm

Hello,

There is the hooks code history here:
xwa_hooks history

The latest hooks can be downloaded using XwaHooksSetup.

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7824
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Tue May 05, 2020 4:21 pm

JeremyaFr wrote:
Tue May 05, 2020 4:14 pm
Hello,

There is the hooks code history here:
xwa_hooks history

The latest hooks can be downloaded using XwaHooksSetup.
Brillaint! Didn't know of that link to the history.
Maybe put that in the main post would help. :) Thanks again!
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
BenKenobi
Cadet 2nd Class
Posts: 94
Joined: Wed Mar 18, 2020 12:30 pm

Post by BenKenobi » Tue May 05, 2020 6:45 pm

Jeremy is way ahead of you, at least since february 2019... :D

From the opening post:
Schermafbeelding 2020-05-05 om 20.43.30.png
You do not have the required permissions to view the files attached to this post.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue May 05, 2020 6:51 pm

Strange.
I've edited the post today but the date is not updated.

User avatar
BenKenobi
Cadet 2nd Class
Posts: 94
Joined: Wed Mar 18, 2020 12:30 pm

Post by BenKenobi » Tue May 05, 2020 7:49 pm

JeremyaFr wrote:
Tue May 05, 2020 6:51 pm
Strange.
I've edited the post today but the date is not updated.
Oops, hahaha, Well it's in the opening post one way or the other. :)

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed May 06, 2020 12:25 pm

UPDATE

Hello,
I've updated the main hook.

I've added a setting to enable or disable the output hooks stats feature.
By default, it is disabled.

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7824
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Tue May 19, 2020 4:00 am

Hi Jeremy. There's still a Hook_Weapon_Color bug

Load a MINE FIELD in a Skirmish or Battle 3 Mission 4 and the game crashes.
I put back the Hook dated ‎06 ‎February ‎2020, which I had been using until the one updated on the 15th May and everything worked fine.

Help us Jeremy, you are our only hope! ;)

Code: Select all

Faulting application name: XwingAlliance.exe, version: 2.0.0.2, time stamp: 0x3765a9b7
Faulting module name: Hook_Weapon_Color.dll, version: 1.0.0.1, time stamp: 0x5ebea7bd
Exception code: 0xc0000005
Fault offset: 0x00009523
Faulting process ID: 0x4120
Faulting application start time: 0x01d62d8f33152da8
Faulting application path: C:\Program Files (x86)\Steam\steamapps\common\Star Wars X-Wing Alliance\XwingAlliance.exe
Faulting module path: C:\Program Files (x86)\Steam\steamapps\common\Star Wars X-Wing Alliance\Hook_Weapon_Color.dll
Report ID: a042b48b-598a-4b3e-9137-c41d52f894f8
Faulting package full name: 
Faulting package-relative application ID: 
This Hook in the Zip is the one that DOES work.
Hope that helps.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue May 19, 2020 12:24 pm

Hello,
You can try this WIP version:

EDIT: link removed

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7824
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Tue May 19, 2020 12:47 pm

JeremyaFr wrote:
Tue May 19, 2020 12:24 pm
Hello,
You can try this WIP version:


xwa_hook_weapon_color_WIP.zip
A quick test seemed fine. The mines no longer crash things. They really show up on the radar improvements now too lol
Brilliant work as always Jeremy. Thank you :)

You may want to edit your readme file slightly though.

** Setup ***
Place hook_weapon_color.dll next to xwingalliance.exe
Copy the "ANIMATIONS.DAT" file in the "RESDATA" directory.


If people aren't clued up and copy ANIMATIONS.DAT from the Hook download then they will overwrite any of the effects improvements like Hyperspace.
Might want to add a bit that it's not needed if you have newer version?

Keep up the great work!
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue May 19, 2020 1:31 pm

UPDATE

Hello,
I've updated the weapon color hook.
I've merged the changes from the WIP version.
I've updated the readme file to indicates that "animations.dat" is a sample.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Jun 04, 2020 11:39 am

UPDATE

Hello,
I've updated the opt limit hook.
I've modified the depth value to fix a bug where the SSD was not shown in the target display.

KydDynoMyte
Recruit
Posts: 3
Joined: Mon May 06, 2019 4:25 pm

Post by KydDynoMyte » Fri Jun 05, 2020 7:18 pm

Would it be possible to create a hook to get ship telemetry data for a motion chair?

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7824
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Thu Jun 11, 2020 9:57 pm

JeremyaFr wrote:
Mon May 04, 2020 1:01 pm
UPDATE
Hello,
I've updated the exterior hook.

Now you can set a lod distance for MFD target on a craft basis.

Suppose that the craft is "FlightModels\[Model].opt".

To set the MFD lod distance, create a file named "FlightModels\[Model]Exterior.txt" or create a section named "[Exterior]" in "FlightModels\[Model].ini".
The format is:
LodDistance = value
Hi. I'd like to try and understand this more. In simple terms please ;)
So I know this code is used in the INI files and it really helps out the FPS on some large detailed ships at a distance. If not everything.

Code: Select all

[Exterior]
LodDistance = 0x7fffffff
1 - With the code active we see a less detailed model in the MFD so that it's not trying to calculate too much. Is that correct?
2 - Does this code only affect the image that is seen in the MFD display. Or is it what can be seen in front of you out the window too?

3 - I'm not good with Hexadecimal currently. 0x7fffffff = a distance right? How can we tell how far away that distance is. Is there an easy way to calculate distances?

4 - This can be set for any ship or fighter if I am correct. Should 0x7fffffff be a pretty good standard on all Starships and Platforms? Is it useful for Starfighters or unnecessary.
Thanks for the help from anyone in advance. :)
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Jun 12, 2020 6:04 pm

1. correct.
2. It only affects the MFD display.
3. With the value 0x7fffffff (the max positive int: 2^31-1), the less detailed lod in displayed.
4. It is usefull for big crafts with a lot of triangles.

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sat Jun 13, 2020 10:45 am

There's one thing I don't understand: LODs are meant to display lower-detailed models when you're far enough away that the loss of detail is acceptable. To show the low-quality model always, shouldn't the distance be set to 0, not (max int)?

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sat Jun 13, 2020 3:59 pm

Think of it this way. LOD's are probably loaded by default first. It's when you approach a starship or object then whatever that trigger-distance "value" is (as defined by each mesh) is when those high poly meshes are rendered. If any given mesh is set to "infinity" then it will always render as is. I think this is a great patch and probably all large models should/will need to have LODs if not already there to improve performance.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Mon Jun 15, 2020 2:04 pm

keiranhalcyon7 wrote:
Sat Jun 13, 2020 10:45 am
There's one thing I don't understand: LODs are meant to display lower-detailed models when you're far enough away that the loss of detail is acceptable. To show the low-quality model always, shouldn't the distance be set to 0, not (max int)?
What Jeremy is probably doing is setting the "distance to object" not actually changing the trigger distance (part of opt).

Trev

Post Reply