Impossible to set secondary warheads other than Concussion Missile?

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.
Post Reply

Impossible to set secondary warheads other than Concussion Missile?

Turgidson
Cadet 2nd Class
Posts: 52
Joined: Sun Aug 25, 2019 10:02 pm

Post by Turgidson » Sun Sep 29, 2019 11:24 am

It seems that when a second set of warhead launchers is added, its always a (standard) Concussion Missile launcher. It just seems impossible to set it to anything else (Advanced Missile, Torpedo, Advanced Torpedo...) - editing the OPT, editing the weaponry with MXvTED... have no effect on this.
Of course, there's no interface to select the secondary weapons type in-game... and I don't think this one absolutely needs to change. But at least, in TIE Fighter for example, the Missile Boat had Advanced CMs (not the near-useless standard CMs).

I'd assume this behavior hard-coded. Would there be a way (through a new Hook?) to make the game read the ship information; so that the weapons type of this second launcher becomes editable?

User avatar
Jaeven
XWAU Member
Posts: 578
Joined: Mon Mar 30, 2015 3:18 am

Post by Jaeven » Sun Sep 29, 2019 2:42 pm

This would be a really interesting idea. CC: Jeremya :D

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

Post by JeremyaFr » Sun Sep 29, 2019 3:07 pm

I will have a look.

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

Post by JeremyaFr » Sun Sep 29, 2019 4:44 pm

Turgidson wrote:
Sun Sep 29, 2019 11:24 am
I'd assume this behavior hard-coded.
You are right.

At address 0041BBF0, there is this code:

Code: Select all

if( s_ExeCraftTable[esp18].WarheadTypeId[1] != ModelIndex_000__1_0 )
{
    s_pXwaCurrentCraft->WarheadsModelIndex[0] = ModelIndex_287_1_25_ConcussionMissile;
    s_pXwaCurrentCraft->WarheadsModelIndex[1] = s_XwaTieWarheadTypeToModelIndex[s_XwaTieFlightGroups[s_V0x09E9708].FlightGroup.WarheadType];
}
else
{
    s_pXwaCurrentCraft->WarheadsModelIndex[0] = s_XwaTieWarheadTypeToModelIndex[s_XwaTieFlightGroups[s_V0x09E9708].FlightGroup.WarheadType];
    s_pXwaCurrentCraft->WarheadsModelIndex[1] = ModelIndex_000__1_0;
}
When 2 warheads are defined, one is replaced with a Concussion Missile.

Turgidson
Cadet 2nd Class
Posts: 52
Joined: Sun Aug 25, 2019 10:02 pm

Post by Turgidson » Sun Sep 29, 2019 8:57 pm

Wow! Thanks for the quick analysis and confirmation. :god:

Now the question is, could this be modified so it reads the "real" value (patched to the EXE with MXvTED and/or read from the OPT) instead of the default replacement? Or have an an external config file that'd determine what the weapons replacement should be... :)

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Sun Sep 29, 2019 9:37 pm

Wow, Jeremy, it looks like you are doing a full decompile of xwa, eventually we wont need hooks :lachtot:

Trev

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

Post by Bman » Mon Sep 30, 2019 4:27 am

Turgidson, have you tried using the AlliED mission editor? The Ship Tab and Options tab? I would think if the .opt model and offsets are setup already (try BHE) this would allow you achieve the second load of 40 adv. mis. so Missible Boat would have it's 80 adv. mis. or whatever. I don't recall how many of payload you can specify. Maybe I'm wrong but thought this was already do-able.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
Mark_Farlander
Rebel Alliance
Posts: 580
Joined: Tue Jan 16, 2018 10:47 pm

Post by Mark_Farlander » Wed Oct 02, 2019 7:19 am

With BinHexEdit or MXvTED v4.2 you can specify 2 warhead loads with their respective per-launcher payloads. Fighters usually have 2 launchers for each warhead load.
However, as soon as the mission or skirmish is loaded, if the craft has only 1 warhead load in MXvTED it is replaced with the load set in AlliED for that Flight Group.
If the craft has 2 warhead loads in MXvTED the first load is replaced with standard concussion missiles and the second one is replaced with the load set in AlliED.
I suspected this logic, but now the code posted by Jeremy leaves without any doubt.
I don't judge tactics. The Battle is the best and only Judge.

User avatar
Mark_Farlander
Rebel Alliance
Posts: 580
Joined: Tue Jan 16, 2018 10:47 pm

Post by Mark_Farlander » Wed Oct 02, 2019 7:42 am

As I just wrote, the code posted by Jeremy essentially means that the warhead types set with MXvTED v4.2 do not matter.
It's the load you set with AlliED, Ship menu, or in the simulator that determines the only (or the second) warhead load.

As far as I know the Options menu in AlliED only serves to allow the player to REPLACE what's set in the Ship menu.
Player can change craft with an optional one, or he can load another warhead type, beam system or countermeasure.
But any selection he will do in the hangar, it will remove the default one (the one set in the Ship menu).

Any changes done while player's craft is in the hangar will only affect player's craft, not the other crafts in his FG.
I don't judge tactics. The Battle is the best and only Judge.

Turgidson
Cadet 2nd Class
Posts: 52
Joined: Sun Aug 25, 2019 10:02 pm

Post by Turgidson » Wed Oct 02, 2019 10:09 pm

So without a hook, no chance to set the other warhead load on the type written in MXvTED (or in any other external file).

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Thu Oct 03, 2019 1:50 am

As I'm reading it can only be changed on a "per mission basis" in allied.

Correct me if I'm wrong.

User avatar
Mark_Farlander
Rebel Alliance
Posts: 580
Joined: Tue Jan 16, 2018 10:47 pm

Post by Mark_Farlander » Thu Oct 03, 2019 5:14 am

No, if a craft has 2 warhead loads then the first one is always set to standard concussion missiles regardless of the warhead load set in MXvTED or AlliED.
JeremyaFr wrote:
Sun Sep 29, 2019 4:44 pm
Turgidson wrote:
Sun Sep 29, 2019 11:24 am
I'd assume this behavior hard-coded.
You are right.

At address 0041BBF0, there is this code:

Code: Select all

if( s_ExeCraftTable[esp18].WarheadTypeId[1] != ModelIndex_000__1_0 )
{
    s_pXwaCurrentCraft->WarheadsModelIndex[0] = ModelIndex_287_1_25_ConcussionMissile;
    s_pXwaCurrentCraft->WarheadsModelIndex[1] = s_XwaTieWarheadTypeToModelIndex[s_XwaTieFlightGroups[s_V0x09E9708].FlightGroup.WarheadType];
}
else
{
    s_pXwaCurrentCraft->WarheadsModelIndex[0] = s_XwaTieWarheadTypeToModelIndex[s_XwaTieFlightGroups[s_V0x09E9708].FlightGroup.WarheadType];
    s_pXwaCurrentCraft->WarheadsModelIndex[1] = ModelIndex_000__1_0;
}
When 2 warheads are defined, one is replaced with a Concussion Missile.
Mark_Farlander wrote:
Wed Oct 02, 2019 7:19 am
With BinHexEdit or MXvTED v4.2 you can specify 2 warhead loads with their respective per-launcher payloads. Fighters usually have 2 launchers for each warhead load.
However, as soon as the mission or skirmish is loaded, if the craft has only 1 warhead load in MXvTED it is replaced with the load set in AlliED for that Flight Group.
If the craft has 2 warhead loads in MXvTED the first load is replaced with standard concussion missiles and the second one is replaced with the load set in AlliED.
I suspected this logic, but now the code posted by Jeremy leaves without any doubt.
I don't judge tactics. The Battle is the best and only Judge.

User avatar
Mark_Farlander
Rebel Alliance
Posts: 580
Joined: Tue Jan 16, 2018 10:47 pm

Post by Mark_Farlander » Thu Oct 03, 2019 5:51 am

There is a thing that needs to be tested: as I wrote in the file "Orders (Basic)" for the AlliED modding wiki, the third box (No Effect?) of the order "Attack targets" is warhead usage.
0 is default: the FG fires concussion missiles (standard or advanced) only against fighters, proton torpedoes or heavy rockets only against transports, capital ships and stations.
[See the values in the Warhead - Behavior section in BinHexEdit to get the default usage for every warhead type]
1 is "All targets": the FG fires warheads against every target regardless of target category while performing such order.
2 is "Never": the FG never fires warheads while performing such order.

However, this is true (has been tested many times) for crafts set to carry only one load of warheads in MXvTED, and that load is replaced with the one set in AlliED.
But how does that logic work for crafts set to carry 2 loads of warheads such as the Missile Boat or the Skipray Blastboat?
I mean if the second warhead load is proton torpedoes (the first load is always standard concussion missiles) and you set the third box to 1, how do crafts behave?
The most logic thing would be to use missiles against fighters and proton torpedoes against capital ships, transports and stations just like default, but this needs to be tested.
I don't judge tactics. The Battle is the best and only Judge.

Post Reply