Hooks
Moderator: JeremyaFr
Re: Hooks
- JeremyaFr
- Posts: 3922
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
I will soon release the updated version of the hangars hook.
EDIT:
released
See the Custom Hangars thread
EDIT:
released
See the Custom Hangars thread
- JeremyaFr
- Posts: 3922
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
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
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
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3922
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
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
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
- rogue518
- Posts: 2856
- Joined: Wed Jul 12, 2000 11:01 pm
- Contact:
Thanks JeremyaFr …… That cleared up my problem...
Sincerely, Rogue518
Sincerely, Rogue518
'Stay in Attack formation!' Darth Vader aka: Anakin Skywalker During the 'Battle Of Yavin'
- JeremyaFr
- Posts: 3922
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
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
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
Last edited by JeremyaFr on Fri Dec 21, 2018 7:52 pm, edited 3 times in total.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
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 Thanks
EDIT: also in your Readme file you have
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 Thanks
EDIT: also in your Readme file you have
I take it "See XWingWeaponRate.txt." is a mistake and should read "See XWingWeaponColor.txt" ????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.
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3922
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
"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.
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.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
I see, thanks for the clearer explanation
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
-
- Posts: 1167
- Joined: Mon Apr 05, 2004 11:01 pm
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.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- DTM
- Posts: 2119
- Joined: Tue Apr 22, 2003 11:01 pm
- Contact:
Great! Does it change also ion cannona and torpedoes and missiles, or only the primary weapon?
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
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
Just unpack them in the Flightmodels folder and follow the instructions that Jeremy has provided
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
Just unpack them in the Flightmodels folder and follow the instructions that Jeremy has provided
You do not have the required permissions to view the files attached to this post.
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3922
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Thanks Darksaber
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).
Last edited by JeremyaFr on Wed Dec 19, 2018 5:13 pm, edited 1 time in total.
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
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.
- Rookie_One1
- Posts: 1656
- Joined: Thu Feb 26, 2004 12:01 am
Should be very interesting when DSUCP and XWAUP packs get updated
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death
Current Holder of the Frying Pan of Death
- JeremyaFr
- Posts: 3922
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
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.
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.
Last edited by JeremyaFr on Fri Dec 21, 2018 7:53 pm, edited 1 time in total.
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
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
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
You do not have the required permissions to view the files attached to this post.
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3922
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
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
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
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 :-
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
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
Would this be correct??
Thanks again
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3922
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
It is correct.
But I think that it doesn't work for countermeasures.
But I think that it doesn't work for countermeasures.
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3922
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
UPDATE
Hello,
I've uploaded the weapon color hook to my OneDrive and to GitHub.
There is no change.
Hello,
I've uploaded the weapon color hook to my OneDrive and to GitHub.
There is no change.
- JeremyaFr
- Posts: 3922
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
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
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
- Trevor
- Posts: 541
- Joined: Thu Dec 04, 2014 7:11 pm
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
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