• 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 Captured Town for Pirates: Fort Still Hostile

ANSEL

Corsair
Storm Modder
Hearts of Oak Donator
I have just taken Port Royal for the Pirates, but now the fort is firing on me.
The log says the fort remember me as a pirate, but they shoot on me anyway.
 

Attachments

  • error.log
    23.8 KB · Views: 119
  • compile.log
    87.8 KB · Views: 117
  • -=Player=- Open Sea February 5th, 1751.zip
    862.7 KB · Views: 90
Did you ever get recognised under a false flag there?
That might be messing things up.
 
Problem found; it is because of the "fort relation to pirates" code that makes, for example, Tortuga not fire on Pirates despite being French.
For performance reasons, I had the game determine its "relation to pirates" once per fort and after that reuse the stored attribute.
This is fine as long as nothing changes. But in this case, something DID change.

To solve your current predicament, execute this line through console:
Code:
DeleteAttribute(CharacterFromID("Redmond Commander"), "relation_to_pirates");

As a better fix, I propose adding the "ResetForts" line shown here into PROGRAM\Dialog_func.c:
Code:
void CaptureColony(string TownName, int toNation)
{
   int i, fn, nExp, iNation, townsize, troops;
   ref PChar = GetMainCharacter();
   ref chref;
   bool tmpbool = toNation >= 0 || toNation < NATIONS_QUANTITY;

   tmpbool = tmpbool || toNation == PERSONAL_NATION;
   if (!tmpbool || !TownExist(TownName)) return;
   iNation = GetTownNation(TownName);
   townsize = GetTownSize(TownName);
   troops = GetTownNumTroops(TownName);
   UpdateRMRelation(PChar, iNation, makefloat(townsize+troops)/100.0);
   
   string sLogTitle;
   string sLogEntry;
   if (toNation != PERSONAL_NATION) {
     ChangeRMRelation(PChar, toNation, 10.0);
     ResetForts(toNation); // PB: All forts are told of your exploits and therefore no longer hold a grudge
     if(GetRMRelation(PChar, toNation) < REL_AMNESTY)   SetRMRelation(PChar, toNation, REL_AMNESTY); // PB: Destination Nation to Turn Friendly
     sLogTitle = "Captured " + FindTownName(TownName) + " for " + GetNationNameByType(toNation);
     sLogEntry = "The " + GetNationDescByType(iNation) + " and their allies will not be happy about this. But " + GetNationNameByType(toNation) + " and their friends most certainly will be!";
   }

That should make ALL forts of the destination nation forget about their relation to pirates AND if they remember you from before.
Seems fair enough to me; you did the destination nation a great favour and the least they can do is to ensure their forts don't fire on you without good reason.

If you can, please add that line in your own game, then try giving a town to the Pirates again.
The same problem should then not occur again. :doff
 
@Pieter Boelen . Just to be sure, have I done it in the right way Udklip.PNG
 
I moved this post to the bugtracker.
 
Last edited:
I have now taken Bonaire. But now the fort is firing at me again!
I dont earn anything by taking the forts, not now and not when I toke Port Royal.
Thats a mess going on. No error log this time.
 

Attachments

  • compile.log
    29.9 KB · Views: 103
I have now taken Bonaire. But now the fort is firing at me again!
I dont earn anything by taking the forts, not now and not when I toke Port Royal.
Thats a mess going on. No error log this time.
Yep, I saw it. And I think I know why it is too.

My earlier fix sorts out all forts of the nation you are giving the town to.
However, it does that BEFORE the town is actually given to that nation.
Which means the one town that you REALLY care about it also the ONE TOWN that is not affected.

I now moved that line to AFTER the town has been captured; that should help.
Extract attached to your PROGRAM folder to try.
 

Attachments

  • Dialog_func.zip
    24.6 KB · Views: 94
I will try your fix, if it dont work I will give this game up and start a new.
This game has really become a pain in my .....!
 
I have taken Willemstad and yes the fort dont fire on me anymore. so I ques
its fixed now:yes. I have now taken 3 forts for the Pirates, but no promotions,
so I think its time to start a new game.
 
but no promotions
As I said in the other thread, indeed there IS something weird with your savegame.
Nothing console can't fix though; execute this:
Code:
ReceiveLetterOfMarque(PIRATE);
And then you should be able to continue your save just fine.

At the moment I don't know how you could have lost your (fake) "letter of marque", so I do still need to investigate that.
But at least that console command will set it back the way it should have been. :facepalm
 
On second thought, now that @Grey Roger is adding your ship type as part of the recognition process, I don't think the "reset all forts" functionality is needed anymore.

This should be enough then:
Code:
  if (iNation != toNation) {
     fn = GetTownNumForts(TownName);
     for (i = 0; i < fn; i++) {
       chref = GetTownFortCommander(TownName, i);
       ResetCharacterMemory(chref); // PB
       SetFortCharacterCaptured(chref, false);
       DeleteAttribute(chref, "Fort.Cannons.Damaged");
       chref.Fort.Mode = FORT_NORMAL;
       chref.Fort.PlayerDamage = 0.0;
     }
   }

   CaptureTownForNation(TownName, toNation);
That just ensures the fort(s) of the current town are reset.
 
On second thought, now that @Grey Roger is adding your ship type as part of the recognition process, I don't think the "reset all forts" functionality is needed anymore.
Don't count on that unless we actually get it working! Anyway, the idea of that isn't to make it harder for the fort to recognise you in the first place, or even to remember you initially. It should only make a difference if, having annoyed the fort, you then leave, get rid of the ship they know, and return in something else, so they won't automatically know it's you.
 
Don't count on that unless we actually get it working!
I'm sure we will. Don't give up just yet. :doff

Anyway, the idea of that isn't to make it harder for the fort to recognise you in the first place, or even to remember you initially. It should only make a difference if, having annoyed the fort, you then leave, get rid of the ship they know, and return in something else, so they won't automatically know it's you.
The ResetForts function I suggested earlier just calls the ResetCharacterMemory function for ALL the forts of that nation.
But since changing ship type should also call that function, I figured just resetting the fort for the town where you are should be enough.
 
This new settings seems to work very well, I have now taken Port au Prince,
and every things work well, the fort are not shooting at me this time.
PS what is that drum music playing in the background at the Forums site?
 
Music in the background on the forum? What? Where?

Only thing I can think of is that you're somehow watching the Beta 4 trailer.
 
Back
Top