In the meantime, that Cannons interface is doing my head in. I'm NOT an interface expert and it is behaving REALLY weird.
I think I might have done it! Both for friendly shipyards (regular price) AND hostile ones (double price).
Included in my file here:
http://www.piratesahoy.net/threads/...-version-2-available.20513/page-3#post-450747
----> WARNING! The following is a short (really?) explanation of what I have done to the Shipyard Interface; skip over this if you don't care
First, I disabled ALL tradeHigh multiplications, which were spread out over the entire shipyard interface file, then added it instead in a global file similar to how it is handled for the ship repair function.
Then I noticed that a lot of the cannon purchase/sell calculations were using the price straight from the init value, instead of applying the player's commerce skill as intended.
Once that was both rectified, at tradeHigh, cannons would also SELL for double price. Next thing you know, every time you add a cannon, it does so at double price,
but remove a cannon and it is at less than regular price. So just clicking left and right a few times could get you to lose insane amounts of money.
So I had to redo the entire price calculation code there so it would use double price when you're actually BUYING and using single price when SELLING.
And if you might think that should solve the whole thing, turns out that was only the
beginning of the troubles.
The code defining whether you can use the various buttons and what explanatory tips show up didn't exactly do what it was supposed to either.
And then there was the WORST part in trying to get the on-screen texts and money values to all match up with what they
should be.
Especially
after doing a cannon transaction.
----> NOTE: Explanation completed. You can safely continue reading....
Needless to say.... it was an incredible pain to get as far as this. But I've tested it for a bit and it is behaving a lot more sensible now.
If you do your tests properly, you might even end up seeing a couple of help texts that I don't think would ever show up before, indicating the maximum number of cannons you can afford.
This is especially obvious when you get rid of ALL cannons on your ship and don't have enough money for a full new set of cannons.
Also new is that for your own cannon type, it will no longer show your MAXIMUM cannons for "Install All", but only the MISSING number of cannons.
This seems to make more sense to me as that number matches with the amount of gold listed right next to it.
Since cannons now properly take into account your commerce skill
and always sell at less than 75% of their purchase value, you should have a REALLY hard time of making money from them!
So here's to hoping you don't manage to break it
too badly....
