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

Abandoned Sharing some thoughts on specific game items

What I thought was that you lose a blade automatically when it breaks.
No, you don't. That IS how I had originally written it, but I changed it based on forum feedback because indeed that could be very annoying.
So I replaced the "Badly Worn" quality with "Broken". When a blade goes from "Worn" to "Broken", it is automatically de-equipped for you.

Depending on the BLADEDAMAGE_USEOTHERBLADE value in InternalSettings.h, you will then be left with your fists OR you automatically equip another blade from your inventory.
Default setting is OFF, so you have to respond quickly when your blade breaks. Press the Quick-Equip key in mid-fight when this happens! :razz

The "Broken" blade remains in your inventory and can be repaired at the blacksmiths.
 
The player's character doesn't need to become a blacksmith, but the kit should allow the character to perform basic maintenance - cleaning, sharpening, maybe basic polishing. The blacksmiths even hint that you ought to be doing this, complaining that you should take care of your sword! So, depending on how it can be coded, the blade care kit could either reduce the frequency at which blades deteriorate; or you use it, time passes, and the blade goes up one level, though never above "Fine". You should be able to get it to the best quality that is available in a store, but to put the final touch and take it up to "Excellent" should still require a blacksmith. Otherwise, if everyone could polish their swords up to maximum quality free of charge, blacksmiths would go out of business. :)
While I do like the idea, I don't think we have anybody who is willing to make that happen.
I could do it myself, but I won't. Have too many other things that require my attention and when I DO get to PotC-modding, I need to fix existing issues rather than adding new features.

If anyone would be interested in making this happen, I'd be quite happy to explain where to look and how to do it. :doff
 
Since that would be my first significant coding mod (as opposed to insignificant mods such as changing variables or editing text files :)), the explaining would probably need to be in such detail as to be almost as much effort as actually doing it. However, if you're willing to do the explaining, I'm willing to have a go...
 
Firstly, the file where blade damage is handled is program\loc_ai\lai_events.c . Look through that file for bladedamage . See if the related code makes any sense to you.
 
I thought of something simular about pistols, even made a Gunsmith perk and tools for it years ago
but never had time to finish the idea. Maybe some day...:guns:
 
I thought of something simular about pistols, even made a Gunsmith perk and tools for it years ago but never had time to finish the idea. Maybe some day...:guns:

Would be indeed a fine addition to the game, IMHO.

If anyone would be interested in making this happen, I'd be quite happy to explain where to look and how to do it. :doff

I'm thinking about giving a try to create some item against encountering storms - some sort of a barometer. Do you think something like that could be implemented with limited coding knowledge? Just some hint of where to start looking first...
 
Firstly, the file where blade damage is handled is program\loc_ai\lai_events.c . Look through that file for bladedamage . See if the related code makes any sense to you.
I've found a section headed by a comment which says "PB: Bladedamage mod", as part of a subroutine "LAi_CharacterBlock()". The code there seems to be counting how many times you've blocked the enemy and vice versa.
 
Yep, that is the correct section. Does it make any sense to you? Perhaps you can add something like
if checkcharacteritem then add a value to the counter limit where your blade decreases in quality.

As for the storms, not sure if that can be done.
Search your Weather folder. There is a cheat to completely disable world map storms. That may be close to some sort of encounter chance section. So I'd recommend trying to track that down.
 
Yeah, I know of the disable function, so that may indeed be close to simply reducing the chance rather than preventing it from happening at all. I'll have a look at it then, thanks.
 
Yep, that is the correct section. Does it make any sense to you?
I'll need to read it in more detail, but I reckon I can figure out what most of it does.
Perhaps you can add something like
if checkcharacteritem then add a value to the counter limit where your blade decreases in quality.
That, on the other hand, I can't recognise. I don't know the various other subroutines defined elsewhere throughout the program files, and have no idea what "checkcharacteritem" does or how I use it. And I've still to find exactly where the blade decreases quality.
 
@Dextr for storms:
PROGRAM\Weather\worldmap_encgen.c looks like this is the Storm Chance:
Code:
#define WDM_STORM_RATE       0.002
Used here in the same file:
Code:
//Storm
void wdmStormGen(float dltTime, float playerShipX, float playerShipZ, float playerShipAY)
{
   ref mc = GetMainCharacter();
   bool encoff = false;
   if(GetAttribute(mc,"worldmapencountersoff") == 1)   return;
   if(CheckAttribute(mc,"ship.SubmergeDutchman"))     return;   // PB: No encounters or storms while you are submerged
   int numStorms = wdmGetNumberStorms();
   if(numStorms < 1)
   {
     wdmTimeOfLastStorm = wdmTimeOfLastStorm + dltTime*WDM_STORM_RATE*1000.0;
     if(rand(1001) < wdmTimeOfLastStorm)
     {
       wdmCreateStorm();
       wdmTimeOfLastStorm = 0.0;
     }
   }else{
     wdmTimeOfLastStorm = 0.0;
   }
}
Change to:
Code:
//Storm
void wdmStormGen(float dltTime, float playerShipX, float playerShipZ, float playerShipAY)
{
   ref mc = GetMainCharacter();
   bool encoff = false;
   if(GetAttribute(mc,"worldmapencountersoff") == 1)   return;
   if(CheckAttribute(mc,"ship.SubmergeDutchman"))     return;   // PB: No encounters or storms while you are submerged
   int numStorms = wdmGetNumberStorms();
   if(numStorms < 1)
   {
     float StormChanceModifier = 1.0;
     if(CheckCharacterItem(mc, "compass1"))
     {
       StormChanceModifier = 2.0;
     }
     wdmTimeOfLastStorm = wdmTimeOfLastStorm + dltTime*WDM_STORM_RATE*StormChanceModifier*1000.0;
     if(rand(1001) < wdmTimeOfLastStorm)
     {
       wdmCreateStorm();
       wdmTimeOfLastStorm = 0.0;
     }
   }else{
     wdmTimeOfLastStorm = 0.0;
   }
}
Not sure if this would work, but you can try. It could be that the 2.0 should actually be 0.5, depending on which way the code works.
You can replace "compass1" with another, more appropriate, item. If you want to add a specific new item, look at PROGRAM\ITEMS\initItems.c .



@Grey Roger for Blade Damage:
PROGRAM\Loc_ai\LAi_events.c find:
Code:
total_chance = sti(bladedamage_usage) + sti(bladedamage_level);
Add extra lines below:
Code:
    if(CheckCharacterItem(enemy, "bladekit"))
     {
       total_chance = total_chance/2;
     }
OR:
Code:
    if(CheckCharacterItem(attack, "bladekit"))
     {
       total_chance = total_chance/2;
     }
Depending on which of the two instances you are dealing with.

Again, this is untested and perhaps the number is inverted and you should be multiplying instead.
Also, I put in zero thought on balancing this properly and just stuck in a simple value of 2.



Anyway, hopefully this gives you both some information on how to proceed.
Now it is up to you to make this actually mod-worthy! Though feel free to post again if you can't figure it out. :doff
 
Now, after reading Hylie Pistof's and Red Back Dude's comments in the build development thread I started to wonder, whether the storm reducer item idea is really that good, seeing that storms are indeed the best way to improve sailing skills...
 
You tell me. :shrug

Either way, something should be done with that code. Either tested and expanded to be fully implementable or removed again if that is considered best.
 
I do like the idea of a storm prevent item. But it should only work when in possesion or there should be a way to turn it "off".
Say you have a precious cargo it would be nice to be able to prevent storms. There are functions to check if a character has the item so that could work. Say if you dont need it you can put it in the chests on your ship or give it to a officer.
 
Back
Top