Page 7 of 15

Re: Hooks

Posted: Fri Feb 01, 2019 7:25 am
by Darksaber
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

Re: Hooks

Posted: Fri Feb 01, 2019 9:08 am
by keiranhalcyon7
Actually I've found the problem. In HangarLoadDroidsHook(), the hook defaults to LoadDroids = 0 when the value is unspecified in the relevant configuration file:

Code: Select all

	const int value = GetFileKeyValueInt(lines, "LoadDroids"); // implicit default of 0
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.)

Re: Hooks

Posted: Fri Feb 01, 2019 9:19 am
by JeremyaFr
Hello,
I've fixed the default value of LoadDroids in the hangars hook.

Please redownload xwa_hook_hangars.zip

Re: Hooks

Posted: Fri Feb 01, 2019 10:14 am
by Darksaber
Thanks Jeremy

@keiranhalcyon7 - Please redownload the SatCom installer

Re: Hooks

Posted: Fri Feb 01, 2019 12:29 pm
by Driftwood
Good find, I was wondering why the droids went missing all of a sudden.

Thanks for fixing this Jeremya.

Re: Hooks

Posted: Sun Feb 10, 2019 8:05 pm
by evilmark
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

Re: Hooks

Posted: Sun Feb 10, 2019 9:20 pm
by evilmark
Well, idk what was up with that but it suddenly started working.

Re: Hooks

Posted: Tue Feb 12, 2019 6:04 pm
by XDragon
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?

Re: Hooks

Posted: Tue Feb 12, 2019 7:33 pm
by Darksaber
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

Re: Hooks

Posted: Wed Feb 13, 2019 3:13 am
by XDragon
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

Re: Hooks

Posted: Wed Feb 13, 2019 6:39 am
by keiranhalcyon7
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.

Re: Hooks

Posted: Fri Apr 05, 2019 4:18 pm
by JeremyaFr
Hello,
I've updated the Hooks page in the Wiki to include information about the .ini files.

Re: Hooks

Posted: Thu May 30, 2019 9:27 am
by Darksaber
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

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

Re: Hooks

Posted: Thu May 30, 2019 12:50 pm
by JeremyaFr
Hello,
I've fixed the crash.

Please redownload the hook.

Re: Hooks

Posted: Thu May 30, 2019 2:14 pm
by Darksaber
Thanks Jeremy :)

Re: Hooks

Posted: Sat Jun 29, 2019 5:10 am
by Driftwood
Jeremya, I'm having an issue with additional FG colors not showing for ships beyond FG color 3.

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
Shows FG 0 by default.

Re: Hooks

Posted: Sat Jun 29, 2019 8:10 am
by JeremyaFr
Hello,
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".

Re: Hooks

Posted: Sat Jun 29, 2019 3:16 pm
by Driftwood
JeremyaFr wrote:
Sat Jun 29, 2019 8:10 am
Hello,
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 had the FG color wrong somehow. I started at 0 and counted up like the flight group, instead of 1, 2, 3, 4, 5.

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.

Re: Hooks

Posted: Sat Jun 29, 2019 4:20 pm
by JeremyaFr
OK

Re: Hooks

Posted: Sat Jun 29, 2019 4:28 pm
by Driftwood
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)

Re: Hooks

Posted: Sat Jun 29, 2019 4:39 pm
by JeremyaFr
The section name is needed to distinguish the sections from different hooks.

Re: Hooks

Posted: Sat Jun 29, 2019 7:15 pm
by Driftwood
Can weapon laser color also be changed to be associated with a given FG color by either ship type or FG sequence number?

Re: Hooks

Posted: Sun Jun 30, 2019 3:00 am
by Driftwood
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.

Re: Hooks

Posted: Sun Jun 30, 2019 3:36 am
by keiranhalcyon7
Driftwood wrote:
Sun Jun 30, 2019 3:00 am
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.
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.

Re: Hooks

Posted: Tue Jul 09, 2019 4:55 pm
by JeremyaFr
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.