Page 1 of 1

Modding campaign provinces names

Posted: Tue Dec 24, 2024 9:11 am
by Lysimachos
Trying to mod a campaign, I wasn't able to give my new armies the proper region names into the campaign.
Does anybody knows which is the file where the pairings of army and region names (present in the TXT6.TXT) is made?

Re: Modding campaign provinces names

Posted: Tue Dec 24, 2024 12:30 pm
by Paul59
Lysimachos wrote: Tue Dec 24, 2024 9:11 am Trying to mod a campaign, I wasn't able to give my new armies the proper region names into the campaign.
Does anybody knows which is the file where the pairings of army and region names (present in the TXT6.TXT) is made?
I don't think I have ever tried to mod the province names, and it is several years since I even played a P&S Campaign, so my knowledge of this is a bit shaky. But looking at the game's files I see that there is a CustomCampaignTools.bsf file in the main P&S Campaign folder. If you can open it you will see a section of code that controls what province names are used with each nation:

Code: Select all

// Print province name - different depending on nation
FUNCTION PrintProvinceName(province)
{
	int offset;
	int sideID;

	sideID = GetCampaignVar("CampSideID", GetProvinceOriginalOwner(province));

	offset = 0;

	if ((sideID == 2) || (sideID == 3) || (sideID == 7) || (sideID == 11) || (sideID == 15) || (sideID == 19))
		{
			offset = 0;
		}

	if ((sideID == 4) || (sideID == 18) || (sideID == 20))
		{
			offset = 23;
		}

	if ((sideID == 13) || (sideID == 14))
		{
			offset = 46;
		}

	if ((sideID == 5) || (sideID == 17) || (sideID == 21) || (sideID == 24))
		{
			offset = 69;
		}

	if ((sideID == 6) || (sideID == 10))
		{
			offset = 92;
		}

	if ((sideID == 8) || (sideID == 22))
		{
			offset = 115;
		}
		
	if ((sideID == 9) || (sideID == 23) || (sideID == 25))
		{
			offset = 138;
		}

	if (sideID == 16)
		{
			offset = 161;
		}

	PrintStringIndexed("IDS_PROVINCE_NAME", province + offset);
}
So for each SideID the code specifies which offset is to be used. The offset refers to the province names in Text6.txt. The names are grouped in sections of 23 names, so offset 0 refers to the section starting with IDS_PROVINCE_NAME0, offset 23 refers to the section starting with IDS_PROVINCE_NAME23 etc.

I hope that helps?

Re: Modding campaign provinces names

Posted: Tue Dec 24, 2024 2:50 pm
by Lysimachos
Thank's a lot Paul (and merry Christmas too)!

I think this really solves the problem.

Re: Modding campaign provinces names

Posted: Tue Dec 24, 2024 3:07 pm
by Paul59
Lysimachos wrote: Tue Dec 24, 2024 2:50 pm Thank's a lot Paul (and merry Christmas too)!

I think this really solves the problem.

Oh yes, Merry Christmas to you too!

Re: Modding campaign provinces names

Posted: Wed Dec 25, 2024 12:00 am
by Lysimachos
Well Paul,
I tried to find the lines you referred to in the CustomCampaignTools.bsf file but wasn't unable to find them.
Do you think that I could try to add them in the file, just in order to verify if it works anyway?

Re: Modding campaign provinces names

Posted: Wed Dec 25, 2024 12:21 am
by Paul59
Lysimachos wrote: Wed Dec 25, 2024 12:00 am Well Paul,
I tried to find the lines you referred to in the CustomCampaignTools.bsf file but wasn't unable to find them.
Do you think that I could try to add them in the file, just in order to verify if it works anyway?
I was referring to the 5PikeandShotCampaign folder. The lines of code are at the very end of the CustomCampaignTools.bsf file. Maybe you are looking at a different campaign?

I would assume that if you added this code to your mods CustomCampaignTools.bsf the game would use it for your mod.

Re: Modding campaign provinces names

Posted: Wed Dec 25, 2024 10:06 am
by Lysimachos
Ok, I understand now!

In fact I was previously looking into the main game folder ...