Page 1 of 1

PA Expansion Hook

Posted: Wed Jun 26, 2019 4:14 am
by Justagai
Hello folks,

This hook will allow one to expand the number of public announcements in the concourse.

v1.2

- Better detection of Wav files

Download and source link here: xwa_hook_pa_expansion.zip

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 4:37 am
by ual002
Here is a link to my Imperial PA re-voice/re-master thread. It includes several additional Imperial announcements that utilize this hook.
Imperial Install PA System Wave edits

Here is a direct DL:
Imperial Install Concourse Wave edits.7z

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 6:24 am
by Darksaber
@Justagai

Quick Q. What if you have the Extra PA's set to say 10 in the cfg file, but those wave files don't exist in the Wave/Frontend folder, will this be ignored??

I only ask as if I add ual002's new PA waves to the DSUCP, they will only be installed if the Imperial Concourse is installed, but the Hook_PA_Expansion.dll and Hook_PA_Expansion.cfg will be installed regardless of what Concourse is installed.

Thanks

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 7:16 am
by ual002
I follow what you are saying, Justagai will have to confirm.

If however it causes issues. I can also record some rebel friendly equivalents for those 10 expansion PAs. This way if playing with this stuff fancies anyone, they have 10 expansion examples for both rebel and Imperial.

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 5:37 pm
by Trevor
Awww, make some rebel ones too... :P

Can the concourse be made to go to red-alert for "defend the liberty"?
Maybe have "General Quarters, General Quarters. All hands man your battle stations. The route of travel is forward and up to starboard, down and aft to port. Set material condition 'Zebra' throughout the ship. Reason for General Quarters: Inbound hostiles - KLAXON"

Trev

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 6:20 pm
by Justagai
Darksaber wrote:
Wed Jun 26, 2019 6:24 am
@Justagai

Quick Q. What if you have the Extra PA's set to say 10 in the cfg file, but those wave files don't exist in the Wave/Frontend folder, will this be ignored??

I only ask as if I add ual002's new PA waves to the DSUCP, they will only be installed if the Imperial Concourse is installed, but the Hook_PA_Expansion.dll and Hook_PA_Expansion.cfg will be installed regardless of what Concourse is installed.

Thanks
If its one of the extra PAs then the announcement would attempt to play but nothing would play. The game would not crash or anything like that.

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 6:25 pm
by Darksaber
Ok thanks :)

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 6:38 pm
by JeremyaFr
Hello,
Instead of requiring a config file value, you can count the wav files in "\WAVE\FRONTEND\" starting with "T01PA".

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 7:12 pm
by ual002
Here's 10 rebel expansion files so someone at least has a template.
https://www.dropbox.com/s/219zryf9hjtt7 ... on.7z?dl=0

Image

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 7:27 pm
by Darksaber
JeremyaFr wrote:
Wed Jun 26, 2019 6:38 pm
Hello,
Instead of requiring a config file value, you can count the wav files in "\WAVE\FRONTEND\" starting with "T01PA".
This would probably be a better use of the hook, instead of having to create more wave files

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 8:08 pm
by Justagai
Hey Jeremy, I've added the code to count the number of PA wavs but it doesn't seem to be getting any. What am I doing wrong?

Here is the code:

Code: Select all

int GetNumOfExtraPA()
{
	int PACount = 0;

	for (const auto& file : std::experimental::filesystem::directory_iterator(".\Wave\Frontend"))
	{
		if (file.path().extension().string() != ".wav")
		{
			continue;
		}

		const auto& filename = file.path().filename().string();

		if (filename.find("T01PA") != 0 && filename.find("t01pa") != 0)
		{
			continue;
		}

		++PACount;
	}

	return PACount - 37;
}

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 8:25 pm
by JeremyaFr
Replace ".\Wave\Frontend" with ".\\Wave\\Frontend".

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 8:33 pm
by Justagai
Ah thanks. I can't believe I overlooked that.

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 8:35 pm
by JeremyaFr
Also, try to make a case-insensitive comparison for ".wav".

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 8:44 pm
by Justagai
Ok, so something like this:

Code: Select all

if (file.path().extension().string() != ".wav" && file.path().extension().string() != ".WAV")
		{
			continue;
		}

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 9:15 pm
by Justagai
Updated to 1.1, no longer needs the config and there is no limit on the amount of expanded PAs.

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 9:34 pm
by Trevor
Justagai, why not do

Code: Select all

if (toupper(file.path().extension().string()( != ".WAV")
		{
			continue;
		}
		
Trev

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 9:50 pm
by Justagai
That works. I'll put it in for the next version.

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 9:53 pm
by Darksaber
Does it work for lower case files though?

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 10:30 pm
by Trevor
it should do since you take the string and make it upper case before comparing.
in = ".wav", ToUpperCase = .WAV, compare ".WAV" == ".WAV" = true

so, ".wav" = ".WAV" = ".WaV" = ".wAv" … etc

Trev

Re: PA Expansion Hook

Posted: Wed Jun 26, 2019 10:40 pm
by Darksaber
You da man, makes sense :)

Re: PA Expansion Hook

Posted: Thu Jun 27, 2019 2:29 am
by Justagai
Updated to 1.2 with better detection of Wav files.

Re: PA Expansion Hook

Posted: Thu Jun 27, 2019 5:24 am
by keiranhalcyon7
Trevor wrote:
Wed Jun 26, 2019 5:37 pm
Awww, make some rebel ones too... :P

Can the concourse be made to go to red-alert for "defend the liberty"?
Maybe have "General Quarters, General Quarters. All hands man your battle stations. The route of travel is forward and up to starboard, down and aft to port. Set material condition 'Zebra' throughout the ship. Reason for General Quarters: Inbound hostiles - KLAXON"

Trev
Close all shops in the mall. Cancel the three ring circus. Secure all animals in the zoo.