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

Flags on ships in B14A9.5 Development Resources

konradk

Privateer
Storm Modder
Storm Modeller
I saw some discussion about problems with adding flags for a new ship in Shipwrights' Office thread (see <a href="http://forum.piratesahoy.net//index.php?showtopic=13023&view=findpost&p=319831" target="_blank">here</a>), so I decided to quote here my PM which I sent to Pieter some time ago where I was trying to describe how to put pennants on ships to help at least a bit in modding.

<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->You should check in which gm files are flag locators (usually *_mast*.gm and *_rey*.gm and then add:

refShip.Flags.Mast<i>m</i>.Flag<i>f</i> = <FLAG_ENSIGN|FLAG_PENNANT|FLAG_NONE>;

<i>m</i> - mast number (i.e, if flag locators is in lugger1_mast2.gm, <i>m</i> = 2
<i>f</i> - flag number on mast no <i>m</i>.
One of: FLAG_ENSIGN - a flag with proportions of ensign taken from RESOURCE\Textures\flags\*flg*.tga.tx files; that's standard flag locators (f1, f2, f3 & f4) in *.gm file; FLAG_PENNANT - a pennant taken from RESOURCE\Textures\flags\*pnt*.tga.tx; that one should have penn locators (f1, f2, f3 & f4) in *.gm file (apart from locator name it's identical as flag - f1,...,f4 are coordinates of flag's corners); finally FLAG_NONE should leave a mast without flag (to be precise, put transparent both ensign and pennant).

One warning though: on some ship models (SuperiorWarship, for example) flag will be set also directly in hull model. In this case mast number m is 0. Example:

refShip.Flags.Mast0.Flag1 = FLAG_ENSIGN;

In *.gm file, every quadruple of flag locators must have also penn equivalent, so amount of those two for one ship is equal. If *.gm files for ship doesn't implement whole system, following paramerter must be set to true:

refShip.Flags.NoPennants = true;

This situation will occur for most of the ships and, I bet, all ships you plan to add.

I hope I explained that clearly and you understood my rabble.<!--QuoteEnd--></div><!--QuoteEEnd-->
pirate_kk

--------------------------------------------------------------------------------------

<b>Adding pennant locators to ships</b>
By Thomas the Terror

1. Always start with shipname_mast1.gm, open that one, click view/locators/view.
2. If you see that there is a flag locator attached to this mast, go to locators/write to file. Then save it under the name shipname_mast1.
3. Go to the folder where you saved the file and open it with wordpad or noteblock.
4. Copy the flag locators (f1, f2, f3, f4) and rename the 'flag' attribute to 'penn' (so if the file says flag2, make it penn2, if it says flag, just make it penn)
5. You can make the flag more narrow by turning up the y-axis of the f4 and f3 attributes, and you can make them longer by extending the x-axis of f2 and f3.
6. Save the file, and exit it.
7. Click locators/read from file and click on the just modified file.
8. Click save .GM

(Do this for all parts of the ship which contain flag locators)

1. To make the game show these pennants, go to ships.init and go to the ship you just modified.
2. Remove the line: refShip.Flags.NoPennants = true;
3. Now change the FLAG_ENSIGN to FLAG_PENNANT for the masts you want pennants on.

refShip.Flags.Mast0.Flag1 = FLAG_ENSIGN;
refShip.Flags.Mast1.Flag1 = FLAG_ENSIGN;
refShip.Flags.Mast2.Flag1 = FLAG_PENNANT;
refShip.Flags.Mast3.Flag1 = FLAG_ENSIGN;
refShip.Flags.Mast4.Flag1 = FLAG_PENNANT;
 
Mmm, I didn't add pennant locators to the ship itself, but there is a flag flying on it. Could that be a problem?
 
<!--quoteo(post=319836:date=May 14 2009, 05:44 PM:name=Thomas the Terror)--><div class='quotetop'>QUOTE (Thomas the Terror @ May 14 2009, 05:44 PM) <a href="index.php?act=findpost&pid=319836"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Mmm, I didn't add pennant locators to the ship itself, but there is a flag flying on it. Could that be a problem?<!--QuoteEnd--></div><!--QuoteEEnd-->Yes, because the way I coded this is that program assumes that every ensign has also a pennant "companion" (quantity of ensigns on mast == quantity of pennants on mast). When one is missing, it tries to put pennent on next (and inappropriate) locators. This applies also for pennants on ship.

pirate_kk
 
<img src="http://i93.photobucket.com/albums/l68/Thomas_the_Terror/ENGINE2009-05-1419-19-02-35.png" border="0" class="linked-image" />
I have succeeded <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> Thanks pirate_kk!
 
Absolutely wonderful! And news on the stability of the mod though? I really, really want to be able to include this mod in the next Alpha, of course!
The historical and visual effect is just wonderful! <img src="style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />
 
Let us not forget this. We'll eventually need to get this done for all ships. <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />
 
And just to be a pain <img src="style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> can we have a white ensign for the Hornblower Quest?

I am tidying the quest up now (based on the Devil and the Duchess - but with a major detour in the middle to compensate for the shortening of the prison scenes).
 
Sure we could. For each nation, we'd have a Navy flag, Merchant flag and Fort flag. Which one do you want the white ensign for? Navy, I imagine, right?
I think maybe we should make a list of certain flags we need in certain periods for the quests. For example:
- Spanish Main Bartolomeu o Portugues Personal Flag
- Colonial Powers Jack Sparrow Personal Flag
- Colonial Powers English Merchant EITC Flag
- The Corsican English Navy White Ensign
 
<!--quoteo(post=319852:date=May 14 2009, 07:23 PM:name=Thomas the Terror)--><div class='quotetop'>QUOTE (Thomas the Terror @ May 14 2009, 07:23 PM) <a href="index.php?act=findpost&pid=319852"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec--><img src="http://i93.photobucket.com/albums/l68/Thomas_the_Terror/ENGINE2009-05-1419-19-02-35.png" border="0" class="linked-image" />
I have succeeded <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> Thanks pirate_kk!<!--QuoteEnd--></div><!--QuoteEEnd-->

Is that a pennant running on the main mast? I think its a pennant! Thats great to see, finally! <img src="style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />

Then again, forgive for being a bit pain in the ass, but where did the stern flag go and what are flags still doing on the fore- and mizzenmast? Or is it because this is a merchant ship and it fly flags differently from naval ships?
 
There is a big stern flag on this ship, but you can't see it on this picture, it is hiding behind the lateen sail.
 
Doing a VERY GOOD job at hiding too! <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
BTW: Just to confirm, those ARE indeed pennants!

It appears this mod is actually working. It just seems to be causing CTDs in some cases. <img src="style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> <img src="style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> <img src="style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />
 
And when you try to go ashore at Kralendijk. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
I really really hope we can get the CTDs through this mod sorted out. It's too cool and works too well to not be able to use in the end! <img src="style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" />
 
These flags are already done:
1 = Early Explorers 1500-1599
2 = Spanish Main 1600-1679
3 = Golden Age of Piracy 1680-1739
4 = Colonial Powers 1740-1769
5 = Revolutions 1770-1789
6 = The Corsican 1790-1820

<b>Fort flags</b>
<img src="http://i93.photobucket.com/albums/l68/Thomas_the_Terror/FortFlags1500-1800.png" border="0" class="linked-image" />

<b>Military Ensigns</b>
<img src="http://i93.photobucket.com/albums/l68/Thomas_the_Terror/Ensigns1500-1800.png" border="0" class="linked-image" />

<b>Merchant flags</b>
<img src="http://i93.photobucket.com/albums/l68/Thomas_the_Terror/MerchantFlags1500-1800.png" border="0" class="linked-image" />

The pennants will come later.
If you have some suggestions, please let me know it.
 
One suggestion: Replace the Colonial Powers English Merchant flag with the EITC flag.

There is no difference anymore between the two periods' USA flags?

There is not much difference between the ensigns and fort flags, is there?
 
In the first periods, no not really.

<a href="http://en.wikipedia.org/wiki/Flag_of_the_United_States" target="_blank">http://en.wikipedia.org/wiki/Flag_of_the_United_States</a>
Pick some others if you want <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />
 
Hmm... no difference between Early Explorers England Ensign and Merchant flag either?
Anyway, what do you think of my suggestion of using the EITC flag as actual merchant flag?

Just out of curiosity, do you have any information on why there's some surprising flags inbetween?
Such as the Colonial Powers Spanish Fort Flag and the Early Explorers Portuguese Merchant one?

I liked having the 13-star "round" USA flag in the Revolutions period and the 15-star "regular" USA flag in The Corsican.
 
1 EITC merchant flag, will do.
2. No difference between normal ensign and merchant flag: before 1602/1606 there was no trading flag for English and Dutch vessels.
3. Portugese one: trading flag for ships going to brazil in the 16th century.
4. Spanish fort flag; official fortress flag used between 1750 - 1770.
5. American flags: okay!
 
2. You can still see the difference for the Dutch, because there is a seperate ensign for us. So it's just the English in that one period where you can't tell.
Should we go for realism here and keep it as-is or go for gameplay and change it? <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />

1 & 5. I'm not the boss, so you don't need to care about my suggestions unless you think they're a good idea. <img src="style_emoticons/<#EMO_DIR#>/razz.gif" style="vertical-align:middle" emoid=":razz" border="0" alt="razz.gif" />
 
I think those are good ideas, otherwise everything is still somewhat the same, and we won't want that do we <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />
 
Back
Top