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

Brainstorming Personal Modifications for Feedback and Testing

Actually, is refCharacter.Ship.Name even used? Since ships get a random name, what purpose does this serve? A new ship doesn’t have a name, does it? I mean, if I buy a ship from the shipwright then it gets the name which is set on the captain, not the ship (because it doesn’t have one). I was actually considering removing all of those entries in ship init just to see if anything changed - I was thinking that nothing would.
"Name" is the name of the model folder containing the GMs. "ID" is the identification used within the game.
Those two are virtually always the same. Except when they're not:
Code:
   refShip.Name         = "CursedPearl";
   refShip.SName         = "CursedPearl";
   refShip.id           = SHIP_CURSED; // Fudge Dragon: Re-enable skeletons
In this specific example it is absolutely crucial that these two are different.
But that is also the ONLY example where it actually matters.

Bear in mind that the text on the icons looks at refCharacter.Ship.SName... I think.
It does. :yes
 
No! The game would then end up referring to your random names as the folder containing the model files. :shock
 
I’ve reverted them all back to what they are for the templates I used. ;)

Never mind that... what the heck is going on here? What did you done?? :confused:

Untitled.jpg
 
Okay, so now I got the 28 and 32 gun frigates showing in the shipyard, which is pretty cool. But they have no texture on the icons, so I guess this has something to do with the names we were talking about. Which setting is this?

Untitled.jpg
 
You need some lines for your new ships in pictures.ini .

Those visible locators came from my InternalSettings.h file.
I had switched them on to sort out that Turks Davy Jones bug earlier today.
 
You scared me, I actually thought Davy was coming to get me! :cool

Okay, I’ll look at the pictures file and see what needs to be done. At least it works, though.
 
For my new 28 and 32 gun frigates I was at first using Corvette1, but it decided to load some stuff for that particular ship.

So I changed it to a unique value...

refShip.Name = "28GunFrigate"

Now it wants to load this as a model, which obviously doesn’t exist.

Is the only way around this to copy and rename the model accordingly?
 
Keep the name identical to the model folder, but change the ID.
We've done that in the past and it works.
 
SkillMax
I think there may be some confusion between "SKILL_MAX" and "MAX_CHARACTER_SKILL".
There are two independent variables::
MAX_CHARACTER_SKILL indicates the maximum number of skill points per skill
SKILL_MAX is the number of different skills that exist in the game (e.g. Leadership/Sailing/Commerce/Etc.)
You’re right about this, there is confusion. If SKILL_MAX = 10 and MAX_CHARACTER_SKILL = 20 then the skills on my character sheet cannot exceed 10 (but I think in reality they actually are higher, they just stop at 10 in a display sense). As soon as I change SKILL_MAX to 20 then my skills which are higher than 10 are correctly displayed. This does not affect summary skills for ships, they seem to be correct. So yeah, I think people have got these confused in places.
 
I tried to have it correct in my upload from today.
If it is still wrong, please see if you can get it right.
 
The thing is, SKILL_MAX is extensively used and I’m pretty sure it is being used for individual skills in many places.

Code:
string PickSkillNoAutoLevel(ref chref)
{
   string skill;
   int importance = 0;
   float importance_total = stf(chref.skillimportancetotal);
   if(importance_total < 1) return "freeskill";
   int PickVal = rand(makeint(importance_total));
   for(int n = 0; n < 10; n++)
   {
     skill = GetSkillName(n);
     importance = sti(chref.skill.(skill).importance);
     if(PickVal <= importance)
     {
       if(GetCharacterSkill(chref, skill) >= SKILL_MAX)
       {
         chref.skillimportancetotal = sti(chref.skillimportancetotal) - sti(chref.skill.(skill).importance);
         chref.skill.(skill).importance = 0;
         if(DEBUG_NOAUTOLEVEL > 1) Trace("Importance for "+skill+" is set to 0 because skill is maxed out");
         return PickSkillNoAutoLevel(chref);
       }
       else
       {
         return skill;
       }
     }
     else
     {
       PickVal = PickVal - importance;
     }
   }
   //if all fails return the last one because it means the rand value was to higher
   Trace("XP ERROR: Overflow in PickSkillNoAUtoLevel");
   return skill;
}
Code:
void MusketVolley(ref mchr, ref echr)
{
   // This only happens for ships, not forts, and is already tested in AIAbordage.c
   bool PlayerVolley = CheckAttribute(mchr, "musket") && !CheckAttribute(echr, "surrendered");
   bool EnemyVolley  = CheckAttribute(echr, "musket") && !CheckAttribute(echr, "surrendered");
   DeleteAttribute(mchr, "musket");
   DeleteAttribute(echr, "musket");

   // delta determines who fires first and affects the final casualty total
   int leadership0 = GetShipSkill(mchr, SKILL_LEADERSHIP);
   int leadership1 = GetShipSkill(echr, SKILL_LEADERSHIP);
   int accuracy0 = GetShipSkill(mchr, SKILL_ACCURACY);
   int accuracy1 = GetShipSkill(echr, SKILL_ACCURACY);
   float delta = makefloat((leadership0 - leadership1) + (accuracy0 - accuracy1)) / (4.0 * SKILL_MAX);
//   float delta = 0.0;
   float killratio1 = 0.0;
   float killratio2 = 0.0;
   bool  bEnemyShotFirst = false;
Code:
float LAi_GetCharacterFightLevel(aref character)
{
   //Fencing skill
   float fgtlevel = 0.0;
   if(isBoardingLoading == false)
   {
     if(CheckAttribute(character, "skill.Fencing") != 0)
     {
       fgtlevel = makefloat(CalcCharacterSkill(character,SKILL_FENCING)); // NK
     }
   }else{
     fgtlevel = CalcCharacterSkill(character, SKILL_FENCING);
   }
   //Level
   if(fgtlevel < 0.0) fgtlevel = 0.0;
   if(fgtlevel > SKILL_MAX) fgtlevel = SKILL_MAX;
   fgtlevel = fgtlevel/SKILL_MAX;
   return fgtlevel;
}
Code:
void Ship_UpdateTmpSkills(ref rCharacter)
{
   rCharacter.TmpSkill = "";

   aref aTmpSkill; makearef(aTmpSkill, rCharacter.TmpSkill);

   aTmpSkill.Commerce  = Clampf(MakeFloat(GetShipSkill(rCharacter, SKILL_COMMERCE  )) / SKILL_MAX);
   aTmpSkill.Leadership = Clampf(MakeFloat(GetShipSkill(rCharacter, SKILL_LEADERSHIP)) / SKILL_MAX);
   aTmpSkill.Sneak  = Clampf(MakeFloat(GetShipSkill(rCharacter, SKILL_SNEAK  )) / SKILL_MAX);
   aTmpSkill.Defence  = Clampf(MakeFloat(GetShipSkill(rCharacter, SKILL_DEFENCE  )) / SKILL_MAX);
   aTmpSkill.Grappling  = Clampf(MakeFloat(GetShipSkill(rCharacter, SKILL_GRAPPLING )) / SKILL_MAX);
   aTmpSkill.Sailing  = Clampf(MakeFloat(GetShipSkill(rCharacter, SKILL_SAILING  )) / SKILL_MAX);
   aTmpSkill.Repair  = Clampf(MakeFloat(GetShipSkill(rCharacter, SKILL_REPAIR  )) / SKILL_MAX);
   aTmpSkill.Fencing  = Clampf(MakeFloat(GetShipSkill(rCharacter, SKILL_FENCING  )) / SKILL_MAX);
   aTmpSkill.Accuracy  = Clampf(MakeFloat(GetShipSkill(rCharacter, SKILL_ACCURACY  )) / SKILL_MAX);
   aTmpSkill.Cannons  = Clampf(MakeFloat(GetShipSkill(rCharacter, SKILL_CANNONS  )) / SKILL_MAX);
}

So this means that increasing the limit to 20, for example, is all well and good but in some areas it will do absolutely nothing if SKILL_MAX = 10.
 
Last edited:
Yeah, tell me about it. Maybe I’ll go through it all at some point, although I probably won’t be sure with some of it if they are looking at skills individually or otherwise. Right now though I’m seriously going to do some work on unique ships/captains.
 
Back
Top