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

Mod Release Build 14 Beta 3 Progress

Why is it that the blacksmith does not contribute anything to the colonies wealth like the shipyard and merchant does? I could upgrade weapons as one way to give a grubstake to a failed colony if they did contribute.
 
Looks like the money is only ever subtracted from the player and not even added to the blacksmith himself.
Would indeed be an interesting idea to make it not disappear, but actually go into the town gold supply.
 
A new thing. When selling to a failed merchant he goes into negative numbers and I have been making a point of buying enough goods from him to get him back into positive numbers before I leave.

Now when I sell goods and put him into the red, then run around doing other things and come back he is already back up to zero! This is a good thing as it helps them recover a little bit faster.
 
I'm still not sure if that if-statement does what it is intended to. I added some trace messages to check:
Code:
  //Check if we can launch an event.
   TraceAndLog("This happens");
   if((day + (EVENT_PER_DAYS*ENCOUNTERBREAK)) > yeardays && nosmuggle) //Add a multiplier for the OPEN SEA MOD
   {
     TraceAndLog("This happens too");
See attached compile.log to see how often(!) the "This happens too" line is being executed. And that was within the first few minutes of a brand new game.
I thought the idea was to prevent that from happening too frequently?

Why is it that the blacksmith does not contribute anything to the colonies wealth like the shipyard and merchant does? I could upgrade weapons as one way to give a grubstake to a failed colony if they did contribute.
This has been changed now. Also for the "regular" repairs.
 

Attachments

  • compile.zip
    1.9 KB · Views: 70
At a game start it happens a few times. That's normal.
This function is called for all shops in the game so its called 33 times for each different shop so that looks alright.
If you play on you will notice it being called less.
The function is called each day at the shop update in daily update.
Go to the tavern and sleep for a night you will see it's being called 33 (I believe) times but less will go trough it. In the beginning it can happen a few times cause the "startdate" of the shops isn't set on the date you started but on a random date somewhere in the range. so they wont update all on the same time.
 
Looks like the money is only ever subtracted from the player and not even added to the blacksmith himself.
Would indeed be an interesting idea to make it not disappear, but actually go into the town gold supply.
I can just see the blacksmith's reaction to that! He works hard at the forge all day, beating various miscreants' swords into decent shape, gets paid lots of money for it, then the governor steals the whole lot and puts it into the town hall kitty. Not the best idea for keeping the blacksmith in business, especially since the first tax collector to try to do this is going to find that the blacksmith is holding a nice, newly polished sword. :walkplank

What's actually happening is that the blacksmith has found out about your evil plan to impose a 100% tax rate on him and has gone to the tavern to spend it all before the tax collector can show up. This is why you never see the blacksmith's gold go up. It's also why the blacksmith in San Juan has a bad temper - he has a bad hangover and a headache.:nerbz
 
At a game start it happens a few times. That's normal.
This function is called for all shops in the game so its called 33 times for each different shop so that looks alright.
If you play on you will notice it being called less.
The function is called each day at the shop update in daily update.
Go to the tavern and sleep for a night you will see it's being called 33 (I believe) times but less will go trough it. In the beginning it can happen a few times cause the "startdate" of the shops isn't set on the date you started but on a random date somewhere in the range. so they wont update all on the same time.
If I understand correctly:
- The function is run for each shop when the game is started
- A random "startdate" is set for each one
- The function is called again for each shop on every daily update, BUT since they now have a startdate, only very few will actually pass that if-statement

That explains why "This happens" all the time, but why does "This happens too" occur so frequently as well?
That makes it look like most towns have an event happening every day.

I can just see the blacksmith's reaction to that! He works hard at the forge all day, beating various miscreants' swords into decent shape, gets paid lots of money for it, then the governor steals the whole lot and puts it into the town hall kitty. Not the best idea for keeping the blacksmith in business, especially since the first tax collector to try to do this is going to find that the blacksmith is holding a nice, newly polished sword. :walkplank
How about the Store Owners, then? The same applies to them.
It does also go the other way though: If they pay you, it comes out of the town gold.
The main reason for this was to give the store owners more money to purchase things from you.

What's actually happening is that the blacksmith has found out about your evil plan to impose a 100% tax rate on him and has gone to the tavern to spend it all before the tax collector can show up. This is why you never see the blacksmith's gold go up. It's also why the blacksmith in San Juan has a bad temper - he has a bad hangover and a headache.:nerbz
:rofl :rofl :rofl
 
How about the Store Owners, then? The same applies to them.
It does also go the other way though: If they pay you, it comes out of the town gold.
The main reason for this was to give the store owners more money to purchase things from you.
I can think of two possibilities:
Socialist: the storekeeper is just the front man, the business is being run for the good of the state, so all the money goes in and out of the colony coffers.
Capitalist: the governor is just the front man, the colony is being run for the good of the merchants, so the storekeeper's money is the colony coffers.

Either way, the blacksmith is independent of the state or merchant cartel because he's the only one with a sword which is probably better than anything the town guards are carrying and is "Excellent" quality. In some towns the blacksmith didn't have such a sword (or didn't know how to use it), so the governor imposed the 100% tax, putting the blacksmith out of business. They're the towns which don't have blacksmiths. xD
 
@Levis: Just did a bit more testing using this code change:
Code:
  //Check if we can launch an event.
   if((day + (EVENT_PER_DAYS*ENCOUNTERBREAK)) < yeardays && nosmuggle) //Add a multiplier for the OPEN SEA MOD
   {
     TraceAndLog("DATE: " + GetHumanDate(GetDataYear(), GetDataMonth(), GetDataDay()) + " - Random Town Event for " + ctown.id);
This is the result:
Code:
DATE: October 9th, 1665 - Random Town Event for Oxbay
DATE: October 9th, 1665 - Random Town Event for Santiago
IT dropped low quality weapon (blade5+1) in favor of higher quality (blade5+2)
IT dropped low quality weapon (blade7) in favor of higher quality (blade7+1)
DATE: October 10th, 1665 - Random Town Event for Oxbay
DATE: October 10th, 1665 - Random Town Event for Santiago
DATE: October 11th, 1665 - Random Town Event for Oxbay
DATE: October 11th, 1665 - Random Town Event for Santiago
DATE: October 11th, 1665 - Random Town Event for Oranjestad
DATE: October 12th, 1665 - Random Town Event for Oxbay
DATE: October 12th, 1665 - Random Town Event for Tortuga
DATE: October 12th, 1665 - Random Town Event for Santiago
DATE: October 12th, 1665 - Random Town Event for Oranjestad
IT dropped low quality weapon (blade2+1) in favor of higher quality (blade2+2)
DATE: October 13th, 1665 - Random Town Event for Falaise de Fleur
DATE: October 13th, 1665 - Random Town Event for Oxbay
DATE: October 13th, 1665 - Random Town Event for Tortuga
DATE: October 13th, 1665 - Random Town Event for Santiago
DATE: October 13th, 1665 - Random Town Event for Oranjestad
DATE: October 14th, 1665 - Random Town Event for Falaise de Fleur
DATE: October 14th, 1665 - Random Town Event for Oxbay
DATE: October 14th, 1665 - Random Town Event for Tortuga
DATE: October 14th, 1665 - Random Town Event for Santiago
DATE: October 14th, 1665 - Random Town Event for Oranjestad
DATE: October 15th, 1665 - Random Town Event for Falaise de Fleur
DATE: October 15th, 1665 - Random Town Event for Oxbay
DATE: October 15th, 1665 - Random Town Event for Tortuga
DATE: October 15th, 1665 - Random Town Event for Santiago
DATE: October 15th, 1665 - Random Town Event for Oranjestad
IT dropped low quality weapon (blade3+1) in favor of higher quality (blade3+2)
IT dropped low quality weapon (pistol1+1) in favor of higher quality (pistol1+2)
DATE: October 16th, 1665 - Random Town Event for Conceicao
DATE: October 16th, 1665 - Random Town Event for Falaise de Fleur
DATE: October 16th, 1665 - Random Town Event for Oxbay
DATE: October 16th, 1665 - Random Town Event for Tortuga
DATE: October 16th, 1665 - Random Town Event for Santiago
DATE: October 16th, 1665 - Random Town Event for Philipsburg
DATE: October 16th, 1665 - Random Town Event for Oranjestad
DATE: October 17th, 1665 - Random Town Event for Conceicao
DATE: October 17th, 1665 - Random Town Event for Falaise de Fleur
DATE: October 17th, 1665 - Random Town Event for Oxbay
DATE: October 17th, 1665 - Random Town Event for Tortuga
DATE: October 17th, 1665 - Random Town Event for Santiago
DATE: October 17th, 1665 - Random Town Event for Philipsburg
DATE: October 17th, 1665 - Random Town Event for Oranjestad
DATE: October 18th, 1665 - Random Town Event for Conceicao
DATE: October 18th, 1665 - Random Town Event for Falaise de Fleur
DATE: October 18th, 1665 - Random Town Event for Oxbay
DATE: October 18th, 1665 - Random Town Event for Greenford
DATE: October 18th, 1665 - Random Town Event for Smugglers Lair
DATE: October 18th, 1665 - Random Town Event for Tortuga
DATE: October 18th, 1665 - Random Town Event for Grand Turk
DATE: October 18th, 1665 - Random Town Event for Santo Domingo
DATE: October 18th, 1665 - Random Town Event for Santiago
DATE: October 18th, 1665 - Random Town Event for Philipsburg
DATE: October 18th, 1665 - Random Town Event for Oranjestad
DATE: October 19th, 1665 - Random Town Event for Conceicao
DATE: October 19th, 1665 - Random Town Event for Falaise de Fleur
DATE: October 19th, 1665 - Random Town Event for Oxbay
DATE: October 19th, 1665 - Random Town Event for Greenford
DATE: October 19th, 1665 - Random Town Event for Charlestown
DATE: October 19th, 1665 - Random Town Event for Smugglers Lair
DATE: October 19th, 1665 - Random Town Event for Tortuga
DATE: October 19th, 1665 - Random Town Event for Grand Turk
DATE: October 19th, 1665 - Random Town Event for Santo Domingo
DATE: October 19th, 1665 - Random Town Event for Santiago
DATE: October 19th, 1665 - Random Town Event for Philipsburg
DATE: October 19th, 1665 - Random Town Event for Oranjestad
DATE: October 20th, 1665 - Random Town Event for Conceicao
DATE: October 20th, 1665 - Random Town Event for Falaise de Fleur
DATE: October 20th, 1665 - Random Town Event for Oxbay
DATE: October 20th, 1665 - Random Town Event for Greenford
DATE: October 20th, 1665 - Random Town Event for Charlestown
DATE: October 20th, 1665 - Random Town Event for Smugglers Lair
DATE: October 20th, 1665 - Random Town Event for Tortuga
DATE: October 20th, 1665 - Random Town Event for Santo Domingo
DATE: October 20th, 1665 - Random Town Event for Santiago
DATE: October 20th, 1665 - Random Town Event for Philipsburg
DATE: October 20th, 1665 - Random Town Event for Oranjestad
DATE: October 21st, 1665 - Random Town Event for Conceicao
DATE: October 21st, 1665 - Random Town Event for Falaise de Fleur
DATE: October 21st, 1665 - Random Town Event for Oxbay
DATE: October 21st, 1665 - Random Town Event for Greenford
DATE: October 21st, 1665 - Random Town Event for Charlestown
DATE: October 21st, 1665 - Random Town Event for Smugglers Lair
DATE: October 21st, 1665 - Random Town Event for Tortuga
DATE: October 21st, 1665 - Random Town Event for Santo Domingo
DATE: October 21st, 1665 - Random Town Event for Santiago
DATE: October 21st, 1665 - Random Town Event for Philipsburg
DATE: October 21st, 1665 - Random Town Event for Oranjestad
DATE: October 22nd, 1665 - Random Town Event for Conceicao
DATE: October 22nd, 1665 - Random Town Event for Falaise de Fleur
DATE: October 22nd, 1665 - Random Town Event for Oxbay
DATE: October 22nd, 1665 - Random Town Event for Greenford
DATE: October 22nd, 1665 - Random Town Event for Charlestown
DATE: October 22nd, 1665 - Random Town Event for Smugglers Lair
DATE: October 22nd, 1665 - Random Town Event for Tortuga
DATE: October 22nd, 1665 - Random Town Event for Santo Domingo
DATE: October 22nd, 1665 - Random Town Event for Santiago
DATE: October 22nd, 1665 - Random Town Event for Philipsburg
DATE: October 22nd, 1665 - Random Town Event for Oranjestad
DATE: October 23rd, 1665 - Random Town Event for Conceicao
DATE: October 23rd, 1665 - Random Town Event for Falaise de Fleur
Quest name fetch_quest_created FOUND in CommonQuestComplete
DATE: October 23rd, 1665 - Random Town Event for Oxbay
DATE: October 23rd, 1665 - Random Town Event for Greenford
DATE: October 23rd, 1665 - Random Town Event for Charlestown
DATE: October 23rd, 1665 - Random Town Event for Smugglers Lair
DATE: October 23rd, 1665 - Random Town Event for Tortuga
DATE: October 23rd, 1665 - Random Town Event for Santo Domingo
DATE: October 23rd, 1665 - Random Town Event for Santiago
DATE: October 23rd, 1665 - Random Town Event for Philipsburg
DATE: October 23rd, 1665 - Random Town Event for Oranjestad
DATE: October 24th, 1665 - Random Town Event for Conceicao
DATE: October 24th, 1665 - Random Town Event for Falaise de Fleur
DATE: October 24th, 1665 - Random Town Event for Oxbay
DATE: October 24th, 1665 - Random Town Event for Greenford
DATE: October 24th, 1665 - Random Town Event for Charlestown
DATE: October 24th, 1665 - Random Town Event for Smugglers Lair
DATE: October 24th, 1665 - Random Town Event for Tortuga
DATE: October 24th, 1665 - Random Town Event for Santo Domingo
DATE: October 24th, 1665 - Random Town Event for Santiago
DATE: October 24th, 1665 - Random Town Event for Philipsburg
DATE: October 24th, 1665 - Random Town Event for Oranjestad
At the beginning, there are only a couple of towns that have random events on a day, but it becomes more and more.
 
It's because encounterbreak is 0 if the opensea mod is not active ... at least if I trace it I get a 0 value.
Check if like this
Code:
//Add a multiplier for the OPEN SEAD MOD
    int multiplier = 1;
    if(OPEN_SEA_MOD) multiplier = EVENT_CHANCE_OPEN_MULT;
    //Add a check to see if a smuggeling quest is active
    bool nosmuggle = true;
    if(CheckAttribute(Pchar, "quest.Contraband.Active"))
    {
        if(Pchar.quest.Contraband.Active) nosmuggle = false;
    }
    //Check if we can launch an event.
    Trace("encounter break " + ENCOUNTERBREAK + " day " + day + " +  " +(EVENT_PER_DAYS*multiplier) + " <  " + yeardays);
    if((day + (EVENT_PER_DAYS*multiplier)) < yeardays && nosmuggle)
    {
        Trace("passed");

I sugest we do use the EVENT_CHANCE_OPEN_MULT now, or if you know for sure the encounterbreak is not 0 with open sea mod active then change it at the other place (multiplier = ) and keep multiplier in the if statement.

just checked but encounter break only is 1 if open sea mod is active. so for now I'd say keep it like this.

Edit 2 ... hmmm... the if(OPEN_SEA_MOD) doesn't seem to pick up if the open sea mod is active or not. if I use iron man at least. So maybe we should use encounter break to check if it's active then.
 
ENCOUNTERBREAK is defined in PROGRAM\NK.c:
Code:
void InitOpenSeaMod()
{
   ref PChar = GetMainCharacter();
   if(iRealismMode>1 || OPEN_SEA_MOD)
   {
[...]
     ENCOUNTERBREAK =                   3.0;   // LDH - Changed to float, number is hours per encounter, directsail is called every 5 minutes occasionally
[...]
   }
   else
   {
[...]
     ENCOUNTERBREAK =                   1.0;   // LDH - Changed to float, number is hours per encounter, directsail is called every 5 minutes occasionally
[...]
   }
}
As you can see, it should never be 0.

Also, the if-statement should read the same as the one in InitOpenSeaMod .
However, using ENCOUNTERBREAK bypasses that completely, making another if statement superfluous.
 
Code:
    //Add a multiplier for the OPEN SEAD MOD
    int multiplier = 1;
    if(iRealismMode>1 || OPEN_SEA_MOD) multiplier = EVENT_CHANCE_OPEN_MULT;
    //Add a check to see if a smuggeling quest is active
    bool nosmuggle = true;
    if(CheckAttribute(Pchar, "quest.Contraband.Active"))
    {
        if(Pchar.quest.Contraband.Active) nosmuggle = false;
    }
    //Check if we can launch an event.
    if((day + (EVENT_PER_DAYS*multiplier)) < yeardays && nosmuggle)
    {

do it like this, it should work then.

I know encounter break shouldnt be 0 but it does show like it. Probally cause its a float it doing anoying things. if you wanna do float * int you need to be very carefull.
I know this way it works for sure so I'd say for now lets do it like this and lets check for it later. to see if we can "improve" it.
 
Apparently I was wrong. While the game does manage to get "easily" past if((day + (EVENT_PER_DAYS*ENCOUNTERBREAK)) < yeardays && nosmuggle) ,
nothing actually happens until after if(random >= 0) . And that does NOT easily occur. In one month, I've now had that happen only once.

I know encounter break shouldnt be 0 but it does show like it. Probally cause its a float it doing anoying things. if you wanna do float * int you need to be very carefull.
I know this way it works for sure so I'd say for now lets do it like this and lets check for it later. to see if we can "improve" it.
My compile.log is showing stuff like:
Code:
encounter break 1. day 279 +  45. <  286
So I don't know why it is working as 0 for you. For me that part seems to be fine. o_O

Edit: Just tested with Open Sea Mod ON:
Code:
encounter break 3. day 268 +  135. <  290
Again, looks fine.
 
Last edited:
hmmm.....my compile log gives break 0. for arcade mode.
Code:
encounter break 0. day 28 +  45 <  74

On iron man it does show 3.0
It could be the first time it shows 0 and then after it it will show 1. Then its because the openseainit is later then the first time the shops are initialized.
I think that's the problem yes. So that means the first time a few more events could be generated but that's not such a problem I think. Still the random function will filter out a lot so probally only 1 or 2 events will be generated at max. And after that it should check for the date right.
 
That would indeed be possible. Easily rectified by setting float ENCOUNTERBREAK = 1.0; in CCCdirectsail.c .
 
After a pleasant direct sail trip from Sao Jorge to San Juan, with stops at St. Pierre and Nevis in the Open Sea mod I have some thoughts.

It is now possible to make money by buying cargo at one place and selling it at another. I just hit the $1,000,000 mark for the first time!

Land combat seems much easier than it was. Normally at the difficulty and level I am at combat is pretty much impossible, but now it is reasonable. It has been like this for some time too.

When leaving Nevis after visiting Clint Eastwood I got too close to the Charlestown fort. My ship was getting hit from approx. 2,000 yards. Has the forts cannon range been increased? I am not complaining, but just need to know.

There seems to be almost no clutter around the islands now. There has been too much since last December and I suspect some will complain that there is not enough now. Could a middle amount be reached?

Oh yeah. Where does the tailor shop money go?
 
When leaving Nevis after visiting Clint Eastwood I got too close to the Charlestown fort. My ship was getting hit from approx. 2,000 yards. Has the forts cannon range been increased? I am not complaining, but just need to know.
We halved the range last year and it hasn't been touched since.
Possibly the Charlestown fort is just so high up that in fires further?

There seems to be almost no clutter around the islands now. There has been too much since last December and I suspect some will complain that there is not enough now. Could a middle amount be reached?
Clutter? What clutter? You mean other ships? Should still be 6 Coast Raiders per island. Hasn't been touched. :shrug
 
I don't really understand the new dynamic economy, I will try to read the posts and catch up. I do notice that the contraband goods are all changed from before. My only comment is give the history of the Spanish Main I don't thing that is realistic to have the Spanish colonies importing gold or sliver since Spain's new world colonies had very nearly all of the mineral wealth in the new world.
 
Simply put, the dynamic economy makes the import/export products change occasionally, depending on random town events.
This should happen only occasionally though. It also means that, for example, when malaria strikes a town, they'll be importing medicine for a while.
 
Back
Top