• 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!

Bug Ship battles, premature battle end?

thanks for the info. Seems there is something which is preventing the code from operating properly. If I have time I will look into it. Someone knows where the code is that defines the new flagship?
 
Not exactly sure. Look through the SEA_AI folder; must be hiding in there somewhere.
 
just a quick update, I have done several battles and the `fix` seems to be working, havent found it not working yet,

also during the `bug` problem the other ships engaged with, when a ship strikes its colours the other ships in convoy their flags go to white, but they are still fighting and I cant engage altough the other allied ships are attacking,
plus just done a battle (usa), 1 surrendered and the other its flag turned to my nations flag (british) and i couldnt engage.
the problem must be there somewhere in the coding. Though this problem in the bug is rare or I may have not noticed untill now.
Hope this helps.

Added :-
Levis, I think you are right,

done another battle, similar as before, but 1 change;

my nationality is british and have a letter of mark, I done a battle between 2 dutch ships nemy to me and my state, and 5 Spanish ships (they were enemy to british then declared truce, however due to my standing with Spanish i was still the enemy, (flying british colours).(the ships menu showed the spanish as neutral on the boarder around the icon, where enemy shows as red and allied as green, I can still battle with the spanish).
on eliminating 2 spanish ships (did quick board with out then surrendering) with out `incident` the 3rd struck its colours plus the other 2 displaced white flags, (though still fighting.) I could not board the 3rd, so instead raised the JR, I had the instant board icon come up and I did the bussiness in capturing it.

Back to sailing mode, (bug shows here) the other 2 spanish ships now showed the british flag, though looking through the telescope the flag in the scope shows spanish.
I could still attack.
 
Last edited:
thanks for the info. Seems there is something which is preventing the code from operating properly. If I have time I will look into it. Someone knows where the code is that defines the new flagship?
I think it is this code in PROGRAM\SEA_AI\AIShip.c:
Code:
  // TIH --> dont do this if already had surrendered Nov5'06
   if (!bAlreadySurrendered) {
     if (cmdrchange) {
       //Trace("SURR: fleet commander change, numships in group: " + og_ships);
       if (og_ships >= 2) {
         cmdridx = Group_GetCharacterIndexR(rOGroup, firstchar);
         cmdr = GetCharacter(cmdridx);
         Group_SetGroupCommander(ogroup, cmdr.id); // <------------------------------------- Especially that line ------------------------------
         DeleteAttribute(cmdr,"relation.UseOtherCharacter");
         traceif("SURR: commander changed to " + cmdr.id);
       } else {
         Group_DeleteGroup(ogroup); // KK
         traceif("SURR: no other ships to change commander to");
       }
     }
   }
   // TIH <--
 
Thanks. I think I see where the problem is. I will check it later.
I think the bAlreadySurrendered is set to be a global variable where it has to be ship depended. or it is set for ships where it shouldn't set (for example it is set for that ship but then the ship is made flagship).
I will check this later today (read: when I'm not high on meds) to see if I can fix it.
 
still looking into it but found another of our problems.

Code:
    if (Ship_GetDistance2D(PChar, chr) < GetVisibilityRange(2)) bReleasedFree = true; // KK
    // TIH --> bandaide until this whole process is handled better Jul22'06
    if (!bReleasedFree) {
        if (oldrel == RELATION_ENEMY) {
            TraceAndLog(TranslateString("","Sir, the") + " " + GetMyShipNameShow(chr) + " " + TranslateString("","has struck her colors!")); // KK
            PlaySound("interface\notebook.wav");
            PlaySound("objects\abordage\abordage_wining.wav");
        } else {
            TraceAndLog(TranslateString("","Sir, the") + " " + GetMyShipNameShow(chr) + " " + TranslateString("","has struck her colors to the enemy!")); // KK
        }
    }
    // TIH <--

This part of the code is responsible for making a lot of battles end premature also. If the enemy is getting away and he made it, it makes it lower its colors so you can capture it. Don't think thats what it is suppost to do.

Edit: Could someone check if this AIShip.c fixes the problem with the commander not set after the first time of surrender? I sometimes get into the fight a bit to much and accedently shoot them to davey jones locker without checking what I need to :p.

Extract to: \PROGRAM\SEA_AI
 

Attachments

  • AIShip.c
    214.6 KB · Views: 144
bReleasedFree is apparently intended to indicate if you let them go on purpose after a boarding.

If I understand correctly, it is supposed to allow other ships further away from you to continue on their merry way again.
Or something like that.
 
did someone notice a difference with this AISHIP?
 
Trying to test it myself also but extra eyes always come in handy.

You need to find a battle with multiple enemys.
Attack the flagship (largest ship) and capture it. Now attack the next ship and capture it and see if it points a new flagship again.

You need to capture it by shooting long enough untill it surrenders.
 
Flagship..hmmn..isn't the flagship always on the front? or at the back? :confused: - and what problem should I keep an eye on?
- I'll see if I can test this later or tomorrow. Still need some reading to do:facepalm:read
 
If it doesn't work then there wont be another flagship and everyone surrenders.

Ok, I think I have a sort of fix for this problem, though there is still a problem if you engage a battle with another allied fleet and you join it, however I may also have found a fix.

Battle between 5 enemy ships, class 5 and 2 class 3. one allied british ship and my only battleship.

I identified the enemy flagship and went in, ignoring the other ships, I kept on hammering it with grape and chain and med and close distance, after about 2 mins it surrendered, I got the usual `end of battle` music with the world map. At this point I saved the game (you cant save during battle.)
Brought my ship up-along side, I got the board Icon, went in and captured the ship, assigned officers and crew, (OFF TOPIC :- it seams if a ship surrenders, and you capture it, back in sailing mode the ship although yours it cant move and is still surrendered i`d via telescope, when capturing a ship that hasnt surrendered with onboard battle, back at sea the ship you capped works and you can give orders.)
back in sailing mode, I identified the 2nd new flagship and went in as before, the ship surrendered but this time the allied ship also surrendered, (this is where the bug is and my fix) I boarded the ship and did as I did before. on reentering sailing mode, i`d the new 3rd flagship, only this time I could not enter battle, due to bug, (my fix). I reloaded the 2nd save game, (saved just before boarding the 2nd ship) boarded again captured, asigned officers,crew, entered saling mode, this time the game is working and I could re enter battle, I i`d the 3rd ship as before did the same. I captured/sank the whole entire enemy fleet, by taking out the new designated flag-ship.

Saving game before boarding and reloading game if the battle sticks seems to be a fix for the game, so far its working for me.
 
The Buccaneer (Swashbuckler) - New Game

Okay, I encountered a British Fleet (3 ships). Well, I'm confused determining who the flagship is. The biggest one's in the middle but I attacked and boarded the front-liner first as they usually be the first in line as Sire Pieter have mentioned (I don't know how to use the spyglass:D), then next is the middle one (the big one) - boarded and leave the ship on wreck again then on the last one, I couldn't get her to surrender even though if she's out of crew and about to sink, I got tired of waiting and sunk the damn thing:aar, well that ship is about to sink anyways. :p seadogs2_0000.jpg seadogs2_0001.jpg (nobody wants to surrender:facepalm)
 

Attachments

  • compile.log
    36.3 KB · Views: 109
  • error.log
    2.6 KB · Views: 113
  • readme.txt
    8.1 KB · Views: 125
Back
Top