Editing Generals txt files

Post Reply
kvnrthr
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 107
Joined: Sun Sep 20, 2015 8:37 pm

Editing Generals txt files

Post by kvnrthr »

I notice that in the campaigns, there are txt files containing each general's info.

What do the three parameters (type, quality, combat) mean? I assume combat is the duel rating of the general, but how do type and quality affect combat radius?
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28014
Joined: Sun Dec 04, 2005 6:25 pm

Re: Editing Generals txt files

Post by rbodleyscott »

kvnrthr wrote:I notice that in the campaigns, there are txt files containing each general's info.

What do the three parameters (type, quality, combat) mean? I assume combat is the duel rating of the general, but how do type and quality affect combat radius?
type is 0 = Sub-General, 1 = CinC, 2 = Ally General

quality affects command range - 0 = 4, 1 = 8, 2 = 12 squares.
Richard Bodley Scott

Image
mkrass
Private First Class - Opel Blitz
Private First Class - Opel Blitz
Posts: 4
Joined: Sat Nov 18, 2017 4:47 am

Re: Editing Generals txt files

Post by mkrass »

I would like to ask a question about general names. Whether it is possible to make division of lists of names for CinC-generals and sub-generals within one sideID for a campaign? I know how to make these lists in .txt file. I do not know how to set a condition for CinC with scripts (maybe in FUNCTION GetRandomGeneralName(nameType, sideID) in GeneralTools.BSF)
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28014
Joined: Sun Dec 04, 2005 6:25 pm

Re: Editing Generals txt files

Post by rbodleyscott »

mkrass wrote:I would like to ask a question about general names. Whether it is possible to make division of lists of names for CinC-generals and sub-generals within one sideID for a campaign? I know how to make these lists in .txt file. I do not know how to set a condition for CinC with scripts (maybe in FUNCTION GetRandomGeneralName(nameType, sideID) in GeneralTools.BSF)
That would be the right place. But the function does not know whether it is looking for a C-in-C name or a SG/AG name.

It would require some other modding to make it work.
Richard Bodley Scott

Image
mkrass
Private First Class - Opel Blitz
Private First Class - Opel Blitz
Posts: 4
Joined: Sat Nov 18, 2017 4:47 am

Re: Editing Generals txt files

Post by mkrass »

rbodleyscott wrote:
mkrass wrote:I would like to ask a question about general names. Whether it is possible to make division of lists of names for CinC-generals and sub-generals within one sideID for a campaign? I know how to make these lists in .txt file. I do not know how to set a condition for CinC with scripts (maybe in FUNCTION GetRandomGeneralName(nameType, sideID) in GeneralTools.BSF)
That would be the right place. But the function does not know whether it is looking for a C-in-C name or a SG/AG name.

It would require some other modding to make it work.
It seems to me that I found a script combination for this from CampaignTools.bsf. At least I'm satisfied with the result.
Resulting script in FUNCTION GetRandomGeneralName(nameType, sideID) in GeneralTools.BSF:

Code: Select all

			if (sideID == 16) 
				{	
					if (CinC != 255)	
						{
							if (nameType == 0)
								{
									ret = 0;
								}
							if (nameType == 1)
								{
									ret = FXRand(500,504);
								}
							if (nameType == 2)
								{
									ret = 500;
								}
						}
					unitCount = GetUnitCount(side);
					for (i = 0; i < unitCount; i++)
						{
							id = GetUnitID(side, i);
							if (id != -1)
								{
								if (GetAttrib(id, "General") > -1)
									{
										if (GetAttrib(id, "GeneralType") != 1)
										{
											if (nameType == 0)
											{
											ret = 0;
											}
										if (nameType == 1)
											{
											ret = FXRand(505,515);
											}
										if (nameType == 2)
											{
											ret = FXRand(505,515);
											}
										}
									}			
								}
						}		
				}	
Post Reply

Return to “Modders Corner”