Page 1 of 1
Editing Generals txt files
Posted: Thu Mar 30, 2017 5:14 am
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?
Re: Editing Generals txt files
Posted: Thu Mar 30, 2017 6:47 am
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.
Re: Editing Generals txt files
Posted: Tue Dec 12, 2017 5:40 pm
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)
Re: Editing Generals txt files
Posted: Wed Dec 13, 2017 2:38 pm
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.
Re: Editing Generals txt files
Posted: Wed Dec 13, 2017 5:59 pm
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);
}
}
}
}
}
}