Hooks

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

Moderator: JeremyaFr

Post Reply

Re: Hooks

Tony Knightcrawler
Commander
Posts: 2231
Joined: Sat Nov 29, 2003 12:01 am
Contact:

Post by Tony Knightcrawler » Wed Jun 24, 2020 5:26 am

So... would it be possible to give the debris flight group colors, and have a hook randomly determine which color is used? Also, can flight group colors have different meshes? It would be good to have a bigger variety of debris pop out of ships that have exploded. But... even if they couldn't have different meshes, it probably would be just fine to load all the debris meshes into the same model and just make different flight group colors have a single part of the debris have visible textures. They have no collision, so it shouldn't matter.

However, there's a similar question about asteroids. Since they do have collision, it would matter if flight groups could have different meshes. I was just thinking it'd be pretty radical to have ice asteroids like in Star Tours. I wonder if asteroids can have destructible "hardpoints" so you could blast through thin walls of ice.

User avatar
Ace Antilles

Admiral (Moderator)
Posts: 4238
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Wed Jun 24, 2020 8:36 am

That sounds more like new opts than hooks.
See this topic which is discussing that kind of thing.
viewtopic.php?f=9&t=12575
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

Tony Knightcrawler
Commander
Posts: 2231
Joined: Sat Nov 29, 2003 12:01 am
Contact:

Post by Tony Knightcrawler » Wed Jun 24, 2020 11:15 pm

Ace Antilles wrote:
Wed Jun 24, 2020 8:36 am
That sounds more like new opts than hooks.
See this topic which is discussing that kind of thing.
viewtopic.php?f=9&t=12575
There is no question that the OPTs can be made. My question is about hooks using those OPTs. I think the hook would need to interrupt the spawning of debris and give them random (or maybe not random) flight group colors. Maybe for asteroids, they could just be given flight group colors in a mission editor, but the model may still need to be swapped out, and each asteroid model would probably be limited to one flight group color per area (but that's okay).

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

Post by JeremyaFr » Thu Jun 25, 2020 12:55 pm

Tony Knightcrawler wrote:
Wed Jun 24, 2020 5:26 am
So... would it be possible to give the debris flight group colors, and have a hook randomly determine which color is used? Also, can flight group colors have different meshes? It would be good to have a bigger variety of debris pop out of ships that have exploded. But... even if they couldn't have different meshes, it probably would be just fine to load all the debris meshes into the same model and just make different flight group colors have a single part of the debris have visible textures. They have no collision, so it shouldn't matter.

However, there's a similar question about asteroids. Since they do have collision, it would matter if flight groups could have different meshes. I was just thinking it'd be pretty radical to have ice asteroids like in Star Tours. I wonder if asteroids can have destructible "hardpoints" so you could blast through thin walls of ice.
Hello,
I think that it may be doable.
In an OPT file, a FG color can have a different geometry and texture. But in a mesh, all FG colors share the same hitzone. So collisions may be impacted.
So when several FG geometries don't collide or have the same size, it can be done.
A hook will be needed to set the FG colors randomly. Or based on the model index to get different debris for different crafts. One problem may be the OPT file size.

User avatar
ual002
Lieutenant
XWAU Member
Posts: 773
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Thu Jun 25, 2020 1:10 pm

JeremyaFr wrote:
Thu Jun 25, 2020 12:55 pm
Tony Knightcrawler wrote:
Wed Jun 24, 2020 5:26 am
So... would it be possible to give the debris flight group colors, and have a hook randomly determine which color is used? Also, can flight group colors have different meshes? It would be good to have a bigger variety of debris pop out of ships that have exploded. But... even if they couldn't have different meshes, it probably would be just fine to load all the debris meshes into the same model and just make different flight group colors have a single part of the debris have visible textures. They have no collision, so it shouldn't matter.

However, there's a similar question about asteroids. Since they do have collision, it would matter if flight groups could have different meshes. I was just thinking it'd be pretty radical to have ice asteroids like in Star Tours. I wonder if asteroids can have destructible "hardpoints" so you could blast through thin walls of ice.
Hello,
I think that it may be doable.
In an OPT file, a FG color can have a different geometry and texture. But in a mesh, all FG colors share the same hitzone. So collisions may be impacted.
So when several FG geometries don't collide or have the same size, it can be done.
A hook will be needed to set the FG colors randomly. Or based on the model index to get different debris for different crafts. One problem may be the OPT file size.
So then the next question is, do we make higher fidelity general use debris, or take an example opt, cut it into pieces, add twisted metal and stuff at the break points and use that as debris? I would imagine it would be better to make higher fidelity general use debris of varying high quality models and textures, because to my knowledge, we cant determine the type and position of the debris at the moment it starts flying away. An exploding star destroyer might look silly with two bridge models flying away from the explosion.
Image Image Image Image Image

Tony Knightcrawler
Commander
Posts: 2231
Joined: Sat Nov 29, 2003 12:01 am
Contact:

Post by Tony Knightcrawler » Fri Jun 26, 2020 12:53 am

12 OPTs x 4 flight group colors would be 48 models. Maybe like 36 of the models could be generic, 4 for Star Destroyers, 4 for Mon Calamari Cruisers, and 4 for XQ space stations. Or 36, 5, 5, 2. Stuff like Lancers or Dreadnaughts aren't very similar to many ships, so it'd be a waste to make specific pieces for them if we have a numerical model limit. If we wanted to do, like, a chunk of a Star Destroyer bridge, maybe the hook can make sure that no more than one of those pieces spawns. Or we could make sure to use more generic pieces that could have come from multiple places on a Star Destroyer. As for how to do the generic pieces, I'd say it probably would be best to make 3 variations of most debris pieces. So a twisted I-Beam might be twisted and torn in 3 different ways, with 3 different shapes. If they're similar, but not identical, it'll be harder to notice repetition.

I am willing to work on these models once I finish my Bulwark. They're probably not going to be very hard to do. I dunno about doing the Star Destroyer, Mon Calamari, or XQ pieces, though. It might be best to ask if the original authors want to do them and if not, if I could reuse and edit their models/textures. I don't know how difficult it would be to make this hook, but I think updated debris models is low-hanging fruit as far as XWAU is concerned, and pretty important.

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

Post by keiranhalcyon7 » Fri Jun 26, 2020 6:00 am

Dang it, now you've got me fantasizing about running all the XWAUP capital ships through a DMM procedural destruction process and storing the resulting debris models as additional unreferenced meshes in each opt (so that the textures can share UV space with the intact meshes) to be deployed as unique debris for each ship... (not that I have the extra $ lying around for a DMM license, nor the expertise to put it to use, but one can dream...)

Tony Knightcrawler
Commander
Posts: 2231
Joined: Sat Nov 29, 2003 12:01 am
Contact:

Post by Tony Knightcrawler » Fri Jun 26, 2020 11:02 pm

I think it'd be awesome if the hook could just, like, use the last X meshes in a model file (where X is defined in a list by their ship number) as debris and replace certain debris OPT FG colors on the fly by referencing those meshes, but that seems pretty impossible. Even if it were possible, it would probably really bug out if a bunch of different ships exploded at around the same time.

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

Post by Bman » Mon Jun 29, 2020 6:12 am

I would assume LOD's (low level meshe(s)) could be added too which would open up more possibilities. And they wouldn't have to be the same shape, size, or texture maps as it's parent HD mesh. Might speed up performance too.
W-I-P: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

Tony Knightcrawler
Commander
Posts: 2231
Joined: Sat Nov 29, 2003 12:01 am
Contact:

Post by Tony Knightcrawler » Fri Jul 03, 2020 6:09 pm

That's an interesting idea! I wonder if it's possible to have a LOD render not based on distance, but on other factors. Multiplying the number of possible parts by 2 would allow for some crazy variety.

User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2458
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: 4238
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
Commander
XWAU Member
Posts: 2458
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: 4238
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
Commander
XWAU Member
Posts: 2458
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
Ensign
Posts: 372
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 4th Class
Posts: 23
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
Commander
XWAU Member
Posts: 2458
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
Commander
XWAU Member
Posts: 2458
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
Commander
XWAU Member
Posts: 2458
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.

Post Reply