• 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 The return of the managable shore crew inventories

Earlier in the build 14 developement stage there usted to be a feature involving ability to arm your on shore crew with weapons. It was removed since it was considered micromanaging and was removed and replaced by crew getting their own guns according to players level. What could have been done instead was to leave the crew getting their own weapons on but let the players manage their inventories, since right now it is completely unavailable. Other than that there seem to be a bug where every crew member gets the same weapon only which kind of uins imersion in my opinion. I have no idea if it has been fixed or not. Haven't been playing lately. Thank you if you will consider this.
 
Having auto equipping together with manual inventory management doesn't work very well.
And there was some other weirdness too, which is why we considered the current solution to be the simplest.
 
I understand that. So is there any possibility you could enable back the abilty to manage their inventories? Or perhaps you could tell me how I could do that on my own. This doesn't sound too complicated.
 
PROGRAM\DIALOGS\permanent_crewmember_dialog.c find:
Code:
//JRH-->
     case "weapons":
       Dialog.text = DLG_TEXT[15];
       link.l1 = DLG_TEXT[16];
       link.l1.go = "exit";
     //   DialogExit();
     //   LaunchCharacterItemChange(NPChar);
     break;
//<-- JRH
Replace with:
Code:
    case "weapons":
       DialogExit();
       LaunchCharacterItemChange(NPChar);
     break;

And PROGRAM\Loc_ai\LAi_init.c remove this entire section:
Code:
          //JRH -->
             string bladeID = GetCharacterEquipByGroup(crew, BLADE_ITEM_TYPE);
             aref blade;
             Items_FindItem(bladeID, &blade);

             string bladeID2 = GetCharacterEquipByGroup(mainChr, BLADE_ITEM_TYPE);
             aref blade2;
             Items_FindItem(bladeID2, &blade2);

             string gunID = GetCharacterEquipByGroup(crew, GUN_ITEM_TYPE);
             aref gun;
             Items_FindItem(gunID, &gun);

             string gunID2 = GetCharacterEquipByGroup(mainChr, GUN_ITEM_TYPE);
             aref gun2;
             Items_FindItem(gunID2, &gun2);

             string old_gun;
             string right_gun;

             string old_blade;
             string right_blade;
         //---------------------------------------------------------------------------------------------------     

             if(CheckAttribute(blade2, "price"))
             {
               if(blade2.price >= 8000)
               {
                 right_blade = "blade34";
               }
               else
               {
                 if(blade2.price >= 4000)
                 {   
                   right_blade = "blade24";
                 }
               }
               else
               {
                 if(blade2.price >= 1000)
                 {   
                   right_blade = "blade31";
                 }
               }
               else
               {
                 if(blade2.price >= 500)
                 {   
                   right_blade = "blade12";
                 }
               }
               else
               {
                 if(blade2.price >= 250)
                 {   
                   right_blade = "blade10";
                 }
               }
               else
               {
                 if(blade2.price >= 50)
                 {   
                   right_blade = "blade4";
                 }
               }
               else
               {
                 if(blade2.price >= 2)
                 {
                   //anything better than fists   
                   right_blade = "barmansknife";
                 }
               }
               else
               {
                 //player has fists only
                 right_blade = "bladeX4";
               }
             }

             if(bladeID2 == "")
             {
               right_blade = "";
             }

             //LogIt("right_blade = " + right_blade);

             if(!IsEquipCharacterByItem(crew, right_blade))
             {
               if(bladeID != "")
               {
                 old_blade = GetCharacterEquipByGroup(crew, BLADE_ITEM_TYPE);
                 //LogIt("old_blade = " + old_blade);
                 TakeItemFromCharacter(crew, old_blade);
               }
               //else LogIt("old_blade = " + "no blade");

               GiveItem2Character(crew, right_blade);
               EquipCharacterbyItem(crew, right_blade);
             }

         //---------------------------------------------------------------------------------------------------
            if(GetCurrentPeriod() >= PERIOD_GOLDEN_AGE_OF_PIRACY)
             {
               if(gunID2 == "pistolmket" || gunID2 == "pistolmtoon" || gunID2 == "pistol10" || gunID2 == "LongRifle_C" || gunID2 == "LongRifle_CT")
               {
                 right_gun = "pistolbbuss";
               }

               if(gunID2 == "pistolbbuss")
               {
                 right_gun = "pistol3";
               }

               if(gunID2 == "pistol3_14" || HasSubStr(gunID2, "pistol9"))
               {
                 right_gun = "pistol5";
               }

               if(HasSubStr(gunID2, "pistol8"))
               {
                 right_gun = "pistol6";
               }

               if( HasSubStr(gunID2, "pistol7") || HasSubStr(gunID2, "pistol6") || HasSubStr(gunID2, "PiratesPistol") )
               {
                 right_gun = "pistol2";
               }

               if(HasSubStr(gunID2, "pistol4") || gunID2 == "pistol4_1")
               {
                 right_gun = "pistol7";
               }

               if(HasSubStr(gunID2, "pistol5") || HasSubStr(gunID2, "pistol3") )
               {
                 right_gun = "PiratesPistol";
               }

               if( HasSubStr(gunID2, "pistol25") || HasSubStr(gunID2, "pistol26") )
               {
                 right_gun = "pistol5";
               }
               else
               {
                 if(HasSubStr(gunID2, "pistol2") )
                 {
                   right_gun = "pistol1";
                 }
               }

               if(HasSubStr(gunID2, "pistol1") )
               {
                 right_gun = "pistol1";
               }

               if(gunID2 == "")
               {
                 right_gun = "";
               }
            }
            else
            {
               if(gunID2 == "Arguebuse" || gunID2 == "pistol13")
               {
                 right_gun = "pistol13";
               }

               if( HasSubStr(gunID2, "pistol11") || HasSubStr(gunID2, "pistol12") )
               {
                 right_gun = "pistol11";
               }
            }
             //LogIt("right_gun = " + right_gun);

             if(!IsEquipCharacterByItem(crew, right_gun))
             {
               if(gunID != "")
               {
                 old_gun = GetCharacterEquipByGroup(crew, GUN_ITEM_TYPE);
                 //LogIt("old_gun = " + old_gun);
                 TakeItemFromCharacter(crew, old_gun);
               }
               //else LogIt("old_gun = " + "no gun");

               GiveItem2Character(crew, right_gun);
               EquipCharacterbyItem(crew, right_gun);
               
             //AMMO only if crew got a gun
               gunID = GetCharacterEquipByGroup(crew, GUN_ITEM_TYPE);
               Items_FindItem(gunID, &gun);
               
               if(gunID != "")
               {
                 TakeNItems(crew,"gunpowder", -100);
                 TakeNItems(crew,"pistolbullets", -100);
                 TakeNItems(crew,"pistolgrapes", -100);
                 TakeNItems(crew,"musketbullets", -100);

                 if(CheckAttribute(gun, "shottype"))
                 {
                   if(gun.shottype == "pb" || gun.shottype == "pb2") TakeNItems(crew,"pistolbullets", 6);
                   if(gun.shottype == "pg" || gun.shottype == "pg2") TakeNItems(crew,"pistolgrapes", 6);
                   if(gun.shottype == "mb") TakeNItems(crew,"musketbullets", 3);
                   if(gun.shottype == "pg" || gun.shottype == "pg2" || gun.shottype == "pb" || gun.shottype == "pb2" || gun.shottype == "mb")
                   TakeNItems(crew,"gunpowder", 6);
                   if(gun.shottype == "ca") TakeNItems(crew,"cartridges", 6);
                 }
             //here for "new" gun, both first gun or changed gun
                 if(CheckAttribute(gun, "chargeQ"))
                 {
                   crew.chr_ai.charge = makeint(gun.chargeQ);
                 }
               }
             }
         
             if(right_gun == "")
             {
               TakeNItems(crew,"gunpowder", -100);
               TakeNItems(crew,"pistolbullets", -100);
               TakeNItems(crew,"pistolgrapes", -100);
               TakeNItems(crew,"musketbullets", -100);
             }
             //LogIt("gun.shottype = " + gun.shottype);   
             //LogIt("charges = " + crew.chr_ai.charge);
             //LAi_SetImmortal(crew, true);     //while testing
           //<-- JRH

No guarantees that this will work quite right. We changed this for a reason, even if I can't remember why.... :wp
 
Back
Top