PA Expansion Hook

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderators: Darksaber, General_Trageton, Forceflow, JeremyaFr, DTM

Post Reply

PA Expansion Hook

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Wed Jun 26, 2019 4:14 am

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
Last edited by Justagai on Thu Jun 27, 2019 2:29 am, edited 1 time in total.

User avatar
ual002
Ensign
Galactic Empire
Posts: 488
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Wed Jun 26, 2019 4:37 am

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
For the glory of his majesty Emperor Palpatine! Image Image Image Image

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10319
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » 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
“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

User avatar
ual002
Ensign
Galactic Empire
Posts: 488
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Wed Jun 26, 2019 7:16 am

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.
For the glory of his majesty Emperor Palpatine! Image Image Image Image

User avatar
Trevor
Cadet 1st Class
Posts: 188
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » 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
Last edited by Trevor on Wed Jun 26, 2019 6:45 pm, edited 1 time in total.

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Wed Jun 26, 2019 6:20 pm

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.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10319
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Jun 26, 2019 6:25 pm

Ok 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

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1611
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » 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".

User avatar
ual002
Ensign
Galactic Empire
Posts: 488
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Wed Jun 26, 2019 7:12 pm

Here's 10 rebel expansion files so someone at least has a template.
https://www.dropbox.com/s/219zryf9hjtt7 ... on.7z?dl=0

Image
For the glory of his majesty Emperor Palpatine! Image Image Image Image

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10319
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Jun 26, 2019 7:27 pm

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
“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

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Wed Jun 26, 2019 8:08 pm

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;
}

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1611
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Jun 26, 2019 8:25 pm

Replace ".\Wave\Frontend" with ".\\Wave\\Frontend".

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Wed Jun 26, 2019 8:33 pm

Ah thanks. I can't believe I overlooked that.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1611
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Jun 26, 2019 8:35 pm

Also, try to make a case-insensitive comparison for ".wav".

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Wed Jun 26, 2019 8:44 pm

Ok, so something like this:

Code: Select all

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

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Wed Jun 26, 2019 9:15 pm

Updated to 1.1, no longer needs the config and there is no limit on the amount of expanded PAs.

User avatar
Trevor
Cadet 1st Class
Posts: 188
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Wed Jun 26, 2019 9:34 pm

Justagai, why not do

Code: Select all

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

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Wed Jun 26, 2019 9:50 pm

That works. I'll put it in for the next version.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10319
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Jun 26, 2019 9:53 pm

Does it work for lower case files though?
“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

User avatar
Trevor
Cadet 1st Class
Posts: 188
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Wed Jun 26, 2019 10:30 pm

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

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10319
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Jun 26, 2019 10:40 pm

You da man, makes sense :)
“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

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Thu Jun 27, 2019 2:29 am

Updated to 1.2 with better detection of Wav files.

User avatar
keiranhalcyon7
Ensign
Posts: 276
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Thu Jun 27, 2019 5:24 am

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.

Post Reply