Hooks
Moderator: JeremyaFr
Re: Hooks
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
Which hangar are we talking about? The pilot proving grounds which uses the main "Hangar.opt" or another in a different mission
The only *txt files the LoadDroids = 0 or LoadDroids = 1 should appear in is the either one of these
- "[MissionDir]\[Mission]_HangarObjects.txt"
- "[MissionDir]\[Mission].ini", section "[HangarObjects]"
- "FlightModels\[Model]HangarObjects.txt"
- "FlightModels\[Model].ini", section "[HangarObjects]"
- "FlightModels\HangarObjects.txt"
The main file you should have a look at is "FlightModels\HangarObjects.txt" as this controls what will appear in all "[Model]Hangar.opt" including the main "Hangar.opt" if a "FlightModels\[Model]HangarObjects.txt" is not present
The only *txt files the LoadDroids = 0 or LoadDroids = 1 should appear in is the either one of these
- "[MissionDir]\[Mission]_HangarObjects.txt"
- "[MissionDir]\[Mission].ini", section "[HangarObjects]"
- "FlightModels\[Model]HangarObjects.txt"
- "FlightModels\[Model].ini", section "[HangarObjects]"
- "FlightModels\HangarObjects.txt"
The main file you should have a look at is "FlightModels\HangarObjects.txt" as this controls what will appear in all "[Model]Hangar.opt" including the main "Hangar.opt" if a "FlightModels\[Model]HangarObjects.txt" is not present
“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
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
Actually I've found the problem. In HangarLoadDroidsHook(), the hook defaults to LoadDroids = 0 when the value is unspecified in the relevant configuration file:
Adding a default of 1 resolves the issue. (Attn: Jeremy - I tried to create a pull request, but I'm afraid I haven't quite grokked git.)
Code: Select all
const int value = GetFileKeyValueInt(lines, "LoadDroids"); // implicit default of 0
- JeremyaFr
- Posts: 3988
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
I've fixed the default value of LoadDroids in the hangars hook.
Please redownload xwa_hook_hangars.zip
I've fixed the default value of LoadDroids in the hangars hook.
Please redownload xwa_hook_hangars.zip
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
Thanks Jeremy
@keiranhalcyon7 - Please redownload the SatCom installer
@keiranhalcyon7 - Please redownload the SatCom installer
“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
- Driftwood
- Posts: 2174
- Joined: Wed Oct 22, 2003 11:01 pm
- Contact:
Good find, I was wondering why the droids went missing all of a sudden.
Thanks for fixing this Jeremya.
Thanks for fixing this Jeremya.
-
- Posts: 51
- Joined: Tue Feb 05, 2019 12:43 am
I'm having some trouble with the weapon color hook. I'm using the laser opts Darksaber posted back on page 4, but each ship I try to use it with the lasers stay at the default. I edited Darksaber's opts to make the yellow texture blue, but even when I try to use the purple color it still doesn't work.
XwingWeaponColor.txt
WeaponColor = 3
XwingWeaponColor.txt
WeaponColor = 3
-
- Posts: 51
- Joined: Tue Feb 05, 2019 12:43 am
Well, idk what was up with that but it suddenly started working.
- XDragon
- Posts: 119
- Joined: Tue Jan 29, 2008 12:01 am
- Contact:
So I've been trying to look for a tutorial on the craft replacement hook and I can't seem to find it. I would love to take advantage of the multiple Corvettes and Frigates that everyone has so diligently been working on, but I have no idea how to actually go about changing which ship is in which mission. Also, is it possible to have multiple versions per mission? IE: a medical frigate ad a carrier frigate?
Founder of Z3R0 (Zero Command)
https://xdragon2688.wixsite.com/z3ro/
https://xdragon2688.wixsite.com/z3ro/
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
There aren't any tutorials on the Hooks, the closest you'll get to a tutorial is to read the readme files that come with the Hooks or to read the Modding Wiki/Hooks
“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
- XDragon
- Posts: 119
- Joined: Tue Jan 29, 2008 12:01 am
- Contact:
That's helpful for the other hooks, but not specifically the craft selection/replacement as I don't see it there. Sorry for being a pain
Founder of Z3R0 (Zero Command)
https://xdragon2688.wixsite.com/z3ro/
https://xdragon2688.wixsite.com/z3ro/
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
Usage is described near the end of Xwa_Hook_Mission_Objects_Readme.txt
What you describe isn't supported, though. Replacement is done by ship type, not by flight group.
What you describe isn't supported, though. Replacement is done by ship type, not by flight group.
- JeremyaFr
- Posts: 3988
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
I've updated the Hooks page in the Wiki to include information about the .ini files.
I've updated the Hooks page in the Wiki to include information about the .ini files.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
Hi Jeremy,
I keep getting a crash when entering skirmish mode, a skipray against a skipray, not sure if that has anything to do with it,
This is the error report from event viewer
From that it looks like it's the new Shield Hook might be the problem, if I remove or delete the hook, skirmish loads fine
Thanks
I keep getting a crash when entering skirmish mode, a skipray against a skipray, not sure if that has anything to do with it,
This is the error report from event viewer
Code: Select all
Faulting application name: XwingAlliance.exe, version: 2.0.0.2, time stamp: 0x3765a9b7
Faulting module name: Hook_Shield.dll, version: 1.0.0.1, time stamp: 0x5ca798b1
Exception code: 0xc0000005
Fault offset: 0x00006d1f
Faulting process id: 0x159c
Faulting application start time: 0x01d516c86268023d
Faulting application path: C:\Program Files (x86)\LucasArts\X-Wing Alliance\XwingAlliance.exe
Faulting module path: C:\Program Files (x86)\LucasArts\X-Wing Alliance\Hook_Shield.dll
Report Id: a95b793c-82bb-11e9-9345-001d7d002f67
From that it looks like it's the new Shield Hook might be the problem, if I remove or delete the hook, skirmish loads fine
Thanks
“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: 3988
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
I've fixed the crash.
Please redownload the hook.
I've fixed the crash.
Please redownload the hook.
“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
- Driftwood
- Posts: 2174
- Joined: Wed Oct 22, 2003 11:01 pm
- Contact:
Jeremya, I'm having an issue with additional FG colors not showing for ships beyond FG color 3.
Is this code still functional?
Shows FG 0 by default.
Is this code still functional?
Code: Select all
\\Flight Group, FG Color number (0-127) IE: 0 = Red, 1 = Gold, 2 = Blue, 3 = Green, ect.
fg, 1, markings, 0
fg, 2, markings, 4
- JeremyaFr
- Posts: 3988
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
It's still functional.
Note that fg count start with 0.
Also, how have you named the file?
It's still functional.
Note that fg count start with 0.
Also, how have you named the file?
Suppose that the mission is "[MissionDir]\[Mission].tie".
To override the mission data, create a file named "[MissionDir]\[Mission].txt" or create a section named "[mission_tie]" in "[MissionDir]\[Mission].ini".
- Driftwood
- Posts: 2174
- Joined: Wed Oct 22, 2003 11:01 pm
- Contact:
I had the FG color wrong somehow. I started at 0 and counted up like the flight group, instead of 1, 2, 3, 4, 5.JeremyaFr wrote: ↑Sat Jun 29, 2019 8:10 amHello,
It's still functional.
Note that fg count start with 0.
Also, how have you named the file?
Suppose that the mission is "[MissionDir]\[Mission].tie".
To override the mission data, create a file named "[MissionDir]\[Mission].txt" or create a section named "[mission_tie]" in "[MissionDir]\[Mission].ini".
I originally 3 and 4, and I got FGs Green and "Five", but it was loading Blue and Green, not "five". This gave me the impression it wasn't working. I was wrong, it was working but loading the textures I was not expecting.
- Driftwood
- Posts: 2174
- Joined: Wed Oct 22, 2003 11:01 pm
- Contact:
I also realized that I had the section header as "FG Color Hook" Not "Mission_TIE" which also broke the hook.
Since It's already in a missionname.ini file does it need to be called "Mission_TIE?" since that doesn't exactly clarify what the section does? (obviously as is, to call the hook it does)
Since It's already in a missionname.ini file does it need to be called "Mission_TIE?" since that doesn't exactly clarify what the section does? (obviously as is, to call the hook it does)
- JeremyaFr
- Posts: 3988
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
The section name is needed to distinguish the sections from different hooks.
- Driftwood
- Posts: 2174
- Joined: Wed Oct 22, 2003 11:01 pm
- Contact:
Can weapon laser color also be changed to be associated with a given FG color by either ship type or FG sequence number?
- Driftwood
- Posts: 2174
- Joined: Wed Oct 22, 2003 11:01 pm
- Contact:
The other thought I've been tossing around lately is, could it be possible to define hull, maneuverability, ect. stats via the craft specific .ini file on a per-opt basis, overwriting whatever is stored in the EXE being called? Say in the instance you have an X-Wing utilized in the editor, but you overwrite it with the object replacer hook with something else, so it pulls the stats from the Othercraft.ini rather than the data in the EXE or the X-Wing.ini file?
Hypothetically.
Hypothetically.
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
I've kicked around an even more ambitious idea - based on a mission ini, overwrite in-memory info for replaced ships (stats, icons, strings) with info read from the replacement ship's .shp file. It's potentially a lot of internal structures to find and edit, though. The location of the stats should be easy enough, since these are part of the exe's data segment, but I think the strings and icons are loaded into dynamically allocated spaces.Driftwood wrote: ↑Sun Jun 30, 2019 3:00 amThe other thought I've been tossing around lately is, could it be possible to define hull, maneuverability, ect. stats via the craft specific .ini file on a per-opt basis, overwriting whatever is stored in the EXE being called? Say in the instance you have an X-Wing utilized in the editor, but you overwrite it with the object replacer hook with something else, so it pulls the stats from the Othercraft.ini rather than the data in the EXE or the X-Wing.ini file?
Hypothetically.
- JeremyaFr
- Posts: 3988
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
UPDATE
Hello,
I've updated the opt limit hook.
I've reverted the last change as I think it is no longer needed. It was used to fix a crash.
Let me know if the game crashes with this updated hook.
Hello,
I've updated the opt limit hook.
I've reverted the last change as I think it is no longer needed. It was used to fix a crash.
Let me know if the game crashes with this updated hook.