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

Players Flag

Takeda-One

Prussian Corsair
Storm Modder
Hi Mates,

as I read here, the Source code shall be in hold by a few trustwurthy mates, so I don't dare to ask for it, but my deepest wish since I play AoP and COAS was always to sail under my own flag (like in Sid Meyers Pirates)! I don't know enough for adding a hole new nation but maybe there is now a possibilaty to add a new playerflag option (as a perk for example) or a codes that says: instead of showing the player nationflag, show another texture only on player ship. I tried all this for years with the normal programfile, but nothing! If damski is able to sail with 08 luga, why shouldn't my wish be possible?? I would try it myself, but I understand your rules for the Soucre code safty, so to my shame I must set up a mod-request. Could someone of you help me?
 
You shouldn't need the source code for this.
We added a player nation as early as PotC Build 13, which allows you to fly your own colours and not those of any nation.
This was even before the Different Flags mod we now have in Build 14 Beta 1.

The Different Flags mod allows you to have different pirate and player flags.
However, you can't select them yet because we haven't done an interface for it so far.
At the moment, the player and pirate flag depends on your selected storyline and occasionally changes as per story purposes.

For all the above, you don't need the source code, though the Different Flags mod is quite complex coding-wise.
Still, just adding a player nation should be quite possible in CoAS also, I reckon.
 
But how can this be adapted? I have no idea how to code it and make a new menu and how to link it to the code?
 
My recommendation: Start out with adding a new nation for the player, then try to make that nation use its own flag.
You can set pchar.nation = PLAYER_NATION; with the console you now have in the Combined Modpack.
That'd allow you to test it.
 
Hi Mates,

as I read here, the Source code shall be in hold by a few trustwurthy mates, so I don't dare to ask for it, but my deepest wish since I play AoP and COAS was always to sail under my own flag (like in Sid Meyers Pirates)! I don't know enough for adding a hole new nation but maybe there is now a possibilaty to add a new playerflag option (as a perk for example) or a codes that says: instead of showing the player nationflag, show another texture only on player ship. I tried all this for years with the normal programfile, but nothing! If damski is able to sail with 08 luga, why shouldn't my wish be possible?? I would try it myself, but I understand your rules for the Soucre code safty, so to my shame I must set up a mod-request. Could someone of you help me?

"If damski is able to sail with 08 luga"
Takeda-one....are you refering to the screenshot of a german Luger at sea?,if you are,that was only an edited screenshot I did for a joke.

damski.
 
Ups...

But anyway, my question still important. Why should it not be possible to code a special flag option (player flag instead of nation flag) without modding a hole new nation?
 
Because putting a new nation in is MUCH simpler than convincing the game to show another flag in another way.
Another way would require you to code in a "PotC Different Flags" type mod, which is NOT easy even for advanced coders.
Adding in a new nation is fairly simple to do though.
 
Ok, do we have some kind of an instuction guide, which describes what steps are to be taken for adding a new nation (what codeslines and wich files has to be included)?

I would give it a try
 
There is no guide, no, but look at the following files:
PROGRAM\NATIONS\nations_init.c
PROGRAM\globals.c (this is where the nation #defines are in PotC; probably also in CoAS?)
RESOURCE\INI\rigging.ini (need to increase the size of flagall.tga.tx to fit your own flag)
 
 
However, you can't select them yet because we haven't done an interface for it so far.
At the moment, the player and pirate flag depends on your selected storyline and occasionally changes as per story purposes.
A bit of correction: you can select a different personal and pirate flag used by main character in game using scrollers in Select Storyline interface, but due to interface pictures for those flags not being done user would see only a default pirate and personal flag picture. However, the ones selected will be visible on the masts in game.

pirate_kk
 
However, you can't select them yet because we haven't done an interface for it so far.
At the moment, the player and pirate flag depends on your selected storyline and occasionally changes as per story purposes.
A bit of correction: you can select a different personal and pirate flag used by main character in game using scrollers in Select Storyline interface, but due to interface pictures for those flags not being done user would see only a default pirate and personal flag picture. However, the ones selected will be visible on the masts in game.

pirate_kk

Nice to read, you seem to understand what has to be done. Could you explain it in detail? I want this to work. For a Flag change in game, I will also have to define the new nation as perk. How could that be done?
 
Not necessarily as a perk - in AoP this is made as a some kind strange constraint which modders shall hopefully correct to work as it should and how that would be expected in the real situations, during sea encounters.

You should assign an unique number for the "personal" nation and, for convenience, add some define in globals.c. Let's be it 10 as in PotC (as in first version of my Hoist the Flag mod; now it's -1 but it would cause some confusion):
Code:
#define PERSONAL_NATION 10

Then, assuming you already have a flagall.tga.tx file with personal flag instead not-used Smugglers one - on position 4, you should edit procGetRiggingData() function in Program\battle_interface\BattleInterface.c to the form:
Code:
ref procGetRiggingData()
{
  int i,n;

  int retVal = 0;

  string datName = GetEventData();
  if(datName=="GetFlagTexNum")
  {
   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 PERSONAL_NATION: 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 PERSONAL_NATION: retVal = 3; break;
 		  }
 	 }
}
return &retVal;
}

Then, to see the personal flag you should execute:
Code:
ref pchar = GetMainCharacter();
pchar.nation = PERSONAL_NATION;
and reload to sea/port/wherever ship with flag is visible.

Optionally, you can modify international affairs interface (in files Program\INTERFACE\NationRelation.c and RESOURCE\INI\interfaces\NationRelation.ini) to be able to select your nation. Description of how this should be done is beyond scope of any one-post-length message though, I'm afraid.

pirate_kk
 
A bit of correction: you can select a different personal and pirate flag used by main character in game using scrollers in Select Storyline interface, but due to interface pictures for those flags not being done user would see only a default pirate and personal flag picture. However, the ones selected will be visible on the masts in game.
We're talking PotC here, right? I don't think I have your code additions making this possible.
I know you said you added that, but never got the files. Do you have them somewhere still?
 
Thanks ! This hole theat was ment to concern COAS :? so I hope this will work.

ref pchar = GetMainCharacter();
pchar.nation = PERSONAL_NATION;

> should this only be added to BattleInterface.c, or what other files instead?
 
We're talking PotC here, right? I don't think I have your code additions making this possible.
I thought that I've put it somewhere on ftp on December 2009 (or at least close to the end of last year).

I know you said you added that, but never got the files. Do you have them somewhere still?
On my HD station. However version I have scr*wed there is pretty unstable. Or, looking from the opposite direction, it's very CTD-wise.


BTW, which is currently so called current beta of the Build?
pirate_kk 

 
The current version we've got is Build 14 Beta 1 with Patch 3 installed.
http://www.moddb.com/mods/new-horizons/downloads/build-14-beta-1-full
+
http://www.moddb.com/mods/new-horizons/downloads/build-14-beta-1-patch-3
 
This mod solution does not seem to work for COAS, if I didn't make a mistake. I am working on adding a new nation, but the problem really starts at the interface arrangements. Very soon I will see where it leads me...
 
Adding a new nation for the sake of showing your own flag shouldn't require you to make any interface modifications.
However, when you want to switch between flags, you may need to change something.
But then you might just be able to add an ability that does it; I think that's how it works with the other flags in CoAS anyway.
 
Back
Top