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

Solved Fixing the Different Flags Mod

Yep; that works! <img src="style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />
This does mean we'll need to play through all quests and find other instances where this goes wrong.
 
For me too <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />

I can continue the quest but i've encountered an other problem after ! When i am teleport to the ShipDeck5, i have a black screen <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />

I saw this line in the compile.log :
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->::locations_loader.c:: Report from LocLoadModel - wrong model's name [..\..\..\locations\Town_Redmond\Port\\\RedPort_landscape] was changed to [..\..\..\locations\Town_Redmond\Port\\\RedPort_landscapen]<!--c2--></div><!--ec2-->
It seems that the locloadmodel function want to load a back model (port model ?) but as it can't find one, it is interrupted and that's the reason of the black screen !
Did you noticed the same thing for you or could you continue the quest normally ?
 
Go to your shipdeck before going to tavern and then go to tavern and it works <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />
 
Apparently the .back attribute used for SetDeckPortBackground() triggers some unintended code.
This shouldn't be run for the deck port background. Should be fixable.<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    if(HasSubStr(sat,"back") && !ownDeckStarted())
    {
        if(addition!="d" && addition!="e" && addition!="m" && addition!="n")
        {
            string hourModel = Whr_GetInsideBack();
            aref aCurWeather = GetCurrentWeather();
            if(CheckAttribute(aCurWeather,"InsideBack")) hourModel = Whr_GetString(aCurWeather,"InsideBack");
            if(GetHour()>22.0 || GetHour()<=6.0) hourModel = "n";
            if(GetHour()>6.0 && GetHour()<=10.0) hourModel = "m";
            if(GetHour()>10.0 && GetHour()<=17.0) hourModel = "d";
            if(GetHour()>17.0 && GetHour()<=22.0) hourModel = "e";
            if(CheckAttribute(aCurWeather,"id") && aCurWeather.id=="Day Storm") hourModel = "n";
            trace("::locations_loader.c:: Report from LocLoadModel - wrong model's name ["+realModel+"] was changed to ["+loc.(sat)+hourModel+"]");
            realModel = loc.(sat) + hourModel;
        }
    }<!--c2--></div><!--ec2-->
Strange that I myself haven't encountered the problem yet though. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
 
Try replacing the SetDeckPortBackground() function in PROGRAM\NK.c with this:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->void SetDeckPortBackground()
{
    ref PChar = GetMainCharacter();
    ref deck = &Locations[FindLocation(GetCharacterShipQDeck(PChar))];
    string loc_id = deck.reload.l4.go;
// KK -->
    int i = 0;
    int j = 0;
    int inum = 0;
    int jnum = 0;
    int locidx = FindLocation(loc_id);
    if (locidx < 0) return;
    if (!CheckAttribute(&Locations[locidx], "models.always.l1")) return;
    if (CheckAttribute(deck, "models.always.back1")) DeleteAttribute(deck,"models.always.back1"); // PB: To fix savegames
    if (CheckAttribute(deck, "models.always.back2")) DeleteAttribute(deck,"models.always.back2"); // PB: To fix savegames
    if (CheckAttribute(deck, "models.always.port1")) DeleteAttribute(deck,"models.always.port1");
    if (CheckAttribute(deck, "models.always.port2")) DeleteAttribute(deck,"models.always.port2");
    if (FindFile("RESOURCE\MODELS\\" + Locations[locidx].filespath.models, "*_landscape.gm", Locations[locidx].models.always.l1 + "_landscape.gm") != "") {
        aref arLandscapes = GetFiles("RESOURCE\MODELS\" + Locations[locidx].filespath.models, "*_landscape.gm");
        inum = GetAttributesNum(arLandscapes);
        for (i = 0; i < inum; i++) {
            string gmfile = GetAttributeValue(GetAttributeN(arLandscapes, i));
            gmfile = strcut(gmfile, 0, strlen(gmfile) - 4);
            string sLandscape = Locations[locidx].filespath.models + "\" + gmfile;
            string port = "port" + (i + 1);
            deck.models.always.(port) = "..\..\..\" + sLandscape;
        }
    }
    string island = Locations[locidx].island;
    ref rIsland = GetIslandByID(island);
    if (CheckAttribute(deck, "locators.ships_other")) DeleteAttribute(deck, "locators.ships_other");
    deck.locators.ships_other = "";
    aref dships; makearef(dships, deck.locators.ships_other);
    aref arIslandReload; makearef(arIslandReload, rIsland.reload);
    int num = GetAttributesNum(arIslandReload);
    for (i = 0; i < num; i++) {
        aref curReload = GetAttributeN(arIslandReload, i);
        if (curReload.go == loc_id) {
            aref iships; makearef(iships, curReload.ships);
            jnum = GetAttributesNum(iships);
            for (j = 0; j < jnum; j++) {
                aref ariship = GetAttributeN(iships, j);
                string l = GetAttributeName(ariship);
                dships.(l) = "";
                aref ardship; makearef(ardship, dships.(l));
                CopyAttributes(ardship, ariship);
            }
        }
    }
// <-- KK
}<!--c2--></div><!--ec2-->
I renamed all "back" references to "port"; hopefully that locations_loaded code will now no longer be executed for this, since it shouldn't. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
 
Note that I edited my above post and added two lines. Otherwise you'd still have <i>.back</i> attributes messing things up. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
 
Hmm... since it's complaining about the Redmond model, I'm thinking the .back attributes were already set in Havana port or so.
But the attributes aren't being removed as they should. Probably my fix does work upon a new game or so.
Anyway, Pirate_KK greatly modified that code in the Dev Res too. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
 
I copied the files and renamed them to what the deck needed :p work around. And the Chico thing, you are right about that one. I also got a crash when you immediately landed in port. But if you went through town, Chico first had to walk to you before he could speak, and that cleared it too.
 
I puted this line in console :

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if (CheckAttribute(&Locations[FindLocation("Shipdeck5")], "models.always.back1")) DeleteAttribute(&Locations[FindLocation("Shipdeck5")],"models.always.back1"); // PB: To fix savegames
if (CheckAttribute(&Locations[FindLocation("Shipdeck5")], "models.always.back2")) DeleteAttribute(&Locations[FindLocation("Shipdeck5")],"models.always.back2"); // PB: To fix savegames<!--c2--></div><!--ec2-->
No black screen anymore ! It confirms that your SetDeckPortBackground modification will work perfectly with a new game Pieter <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
 
That is excellent news <img src="style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />
 
<!--quoteo(post=336568:date=Jul 11 2009, 02:17 PM:name=Thomas the Terror)--><div class='quotetop'>QUOTE (Thomas the Terror @ Jul 11 2009, 02:17 PM) <a href="index.php?act=findpost&pid=336568"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I also got a crash when you immediately landed in port.<!--QuoteEnd--></div><!--QuoteEEnd-->
Could you post your compile.log ?
 
<!--quoteo(post=336570:date=Jul 11 2009, 02:24 PM:name=Screwface)--><div class='quotetop'>QUOTE (Screwface @ Jul 11 2009, 02:24 PM) <a href="index.php?act=findpost&pid=336570"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->No black screen anymore ! It confirms that your SetDeckPortBackground modification will work perfectly with a new game Pieter <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" /><!--QuoteEnd--></div><!--QuoteEEnd-->Thought so! Thanks for confirming! <img src="style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />

<!--quoteo(post=336572:date=Jul 11 2009, 02:39 PM:name=Screwface)--><div class='quotetop'>QUOTE (Screwface @ Jul 11 2009, 02:39 PM) <a href="index.php?act=findpost&pid=336572"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec--><!--quoteo(post=336568:date=Jul 11 2009, 02:17 PM:name=Thomas the Terror)--><div class='quotetop'>QUOTE (Thomas the Terror @ Jul 11 2009, 02:17 PM) <a href="index.php?act=findpost&pid=336568"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I also got a crash when you immediately landed in port.<!--QuoteEnd--></div><!--QuoteEEnd-->Could you post your compile.log ?<!--QuoteEnd--></div><!--QuoteEEnd-->I think Thomas means the "Assassin immediate dialog in port crash" that you and Captain Maggee fixed.
 
<!--quoteo(post=336574:date=Jul 11 2009, 10:43 PM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Jul 11 2009, 10:43 PM) <a href="index.php?act=findpost&pid=336574"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I think Thomas means the Assassin immediately dialog in port crash that you and Captain Maggee fixed.<!--QuoteEnd--></div><!--QuoteEEnd-->
Screwface worked out what was wrong I just did the simple work of adding a delay <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />
 
...That Screwface and Captain Maggee fixed. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
 
<img src="style_emoticons/<#EMO_DIR#>/thpirateshipff.gif" style="vertical-align:middle" emoid=":piratesahoy!" border="0" alt="thpirateshipff.gif" />
 
I just got a crash upon setting sail from Redmond port; there were some enemies near the fort, which the fort immediately fired upon.
Here's compile.log:<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>Start reload
Battle_Rocks added
PauseAllSounds
ReloadStartFade
ItemLogic: On unload location
ReloadEndFade
SEA: SeaLogin begin
** Whr: CreateWeatherEnvironment - iCurWeatherhour = 10, theHour = 10
SEA: sealogin loading island Redmond
SEA: added pchar to sea
SetCoastTraffic() called for Redmond
-
SetCoastTraffic: Char CrRedmond1 of type pirate and nation Britain and we'll check to see if we regen: yes.
bgennew set to true anyway
CrRedmond1 is not dead, adding.
cr is group commander
A Snow flying Pirate colors sighted at Jamaica
Ship is Fancy
-
SetCoastTraffic: Char CrRedmond2 of type pirate and nation Britain and we'll check to see if we regen: yes.
bgennew set to true anyway
CrRedmond2 is not dead, adding.
cr is not group commander
do not need to create new group
A Xebec flying Pirate colors sighted at Jamaica
Ship is Golden Hind
-
SetCoastTraffic: Char CrRedmond3 of type trade and nation Britain and we'll check to see if we regen: yes.
bgennew set to true anyway
CrRedmond3 is not dead, adding.
cr is group commander
A Galeoth flying Spanish colors sighted at Jamaica
Ship is Gloriosa
-
SetCoastTraffic: Char CrRedmond4 of type trade and nation Britain and we'll check to see if we regen: yes.
bgennew set to true anyway
CrRedmond4 is not dead, adding.
cr is not group commander
do not need to create new group
A Ketch flying Spanish colors sighted at Jamaica
Ship is San Gabriel
-
SetCoastTraffic: Char CrRedmond5 of type war and nation Britain and we'll check to see if we regen: yes.
bgennew set to true anyway
CrRedmond5 is not dead, adding.
cr is group commander
A Sloop flying Spanish colors sighted at Jamaica
Ship is Santa Agüera
-
SetCoastTraffic: Char CrRedmond6 of type war and nation Britain and we'll check to see if we regen: yes.
bgennew set to true anyway
CrRedmond6 is not dead, adding.
cr is not group commander
do not need to create new group
A Fast Galleon flying Spanish colors sighted at Jamaica
Ship is Santa Rosa
-
SEA: Did CRs
SEA: Did any groups
SEA: added ships
SEA: Set tasks
SETTING MUSIC: music_spokplavanie
ResumeAllSounds
SEA: SeaLogin end
BattleInterface DoSetFlags: 0
procGetRiggingData: n=-2, chr.id=Blaze, ship.type=Interceptor, nation=-1, ShipFlagsQuantity=6, bShipWithoutPennants=0
CurrentFlag=1, ShipFlagsQuantity=6, FlagType=P
FlagType==FLAG_PENNANT && n == SHIP_FLAG
procGetRiggingData: n=-2, chr.id=Blaze, ship.type=Interceptor, nation=-1, ShipFlagsQuantity=6, bShipWithoutPennants=0
CurrentFlag=2, ShipFlagsQuantity=6, FlagType=P
FlagType==FLAG_PENNANT && n == SHIP_FLAG
procGetRiggingData: n=-2, chr.id=Blaze, ship.type=Interceptor, nation=-1, ShipFlagsQuantity=6, bShipWithoutPennants=0
CurrentFlag=3, ShipFlagsQuantity=6, FlagType=E
BattleInterface DoSetFlags: 1
Ship_SetTaskAttack before
Ship_SetTaskAttack after
Ship_SetTaskAttack before
Ship_SetTaskAttack after
procGetRiggingData: n=-2, chr.id=CrRedmond1, ship.type=Shnyava2, nation=3, ShipFlagsQuantity=3, bShipWithoutPennants=1
CurrentFlag=1, ShipFlagsQuantity=3, FlagType=E
procGetRiggingData: n=-2, chr.id=CrRedmond1, ship.type=Shnyava2, nation=3, ShipFlagsQuantity=3, bShipWithoutPennants=1
CurrentFlag=2, ShipFlagsQuantity=3, FlagType=E
procGetRiggingData: n=-2, chr.id=CrRedmond1, ship.type=Shnyava2, nation=3, ShipFlagsQuantity=3, bShipWithoutPennants=1
CurrentFlag=3, ShipFlagsQuantity=3, FlagType=E
BattleInterface DoSetFlags: 2
procGetRiggingData: n=-2, chr.id=CrRedmond2, ship.type=XebecCT, nation=3, ShipFlagsQuantity=2, bShipWithoutPennants=1
CurrentFlag=1, ShipFlagsQuantity=2, FlagType=E
procGetRiggingData: n=-2, chr.id=CrRedmond2, ship.type=XebecCT, nation=3, ShipFlagsQuantity=2, bShipWithoutPennants=1
CurrentFlag=2, ShipFlagsQuantity=2, FlagType=E
SETTING MUSIC: music_sea_battle
BattleInterface DoSetFlags: 3
procGetRiggingData: n=-2, chr.id=CrRedmond3, ship.type=Galeoth1, nation=2, ShipFlagsQuantity=2, bShipWithoutPennants=1
CurrentFlag=1, ShipFlagsQuantity=2, FlagType=E
procGetRiggingData: n=-2, chr.id=CrRedmond3, ship.type=Galeoth1, nation=2, ShipFlagsQuantity=2, bShipWithoutPennants=1
CurrentFlag=2, ShipFlagsQuantity=2, FlagType=E
BattleInterface DoSetFlags: 4
procGetRiggingData: n=-2, chr.id=CrRedmond4, ship.type=Ketch, nation=2, ShipFlagsQuantity=4, bShipWithoutPennants=0
CurrentFlag=1, ShipFlagsQuantity=4, FlagType=E
procGetRiggingData: n=-2, chr.id=CrRedmond4, ship.type=Ketch, nation=2, ShipFlagsQuantity=4, bShipWithoutPennants=0
CurrentFlag=2, ShipFlagsQuantity=4, FlagType=P
FlagType==FLAG_PENNANT && n == SHIP_FLAG
BattleInterface DoSetFlags: 5
procGetRiggingData: n=-2, chr.id=CrRedmond5, ship.type=Sloop1, nation=2, ShipFlagsQuantity=1, bShipWithoutPennants=1
CurrentFlag=1, ShipFlagsQuantity=1, FlagType=E
BattleInterface DoSetFlags: 6
procGetRiggingData: n=-2, chr.id=CrRedmond6, ship.type=FastGalleon1, nation=2, ShipFlagsQuantity=3, bShipWithoutPennants=1
CurrentFlag=1, ShipFlagsQuantity=3, FlagType=E
procGetRiggingData: n=-2, chr.id=CrRedmond6, ship.type=FastGalleon1, nation=2, ShipFlagsQuantity=3, bShipWithoutPennants=1
CurrentFlag=2, ShipFlagsQuantity=3, FlagType=E
procGetRiggingData: n=-2, chr.id=CrRedmond6, ship.type=FastGalleon1, nation=2, ShipFlagsQuantity=3, bShipWithoutPennants=1
CurrentFlag=3, ShipFlagsQuantity=3, FlagType=E
For character 848 fall Mast name mast2 has index 2
BattleInterface DoSetFlags: 0
procGetRiggingData: n=-2, chr.id=Blaze, ship.type=Interceptor, nation=-1, ShipFlagsQuantity=6, bShipWithoutPennants=0
CurrentFlag=1, ShipFlagsQuantity=6, FlagType=P
FlagType==FLAG_PENNANT && n == SHIP_FLAG
BattleInterface DoSetFlags: 1
procGetRiggingData: n=-2, chr.id=CrRedmond1, ship.type=Shnyava2, nation=3, ShipFlagsQuantity=3, bShipWithoutPennants=1
CurrentFlag=1, ShipFlagsQuantity=3, FlagType=E
procGetRiggingData: n=-2, chr.id=CrRedmond1, ship.type=Shnyava2, nation=3, ShipFlagsQuantity=3, bShipWithoutPennants=1
CurrentFlag=2, ShipFlagsQuantity=3, FlagType=E
procGetRiggingData: n=-2, chr.id=CrRedmond1, ship.type=Shnyava2, nation=3, ShipFlagsQuantity=3, bShipWithoutPennants=1
CurrentFlag=3, ShipFlagsQuantity=3, FlagType=E
procGetRiggingData: n=-2, chr.id=CrRedmond1, ship.type=Shnyava2, nation=3, ShipFlagsQuantity=3, bShipWithoutPennants=1</div>
I wonder if the volley from the fort could've made some masts fall while the RefreshFlags code wasn't even done yet.
 
Captain Maggee reports a crash that occurs after closing down the "transfer with officer" interface.
I have been able to confirm this AND discover a really weird effect. Start the Blaze Devlin storyline and use console to give you officers.
Go to sea, then back to port to put ships there. Stand in front of an officer, use [Enter] to open the transfer, then close again.
The game crashes then. Figuring this might have something to do with the delay, I increased the value to 100000 now (= 100 seconds!).
The game works smoothly for those ten seconds, but then crashes anyway when the flag update call is done.
Since there's a 100 second delay, it can't possibly be interfering with another SendMessage call. <img src="style_emoticons/<#EMO_DIR#>/wacko.gif" style="vertical-align:middle" emoid=":wacko:" border="0" alt="wacko.gif" />

In any case, the flags don't even NEED to update upon closing this interface screen.
It'd be nice if the RefreshFlags call was made only if you actually hoised another flag.
Would save a lot of chances for crashes.

Additionally, what if you open an interface, close it, delay starts, but before the delay is done, you open an interface again?
 
Back
Top