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

Pennant Work for the Different Flags Mod

Pieter Boelen

Navigation Officer
Administrator
Storm Modder
Hearts of Oak Donator
One of the mods we're currently working on is the Different Flags mod. It's been in existance for quite a while, but has been causing crashes.
Screwface is looking into fixing it though and things are beginning to look promising.

This mod will put period-correct flags on ships, will add greater variety in pirate flags,
allows you to distinguish between merchant and navy ships based on the flag and also add two types of flags on the same ship:
pennants and ensigns. This can be seen in below picture:

<img src="http://piratesahoy.net/build/temp/SchoonerXebec2.jpg" border="0" class="linked-image" />

However, a fair amount of work needs to be done for this and on every ship all flag locators must be copied for their pennant equivalent.
I am trying to do some work on this, but some GM files my TOOL won't read, so I can't fix those ships.
It seems that those files sometimes DO load on other people's computer though, so I'll be needing some help on this project.

Please try to open <i>RESOURCE\MODELS\Ships\LuggerVML_mast5.gm</i> and <i>RESOURCE\MODELS\Ships\Lineship5\Lineship5_mast1.gm</i>
in the TOOL. If you can, post here. I don't need much help, just a little. But without that help, we can't get those ships to look as good as the others.


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

1. Open a GM file containing flag locators (f1, f2, f3, f4) in Ines Diaz' TOOL
2. 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
 
This work is really annoying for a single person to do on his onesy. But as they say, many hands make light work.
So PLEASE help. It is NOT hard and if everybody does a couple of ships, this'll be done in no-time.
Without much effort on any single person's part. So get off yer lazy thingamajingey and get on with it! <img src="style_emoticons/<#EMO_DIR#>/whippa.gif" style="vertical-align:middle" emoid=":whipa" border="0" alt="whippa.gif" />

Post here if you're willing to help. Then we can assign a certain set of ships to everyone who applies.
 
Already did the first three of those. For all I know, novotny999 actually did a lot too. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
But with nobody giving any information on what's done or releasing their work, this whole effort is rather a mess! <img src="style_emoticons/<#EMO_DIR#>/boom.gif" style="vertical-align:middle" emoid=":boom" border="0" alt="boom.gif" />
 
It was a huge undertaking, but all ships are now adjusted for the Different Flags mod and show pennants as they should.
Thanks to Captain Maggee for covering those ships that I couldn't do.
All this work will be inluded in the next Build mod patch. :doff
 
Too bad i did not see this thread before...
Thanks for the effort pieter, Cap and novotny999 :cheers
 
Is the concept the same for ships in COAS? Although it surely is a massive undertaking, the end result would be worth the effort. I'd love to see different pirate flags in the game or merchant ships have their own flags.

Would this work for forts as well?
 
I will help too if someone can point us in the right direction. Any guidance from the great ones???? :bow

I'm with you OP, it would definately be worth it! :will

MK
 
The PotC engine originally didn't really support this and Pirate KK had to do a LOT of coding experiments to make it work.
Then Screwface had to make a LOT of additional modifications to prevent crashes.
Then Captain Maggee and me had to do a LOT of work on every single mast of every single ship for this mod.

If you want to put this mod into CoAS, you first need to tackle the challenge of the coding-related part.
Is it possible? Maybe. Is it going to be easy? HELL NO! Somebody would be needed with some SERIOUS coding knowledge.
It wouldn't be a simple cut-and-paste job, since the CoAS code is not exactly the same as the PotC code.
 
If I add these pennant-locators, how can I make the engine to show a diffent pennant texture at this position??
 
If I add these pennant-locators, how can I make the engine to show a diffent pennant texture at this position??

I was thinking about to ask you if we could get a more simple version of your mod to run for our german edition. We would be satisfied to roughly seperate the flags to war/merchant/personal. Could someone explain how your mod works? I noticed the usage of additional dll's beside the rigging.ini changes and locater/texture work. What else has to be done to get this to work?
 
The way it works in POTC for individual ships is like this.

First the locators must be set for each mast in TOOL. Then in program---->ships---->shipsinit.c the highlighted lines must be added so that the program shows what you desire. That is the theory anyway. I'm sure there is a lot of other stuff I don't know about.
 
You'd have to figure out how to add the code to CoAS, but I have no clue how to do that. Pirate_KK did it for PotC and it was NOT easy. :shock
 
You can try to "port" of Different Flags mod into CoAS using the same method as it was done for PoTC, however I plan to implement it on the source-code-level when I finally get rid of memory leaks from CoAS source code.

pirate_kk
 
You can try to "port" of Different Flags mod into CoAS using the same method as it was done for PoTC, however I plan to implement it on the source-code-level when I finally get rid of memory leaks from CoAS source code.

pirate_kk

Thanks mate, that would be awsome, could you explain further wich files I would have to conasider for the import operation?
 
You need to make copies of rigging.dll and modify them with hex editor to "handle" separate entity names (i.e. mflg) to replace "flag", together with entries from [FLAG] section of RESOURCE\INI\rigging.ini. Then, you should modify ship model files adding appropriate number of "penn" locators, obeying a rule that every "flag" locator must have its "penn companion" on each mast. Finally, write a code to call those entities, using total analogy to code from PotC (especially battle_interface\flag.c, battle_interface\BattleInterface.c, battle_interface\LandInterface.c and Sea_AI\AIShip.c, among others).

However, the "code" from PotC is an premiere example how coding shouldn't be done; we decided to put it into a mod because we didn't have access to a source code. I strongly advise to create such a mod, if at all, as a separate thing, so it could be easily replaced by properly coded one at the engine source level.

pirate_kk
 
I think I have located the flag texture call in COAS (with BattleInterface.c starting at line 2349)

["ref procGetRiggingData()
{
int i,n;

int retVal = 0;

string datName = GetEventData();
if(datName=="GetFlagTexNum")
{ >> somewhere here must be the place to add an additional call for a seperate pennon texture or better a seperate flagall_ship-file only for the player ship, but I am not sure how to write this
i = GetEventData();
n = GetEventData();
if(i==true)
{
switch(n)
{
case ENGLAND: retVal = 1; break;
case FRANCE: retVal = 2; break;
case SPAIN: retVal = 4; break;
case PIRATE: retVal = 5; break;
case HOLLAND: retVal = 0; break;
//case SMUGGLER: retVal = 3; break;
}
}
else
{
switch(n)
{
case ENGLAND: retVal = 1; break;
case FRANCE: retVal = 2; break;
case SPAIN: retVal = 4; break;
case PIRATE: retVal = 5; break;
case HOLLAND: retVal = 0; break;
//case SMUGGLER: retVal = 3; break;
}
}
}
return &retVal;"]
 
Back
Top