• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Capture Colonies: Assigning Female Governor

Just move her to a random free locator and let her stand there instead of sit?
 
Just move her to a random free locator and let her stand there instead of sit?
That's what I was thinking of as well. Hopefully I can sort this one out soon as it is admittedly a bit of an annoying one.
 
I created a female officer myself to assign with:
Code:
         ch = CreateOfficer_Cheat(OFFIC_TYPE_QMASTER, "33_Piratess10", 0, PIRATE, false);
         ch.name = "Claire";
         ch.lastname = "Larrousse";
That goes badly wrong, so I'll be looking into this one now.

However, maybe @Levis has got any clue how this in the DumpAttribute might be possible:
Code:
id = Jacinto Arcibaldo Barreto
model = 33_Piratess10
  entity = NPCharacter
  animation = woman_sit
  height = 1.7000000
location = Conceicao_townhall
  locator = sit1
  group = sit
  stime = 0.0000000
  etime = 24.0000000
[...]
name = Claire
lastname = Larrousse
old =
  name = Mildred
  lastname = Hornblower
  chr_ai =
  group =
Mildred Hornblower? Where does THAT come from???
I'm assuming it is a random name that got overwritten when I renamed her to Claire. o_O
 
Making progress and this is definitely less bugged than it was.
Still need to do some further work to ensure ALL cases go right.

This is what I've got so far:
Code:
   // PB: Fix for Female Governors -->
   SetModelfromArray(refChar, GetModelIndex(refChar.model));
   if (refChar.location.group == "sit")
   {
     if (IsModelSitEnable(refChar.model))   LAi_SetHuberType(refChar);
     else                   LAi_SetHuberStayType(refChar);
   }
   else
   {
     LAi_SetHuberStayType(refChar);
   }
   // PB: Fix for Female Governors <--
With a new function:
Code:
bool IsModelSitEnable(string id)
{
   ref model = ModelFromID(id);
   if (model.ani == "towngirl")   return false;
   return true;
}
 
I created a female officer myself to assign with:
Code:
         ch = CreateOfficer_Cheat(OFFIC_TYPE_QMASTER, "33_Piratess10", 0, PIRATE, false);
         ch.name = "Claire";
         ch.lastname = "Larrousse";
That goes badly wrong, so I'll be looking into this one now.

However, maybe @Levis has got any clue how this in the DumpAttribute might be possible:
Code:
id = Jacinto Arcibaldo Barreto
model = 33_Piratess10
  entity = NPCharacter
  animation = woman_sit
  height = 1.7000000
location = Conceicao_townhall
  locator = sit1
  group = sit
  stime = 0.0000000
  etime = 24.0000000
[...]
name = Claire
lastname = Larrousse
old =
  name = Mildred
  lastname = Hornblower
  chr_ai =
  group =
Mildred Hornblower? Where does THAT come from???
I'm assuming it is a random name that got overwritten when I renamed her to Claire. o_O
I believe there is also a function to rename a character. If a officer is created both the normal name and the old name are filled in.
As you only overwritte the active name at the moment the other name still there indeed is the random name assigned to the officer
 
I believe there is also a function to rename a character. If a officer is created both the normal name and the old name are filled in.
As you only overwritte the active name at the moment the other name still there indeed is the random name assigned to the officer
That indeed explains it then. Probably does no harm.

What is the point and purpose of all this "old" and "orig" stuff anywhere?
I get the impression a lot of that is just leftover stuff that serves little purpose these days.

For example, I think the whole "gov.orig" attribute with a copy of the original governor goes completely unused now.
It used to be that if a town is recaptured by the original nation, the original governor would return.
But for simplicity's sake, that no longer happens anyway. :shrug
 
IT WORKS! :woot

Code:
  // PB: Fix for Female Governors -->
   SetModelfromArray(refChar, GetModelIndex(refChar.model));
   if (refChar.sex == "woman")
   {
     ChangeCharacterAddressGroup(refChar, refChar.location, "goto", GetNearLocatorToLocator(refChar.location.group, refChar.location.locator, "goto"));
     LAi_SetStayType(refChar);
   }
   else
   {
     if (refChar.location.group == "sit")
     {
       LAi_SetHuberType(refChar);
     }
     else
     {
       LAi_SetHuberStayType(refChar);
     }
   }
   // PB: Fix for Female Governors <--

After some investigation, I found that the 'IsModelSitEnable' check wasn't needed, because it seems that ALL male and skeleton models work fine.
It is only the women that caused trouble. So now they all end up standing up near their chair, which at least causes no crazy scary effects. :wp

And this line had to be removed as it messed things up when you would return to the location:
Code:
if (CheckAttribute(refChar, "orig.chr_ai.type")) refChar.chr_ai.type = refChar.orig.chr_ai.type;

So "Fixed" it is! :dance
 
Back
Top