1. Dismiss Notice
  2. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

Players Flag

Discussion in 'Storm Coding' started by Takeda-One, Jul 21, 2010.

  1. Takeda-One

    Takeda-One Prussian Corsair Storm Modder

    Joined:
    Jul 16, 2007
    Messages:
    579
    Gender:
    Male
    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?
     
  2. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,593
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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.
     
  3. Takeda-One

    Takeda-One Prussian Corsair Storm Modder

    Joined:
    Jul 16, 2007
    Messages:
    579
    Gender:
    Male
    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?
     
  4. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,593
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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.
     
  5. damski62

    damski62 HoO Team Member 3D Artist Animator Storm Modeller

    Joined:
    May 9, 2007
    Messages:
    1,040
    Gender:
    Male
    Location:
    Lovchantsi, Dobrich, Bulgaria.
    "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.
     
  6. Takeda-One

    Takeda-One Prussian Corsair Storm Modder

    Joined:
    Jul 16, 2007
    Messages:
    579
    Gender:
    Male
    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?
     
  7. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,593
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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.
     
  8. Takeda-One

    Takeda-One Prussian Corsair Storm Modder

    Joined:
    Jul 16, 2007
    Messages:
    579
    Gender:
    Male
    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
     
  9. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,593
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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)
     
  10. konradk

    konradk Privateer Storm Modeller Storm Modder

    Joined:
    Oct 27, 2005
    Messages:
    713
    Gender:
    Male
    Location:
    Poland
     
    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
     
  11. Takeda-One

    Takeda-One Prussian Corsair Storm Modder

    Joined:
    Jul 16, 2007
    Messages:
    579
    Gender:
    Male
    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?
     
  12. konradk

    konradk Privateer Storm Modeller Storm Modder

    Joined:
    Oct 27, 2005
    Messages:
    713
    Gender:
    Male
    Location:
    Poland
    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
     
  13. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,593
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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?
     
  14. Takeda-One

    Takeda-One Prussian Corsair Storm Modder

    Joined:
    Jul 16, 2007
    Messages:
    579
    Gender:
    Male
    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?
     
  15. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,593
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Just in one spot that's executed when the game is started.
     
  16. konradk

    konradk Privateer Storm Modeller Storm Modder

    Joined:
    Oct 27, 2005
    Messages:
    713
    Gender:
    Male
    Location:
    Poland
    I thought that I've put it somewhere on ftp on December 2009 (or at least close to the end of last year).

    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 

     
  17. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,593
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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
     
  18. Takeda-One

    Takeda-One Prussian Corsair Storm Modder

    Joined:
    Jul 16, 2007
    Messages:
    579
    Gender:
    Male
    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...
     
  19. konradk

    konradk Privateer Storm Modeller Storm Modder

    Joined:
    Oct 27, 2005
    Messages:
    713
    Gender:
    Male
    Location:
    Poland
  20. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,593
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    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.
     

Share This Page