Page 4 of 15

Re: Hooks

Posted: Sat Oct 20, 2018 3:03 pm
by JeremyaFr
I will soon release the updated version of the hangars hook.

EDIT:
released
See the Custom Hangars thread

Re: Hooks

Posted: Sun Oct 21, 2018 1:33 pm
by JeremyaFr
UPDATE
Hello,
I've updated the turret hook.

Previously, when there was multiple crafts with turret, only the first turret was loaded. I've fixed that. Now, the correct turret is loaded.

Please redownload xwa_hook_mission_objects.zip

Re: Hooks

Posted: Sun Oct 21, 2018 2:59 pm
by Darksaber
Thanks Jeremy

Re: Hooks

Posted: Wed Nov 28, 2018 5:31 pm
by JeremyaFr
UPDATE

Hello,
I've updated the main hook to include a better error message for "The called hook was not correctly installed or initialized" error.

Please redownload xwa_hook_main.zip

Re: Hooks

Posted: Wed Nov 28, 2018 8:05 pm
by rogue518
Thanks JeremyaFr …… :D That cleared up my problem...:)

Sincerely, Rogue518

Re: Hooks

Posted: Sun Dec 16, 2018 2:33 pm
by JeremyaFr
NEW HOOK
Hello,

Here is a hook to set the lasers flightgroup color.

Suppose that the craft is "FlightModels\[Model].opt".
To define the color, create a file named "FlightModels\[Model]WeaponColor.txt".
The format is:
WeaponColor = color value
WeaponColorXXX = color value
WeaponColor defines the default value used for all weapons.
XXX in WeaponColorXXX goes from 280 to 307. When present, this overrides the default value. You can define a different value for all weapons.
If the file does not exist, 0 is used.
You also need to add a flightgroup color to the laser OPTs.

Download:
xwa_hook_weapon_color.zip

Re: Hooks

Posted: Sun Dec 16, 2018 3:03 pm
by Darksaber
This is brilliant, thanks, but sorry to be a pain

but can you go into a little more detail on what values to use

Also I have a Yellow Laser for a different version of the Slave One, what is the Yellow Value?

Again sorry to be a pain :D Thanks

EDIT: also in your Readme file you have
Suppose that the craft is "FlightModels\[Model].opt".

To define the color, create a file named "FlightModels\[Model]WeaponColor.txt".
The format is:
WeaponColor = color value

If the file does not exist, 0 is used.

See XWingWeaponRate.txt.

You also need to add a flightgroup color to the laser OPTs.
I take it "See XWingWeaponRate.txt." is a mistake and should read "See XWingWeaponColor.txt" ????

Re: Hooks

Posted: Sun Dec 16, 2018 3:39 pm
by JeremyaFr
"See XWingWeaponRate.txt." is a mistake. I've fixed that ("See XWingWeaponColor.txt.").

The color value is the index of the flightgroup color in the opt file. 0 is the first flightgroup color, 1 is the second flightgroup color, and so on...
I've included a modified version of LaserRebel.opt and LaserRebelTurbo.opt in the zip. I've added a green color. You can test that with the XWing by setting "WeaponColor = 1". The lasers appear green.

For the Slave One, the Yellow color works differently. It defines the open weapon in the exe. This hook doesn't modify the weapons stats in the exe. It use the different colors (textures) defined in the OPTs.

Re: Hooks

Posted: Sun Dec 16, 2018 3:58 pm
by Darksaber
I see, thanks for the clearer explanation :)

Re: Hooks

Posted: Mon Dec 17, 2018 3:01 am
by Bman
I see, in other words WeaponColor = FG markings (index 0, 1, 2,...) It's the same technique used for referencing the 6 Red Squardon X-wing textures in one model. :-) Also, the IFF side determines which laser.opt file(s) is loaded by game engine. So having additional FG's colors for those .opt models allows a lot of flexibility. Thanks Jeremy.

Re: Hooks

Posted: Mon Dec 17, 2018 6:06 am
by DTM
Great! Does it change also ion cannona and torpedoes and missiles, or only the primary weapon?

Re: Hooks

Posted: Mon Dec 17, 2018 1:26 pm
by Darksaber
For those interested here are some flightgroup lasers

LaserImp.opt and LaserImpTurbo.opt
Green = 0
Red = 1
Purple = 2
Yellow = 3

LaserRebel.opt and LaserRebelTurbo.opt
Red = 0
Green = 1
Purple = 2
Yellow = 3
FlightGroupLasers.rar
Just unpack them in the Flightmodels folder and follow the instructions that Jeremy has provided

Re: Hooks

Posted: Mon Dec 17, 2018 5:28 pm
by JeremyaFr
Thanks Darksaber
DTM wrote:
Mon Dec 17, 2018 6:06 am
Great! Does it change also ion cannona and torpedoes and missiles, or only the primary weapon?
Currently, the hook works the same for any weapons. So it also works for ions, torpedos, missiles, bombs, rockets. If needed, I can modify the hook to distinguish lasers (rebel, imp, ion) and missiles (torpedo, missile, bomb, rocket).

Re: Hooks

Posted: Mon Dec 17, 2018 5:56 pm
by keiranhalcyon7
It might be preferable to distinguish between all weapon types. Say ship A is intended to fire type 1 lasers and default ions, and ship B is intended to fire default lasers and type 1 ions. Is this configuration currently possible? I think currently both ships would end up firing type 1 of both weapons.

Re: Hooks

Posted: Mon Dec 17, 2018 6:04 pm
by Rookie_One1
Should be very interesting when DSUCP and XWAUP packs get updated

Re: Hooks

Posted: Mon Dec 17, 2018 7:48 pm
by JeremyaFr
UPDATE
You can now select a different value for all weapons.

EDIT: link removed

The format is:
WeaponColor = color value
WeaponColorXXX = color value

WeaponColor defines the default value used for all weapons.
XXX in WeaponColorXXX goes from 280 to 307. When present, this overrides the default value. You can define a different value for all weapons.

Re: Hooks

Posted: Tue Dec 18, 2018 12:38 pm
by Darksaber
Thanks Jeremy that's brilliant

Re: Hooks

Posted: Tue Dec 18, 2018 9:24 pm
by Darksaber
Hi Jeremy,

Just testing your new weapon color hook I've added other colors to LaserIon.opt and LaserIonTurbo.opt

the colors are

Blue=0
LightBlue=1
BluePurple=2
RedPurple=3

Testing with the assault gunboat,

These are the settings I have in the AssaultGunboatWeaponsColor.txt

WeaponColor = 0
WeaponColor284 = 3

When your firing any of the lasers on full charge the LaserImpTurbo.opt, LaserRebelTurbo.opt ot LaserIonTurbo.opt fires and when your on half charge the lasers switch to LaserImp.opt, LaserRebel.opt ot LaserIon.opt

The problem is when your firing the Ions (284) on full charge it first fires the Ionturbo.opt but it still fires FG0 = Blue, and only switches to Ion.opt FG3 (RedPurple) when the charge is halved

It should be showing both FG3 on full or half charge, hope you understand

I've included the Opts for you to test for yourself :) Remember to backup the other LaserIon.opt & LaserIonTurbo.opt first :)
LaserIonTest.rar

Re: Hooks

Posted: Wed Dec 19, 2018 4:32 pm
by JeremyaFr
Darksaber wrote:
Tue Dec 18, 2018 9:24 pm
These are the settings I have in the AssaultGunboatWeaponsColor.txt
Typo: AssaultGunboatWeaponColor.txt

Ion turbo is 285. So to have 3 for the ion, you have that in AssaultGunboatWeaponsColor.txt:

Code: Select all

WeaponColor284 = 3
WeaponColor285 = 3

Re: Hooks

Posted: Wed Dec 19, 2018 4:57 pm
by Darksaber
Sorry, yes the typo, the file I have though is correct spelling :)

and Opps, I thought it would work the same as the normal Red/Green lasers, I didn't realise you had to add both

Ok just another quick question

Not that I'm going to, but hypothetically........

A craft can change to a number of different missiles and torpedoes in game or in skirmish, If I were to change the missiles and torpedoes and add different FG's (which I'm not) to those, I would also have to add other lines in the list, something like so :-

Code: Select all

WeaponColor = 0
WeaponColor284 = 3
WeaponColor285 = 3
WeaponColor286 = 1
WeaponColor287 = 2
WeaponColor291 = 3
WeaponColor292 = 1
WeaponColor293 = 2
WeaponColor294 = 3
WeaponColor295 = 0
WeaponColor296 = 1
Just on the off chance that I might want to select a different missile or torpedo with a different FG for that craft

Would this be correct??

Thanks again :)

Re: Hooks

Posted: Wed Dec 19, 2018 5:12 pm
by JeremyaFr
It is correct.
But I think that it doesn't work for countermeasures.

Re: Hooks

Posted: Wed Dec 19, 2018 6:55 pm
by Darksaber
Ok gotta, thanks :D

Re: Hooks

Posted: Fri Dec 21, 2018 7:54 pm
by JeremyaFr
UPDATE
Hello,
I've uploaded the weapon color hook to my OneDrive and to GitHub.
There is no change.

Re: Hooks

Posted: Sun Dec 30, 2018 11:50 am
by JeremyaFr
NEW HOOK
Hello,
Here is a new hook. It permits to enable interdictor feature for any craft.

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

To enable the interdictor feature, create a file named "FlightModels\[Model]Interdictor.txt".
The format is:
IsInterdictor = 1
or
IsInterdictor = 0

If the file does not exist, default values are used. By default, the ModelIndex 137 Interdictor2 and ModelIndex 141 ModStrikeCruiser are interdictor.

xwa_hook_interdictor.zip

Re: Hooks

Posted: Sun Dec 30, 2018 12:41 pm
by Trevor
With all these hooks there is a potential for a lot of txt files, have you thought about making a unified ini file for each craft with section headers?

then you could have:
Suppose that the craft is "FlightModels\[Model].opt".

To enable the interdictor feature, create a file named "FlightModels\[Model].ini"
[Interdictor]
IsInterdictor = 1

[otherhook]


This would still be future proof as any new hook simply adds a section and any new features simply read their key=value pair while old hooks (who would be using an old hook anyway) ignore new features.

Trev