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

Included in Build Different Shipyard Sale Prices for Naval Officers/Privateers

We could also have the functionality work EXACTLY as you suggest there.
So rather than storing whether a ship was pirated or an honest prize ship, not bothering with that at all.
That would actually be simpler than storing it correctly at the time you get the ship and then using that status later when you try to sell her.
Less fancy as well, but probably more logical and realistic. Perhaps easier for the player to understand as well?
It doesn't really matter how the game figures out whether the ship was pirated, captured or purchased, and the player certainly won't know the mechanism.

You'll still need somehow to store the fact that a ship was purchased.

One thing to consider is what happens if you take a ship legally under a LoM and then somehow lose the LoM before you sell the ship (e.g. resign from the nation's service, or you're playing "Tales of a Sea Hawk" and have just lost your British LoM when you try to get the golden idol in Bridgetown). The ship was taken legally but you don't have a LoM to show the shipyard owner, who therefore regards the ship as pirated. This may or may not be a desirable feature - it's consistent with my logic above but may annoy a player who thinks he's about to sell a legal prize and then gets accused of piracy...
 
It doesn't really matter how the game figures out whether the ship was pirated, captured or purchased, and the player certainly won't know the mechanism.
Based on that, I'm inclined to go with the simplest solution which is to determine everything at the time of sale instead of at the time of capture.

You'll still need somehow to store the fact that a ship was purchased.
Absolutely. That is already in place and will have to stay. :yes

One thing to consider is what happens if you take a ship legally under a LoM and then somehow lose the LoM before you sell the ship (e.g. resign from the nation's service, or you're playing "Tales of a Sea Hawk" and have just lost your British LoM when you try to get the golden idol in Bridgetown). The ship was taken legally but you don't have a LoM to show the shipyard owner, who therefore regards the ship as pirated. This may or may not be a desirable feature - it's consistent with my logic above but may annoy a player who thinks he's about to sell a legal prize and then gets accused of piracy...
The same thing occurred to me. Might be annoying, but to me also makes quite a lot of sense.
After all, how should the shipyard owner know how you got the ship if you, as you say, "don't have the papers"?

I'm also not sure if players even take note of how they got the ship themselves and whether they noticed the difference in sale price that creates.
So probably I'll just set something up that is as simple as possible and then we'll await player feedback before making it more fancy again.
 
I'm also not sure if players even take note of how they got the ship themselves and whether they noticed the difference in sale price that creates.
So probably I'll just set something up that is as simple as possible and then we'll await player feedback before making it more fancy again.
They might not notice the price difference but they'll certainly notice if you change the "Sell" label to say whether they're selling a purchased, prize or pirated ship. Especially if you later implement consequences for selling a pirated ship. ;)

So we may as well decide at this stage whether, if you captured a ship under a LoM and then lost the LoM, the shipyard should regard the ship as prize or pirated. That lays the groundwork for future development.
 
They might not notice the price difference but they'll certainly notice if you change the "Sell" label to say whether they're selling a purchased, prize or pirated ship.
That is what I'm counting on! If we add cool and interesting features, it is better if the players NOTICE! :cheeky

Especially if you later implement consequences for selling a pirated ship. ;)
*Insert Evil Laugh* :whipa

So we may as well decide at this stage whether, if you captured a ship under a LoM and then lost the LoM, the shipyard should regard the ship as prize or pirated. That lays the groundwork for future development.
Unless anyone REALLY wants me to do it differently, I'll base it on your legal status when you actually make the sale.
That is simpler to code, prevents spreading the related code over multiple files and hopefully makes it a bit more transparent to players too.

We DO have a "more fancy" system in place right now which could be adapted to actually base this on whether your capture was an act of piracy or not.
I already had a look into that and have got a fair idea of how to do that. Should not be too difficult, but if we don't need to, then why bother at all? :wp
 
Big discussion for future development moved to its own thread here: Feature Request - Improve Consequences from Sea Battles | PiratesAhoy!

As for the feature at hand, I am intending to make the following changes:
- Add a text to the shipyard "Buy" button to indicate the status of that ship "Purchased/Prize/Pirated"
- Have the prices depend on that in a more direct way (I think currently the code is doubling up a bit on its own)
- Depending on what I feel like doing, I might link this to the status AT THE TIME OF CAPTURE or AT THE TIME OF SALE
If anyone has any preference for either of those two, now would be a good time to mention it. ;)
 
If you haven't done it yet please use the at the time of capture link.
 
If you haven't done it yet please use the at the time of capture link.
Nope, didn't do it yet because I got distracted by the whole sudden "game performance skill rewrite".
I'll try to do that "time of capture" link. Should be possible and if we decide to use the alternate approach, it is always easier to simplify later...
 
Time of capture makes more sense to me, even if , for instance, two (game) years later you have forgotten how you got a ship as @Grey Roger said you wouldn't have the papers (unless of course they carried them on the ship and you "persuaded" the captain to sign them over). The behaviour you are planning to program in greying buttons etc would remind the player they didn't acquire the ship in an approved manner.
 
The behaviour you are planning to program in greying buttons etc would remind the player they didn't acquire the ship in an approved manner.
For now I'm just planning to change the text on the "Sell" button and update the price to match, but not actively prevent it.
Not for this update anyway. Probably best to allow the players to evolve along with the updates.... :wp
 
So I got started on this and got so far that UpdateRMRelation will now return 'true' or 'false' depending on whether this was an Unrespectable Act/Act of Piracy or a Valid attack.
I made some additional slight simplifications to that functionality too.
Unfortunately that is the point where I got side-tracked by the various recently-reported bugs that needed fixing.

The following still needs doing:
- Carrying the output from "UpdateRMRelation" so that it gets into "ShipTaken" and subsequently can be used to assign the appropriate attribute to shipsNewOwner
Usually this takes place in the "ransack_main.c" interface file.
However, another call to ShipTaken occurs in Cabinfight_dialog.c that seems to happen when you ask the captured captain to stay on as captain but work for you instead.
At the moment that doesn't affect the "pirated"/"captured" state of the ship, but probably should do. This is to be added too.
- Modify the shipyard sale prices so that this is taken into account properly without doubling up the effects.
- Change the "Sell" button text to indicate how you got the ship and help explain the difference in price.
(Additionally, having it say "Action Prize Ship" may add some nice extra atmosphere too. ;) )
- Possibly have something in F2>Ship indicating the source of the ship too. (Up for debate; would that really be necessary?)
 
This has been DONE and is available for testing in this update:
Mod Release - Build 14 Beta 4 Internal WIP For Testing | PiratesAhoy!

With this update, the "ship acquired" status is now based on the "unrespectable act" functionality that was recently introduced.
This affects ship sale prices as discussed before AND this is now indicated by the renamed "Sell" button.

This became rather a complex affair, but I reckon I managed to come up with something that does make some measure of internal sense.

Ship sale prices:
- 100% sale price (minus skill and ability effects) for ships that were always yours
- 80% sale price (minus skill and ability effects) for ships you purchased
- 50% sale price (SKIPPING skill and ability effects) for legal price ships
- 20% sale price (minus skill and ability effects) for pirated ships if you did NOT join the pirates
- 80% sale price (minus skill and ability effects) for pirated ships if you DID join the pirates

These percentages affect the pricing of the bare hull, any upgrades and cannons installed.
These percentages do NOT affect selling of the cargo still on board.

This whole feature (combined with Included in Build - Merchant Gameplay | PiratesAhoy!) did become rather complicated and confusing at some point.
Therefore I would certainly welcome someone to double-check my logic and ensure it doesn't actually end up doing anything stupid and unintentional. :facepalm

@pedrwyth, would you be willing to have a look at it by any chance?
All you need to do is to WinMerge my latest ZIP with the latest EXE to see what I did.
 
Made a start on this but not quite that simple as a one file winmerge. things like extending the variables in GetCharPriceMod got me away to see where it's defined (and where else called) but since I haven't loaded the zip into the game (so I can compare) my windows search shows me my unaltered files which I then have to find in the ZIP - all good fun really.

One thing that confuses me is the skills being taken off a price rather than improving what you get - no doubt it will become clear as I follow the trail. EDIT Of course the modifier is reducing the price so perhaps they are reducing the reduction as it were - I'll look again.

I presume you get less for a bought ship than an "original" to introduce the loss on taking it out the showdock (to use a car analogy) but then your original is a used vessel too?
 
Made a start on this but not quite that simple as a one file winmerge. things like extending the variables in GetCharPriceMod got me away to see where it's defined (and where else called) but since I haven't loaded the zip into the game (so I can compare) my windows search shows me my unaltered files which I then have to find in the ZIP - all good fun really.
You know WinMerge can compare folder contents, right?
Just compare the PROGRAM folder in the ZIP with your own one and you should be able to find all the changes.

One thing that confuses me is the skills being taken off a price rather than improving what you get - no doubt it will become clear as I follow the trail. EDIT Of course the modifier is reducing the price so perhaps they are reducing the reduction as it were - I'll look again.
Lower skills = higher buy prices and lower sell prices.

I presume you get less for a bought ship than an "original" to introduce the loss on taking it out the showdock (to use a car analogy) but then your original is a used vessel too?
The difference between "owned" (100%) and "bought" (80%) is a bit arbitrary.
There was a number already in InternalSettings.h that I figured I'd keep combined with "owned" which happens if a ship doesn't have an "acquired" attribute at all.
This probably happens only at game start (gives beginning players a 20% bonus in ship value if they decide to sell) or when you get a special ship for quest purposes.
Generally should not happen very much. The two could be joined, I suppose. :shrug
 
Got fed up of trying to reverse engineer the wheel (aka tracing code just in case there might be a flaw "somewhere").

So i started using your ShipAcquiredState call at the bottom of the shipyard file to set different acquired states - after adding a call to delete it first and just test functionality. My first (and only) bought ship looked to have the right ratios for given states ( i wasn't proceeding with the sale so I could check the next case value with the same ship - I took skills out of the equation too) but the "owned" ship from the start didn't give the right results.

However haven't got further into that yet because I just noticed that if you sell your ship you get to buy replacements for 0. Don't think it's me cause I put your shipyard.c back undoctored and got the same.

EDIT Hmm Hold on this for a minute even a new game seems affected - must be something I've done. I'll try re-install and report back

PS the owned ship variation could be due to the cargo allowance - I'll check that too before I post again
 
Last edited:
So i started using your ShipAcquiredState call at the bottom of the shipyard file to set different acquired states - after adding a call to delete it first and just test functionality. My first (and only) bought ship looked to have the right ratios for given states ( i wasn't proceeding with the sale so I could check the next case value with the same ship - I took skills out of the equation too) but the "owned" ship from the start didn't give the right results.
I did some similar tests while doing my work, but didn't actually perform those tests on the final version of the code.
It did seem to start behaving itself in the end though.

However haven't got further into that yet because I just noticed that if you sell your ship you get to buy replacements for 0. Don't think it's me cause I put your shipyard.c back undoctored and got the same.
What do you mean with "buy replacements"? That does indeed sound VERY bizarre!
 
I did some similar tests while doing my work, but didn't actually perform those tests on the final version of the code.
It did seem to start behaving itself in the end though.


What do you mean with "buy replacements"? That does indeed sound VERY bizarre!
I mean sell one and immediately buy a different ship for the same captain BUT see my edit above. Just leave me with it for now I'm sure it will probably turn out to be fine in the end:)
 
Hmm well i checked the owned ship having taken the cargo off and it does seem nearer the ratios but am having some issues with the price for removing cannons. WIP.

However a full re-install still has selling your ship allowing purchases for 0 - so a genuine bug I think.
 
However a full re-install still has selling your ship allowing purchases for 0 - so a genuine bug I think.
You're right.
Did you happen to test without my extra ZIP fixes?
That would tell us if it is something I broke or if just nobody found that bug until now.
 
Back
Top