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

Fixed Ships with no HP or speed in Shipyard

Wolve

Sailor
Ahoi!
I just captured my first colonie (yay:dance) and went to the shipyard for repairs.
While browsing the ships there, I noticed some had no HP for the hull or no speed indicated.



I bought one with no speed (thought it might be visual) but indeed when using full sails the ship doesnt move as can be seen below:


It's not affecting all ships, just a few it seems.
 
Can you confirm that it is only those ships that are marked as "Personal design"?
That seems to me the most likely cause.
 
I think the reason is because "personal" has no national modifiers defined at the top of PROGRAM\Ships\ships_init.c .

Should be a quick fix to try adding that.
 
@Wolve: If you like, have a look at that file and see if you can figure it out. If you have any questions, post here.
The relevant section is found quite close to the top and has "scalars/modifiers" for each nation in the game.
 
Sure if I get tired of studying I can try to figure some stuff out.

Would it be cool if you would get a nation modifier for your own nation based on what background you chose at the start of a game?
For example starting as a merchant or smuggler will give you increased cargo space while reducing crew capacity/agility of the ship, starting as a sailor will give you more agile ships while reducing ship HP or something.
Would give the way you start a game a bigger impact (and more fun in my opinion)
 
Would it be cool if you would get a nation modifier for your own nation based on what background you chose at the start of a game?
For example starting as a merchant or smuggler will give you increased cargo space while reducing crew capacity/agility of the ship, starting as a sailor will give you more agile ships while reducing ship HP or something.
Would give the way you start a game a bigger impact (and more fun in my opinion)
I don't think that's going to happen. Game code is probably not set up to allow that.

My idea was to just set the modified to 1.0 for everything. Not sure if any of the other nations has that yet....
 
It was just an idea :) if it's no possible with the game code thats fine.
I got no clue what kind of coding language you are using, but wouldn't it be possible as the background choice is stored somewhere to set the bonus exp to some skills to just use an if-else construction to set values to the modifiers? (I'm only familiar with Matlab/Python and basic JAVA)
1.0 seems to be ok I guess (would be the most balanced option).
 
The game code is a variation on C; it is quite similar to Matlab, really (which was a tremendous help when I had to start using Matlab after having never heard of that).

The reason why it may not be so simple is because of where those national modifiers are used.
They're part of the ship initialization code and I'm not sure if putting variable-dependent switch statements in there would quite work.

Why don't you try? Once you've found the code, it should be quite easy.
I can tell you which variable stores the starting choice as well.
 
I've been looking at the ships_init.c and indeed there is no 'personal' faction mentioned when allocating multipliers.
I don't see where the script is using the multiplier values, is that in a different script? I dont think an if-else construction there is difficult, it just uses a lot of space :p.
Also it seems that the missing values are quite random (not all assigned 0 at once) which is kinda wierd if it was just because there was no faction multiplier right?
 
That multipliers are used in other spots in several ways.

If you insits, you can try a switch statement for personal nation.

First thing to do would be to add it with 1.0 though and see if that does solve the problem.
 
Would it not depend on which is run first? If "Ships_init.c" is run before you have chosen your background then it can't set multipliers based on your background!

The other problem is that the variables which store national modifiers seem to be tied to nation values. ENGLAND is 0, FRANCE is 1, SPAIN is 2, etc. English modifiers are 'shipstatsmult.n0.<attribute>', French modifiers are 'shipstatsmult.n1.<attribute>', Spanish modifiers are 'shipstatsmult.n2.<attribute>', etc. PERSONAL_NATION is -1. Would 'shipstatsmult.n-1.<attribute>' work?
 
Good point on what script will be run first. But I guess it would only be run after you start a game (hence the background is set).
I got no idea if the code can handle a n-1.
And I'm not insisting, just trying to find possible improvements :) You got more experience with coding than I so if you say it can't be done then that's that.
But shouldn't there be some personal modifiers coded somewhere already? Else there should be errors for sure when trying to initialize a ship of personal design.
 
That was a question directed at the truly experienced coders, not a statement! I don't know which order the scripts run when the game starts, and I don't know whether or not 'shipstatsmult.n-1' would work.
 
Would it not depend on which is run first? If "Ships_init.c" is run before you have chosen your background then it can't set multipliers based on your background!
Very true.

But I guess it would only be run after you start a game (hence the background is set).
The ships are initialized already BEFORE you get to set the background, because the Select Storyline interface needs the ship data.
There is a good chance that the ships are re-initialized afterwards again, but it doesn't simplify your request.

Anyway: Priority should be to have it functional at all.

ut shouldn't there be some personal modifiers coded somewhere already? Else there should be errors for sure when trying to initialize a ship of personal design.
When do ships of personal design ever get initialized? Virtually never. ONLY when the town is yours, but players don't often get that far.

The other problem is that the variables which store national modifiers seem to be tied to nation values. ENGLAND is 0, FRANCE is 1, SPAIN is 2, etc. English modifiers are 'shipstatsmult.n0.<attribute>', French modifiers are 'shipstatsmult.n1.<attribute>', Spanish modifiers are 'shipstatsmult.n2.<attribute>', etc. PERSONAL_NATION is -1. Would 'shipstatsmult.n-1.<attribute>' work?
It uses numbers? Bugger; I had hoped for nation IDs. Couldn't remember. :facepalm

Someone would need to check the code to see how exactly it is used and see what does and doesn't work.
Probably PROGRAM\Ships\ships.c is the one that actually does it.

Maybe "-1" does work there. But I'm not sure....
 
It uses numbers? Bugger; I had hoped for nation IDs. Couldn't remember. :facepalm
Nation ID's are numbers, defined in "globals.c":
Code:
#define ENGLAND  0
#define FRANCE  1
#define SPAIN  2
...

Someone would need to check the code to see how exactly it is used and see what does and doesn't work.
Probably PROGRAM\Ships\ships.c is the one that actually does it.

Maybe "-1" does work there. But I'm not sure....
It might at that. As an example from 'arSetRandomStatsToShip':
Code:
  if(!CheckAttribute(shipstatsmult,"n"+nat)) return; // 04-09-10 if no mult for nation, return. Whoops!
  aref natstats; atrstr = "n" + nat;makearef(natstats, shipstatsmult.(atrstr)); //these are our multipliers
'nat' is an integer argument to 'arSetRandomStatsToShip'.
 
Imo it is quite easy to capture a Colonie (you can do it with just 2 tier 3 ships on Sea Dog difficulty), so I guess more will run into this problem.
Easiest way to solve this: disable to capture the colonie for yourself and force to assign it to an existing nation.
 
Nation ID's are numbers, defined in "globals.c":
Depends on what you call an "ID". Nations.c has a function that returns "nation IDs" and that one returns strings.
The numbers are what I would call "nation index".

Anyway, doesn't exactly matter. :cheeky

It might at that. As an example from 'arSetRandomStatsToShip':
Code:
if(!CheckAttribute(shipstatsmult,"n"+nat)) return; // 04-09-10 if no mult for nation, return. Whoops!
aref natstats; atrstr = "n" + nat;makearef(natstats, shipstatsmult.(atrstr)); //these are our multipliers
'nat' is an integer argument to 'arSetRandomStatsToShip'.
Indeed that DOES look promising.

Imo it is quite easy to capture a Colonie (you can do it with just 2 tier 3 ships on Sea Dog difficulty), so I guess more will run into this problem.
Easiest way to solve this: disable to capture the colonie for yourself and force to assign it to an existing nation.
That would be a huge lost feature. And if it can be easily solved by adding those 'shipstatsmult.n-1.<attribute>' lines, then that should be a much better solution.

Adding those in ships_init.c should be quite straightforward.
Then if it works, pressing F11 should make it take effect on a savegame and hopefully all ships generated afterwards will be OK.
 
Ok this didnt work: shipstatsmult.n-1.whateversomething
Loaded a save, pressed F11, moved to tavern, F11 again, stayed there for a night or 2 to generate new ships, still 0 values sometimes.
Good news is the game didnt crash either. How should I change the n-1? Any clue?
 
Back
Top