PROGRAM\Towns\Towntable.c:
I think there is a logic error with the above code because it relies on all governors having a section of code like this in their character init entries:
But not all of them do. And it is probably a LOT of hard work to set that up.
So how about this simplified version instead?
Away are all the extra pre-defined potential characters used so you'll always get a random one.
Away is all the .old code so once a governor is replaced, that name and model will not return even when the town is given back to the original nation.
I figure that might just be fair enough because why would the very original governor return? That governor may not even be alive anymore!
Taking over a pirate town will maintain a pirate governor instead of removing the governor altogether.
This wasn't the case before, but fits in with the "Pirate Play Style" changes we've been making this year.
The code also doesn't care about "bFirstInit" anymore which used to apply when the function is called through ModifyTown.
As far as I can tell, that function isn't even used anyway these days so this shouldn't make a difference.
I figure that perhaps was intended for when a town changes hands for the Periods mod.
But that now seems to be handled differently with the governors being defined through Periods.c .
Does this make sense to you guys? Anyone care testing some town captures and seeing what happens with this?
Also, confirm if for example the Spanish governors for normally non-Spanish towns in Early Explorers still are who they're supposed to be according to Periods.c .
Code:
ref gov = &characters[govidx];
gov.nation = iNation;
if (iNation != PERSONAL_NATION)
{
// Create new governor:
SetRandomNameToCharacter(gov);
switch(iNation)
{
case ENGLAND:
gov.greeting = "Gr_Robert Christopher Silehard";
break;
case FRANCE:
gov.greeting = "Gr_joseph claude le moigne";
break;
case SPAIN:
gov.greeting = "Gr_Christofor Manuel de Alencar";
break;
case PIRATE:
gov.greeting = "Gr_Isenbrandt Jurcksen";
break;
case HOLLAND:
gov.greeting = "Gr_Reynard Grueneveldt";
break;
case PORTUGAL:
gov.greeting = "Gr_Jacinto Arcibaldo Barreto";
break;
case AMERICA:
gov.greeting = "Gr_Robert Christopher Silehard";
break;
}
SetModelFromID(gov, GetRandomModelForTypeExSubCheck(-1, "Rich_citizens", "man", iNation)); // PB: Give this guy a random model
}
Code:
// KK -->
ch.nation.n0.name = "Michael";
ch.nation.n0.lastname = "Johnson";
ch.nation.n0.model = "huber_eng2_17";
ch.nation.n0.sex = "man";
ch.nation.n0.greeting = "Gr_Robert Christopher Silehard";
ch.nation.n1.name = "Joseph";
ch.nation.n1.lastname = "Fayette";
ch.nation.n1.model = "huber_fra3_17";
ch.nation.n1.sex = "man";
ch.nation.n1.greeting = "Gr_joseph claude le moigne";
ch.nation.n2.name = "Miguel";
ch.nation.n2.lastname = "de Suza";
ch.nation.n2.model = "huber_spa2_17";
ch.nation.n2.sex = "man";
ch.nation.n2.greeting = "Gr_Christofor Manuel de Alencar";
ch.nation.n4.name = ch.old.name;
ch.nation.n4.lastname = ch.old.lastname;
ch.nation.n4.model = ch.model;
ch.nation.n4.sex = ch.sex;
ch.nation.n4.greeting = ch.greeting;
ch.nation.n5.name = "Menirez";
ch.nation.n5.lastname = "De Marco";
ch.nation.n5.model = "huber_por_17";
ch.nation.n5.sex = "man";
ch.nation.n5.greeting = "Gr_Jacinto Arcibaldo Barreto";
// <-- KK
So how about this simplified version instead?
Code:
ref gov = &characters[govidx];
gov.nation = iNation;
if (iNation != PERSONAL_NATION)
{
SetRandomNameToCharacter(gov);
switch(iNation)
{
case ENGLAND:
gov.greeting = "Gr_Robert Christopher Silehard";
break;
case FRANCE:
gov.greeting = "Gr_joseph claude le moigne";
break;
case SPAIN:
gov.greeting = "Gr_Christofor Manuel de Alencar";
break;
case PIRATE:
gov.greeting = "Gr_Isenbrandt Jurcksen";
break;
case HOLLAND:
gov.greeting = "Gr_Reynard Grueneveldt";
break;
case PORTUGAL:
gov.greeting = "Gr_Jacinto Arcibaldo Barreto";
break;
case AMERICA:
gov.greeting = "Gr_Robert Christopher Silehard";
break;
}
SetModelFromID(gov, GetRandomModelForTypeExSubCheck(-1, "Rich_citizens", "man", iNation)); // PB: Give this guy a random model
}
Away is all the .old code so once a governor is replaced, that name and model will not return even when the town is given back to the original nation.
I figure that might just be fair enough because why would the very original governor return? That governor may not even be alive anymore!
Taking over a pirate town will maintain a pirate governor instead of removing the governor altogether.
This wasn't the case before, but fits in with the "Pirate Play Style" changes we've been making this year.
The code also doesn't care about "bFirstInit" anymore which used to apply when the function is called through ModifyTown.
As far as I can tell, that function isn't even used anyway these days so this shouldn't make a difference.
I figure that perhaps was intended for when a town changes hands for the Periods mod.
But that now seems to be handled differently with the governors being defined through Periods.c .
Does this make sense to you guys? Anyone care testing some town captures and seeing what happens with this?
Also, confirm if for example the Spanish governors for normally non-Spanish towns in Early Explorers still are who they're supposed to be according to Periods.c .