• 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

<!--quoteo(post=333010:date=Jun 26 2009, 02:43 PM:name=Screwface)--><div class='quotetop'>QUOTE (Screwface @ Jun 26 2009, 02:43 PM) <a href="index.php?act=findpost&pid=333010"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I began the assassin quest and for now i reach the mission in port au prince with the stinkpot without any ctd. But when i want to equip the stinkpot, i have a crash by exiting the interface. Perhaps the refreshflags call in the InterfaceDoExit function also causes problems and should only be done when we exit the nationrelation interface (that's the only case where flag can be changed by interface i think)<!--QuoteEnd--></div><!--QuoteEEnd-->Do you think I didn't put it in INTERFACE\NationRelation.c file in the first place??? I did it, and it worked when I exited interface just after switching colors. However, when I tried to switch to other interface and then exit, all get messy (because it run refresh flags at the same time not one per frame).

As for surrender: what exactly do you want to do? TEXTURES\flagall.tga.tx & TEXTURES\flagfrt.tga.tx aren't used anymore and may be deleted. Surrendered ships should take white flag from appropriate flgfrt#.tga.tx file!!! Don't put white flag in to ship's flags, especially on the last position since then you'd get pennant and white flag simultaneusly.

Last time some ship surrendered with different flag mod I had a ctd (unrelated to this bugger) before I could see anything.

Code which swaps ships is unfinished because it removes existing models, puts new ones but I didn't find a way how to properly update their order yet, so ship models are loaded with deleted rigging environment (thus sails and flags, so forts and towns flags are also broken):<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// KK -->
    if (FindLoadedLocation() >= 0 && locNumShips > 0) {
        DeleteRiggingEnvironment();
        LocLoadShips(&Locations[FindLoadedLocation()]);
    }
// <-- KK<!--c2--></div><!--ec2-->

pirate_kk
 
<!--quoteo(post=333466:date=Jun 27 2009, 10:56 PM:name=Screwface)--><div class='quotetop'>QUOTE (Screwface @ Jun 27 2009, 10:56 PM) <a href="index.php?act=findpost&pid=333466"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Pieter, did you notice that pennants miss on some ships ? For example try the interceptor, Barque4_47, XebecAs, or cutter2. They do not have their pennants hoisted <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /> Or perhaps you recently modified something on those ship models accordind to the modifications that you done in ships_init.c ?<!--QuoteEnd--></div><!--QuoteEEnd-->Indeed those ARE the ship models that I modified. But I didn't release the modified GM files yet.
I'm planning to update as many ships as possible for the different flags mod and then release it all at once. Today I'll continue work on it.
BTW: XebecAS I <i>didn't</i> modify; that one just doesn't HAVE any flag locators, except on mast3.

<!--quoteo(post=333564:date=Jun 28 2009, 09:26 AM:name=pirate_kk)--><div class='quotetop'>QUOTE (pirate_kk @ Jun 28 2009, 09:26 AM) <a href="index.php?act=findpost&pid=333564"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Do you think I didn't put it in INTERFACE\NationRelation.c file in the first place??? I did it, and it worked when I exited interface just after switching colors. However, when I tried to switch to other interface and then exit, all get messy (because it run refresh flags at the same time not one per frame).<!--QuoteEnd--></div><!--QuoteEEnd-->What would happen if you only refresh flags if you actually click the button to hoist a flag? And otherwise do nothing?
But then you could mess things up again by pressing a hoist flag button several times without exiting the interface.
Maybe if you press the button, add an attribute to the player, then if that attribute is present upon closing the interface, refresh flags and remove the attribute.
That way the flags would only be refreshed if you had actually hoisted another flag. Right?

<!--quoteo(post=333564:date=Jun 28 2009, 09:26 AM:name=pirate_kk)--><div class='quotetop'>QUOTE (pirate_kk @ Jun 28 2009, 09:26 AM) <a href="index.php?act=findpost&pid=333564"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->As for surrender: what exactly do you want to do? TEXTURES\flagall.tga.tx & TEXTURES\flagfrt.tga.tx aren't used anymore and may be deleted. Surrendered ships should take white flag from appropriate flgfrt?.tga.tx file!!! Don't put white flag in to ship's flags, especially on the last position since then you'd get pennant and white flag simultaneusly.<!--QuoteEnd--></div><!--QuoteEEnd-->I didn't observe any proper white flags in my game, but Thomas says that it DID work in the Development Resources. Right now I'm not in a position to check though.
Possibly there's some code required for that missing from the separated mod version?

What happens with pennants upon surrender? Do they go white too?
Would it be possible to only have the ensign go white and keep the pennants showing the original nation?
I can imagine that if you surrender, you'd only hoist one white flag, not several.

<!--quoteo(post=333564:date=Jun 28 2009, 09:26 AM:name=pirate_kk)--><div class='quotetop'>QUOTE (pirate_kk @ Jun 28 2009, 09:26 AM) <a href="index.php?act=findpost&pid=333564"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Code which swaps ships is unfinished because it removes existing models, puts new ones but I didn't find a way how to properly update their order yet, so ship models are loaded with deleted rigging environment (thus sails and flags, so forts and towns flags are also broken):<!--QuoteEnd--></div><!--QuoteEEnd-->Thanks for confirming that; I couldn't check if it worked the same in the Development Resources. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />

Does anyone have any thoughts on the consistent CTDs I've run into? Jack Sparrow's "Grand Entrance" in Port Royale?
And the to-sea from port/worldmap ones I got during my playing of the Assassin quest? Those are the problems that worry me most at the moment... <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
<!--quoteo(post=333591:date=Jun 28 2009, 12:23 PM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Jun 28 2009, 12:23 PM) <a href="index.php?act=findpost&pid=333591"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Does anyone have any thoughts on the consistent CTDs I've run into? Jack Sparrow's "Grand Entrance" in Port Royale?
And the to-sea from port/worldmap ones I got during my playing of the Assassin quest? Those are the problems that worry me most at the moment... <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /><!--QuoteEnd--></div><!--QuoteEEnd-->
I've replayed the assassin quest to the port au prince mission with the same ships_init.c as in your pb_code_09-6-26 pack and i've encountered no to-sea from port/worldmap CTDs for the moment. Where should i go to continue the quest after salvadore benavides give me no more missions ?
 
You can't continue the quest, unless you have installed Bartolomeu's recent update. That is included in my pb_code_09-6-26.zip file.
Excluding the required RESOURCE files, that is... In a couple of days, I think I'll put together a fairly simple Alpha 9.5 Patch 2.
 
I just noticed the XebecAS had two flags defined, but the models only have one. That might've caused some confusion for the game.
I'm surprised it didn't crash the game straight away. <img src="style_emoticons/<#EMO_DIR#>/wacko.gif" style="vertical-align:middle" emoid=":wacko:" border="0" alt="wacko.gif" />
Anyway, I've got that changed now, so hopefully things will work better now when playing the Assassin storyline. Or is that too much to hope for...? <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
<!--quoteo(post=332954:date=Jun 26 2009, 10:59 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Jun 26 2009, 10:59 AM) <a href="index.php?act=findpost&pid=332954"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Could that possibly be because there's an additional non-coast-raider group around the island?<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->            Group_CreateGroup("Aurelien_Ship");
            Group_AddCharacter("Aurelien_Ship", "Aurelien Bergerat");
            Group_SetGroupCommander("Aurelien_Ship", "Aurelien Bergerat");
             Group_SetAddress("Aurelien_Ship", "Conceicao", "Quest_ships","quest_ship_7");<!--c2--></div><!--ec2--><!--QuoteEnd--></div><!--QuoteEEnd-->
Additionnal non-coast-raider group around island don't cause crashes. I played assassin storyline and had aurelien bergerat added around martinique with no crah. If you played with directsail, you can also have direct encounters added and have no crash.
However, i did have a crash in 3d sailing and i discovered something very interesting in my compil.log. There was a battle between NPCs around the island and it seems that some masts have fallen during the battle. So when i have open and closed an interface, the game crashes !!!!!!
I think the game would refresh flags but as some mast(s) have disappeared then CTD.
It seems that was the reason why you could not go out of marigot pieter. I reloaded the savegame that was include in your pb_code_09-6-26.zip and after outcommenting the set flags, i could go in 3d sailing and discovered that there was a ship who have had lost a mast !
 
AHA! That DOES make sense! Good find! <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
 
Perhaps we could add an attribute to the npc to indicate the mast which have fallen in procMastFall function (chr.fallen.mast? for example) and check this attribute in the set flags functions... Flag(s) would not be set on this mast and of course this attribute would be deleted when the char would be regen !
 
So if I understand correctly, we have the following three confirmed reasons for crashing:
1. Inventory interface equip character SendMessage somehow interferes with the Refresh Flags code.
2. Crash when a random ship lost a mast at the time of a Refresh Flags.
3. Crash when there's multiple ships in port through the SetCharacterShipLocation function on a DoQuestReloadToLocation (eg. Jack Sparrow "Grand Entrance").
 
Yes for what i know but i hope there are not some others that we haven't discovered yet <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
I hope so too. Actually, today I was testing the Grand Entrance scene and it DID work. Huh??? <img src="style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" />
 
During my -admittedly fairly bizarre- experimenting with the <a href="http://forum.piratesahoy.net//index.php?showtopic=13988" target="_blank">Ships Sailing in Port/Shore Scene</a>, I ran into the following weird effects:

1. Cayman fort had EITC flag: Bug? Fluke because of fallen masts? Mess-up because of my messing around with "CrCayman6"?

2. Cayman fort was hostile to me, even though I was flying personal colours (also during sea enter) and was not hostile to England.

I had just done the following for the Black Pearl mutiny scene prior to that in the same game:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->            characters[GetCharacterIndex("CrCayman6")].nation = PIRATE;
            characters[GetCharacterIndex("CrCayman6")].sailaway = true;
            GiveShip2Character(characterFromID("CrCayman6"),"BlackPearl","Black Pearl",-1,PIRATE,true,true);
            setCharacterShipLocation(characterFromID("CrCayman6"), "Deserted_Island_shore_01");<!--c2--></div><!--ec2-->

3. Pirate flags/pennants tended to not appear on my ship. Sometimes one did, but most didn't work.
That was using this in PROGRAM\Storyline\LegendJackSparrow.c:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    sl.(sn).start.Flags.Pirate = 1;
    sl.(sn).start.Flags.Personal = 0;<!--c2--></div><!--ec2-->
Can anybody confirm that?
 
<!--quoteo(post=334622:date=Jul 3 2009, 12:06 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Jul 3 2009, 12:06 AM) <a href="index.php?act=findpost&pid=334622"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->3. Pirate flags/pennants tended to not appear on my ship. Sometimes one did, but most didn't work.
That was using this in PROGRAM\Storyline\LegendJackSparrow.c:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    sl.(sn).start.Flags.Pirate = 1;
    sl.(sn).start.Flags.Personal = 0;<!--c2--></div><!--ec2-->
Can anybody confirm that?<!--QuoteEnd--></div><!--QuoteEEnd-->
I can confirm that... The Black Pearl after being risen from the locker had no flags. Only the pirate flag is bugged, what happens if sl.(sn).start.Flags.Pirate = 0;?
 
Worked last time I checked, I think. But then the pirate flags with 1 also worked at least in one case, if I recall. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
 
I think the function "Hoist Pirate flag" now doesn't work and causes a CTD.

Can anyone confirm this?
 
I'm trying to fix the "mast fallen" crash for a moment and i can say it seems that's not so easy as it could appear ! <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />

In a first try, i tried to avoid the set flags only on the mast which has fallen but i saw some weird effects <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /> Strangely some of the other coastraiders could have no flags too or flags of a different nation than own <img src="style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />

I did a lot of try and tracing but not succeded to find the reason of those weird effects. For now, i begin to believe that the best compromise to avoid those weird effects and the crash is to abort set flags on a ship who has lost a mast ! I haven't seen weird effects yet by doing that, the only problem is that the ship will have no flags at the next refreshflags if she loose a mast <img src="style_emoticons/<#EMO_DIR#>/no.gif" style="vertical-align:middle" emoid=":no" border="0" alt="no.gif" /> but wouldn't it be better as a crash by waiting to find a better solution?

<b>Edit :</b>
The Hoist pirate flag don't causes CTD for me but you can have a crash with because of other reasons. As it recalls the refreshflags(), for example if you have a ship who has lost a mast around, you will have a CTD by doing the hoist pirate flag !
 
Back
Top