• 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 Different colored sails for each nation

jean

Master Mariner
Storm Modder
Hi,

I modified Battle_interface.c to get different sails and it's works. But the problem is I can't anymore change
the color of my own ship at shipyart, and when I buy a ship the sails are the same color the nation I am.

Code:
switch(sti(Characters[chrIdx].nation))  // Íå ðàáîòàåò ýòî :(
     {
  trace("voiles couleur")
       case ENGLAND:   
          BI_objRetValue.sailscolor = argb(255, 255, 255, 153);//Yellow 
       break;
       case FRANCE:   
        BI_objRetValue.sailscolor = argb(255, 0, 0, 255);
       break;
       case SPAIN:     
         BI_objRetValue.sailscolor = argb(255, 3, 91, 80);
       break;
       case PIRATE:
         BI_objRetValue.sailscolor = argb(255, 60, 60, 60)//Black
       break;
       case HOLLAND:   
         BI_objRetValue.sailscolor = argb(255, 128, 128, 128);//Gray
       break;
       case MORVIS:   
         BI_objRetValue.sailscolor = argb(255, 255, 15, 15);//Red
       break;
  case PORTU:     
         BI_objRetValue.sailscolor = argb(255, 153, 255, 153);//Green 
       break;
     }

It seems that the "BI_objRetValue" can't be removed. Has somebody an idea to change that?
 
Thanks for your answer, Pieter, it doesn't work. It seems "Battle_Interface" says you've to keep the colors
of your sails, and shipyarder says I only can change your emblems...:oops:
 
How are your own personal sail colours defined?
Perhaps a CheckAttribute around that whole switch statement might help?
 
Well, my personal sail colours aren't defined. There's a "int chrIdx = GetEventData();" which include encounters and player.
I tried that (but it didn't work):

if(CheckAttribute(PChar,"ship.sails.color"))
{
DeleteAttribute(&BI_objRetValue,"sailscolor");
}

So I tried :

chrIdx.ship.sails.color = argb(255, 255, 153, 153);

It's a little much better, I can change the colours of my sails (I see it ashore) but as soon as I go at sea colours change again...:(
 
Maybe:
Code:
if(!CheckAttribute(PChar,"ship.sails.color"))
{
   switch(sti(Characters[chrIdx].nation))  // Íå ðàáîòàåò ýòî :(
   {
     trace("voiles couleur")
     case ENGLAND:   
       BI_objRetValue.sailscolor = argb(255, 255, 255, 153);//Yellow
     break;
     case FRANCE:   
       BI_objRetValue.sailscolor = argb(255, 0, 0, 255);
     break;
     case SPAIN:   
       BI_objRetValue.sailscolor = argb(255, 3, 91, 80);
     break;
     case PIRATE:
       BI_objRetValue.sailscolor = argb(255, 60, 60, 60)//Black
     break;
     case HOLLAND:   
       BI_objRetValue.sailscolor = argb(255, 128, 128, 128);//Gray
     break;
     case MORVIS:   
       BI_objRetValue.sailscolor = argb(255, 255, 15, 15);//Red
     break;
     case PORTU:   
       BI_objRetValue.sailscolor = argb(255, 153, 255, 153);//Green
     break;
   }
}
 
It doesn't work. Right now I don't know what to do else, I'll see tomorrow...:wp
 
I am in progress, now I can change the color of my sails...but whole ships have "my" color. I don't know if I must laugh or cry. :rofl
 
That's OK, it's works. :fiddler

Code:
ref procGetSailTextureData()
{
    int st,i,sq;
        int ms;
    ref shref;
    aref arEmbl,arSail;
    string attrName;

        int PChar = nMainCharacterIndex;
    int chrIdx = GetEventData();

    //DeleteAttribute(&BI_objRetValue,"");

    string sUpgrade = "common";

    ref    refBaseShip = GetRealShip(GetCharacterShipType(&characters[chrIdx])); // boal

    int iUpgrade = sti(refBaseShip.ship.upgrades.sails);  // boal
    switch(iUpgrade)
    {
        case 1:
            sUpgrade = "common";
        break;
        case 2:
            sUpgrade = "pat";
        break;
        case 3:
            sUpgrade = "silk";
        break;
    }
    //BI_objRetValue.normalTex = "ships\parus_" + sUpgrade + ".tga";
    ///âûñòàâëåíèå ãåðáà (ïåðåíåñòè íèæå â êàýéç íàöèé. âñå ÷òî â ýòîì êåéçå óáðàòü
    //BI_objRetValue.geraldTex = "";//"ships\gerald\chuckskull.tga";
    //BI_objRetValue.sailscolor = argb(255,255,255,255);

    //BI_objRetValue.geraldTexPointer = 0; // (IDirect3DTexture8*)

    string nationFileName = "ships\parus_" + sUpgrade + ".tga";
    string tmpStr;

        if(chrIdx==nMainCharacterIndex)    chrIdx = -1;
    if (chrIdx>=0)
    {
         BI_objRetValue.normalTex = "ships\parus_" + sUpgrade + ".tga";
     BI_objRetValue.geraldTex = "";//"ships\gerald\chuckskull.tga";
     BI_objRetValue.sailscolor = argb(255,255,255,255);
                if (CheckAttribute(&characters[chrIdx], "ship.sails.color"))
        {
            BI_objRetValue.sailscolor = sti(characters[chrIdx].ship.sails.color);
        }
        if( CheckAttribute(&characters[chrIdx],"Ship.Sails.gerald_name") )
        {
            BI_objRetValue.geraldTex = characters[chrIdx].Ship.Sails.gerald_name;//ShipSails.gerald_name;
        }
       
        switch(sti(Characters[chrIdx].nation))  // Íå ðàáîòàåò ýòî :(
        {                        
                                  trace("voiles couleur")

            case ENGLAND:   
                 BI_objRetValue.sailscolor = argb(255, 255, 255, 153);//Yellow
            break;
            case FRANCE:   
                                BI_objRetValue.sailscolor = argb(255, 0, 0, 255);// deep blue
            break;
            case SPAIN:       
                BI_objRetValue.sailscolor = argb(255, 3, 91, 80);//Lilo
            break;
            case PIRATE:
                BI_objRetValue.sailscolor = argb(255, 60, 60, 60)//Black
            break;
            case HOLLAND:   
                BI_objRetValue.sailscolor = argb(255, 128, 128, 128);//Gray
            break;
            case MORVIS:   
                BI_objRetValue.sailscolor = argb(255, 255, 15, 15);//Red
            break;
                        case PORTU:       
                BI_objRetValue.sailscolor = argb(255, 153, 255, 153);//Green
            break;
        }

               st = GetCharacterShipType(GetCharacter(chrIdx))
        if(st!=SHIP_NOTUSED)
        {
            shref = GetRealShip(st);
            BI_objRetValue.maxSP = shref.sp;
            // boal -->
            if (CheckAttribute(shref, "EmblemedSails.normalTex")) // çàäíàííûé â òèïå ïàðóñ
                {
                BI_objRetValue.normalTex = shref.EmblemedSails.normalTex;
                nationFileName           = shref.EmblemedSails.normalTex;
                }
            if( CheckAttribute(&Characters[chrIdx],"Features.GeraldSails") && sti(Characters[chrIdx].Features.GeraldSails)==true)
            {
                makearef(arEmbl,shref.GeraldSails);
            } else {
                makearef(arEmbl,shref.EmblemedSails);
            }
            /*if (CheckAttribute(shref, "GeraldSails"))
               {
                makearef(arEmbl, shref.GeraldSails);  */
                // boal <--
                sq = GetAttributesNum(arEmbl);
                for(i=0; i<sq; i++)
                {
                    arSail = GetAttributeN(arEmbl,i);
                    attrName = GetAttributeName(arSail);
                    tmpStr = GetAttributeValue(arSail);
                    if( CheckAttribute(arSail,"hscale") ) {
                        BI_objRetValue.(attrName).hscale = arSail.hscale;
                    }
                    if( CheckAttribute(arSail,"vscale") ) {
                        BI_objRetValue.(attrName).vscale = arSail.vscale;
                    }
                    if(tmpStr=="1") {
                        //BI_objRetValue.(attrName).Gerald = nationFileName; 
                        BI_objRetValue.(attrName) = nationFileName;
                    } else {
                        BI_objRetValue.(attrName).Gerald = tmpStr;
                    }
                    //BI_objRetValue.(attrName).Gerald = "ships\chuckskull.tga"; // òåêñòóðà ãåðáà (åñëè íå óêàçàíà, òî áåðåòñÿ BI_objRetValue.geraldTex èëè BI_objRetValue.geraldTexPointer)
                    //BI_objRetValue.(attrName).hscale = 0.5; // ìàñøòàá â ðàçìåðå ïàðóñà (0.5 - ãåðá çàíèìàåò ïîëîâèíó ïàðóñà)
                    //BI_objRetValue.(attrName).vscale = 0.5; // åñëè íåò vscale, òî èñïîëüçóåòñÿ = scale
                }
        }
           return &BI_objRetValue;
    }

       if (nMainCharacterIndex == 1)
    {
          BI_objRetValue.normalTex = "ships\parus_" + sUpgrade + ".tga";
      BI_objRetValue.geraldTex = "";//"ships\gerald\chuckskull.tga";
      BI_objRetValue.sailscolor = argb(255,255,255,255);
                if (CheckAttribute(&characters[nMainCharacterIndex], "ship.sails.color"))//"ship.sailscolor"
        {
            BI_objRetValue.sailscolor = sti(characters[nMainCharacterIndex].ship.sails.color);//sti(characters[chrIdx].ship.sailscolor);
        }
        if( CheckAttribute(&characters[nMainCharacterIndex],"Ship.Sails.gerald_name") )//"ShipSails.gerald_name" // íå íàñëåäóåòñÿ ïðè îáìåíå êîðàáëåé, ïîòîìó íå â  ship.
        {
            BI_objRetValue.geraldTex = characters[nMainCharacterIndex].Ship.Sails.gerald_name;//ShipSails.gerald_name;
        }
                        trace("couleur de mon navire")
             
               ms = GetCharacterShipType(GetCharacter(nMainCharacterIndex))
        if(ms!=SHIP_NOTUSED)
        {
            shref = GetRealShip(ms);
            BI_objRetValue.maxSP = shref.sp;
                }
          return &BI_objRetValue;
         }
   
}

Now I've to see for differents geraldsails :monkeydance
 
Hi,

I try to give differents sails color to my officers, but it does'nt work. Could somebody have a look and teel me what could be wrong?
Code:
Trace officier mais pas changement de voiles

ref procGetSailTextureData()
{
    int st,i,sq;
        int ms, os;
    ref shref;
    aref arEmbl,arSail;
    string attrName;

        int PChar = GetMainCharacterIndex();
    int chrIdx = GetEventData();

         int cn, e;
         int offref;

           for (e=0; e<COMPANION_MAX; e++)
    {
        cn = GetCompanionIndex(GetMainCharacter(), e);
        if (cn>=0)
        {
            offref = GetCharacter(cn);
                }
        }

    //DeleteAttribute(&BI_objRetValue,"");

    string sUpgrade = "common";

    ref    refBaseShip = GetRealShip(GetCharacterShipType(&characters[chrIdx])); // boal

        int iclass = sti(refBaseShip.Class);

    int iUpgrade = sti(refBaseShip.ship.upgrades.sails);  // boal
    switch(iUpgrade)
    {
        case 1:
            sUpgrade = "common";
        break;
        case 2:
            sUpgrade = "pat";
        break;
        case 3:
            sUpgrade = "silk";
        break;
    }
    BI_objRetValue.normalTex = "ships\parus_" + sUpgrade + ".tga";
    ///âûñòàâëåíèå ãåðáà (ïåðåíåñòè íèæå â êàýéç íàöèé. âñå ÷òî â ýòîì êåéçå óáðàòü
    BI_objRetValue.geraldTex = "";//"ships\gerald\chuckskull.tga";
    BI_objRetValue.sailscolor = argb(255,255,255,255);

    //BI_objRetValue.geraldTexPointer = 0; // (IDirect3DTexture8*)

    string nationFileName = "ships\parus_" + sUpgrade + ".tga";
    string tmpStr;

        if(chrIdx==PChar)    chrIdx = -1;

        if(chrIdx==offref)    chrIdx = -1;

         if (chrIdx>=0)
         {                                        
         BI_objRetValue.normalTex = "ships\parus_" + sUpgrade + ".tga";
     BI_objRetValue.geraldTex = "";//"ships\gerald\chuckskull.tga";
     BI_objRetValue.sailscolor = argb(255,255,255,255);
                if (CheckAttribute(&characters[chrIdx], "ship.sails.color"))
        {
            BI_objRetValue.sailscolor = sti(characters[chrIdx].ship.sails.color);
        }
        if( CheckAttribute(&characters[chrIdx],"Ship.Sails.gerald_name") )
        {
            BI_objRetValue.geraldTex = characters[chrIdx].Ship.Sails.gerald_name;//ShipSails.gerald_name;
        }
                        
        switch(sti(Characters[chrIdx].nation))  // Íå ðàáîòàåò ýòî :(
        {  
            case ENGLAND:
                            if(iClass < 4){   
                 BI_objRetValue.sailscolor = argb(255, 219, 199, 71);//Yellow
                                 BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255, 255, 255, 153);//argb(255, 209, 145, 49);// yellow
                                 BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";trace("petite classe")}
            break;
            case FRANCE:
                            if(iClass < 4){   
                                BI_objRetValue.sailscolor = argb(255, 0, 0, 255);// deep blue
                                BI_objRetValue.geraldTex = "ships\gerald\fra_3.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 105, 180, 230);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\fra_5.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255, 153, 204, 255);//Blue
                                BI_objRetValue.geraldTex = "ships\gerald\fra_6.tga";trace("petite classe")}
            break;
            case SPAIN:
                            if(iClass < 4){       
                BI_objRetValue.sailscolor = argb(255, 3, 91, 80);//green
                                BI_objRetValue.geraldTex = "ships\gerald\spa_4.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255, 153, 255, 153);// yellow
                                BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";trace("petite classe")}
            break;
            case PIRATE:
                            if(iClass < 4){
                BI_objRetValue.sailscolor = argb(255, 60, 60, 60)//Black
                                BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\pir6.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255, 128, 128, 128);// Grey
                                BI_objRetValue.geraldTex = "ships\gerald\pir1.tga";trace("petite classe")}
            break;
            case HOLLAND:   
                            if(iClass < 4){
                BI_objRetValue.sailscolor = argb(255, 128, 128, 128);//Gray
                                BI_objRetValue.geraldTex = "ships\gerald\hol_4.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255,60,60,60);// Black
                                BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";trace("petite classe")}
            break;
            case MORVIS:
                            if(iClass < 4){   
                BI_objRetValue.sailscolor = argb(255, 255, 15, 15);//Red
                                BI_objRetValue.geraldTex = "ships\gerald\pir_6.tga";
                                BI_objRetValue.normalTex = "ships\parus_common_torn.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\pir_1.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255,255,110,90);// yellow
                                BI_objRetValue.geraldTex = "ships\gerald\pir_3.tga";trace("petite classe")}
            break;
                        case PORTU:
                            if(iClass < 4){       
                BI_objRetValue.sailscolor = argb(255, 153, 255, 153);//pas Green
                                BI_objRetValue.geraldTex = "ships\gerald\spa_3.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255,255,255,255);// yellow
                                BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";trace("petite classe")}
            break;

                                 trace("voiles couleur nations")
        }
          
               st = GetCharacterShipType(GetCharacter(chrIdx))
        if(st!=SHIP_NOTUSED)
        {
            shref = GetRealShip(st);
            BI_objRetValue.maxSP = shref.sp;
            // boal -->
            if (CheckAttribute(shref, "EmblemedSails.normalTex")) // çàäíàííûé â òèïå ïàðóñ
                {
                BI_objRetValue.normalTex = shref.EmblemedSails.normalTex;
                nationFileName           = shref.EmblemedSails.normalTex;
                }
            if( CheckAttribute(&Characters[chrIdx],"Features.GeraldSails") && sti(Characters[chrIdx].Features.GeraldSails)==true)
            {
                makearef(arEmbl,shref.GeraldSails);
            } else {
                makearef(arEmbl,shref.EmblemedSails);
            }
                // boal <--
                sq = GetAttributesNum(arEmbl);
                for(i=0; i<sq; i++)
                {
                    arSail = GetAttributeN(arEmbl,i);
                    attrName = GetAttributeName(arSail);
                    tmpStr = GetAttributeValue(arSail);
                    if( CheckAttribute(arSail,"hscale") ) {
                        BI_objRetValue.(attrName).hscale = arSail.hscale;
                    }
                    if( CheckAttribute(arSail,"vscale") ) {
                        BI_objRetValue.(attrName).vscale = arSail.vscale;
                    }
                    if(tmpStr=="1") {
                        //BI_objRetValue.(attrName).Gerald = nationFileName; 
                        BI_objRetValue.(attrName) = nationFileName;
                    } else {
                        BI_objRetValue.(attrName).Gerald = tmpStr;
                    }
                }
        }
           return &BI_objRetValue;
    }

       if (PChar == 1)
    {
                if (CheckAttribute(&characters[PChar], "ship.sails.color"))
        {
            BI_objRetValue.sailscolor = sti(characters[PChar].ship.sails.color);
        }
        if( CheckAttribute(&characters[PChar],"Ship.Sails.gerald_name") )
        {
            BI_objRetValue.geraldTex = characters[PChar].Ship.Sails.gerald_name;
        }
                        trace("couleur de mon navire")
             
               ms = GetCharacterShipType(GetCharacter(PChar))
        if(ms!=SHIP_NOTUSED)
        {
            shref = GetRealShip(ms);
            BI_objRetValue.maxSP = shref.sp;
            // boal -->
            if (CheckAttribute(shref, "EmblemedSails.normalTex")) // çàäíàííûé â òèïå ïàðóñ
                   {
                  BI_objRetValue.normalTex = shref.EmblemedSails.normalTex;
                  nationFileName           = shref.EmblemedSails.normalTex;
                   }
            if( CheckAttribute(&Characters[PChar],"Features.GeraldSails") && sti(Characters[PChar].Features.GeraldSails)==true)
            {
                makearef(arEmbl,shref.GeraldSails);
            } else {
                makearef(arEmbl,shref.EmblemedSails);
            }
           
                // boal <--
                sq = GetAttributesNum(arEmbl);
                for(i=0; i<sq; i++)
                {
                    arSail = GetAttributeN(arEmbl,i);
                    attrName = GetAttributeName(arSail);
                    tmpStr = GetAttributeValue(arSail);
                    if( CheckAttribute(arSail,"hscale") ) {
                        BI_objRetValue.(attrName).hscale = arSail.hscale;
                    }
                    if( CheckAttribute(arSail,"vscale") ) {
                        BI_objRetValue.(attrName).vscale = arSail.vscale;
                    }
                    if(tmpStr=="1") {
                        BI_objRetValue.(attrName) = nationFileName;
                    } else {
                        BI_objRetValue.(attrName).Gerald = tmpStr;
                    }
                }
                }
         }
       
             if (offref >= 0)
          {
          trace("l officier est present 1")
      
                if (CheckAttribute(&characters[offref], "ship.sails.color"))
        {
                        trace("couleur de son navire")
            BI_objRetValue.sailscolor = sti(characters[offref].ship.sails.color);
        }
        if( CheckAttribute(&characters[offref],"Ship.Sails.gerald_name") )
        {
            BI_objRetValue.geraldTex = characters[offref].Ship.Sails.gerald_name;//ShipSails.gerald_name;
        }
                   os = GetCharacterShipType(GetCharacter(offref))
        if(os!=SHIP_NOTUSED)
        {
            shref = GetRealShip(os);
            BI_objRetValue.maxSP = shref.sp;
            // boal -->
            if (CheckAttribute(shref, "EmblemedSails.normalTex")) // çàäíàííûé â òèïå ïàðóñ
                   {
                  BI_objRetValue.normalTex = shref.EmblemedSails.normalTex;
                  nationFileName           = shref.EmblemedSails.normalTex;
                   }
            if( CheckAttribute(&Characters[offref],"Features.GeraldSails") && sti(Characters[offref].Features.GeraldSails)==true)
            {
                makearef(arEmbl,shref.GeraldSails);
            } else {
                makearef(arEmbl,shref.EmblemedSails);
            }
           
                // boal <--
                sq = GetAttributesNum(arEmbl);
                for(i=0; i<sq; i++)
                {
                    arSail = GetAttributeN(arEmbl,i);
                    attrName = GetAttributeName(arSail);
                    tmpStr = GetAttributeValue(arSail);
                    if( CheckAttribute(arSail,"hscale") ) {
                        BI_objRetValue.(attrName).hscale = arSail.hscale;
                    }
                    if( CheckAttribute(arSail,"vscale") ) {
                        BI_objRetValue.(attrName).vscale = arSail.vscale;
                    }
                    if(tmpStr=="1") {
                        BI_objRetValue.(attrName) = nationFileName;
                    } else {
                        BI_objRetValue.(attrName).Gerald = tmpStr;
                    }
                }
                }
         }
    return &BI_objRetValue;
}

Thanks.
 
I don't see where that offref is used further down in the code.
What do you intend to use that for? To check if the character is a player companion so he'll have matching sails to you?
 
Yes Pieter, and I'd like to be able to change companions color sails. It's strange cause with the code :

if (offref >= 0)
{
trace("l officier est present 1")

if (CheckAttribute(&characters[offref], "ship.sails.color"))
{
trace("couleur de son navire")
BI_objRetValue.sailscolor = sti(characters[offref].ship.sails.color);
}

traces are in my compile.log but nothing happen.

By the way, I took your lines for "differents ships for differents nations", works fine. :dance
 
I'm not familiar enough with the CoAS code to tell you why it doesn't work.
What I can do though is to attach the PotC Build Mod version of that function.
That one was rewritten quite a bit my me and it finally does what we want it to do.

Of course the ability to change sail colour purely through code is a CoAS feature that PotC never had.
Maybe this can at least point you a bit in the right direction.
 

Attachments

  • procGetSailTextureData.zip
    1,000 bytes · Views: 481
You're great, Pieter, it works ! Three lines were missing :
Code:
      char = GetCharacter(chrIdx);
       st = GetCharacterShipType(char);
      shref = GetShipByType(st);

So, the code is :
Code:
ref procGetSailTextureData()
{
    int st,i,sq;
    ref shref, char;
    aref arEmbl,arSail;
    string attrName;

    int PChar = GetMainCharacterIndex();
    int chrIdx = GetEventData();

    char = GetCharacter(chrIdx);
    st = GetCharacterShipType(char);
    shref = GetShipByType(st);

    string sUpgrade = "common";

    ref    refBaseShip = GetRealShip(GetCharacterShipType(&characters[chrIdx])); // boal

    int iclass = sti(refBaseShip.Class);

    int iUpgrade = sti(refBaseShip.ship.upgrades.sails);  // boal
    switch(iUpgrade)
    {
        case 1:
            sUpgrade = "common";
        break;
        case 2:
            sUpgrade = "pat";
        break;
        case 3:
            sUpgrade = "silk";
        break;
    }
    BI_objRetValue.normalTex = "ships\parus_" + sUpgrade + ".tga";
    ///âûñòàâëåíèå ãåðáà (ïåðåíåñòè íèæå â êàýéç íàöèé. âñå ÷òî â ýòîì êåéçå óáðàòü
    BI_objRetValue.geraldTex = "";//"ships\gerald\chuckskull.tga";
    BI_objRetValue.sailscolor = argb(255,255,255,255);

    //BI_objRetValue.geraldTexPointer = 0; // (IDirect3DTexture8*)

    string nationFileName = "ships\parus_" + sUpgrade + ".tga";
    string tmpStr;

        if(chrIdx==PChar)    chrIdx = -1;

         if (chrIdx>=0)
         { 
       
                                       
            BI_objRetValue.normalTex = "ships\parus_" + sUpgrade + ".tga";
            BI_objRetValue.geraldTex = "";//"ships\gerald\chuckskull.tga";
            BI_objRetValue.sailscolor = argb(255,255,255,255);
                if (CheckAttribute(&characters[chrIdx], "ship.sails.color"))
        {
            BI_objRetValue.sailscolor = sti(characters[chrIdx].ship.sails.color);
        }
        if( CheckAttribute(&characters[chrIdx],"Ship.Sails.gerald_name") )
        {
            BI_objRetValue.geraldTex = characters[chrIdx].Ship.Sails.gerald_name;//ShipSails.gerald_name;
        }
             
             switch(sti(Characters[chrIdx].nation))  // Íå ðàáîòàåò ýòî :(
          {  

           if(IsCompanion(char))
               {
                      trace("l officier est present 1")
      
         if (CheckAttribute(&characters[char], "ship.sails.color"))
        {
                        trace("couleur de son navire")
            BI_objRetValue.sailscolor = sti(characters[char].ship.sails.color);
        }
        if( CheckAttribute(&characters[char],"Ship.Sails.gerald_name") )
        {
            BI_objRetValue.geraldTex = characters[char].Ship.Sails.gerald_name;//ShipSails.gerald_name;
        }
        if(st!=SHIP_NOTUSED)
        {
            shref = GetRealShip(st);
            BI_objRetValue.maxSP = shref.sp;
                }
               }
            else
               {
         case ENGLAND:
                            if(iClass < 4){   
                 BI_objRetValue.sailscolor = argb(255, 219, 199, 71);//Yellow
                                 BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255, 255, 255, 153);//argb(255, 209, 145, 49);// yellow
                                 BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";trace("petite classe")}
            break;
            case FRANCE:
                            if(iClass < 4){   
                                BI_objRetValue.sailscolor = argb(255, 0, 0, 255);// deep blue
                                BI_objRetValue.geraldTex = "ships\gerald\fra_3.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 105, 180, 230);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\fra_5.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255, 153, 204, 255);//Blue
                                BI_objRetValue.geraldTex = "ships\gerald\fra_6.tga";trace("petite classe")}
            break;
            case SPAIN:
                            if(iClass < 4){       
                BI_objRetValue.sailscolor = argb(255, 3, 91, 80);//green
                                BI_objRetValue.geraldTex = "ships\gerald\spa_4.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255, 153, 255, 153);// yellow
                                BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";trace("petite classe")}
            break;
            case PIRATE:
                            if(iClass < 4){
                BI_objRetValue.sailscolor = argb(255, 60, 60, 60)//Black
                                BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\pir6.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255, 128, 128, 128);// Grey
                                BI_objRetValue.geraldTex = "ships\gerald\pir1.tga";trace("petite classe")}
            break;
            case HOLLAND:   
                            if(iClass < 4){
                BI_objRetValue.sailscolor = argb(255, 128, 128, 128);//Gray
                                BI_objRetValue.geraldTex = "ships\gerald\hol_4.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255,60,60,60);// Black
                                BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";trace("petite classe")}
            break;
            case MORVIS:
                            if(iClass < 4){   
                BI_objRetValue.sailscolor = argb(255, 255, 15, 15);//Red
                                BI_objRetValue.geraldTex = "ships\gerald\pir_6.tga";
                                BI_objRetValue.normalTex = "ships\parus_common_torn.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\pir_1.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255,255,110,90);// yellow
                                BI_objRetValue.geraldTex = "ships\gerald\pir_3.tga";trace("petite classe")}
            break;
            case PORTU:
                            if(iClass < 4){       
                BI_objRetValue.sailscolor = argb(255, 153, 255, 153);//pas Green
                                BI_objRetValue.geraldTex = "ships\gerald\spa_3.tga";}
                            if((iClass == 4) || (iClass == 5)){   
                 BI_objRetValue.sailscolor = argb(255, 255, 153, 153);//Red
                                 BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(255,255,255,255);// yellow
                                BI_objRetValue.geraldTex = "ships\gerald\pir3.tga";trace("petite classe")}
            break;

                                 trace("voiles couleur nations")
        }
            }
          
        if(st!=SHIP_NOTUSED)
        {
            shref = GetRealShip(st);
            BI_objRetValue.maxSP = shref.sp;
            // boal -->
            if (CheckAttribute(shref, "EmblemedSails.normalTex")) // çàäíàííûé â òèïå ïàðóñ
                {
                BI_objRetValue.normalTex = shref.EmblemedSails.normalTex;
                nationFileName           = shref.EmblemedSails.normalTex;
                }
            if( CheckAttribute(&Characters[chrIdx],"Features.GeraldSails") && sti(Characters[chrIdx].Features.GeraldSails)==true)
            {
                makearef(arEmbl,shref.GeraldSails);
            } else {
                makearef(arEmbl,shref.EmblemedSails);
            }
                // boal <--
                sq = GetAttributesNum(arEmbl);
                for(i=0; i<sq; i++)
                {
                    arSail = GetAttributeN(arEmbl,i);
                    attrName = GetAttributeName(arSail);
                    tmpStr = GetAttributeValue(arSail);
                    if( CheckAttribute(arSail,"hscale") ) {
                        BI_objRetValue.(attrName).hscale = arSail.hscale;
                    }
                    if( CheckAttribute(arSail,"vscale") ) {
                        BI_objRetValue.(attrName).vscale = arSail.vscale;
                    }
                    if(tmpStr=="1") {
                        //BI_objRetValue.(attrName).Gerald = nationFileName; 
                        BI_objRetValue.(attrName) = nationFileName;
                    } else {
                        BI_objRetValue.(attrName).Gerald = tmpStr;
                    }
                }
        }
           return &BI_objRetValue;
    }

       if (PChar == 1)
    {
         if (CheckAttribute(&characters[PChar], "ship.sails.color"))
        {
            BI_objRetValue.sailscolor = sti(characters[PChar].ship.sails.color);
        }
        if( CheckAttribute(&characters[PChar],"Ship.Sails.gerald_name") )
        {
            BI_objRetValue.geraldTex = characters[PChar].Ship.Sails.gerald_name;
        }
                        trace("couleur de mon navire")
             
        if(st!=SHIP_NOTUSED)
        {
            shref = GetRealShip(st);
            BI_objRetValue.maxSP = shref.sp;
            // boal -->
            if (CheckAttribute(shref, "EmblemedSails.normalTex")) // çàäíàííûé â òèïå ïàðóñ
                   {
                  BI_objRetValue.normalTex = shref.EmblemedSails.normalTex;
                  nationFileName           = shref.EmblemedSails.normalTex;
                   }
            if( CheckAttribute(&Characters[PChar],"Features.GeraldSails") && sti(Characters[PChar].Features.GeraldSails)==true)
            {
                makearef(arEmbl,shref.GeraldSails);
            } else {
                makearef(arEmbl,shref.EmblemedSails);
            }
           
                // boal <--
                sq = GetAttributesNum(arEmbl);
                for(i=0; i<sq; i++)
                {
                    arSail = GetAttributeN(arEmbl,i);
                    attrName = GetAttributeName(arSail);
                    tmpStr = GetAttributeValue(arSail);
                    if( CheckAttribute(arSail,"hscale") ) {
                        BI_objRetValue.(attrName).hscale = arSail.hscale;
                    }
                    if( CheckAttribute(arSail,"vscale") ) {
                        BI_objRetValue.(attrName).vscale = arSail.vscale;
                    }
                    if(tmpStr=="1") {
                        BI_objRetValue.(attrName) = nationFileName;
                    } else {
                        BI_objRetValue.(attrName).Gerald = tmpStr;
                    }
                }
                }
         }
    return &BI_objRetValue;
}

:doff :cheers
 
Hi,

you've just to open Program\Battle_interface\Battleinterface.c, look for the code :

Code:
ref procGetSailTextureData()
{
    int st,i,sq;
    ref shref;
    aref arEmbl,arSail;
    string attrName;

..........................................................
..........................................................

//BI_objRetValue.(attrName).Gerald = "ships\chuckskull.tga"; // òåêñòóðà ãåðáà (åñëè íå óêàçàíà, òî áåðåòñÿ BI_objRetValue.geraldTex èëè BI_objRetValue.geraldTexPointer)
                    //BI_objRetValue.(attrName).hscale = 0.5; // ìàñøòàá â ðàçìåðå ïàðóñà (0.5 - ãåðá çàíèìàåò ïîëîâèíó ïàðóñà)
                    //BI_objRetValue.(attrName).vscale = 0.5; // åñëè íåò vscale, òî èñïîëüçóåòñÿ = scale
                }
            //}
        }
    }

    return &BI_objRetValue;
}

and change it with this one :

Code:
ref procGetSailTextureData()
{
    int st,i,sq;
    ref shref, char;
    aref arEmbl,arSail;
    string attrName;

        int PChar = GetMainCharacterIndex();
    int chrIdx = GetEventData();

        char = GetCharacter(chrIdx);
        st = GetCharacterShipType(char);
    shref = GetShipByType(st);

    string sUpgrade = "common";

    ref    refBaseShip = GetRealShip(GetCharacterShipType(&characters[chrIdx])); // boal

        int iclass = sti(refBaseShip.Class);

    int iUpgrade = sti(refBaseShip.ship.upgrades.sails);  // boal
    switch(iUpgrade)
    {
        case 1:
            sUpgrade = "common";
        break;
        case 2:
            sUpgrade = "pat";
        break;
        case 3:
            sUpgrade = "silk";
        break;
    }
    BI_objRetValue.normalTex = "ships\parus_" + sUpgrade + ".tga";
    ///âûñòàâëåíèå ãåðáà (ïåðåíåñòè íèæå â êàýéç íàöèé. âñå ÷òî â ýòîì êåéçå óáðàòü
    BI_objRetValue.geraldTex = "";//"ships\gerald\chuckskull.tga";
    BI_objRetValue.sailscolor = argb(255,255,255,255);

    //BI_objRetValue.geraldTexPointer = 0; // (IDirect3DTexture8*)

    string nationFileName = "ships\parus_" + sUpgrade + ".tga";
    string tmpStr;

        if(chrIdx==PChar)    chrIdx = -1;

         if (chrIdx>=0)
         {
      
                                      
                BI_objRetValue.normalTex = "ships\parus_" + sUpgrade + ".tga";
            BI_objRetValue.geraldTex = "";//"ships\gerald\chuckskull.tga";
            BI_objRetValue.sailscolor = argb(255,255,255,255);
                if (CheckAttribute(&characters[chrIdx], "ship.sails.color"))
        {
            BI_objRetValue.sailscolor = sti(characters[chrIdx].ship.sails.color);
        }
        if( CheckAttribute(&characters[chrIdx],"Ship.Sails.gerald_name") )
        {
            BI_objRetValue.geraldTex = characters[chrIdx].Ship.Sails.gerald_name;//ShipSails.gerald_name;
        }
            
             switch(sti(Characters[chrIdx].nation))  // Íå ðàáîòàåò ýòî :(
          { 

           if(IsCompanion(char))
               {
                      trace("l officier est present 1")
     
                if (CheckAttribute(&characters[char], "ship.sails.color"))
        {
                        trace("couleur de son navire")
            BI_objRetValue.sailscolor = sti(characters[char].ship.sails.color);
        }
        if( CheckAttribute(&characters[char],"Ship.Sails.gerald_name") )
        {
            BI_objRetValue.geraldTex = characters[char].Ship.Sails.gerald_name;//ShipSails.gerald_name;
        }
        if(st!=SHIP_NOTUSED)
        {
            shref = GetRealShip(st);
            BI_objRetValue.maxSP = shref.sp;
                }
               }
            else
               {
            case ENGLAND:
                            if(iClass < 4){      
                BI_objRetValue.sailscolor = argb(5, 149, 74, 17);
                                BI_objRetValue.geraldTex = "ships\gerald\eng_3.tga";}
                            if((iClass == 4) || (iClass == 5)){  
                 BI_objRetValue.sailscolor = argb(5, 168, 88, 27);
                                 BI_objRetValue.geraldTex = "ships\gerald\eng_4.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(5,125,83,51);
                                BI_objRetValue.geraldTex = "ships\gerald\eng_5.tga";trace("petite classe")}
            break;
            case FRANCE:
                            if(iClass < 4){  
                                BI_objRetValue.sailscolor = argb(5, 0, 0, 255);// deep blue
                                BI_objRetValue.geraldTex = "ships\gerald\fra_3.tga";}
                            if((iClass == 4) || (iClass == 5)){  
                 BI_objRetValue.sailscolor = argb(5, 36, 120, 217);
                                 BI_objRetValue.geraldTex = "ships\gerald\fra_5.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(5, 0, 95, 203);//Blue
                                BI_objRetValue.geraldTex = "ships\gerald\fra_6.tga";trace("petite classe")}
            break;
            case SPAIN:
                            if(iClass < 4){      
                BI_objRetValue.sailscolor = argb(5, 3, 91, 80);
                                BI_objRetValue.geraldTex = "ships\gerald\spa_4.tga";}
                            if((iClass == 4) || (iClass == 5)){  
                 BI_objRetValue.sailscolor = argb(5, 64, 164, 151);
                                 BI_objRetValue.geraldTex = "ships\gerald\spa_1.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(5, 0, 158, 137);
                                BI_objRetValue.geraldTex = "ships\gerald\spa_2.tga";trace("petite classe")}
            break;
            case PIRATE:
                            if(iClass < 4){
                BI_objRetValue.sailscolor = argb(5, 60, 60, 60)//Black
                                BI_objRetValue.geraldTex = "ships\gerald\pir4.tga";}
                            if((iClass == 4) || (iClass == 5)){  
                 BI_objRetValue.sailscolor = argb(5, 15, 22, 29);
                                 BI_objRetValue.geraldTex = "ships\gerald\pir6.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(5, 55, 59, 63);
                                BI_objRetValue.geraldTex = "ships\gerald\pir5.tga";trace("petite classe")}
            break;
            case HOLLAND:  
                            if(iClass < 4){
                BI_objRetValue.sailscolor = argb(5, 255, 15, 15);
                                BI_objRetValue.geraldTex = "ships\gerald\hol_4.tga";}
                            if((iClass == 4) || (iClass == 5)){  
                 BI_objRetValue.sailscolor = argb(5, 233, 0, 47);
                                 BI_objRetValue.geraldTex = "ships\gerald\hol_2.tga";}
                            if(iClass > 5){BI_objRetValue.sailscolor = argb(5,233,72,104);
                                BI_objRetValue.geraldTex = "ships\gerald\hol_1.tga";trace("petite classe")}
            break;
                                 trace("voiles couleur nations")
        }
            }
         
        if(st!=SHIP_NOTUSED)
        {
            shref = GetRealShip(st);
            BI_objRetValue.maxSP = shref.sp;
            // boal -->
            if (CheckAttribute(shref, "EmblemedSails.normalTex")) // çàäíàííûé â òèïå ïàðóñ
                {
                BI_objRetValue.normalTex = shref.EmblemedSails.normalTex;
                nationFileName           = shref.EmblemedSails.normalTex;
                }
            if( CheckAttribute(&Characters[chrIdx],"Features.GeraldSails") && sti(Characters[chrIdx].Features.GeraldSails)==true)
            {
                makearef(arEmbl,shref.GeraldSails);
            } else {
                makearef(arEmbl,shref.EmblemedSails);
            }
                // boal <--
                sq = GetAttributesNum(arEmbl);
                for(i=0; i<sq; i++)
                {
                    arSail = GetAttributeN(arEmbl,i);
                    attrName = GetAttributeName(arSail);
                    tmpStr = GetAttributeValue(arSail);
                    if( CheckAttribute(arSail,"hscale") ) {
                        BI_objRetValue.(attrName).hscale = arSail.hscale;
                    }
                    if( CheckAttribute(arSail,"vscale") ) {
                        BI_objRetValue.(attrName).vscale = arSail.vscale;
                    }
                    if(tmpStr=="1") {
                        //BI_objRetValue.(attrName).Gerald = nationFileName;
                        BI_objRetValue.(attrName) = nationFileName;
                    } else {
                        BI_objRetValue.(attrName).Gerald = tmpStr;
                    }
                }
        }
           return &BI_objRetValue;
    }

       if (PChar == 1)
    {
                if (CheckAttribute(&characters[PChar], "ship.sails.color"))
        {
            BI_objRetValue.sailscolor = sti(characters[PChar].ship.sails.color);
        }
        if( CheckAttribute(&characters[PChar],"Ship.Sails.gerald_name") )
        {
            BI_objRetValue.geraldTex = characters[PChar].Ship.Sails.gerald_name;
        }
                        trace("couleur de mon navire")
            
        if(st!=SHIP_NOTUSED)
        {
            shref = GetRealShip(st);
            BI_objRetValue.maxSP = shref.sp;
            // boal -->
            if (CheckAttribute(shref, "EmblemedSails.normalTex")) // çàäíàííûé â òèïå ïàðóñ
                   {
                  BI_objRetValue.normalTex = shref.EmblemedSails.normalTex;
                  nationFileName           = shref.EmblemedSails.normalTex;
                   }
            if( CheckAttribute(&Characters[PChar],"Features.GeraldSails") && sti(Characters[PChar].Features.GeraldSails)==true)
            {
                makearef(arEmbl,shref.GeraldSails);
            } else {
                makearef(arEmbl,shref.EmblemedSails);
            }
          
                // boal <--
                sq = GetAttributesNum(arEmbl);
                for(i=0; i<sq; i++)
                {
                    arSail = GetAttributeN(arEmbl,i);
                    attrName = GetAttributeName(arSail);
                    tmpStr = GetAttributeValue(arSail);
                    if( CheckAttribute(arSail,"hscale") ) {
                        BI_objRetValue.(attrName).hscale = arSail.hscale;
                    }
                    if( CheckAttribute(arSail,"vscale") ) {
                        BI_objRetValue.(attrName).vscale = arSail.vscale;
                    }
                    if(tmpStr=="1") {
                        BI_objRetValue.(attrName) = nationFileName;
                    } else {
                        BI_objRetValue.(attrName).Gerald = tmpStr;
                    }
                }
                }
         }
    return &BI_objRetValue;
}

You also can choose another color for a nation, just go here :

http://www.code-couleur.com/

and then change argb in the code.

:cheers
 
I tried the changes in your last post and it seems to work. I was afraid it would not as some of the things are written in French. It seems to work in this English version so far.

I have not seen a dialog to change my sails yet, but others seem to change ok. That French blue is too blue IMHO.

start 2015-07-15 13-15-55-53.jpg start 2015-07-15 13-26-56-59.jpg start 2015-07-15 14-24-33-02.jpg start 2015-07-15 14-24-45-84.jpg start 2015-07-15 14-24-59-87.jpg
 
Back
Top