Hooks

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

Moderator: JeremyaFr

Re: Hooks

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

Post by JeremyaFr » Wed Jul 22, 2020 3:09 pm

UPDATE

Hello,

I've updated all the hooks that have a config file.
I've added support for a global "hooks.ini" file. This file contains all the individual cfg files.

I've also updated XwaHooksSetup.
All the individual cfg files are merged into a single global "hooks.ini" file.
All the individual readme txt files are merged into a single "Hooks_Readme.txt" file.

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

Post by Ace Antilles » Wed Jul 22, 2020 3:24 pm

JeremyaFr wrote:
Wed Jul 22, 2020 3:09 pm
UPDATE

Hello,

I've updated all the hooks that have a config file.
I've added support for a global "hooks.ini" file. This file contains all the individual cfg files.

I've also updated XwaHooksSetup.
All the individual cfg files are merged into a single global "hooks.ini" file.
All the individual readme txt files are merged into a single "Hooks_Readme.txt" file.
Nice work. :) This is certainty a much tidier option and I welcome that :)
Just to double check, any changes in the current Hook CFG files need to be inputted into the Hooks.ini file now. right?
What if someone still has say Hook_Sfoils.cfg and the new Hooks.ini also. Will it still read the cfg file or only the INI?
Trying to see if there's any possible conflicts that will need resolving.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

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

Post by JeremyaFr » Wed Jul 22, 2020 3:31 pm

The hooks.ini file is read before the cfg file.

If a section exists for a hook in the ini file and a cfg file also exists, then the content of the ini section is used.
If there is no section for a hook in the ini file and a cfg file exists, then the content of the cfg file is used.

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

Post by Ace Antilles » Wed Jul 22, 2020 3:40 pm

Cool that seems to make sense.
So I assume if the Hooks.ini file is not in the main folder and neither are any CFG files then nothing works or you get crashes.

I really like this system it's a lot simpler in some ways and a lot easier to see what's added to the XWA folder.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

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

Post by JeremyaFr » Wed Jul 22, 2020 3:44 pm

Ace Antilles wrote:
Wed Jul 22, 2020 3:40 pm
So I assume if the Hooks.ini file is not in the main folder and neither are any CFG files then nothing works or you get crashes.
If there is no hooks.ini and no cfg file, then default values are used.

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

Post by Trevor » Wed Jul 22, 2020 7:02 pm

You should update your first post to point to the downloads page for hookssetup instead of the bottom of another forum topic.

Trev

Ronin65
Cadet 3rd Class
Posts: 48
Joined: Thu Jul 02, 2020 1:00 pm

Post by Ronin65 » Wed Jul 22, 2020 7:56 pm

Jeremy First thank you for simpifying the files

Could I possibly make a suggestion though, please.

But first could I ask, is the Hooks.ini generated when the hooks are downloaded, or is it a standalone file that can be edited at your end?

If it's generated, then ignore the text below, but please let me know either way :)

Looking at the Hooks.ini, sorry but it's a little messy, it took me a minute or two to figure out everything, as the [***] sections are surrounded within other text, could I suggest you change it to this

The dinput.dll it the main dll file, so shouldn't the text go at the top?

Anyhow so it just a little tidier

Code: Select all

[dinput]
; OutputStats = 0 or 1
; When set to 1, outputs hooks stats using OutputDebugString
OutputStats = 0

[hook_d3d]
IsHookD3DEnabled = 1

[hook_d3dinfos_textures]
Size = 10000

[hook_hangars]
; SelectionMode = ForceHangar or BasedOnModelIndex or BasedOnModelIndexAzzameenCampaign
SelectionMode = BasedOnModelIndexAzzameenCampaign

; Set the proving ground hangar opt model. The default value is "" or "FlightModels\".
ProvingGroundHangarModel = FlightModels\

; Draw shadows: 0 = no, 1 = yes
DrawShadows = 1

; Shadow lod: 0 = most detailed, 1 = less detailed
ShadowLod = 0

[hook_joystick_ff]
; Select a joystick with force feedback
; 0 to select the first device
; -1 to select the last device
; integer value to select a device by its index
JoystickDeviceIndex = 0

; Enable small joystick movement
; 0 to disable small movement
; 1 to enable small movement
EnableSmallMovement = 1

[hook_mission_objects]
; UnlimitedTurretLaser = 0 or 1
; When set to 0, the lasers are limited
; When set to 1, the lasers are unlimited
UnlimitedTurretLaser = 1

[hook_normals]
; Output: from 0 to 3
; 0 = color
; 1 = X axis
; 2 = Y axis
; 3 = Z axis
Output = 0

[hook_opt_limit]
Size = 65536

[hook_resolution]
; Auto set the game resolution
; 1 to enable the feature
; 0 to disable the feature
IsAutoResolutionEnabled = 0

; Define the resolution width
; When set to 0, the screen width is used
ResolutionWidth = 0

; Define the resolution height
; When set to 0, the screen height is used
ResolutionHeight = 0

[hook_sfoils]
; CloseSFoilsAndOpenLangingGearsBeforeEnterHangar = 0 or 1
; When set to 0, normal behavior
; When set to 1, s-foils must be closed and landing gears opened before enter hangar
CloseSFoilsAndOpenLangingGearsBeforeEnterHangar = 0

; CloseLangingGearsBeforeEnterHyperspace = 0 or 1
; When set to 0, normal behavior
; When set to 1, landing gears must be closed before enter hyperspace
CloseLangingGearsBeforeEnterHyperspace = 0

[hook_textures_tag]
; OutputDebugStrings = 0 or 1
; When set to 0, the hook doesn't print debug strings
; When set to 1, the hook prints debug strings
OutputDebugStrings = 0

[hook_weapon_color]
WeaponSwitchBasedOnIff = 0

; blue
WeaponImpactColor_3100 = 0xFF0000FF

; red
WeaponImpactColor_3200 = 0xFFFF0000

; green
WeaponImpactColor_3300 = 0xFF00FF00

; purple
WeaponImpactColor_3400 = 0xFFFF00FF

; yellow
WeaponImpactColor_3500 = 0xFFFFFF00

WeaponLightColor280 = FF3300
WeaponLightColor281 = FF3300
WeaponLightColor282 = 00FF33
WeaponLightColor283 = 00FF33
WeaponLightColor284 = 3333FF
WeaponLightColor285 = 3333FF
WeaponLightColor286 = 6633FF
WeaponLightColor287 = FF6633
WeaponLightColor288 = FF3300
WeaponLightColor289 = 00FF33
WeaponLightColor290 = 3333FF
WeaponLightColor291 = 6633FF
WeaponLightColor292 = FF6633
WeaponLightColor293 = FF6633
WeaponLightColor294 = FF6633
WeaponLightColor295 = FF33FF
WeaponLightColor296 = 3333FF
WeaponLightColor297 = FF3300
WeaponLightColor298 = FF66FF
WeaponLightColor299 = 0
WeaponLightColor300 = 0
WeaponLightColor301 = FF3300
WeaponLightColor302 = FF3300
WeaponLightColor303 = 00FF33
WeaponLightColor304 = 00FF33
WeaponLightColor305 = 00FF33
WeaponLightColor306 = 00FF33
WeaponLightColor307 = 0

[hook_windowed]
X = 0
Y = 0
Width = 0
Height = 0

Thanks :)

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

Post by JeremyaFr » Wed Jul 22, 2020 8:19 pm

Hello,

The "Hooks.ini" and "Hooks_Readme.txt" are generated by XwaHooksSetup after the hooks are downloaded.

But I can improve the generating code.

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

Post by JeremyaFr » Wed Jul 22, 2020 8:23 pm

Trevor wrote:
Wed Jul 22, 2020 7:02 pm
You should update your first post to point to the downloads page for hookssetup instead of the bottom of another forum topic.

Trev
Hello,
I've updated the download link in the first post.

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

Post by JeremyaFr » Thu Jul 23, 2020 4:39 pm

UPDATE

Hello,
I've updated XwaHooksSetup.

The main hook is placed at the top of the config and readme files.
The empty lines in the config file between a section name and the first setting are removed.

User avatar
Haakan
Cadet 2nd Class
Posts: 81
Joined: Sun Jul 14, 2019 1:36 am

Post by Haakan » Sun Aug 09, 2020 10:03 am

JeremyaFr wrote:
Thu Jul 23, 2020 4:39 pm
UPDATE

Hello,
I've updated XwaHooksSetup.

The main hook is placed at the top of the config and readme files.
The empty lines in the config file between a section name and the first setting are removed.
Hello there!

If you'd be so kind m8, I've got a question here : Will this update override any custom settings we might have in our cfg files?

Thanks!
Lt. Colonel A. Araujo
Commander, 7th SpecOps Squadron "Alpha"
Battlegroup I
Emperor's Hammer.

CMDR/LC Alejandro Araujo/Alpha/Wing I/ISDII Hammer/BGI

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

Post by JeremyaFr » Sun Aug 09, 2020 10:25 am

Hello,
The ini file is read before the cfg files. So if both a cfg file and a corresponding ini section exist, then the setting from the ini file section are used.

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

Post by Ace Antilles » Wed Sep 02, 2020 12:15 am

JeremyaFr wrote:
Sun Aug 09, 2020 10:25 am
Finding an unusual issue with Hook_Mission_Objects that Will T discovered.

I can't get any Fighter FLYABLE ship to swap with any other Fighters.
You can change a Non Flyable ship like a Medium Transport into a Shuttle. But I can't turn an A-wing into a R41 for example.
It looks like something happened in various tests as the CMD got large, kinda like an LOD change, but it still didn't show the right opt.

Been using this code as examples.
[Objects]
FlightModels\Frigate2Standard.opt = FlightModels\Frigate2Medical.opt
JeremyaFr can you take a look into it please and see what you can magically discover :)
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

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

Post by JeremyaFr » Wed Sep 02, 2020 10:36 am

I will take a look

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

Post by JeremyaFr » Wed Sep 02, 2020 2:33 pm

Hello,

To replace the A-Wing with a R41, you can try to replace this in HangarObjects and Objects:

Code: Select all

;HangarObjects
FlightModels\AWing.opt = FlightModels\R41.opt

Code: Select all

;Objects
FlightModels\AWing.opt = FlightModels\R41.opt
FlightModels\AWingCockpit.opt = FlightModels\R41.opt
FlightModels\AWingExterior.opt = FlightModels\R41.opt

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

Post by Ace Antilles » Wed Sep 02, 2020 2:49 pm

JeremyaFr wrote:
Wed Sep 02, 2020 2:33 pm
Hello,
To replace the A-Wing with a R41, you can try to replace this in HangarObjects and Objects:

Code: Select all

;HangarObjects
FlightModels\AWing.opt = FlightModels\R41.opt

Code: Select all

;Objects
FlightModels\AWing.opt = FlightModels\R41.opt
FlightModels\AWingCockpit.opt = FlightModels\R41.opt
FlightModels\AWingExterior.opt = FlightModels\R41.opt
It didn't work. Did it work for you?
As said before it looks like something happens as the display image changes size, kinda like an LOD change, but it still didn't show the right opt.
You can change a Non Flyable ship like a Medium Transport into a R41. But I can't turn any Flyable fighter into another flyable fighter, R41 as an example.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

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

Post by JeremyaFr » Wed Sep 02, 2020 3:18 pm

I tested in B4M2.

So 1b4m2b.ini looks like that:

Code: Select all

;1b4m2b.ini

[Resdata]
Resdata\Planet2.dat

[HangarObjects]
FlightModels\AWing.opt = FlightModels\R41.opt

[Objects]
FlightModels\AWing.opt = FlightModels\R41.opt
FlightModels\AWingCockpit.opt = FlightModels\R41.opt
FlightModels\AWingExterior.opt = FlightModels\R41.opt

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

Post by Ace Antilles » Wed Sep 02, 2020 8:16 pm

That way did work but it changed things in the Hangar too which wasn't what I really wanted though.
It let me do the necessary experimenting I needed to check anyway.
Thanks for your help.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

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

Post by JeremyaFr » Thu Sep 03, 2020 2:54 pm

UPDATE

Hello,
I've updated XwaHooksSetup.

I've added support for tools exe in the hooks zip packages.
For now, no hook has a config tool inside the zip. So it is not needed to redownload the hooks.

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

Post by JeremyaFr » Fri Sep 11, 2020 11:39 am

UPDATE

Hello,
I've updated the mission objects hook.

Now you can overwrite the cockpit pov settings when an opt is replaced via the hook.

Suppose that the new craft is "FlightModels\[Model].opt".
To define the cockpit POV, set CockpitPovX, CockpitPovY and CockpitPovZ in a file named "FlightModels\[Model]CockpitPov.txt" or create a section named "[CockpitPov]" in "FlightModels\[Model].ini".

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

Post by JeremyaFr » Sat Oct 10, 2020 2:43 pm

UPDATE

Hello,
I've updated the mission objects hook.

Now turrets settings are replaced when a craft is replaced.

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Sat Oct 10, 2020 3:03 pm

Similar to cockpit POV changes?

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

Post by JeremyaFr » Sat Oct 10, 2020 3:11 pm

Driftwood wrote:
Sat Oct 10, 2020 3:03 pm
Similar to cockpit POV changes?
Yes

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

Post by JeremyaFr » Wed Oct 21, 2020 1:55 pm

UPDATE

Hello,
I've updated the mission objects hook.

I've fixed a crash with the turrets.

baggy101
Cadet 2nd Class
Posts: 72
Joined: Mon Feb 02, 2015 9:32 am

Post by baggy101 » Thu Nov 26, 2020 10:34 pm

Can the mission objects hook be used to define a flightgroup opt rather than a flight model?

Post Reply