Indeed. Today I'm very proud of having got my first for() function to work.There's a lot to learn, even after more than ten years.
Took only 10 years.
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!
Quick links for Beyond New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
- Bug Tracker on Github
Quick links for Maelstrom
- Download the latest version of Maelstrom
- Download the latest version of ERAS II
- Download the latest version of New Horizons on Maelstrom
Quick links for PotC: New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
Thanks to YOUR votes, GOG.com now sells:
- Sea Dogs
- Sea Dogs: Caribbean Tales
- Sea Dogs: City of Abandoned Ships
Vote now to add Pirates of the Caribbean to the list!
Quick links for AoP2: Gentlemen of Fortune 2
- Downloads and info
- ModDB Profile
- Forums Archive
A Pirate Podcast with Interviews
Music, Comedy and all things Pirate!
- Episode Guide - About - Subscribe -
- Twitter - Facebook - iTunes - Android -
- Youtube - Fill the Coffers -
Indeed. Today I'm very proud of having got my first for() function to work.There's a lot to learn, even after more than ten years.
Congratulations! Those are good ones. Not always very efficient, but EXTREMELY powerful!Indeed. Today I'm very proud of having got my first for() function to work.
Took only 10 years.
Here's another thought:I just put that in my game version; looking good!
Then we'd just need to check that Aubrey gets his right ships too and add this "Robert Fulton" character.
Possible. Could be fun. I wasn't sure if we should give the ship to him straight away or not.Here's another thought:
Don't make Fulton a naval officer at all. If the entire point is to make it easier to get the steam frigate, especially if you're going to give it to him right away, then define a new free play character type, "Inventor". Use one of the model variants of Clement Aurentius. Give him low sailing and leadership skills so that, as a civilian who is testing his new design for the first time, he is barely capable of steering it.
This is the page I used for that before: http://www.ctbasses.com/misc/BruceTrinque/aubrey4.htmlAs for Aubrey, let me have a full list of his ship names and types, and I'll add them.
Why not do both? Define the Inventor character type who jump starts straight to a steam frigate but has poor sailing and leadership, so he can't use it very well at first; and also define our own fictitious naval officer who gets an exception at rank 6 to guarantee him a steam frigate, otherwise he uses regular American promotion ships. Just so long as regular officers don't get steam frigates more often and they don't show up more often as non-player ships.Possible. Could be fun. I wasn't sure if we should give the ship to him straight away or not.
With a Naval Officer, we have the system in place to give the ship some time later as well.
Looking through that, Aubrey seems to have had numerous short term commands but then generally returning to the Surprise, which is only a Unite class frigate so would short-change him at higher ranks. I suggest:This is the page I used for that before: http://www.ctbasses.com/misc/BruceTrinque/aubrey4.html
Sounds OK to me! We'd get two extra characters instead of one, which could clutter up the starting choices.Why not do both? Define the Inventor character type who jump starts straight to a steam frigate but has poor sailing and leadership, so he can't use it very well at first; and also define our own fictitious naval officer who gets an exception at rank 6 to guarantee him a steam frigate, otherwise he uses regular American promotion ships. Just so long as regular officers don't get steam frigates more often and they don't show up more often as non-player ships.
Sounds good to me! Though RN_Warship is quite an ugly model, so if you can find an alternative for that one, that might be welcome.Looking through that, Aubrey seems to have had numerous short term commands but then generally returning to the Surprise, which is only a Unite class frigate so would short-change him at higher ranks. I suggest:
Start at rank 3 (Lieutenant) with HMS Sophie (HMS_Sophie), then the following promotion list:
4 / Senior Lieutenant: HMS Polychrest (RN_Volage, preferably a variant with carronades)
5 / Commander: HMS Surprise (RN_Surprise)
6 / Post Captain: HMS Leopard (RN_Warship)
7 / Commodore: companion HMS Diane (RN_Essex)
8 / Rear Admiral: HMS Bellona (HMS_Bellona)
9 / Vice Admiral: companion HMS Pomone (RN_Essex or RN_BattleFrigate)
10 / Admiral: companion HMS Suffolk (RN_Superbe)
As far as I can tell from the list, Aubrey never got anything bigger than a 3rd rate, so he has to do what Dutch and Portuguese officers do anyway, which is get an extra companion ship.
How's this for starters?Why not do both? Define the Inventor character type who jump starts straight to a steam frigate but has poor sailing and leadership, so he can't use it very well at first; and also define our own fictitious naval officer who gets an exception at rank 6 to guarantee him a steam frigate, otherwise he uses regular American promotion ships. Just so long as regular officers don't get steam frigates more often and they don't show up more often as non-player ships.
It's not as sleek as a frigate, but that's the point - Aubrey didn't get a frigate at that time, he got a ship of the line, and according to the quote in the list, Leopard was indeed not a pretty ship.Sounds good to me! Though RN_Warship is quite an ugly model, so if you can find an alternative for that one, that might be welcome.
if (GetMySimpleName(PChar) == "Horatio Hornblower")
{
GiveShip2Character(PChar, "HMS_Bellona", "Sutherland", -1, ENGLAND, true, false); // Bellona class 3rd Rate
}
else if (GetMySimpleName(PChar) == "Jack Aubrey")
{
GiveShip2Character(PChar, "HMS_Bellona", "Bellona", -1, ENGLAND, true, false); // Bellona class 3rd Rate
}
else
{
[other stuff]
}
switch (GetMySimpleName(PChar))
case "Horatio Hornblower":
GiveShip2Character(PChar, "HMS_Bellona", "Sutherland", -1, ENGLAND, true, false); // Bellona class 3rd Rate
break;
case "Jack Aubrey":
GiveShip2Character(PChar, "HMS_Bellona", "Bellona", -1, ENGLAND, true, false); // Bellona class 3rd Rate
break;
[other stuff]
You don't even need the extra else there. This would work:Programming question - is this structure legal?
Code:if (GetMySimpleName(PChar) == "Horatio Hornblower") { GiveShip2Character(PChar, "HMS_Bellona", "Sutherland", -1, ENGLAND, true, false); // Bellona class 3rd Rate } else if (GetMySimpleName(PChar) == "Jack Aubrey") { GiveShip2Character(PChar, "HMS_Bellona", "Bellona", -1, ENGLAND, true, false); // Bellona class 3rd Rate } else { [other stuff] }
if (GetMySimpleName(PChar) == "Horatio Hornblower")
{
GiveShip2Character(PChar, "HMS_Bellona", "Sutherland", -1, ENGLAND, true, false); // Bellona class 3rd Rate
}
if (GetMySimpleName(PChar) == "Jack Aubrey")
{
GiveShip2Character(PChar, "HMS_Bellona", "Bellona", -1, ENGLAND, true, false); // Bellona class 3rd Rate
}
else
{
[other stuff]
}
if (GetMySimpleName(PChar) == "Horatio Hornblower")
{
GiveShip2Character(PChar, "HMS_Bellona", "Sutherland", -1, ENGLAND, true, false); // Bellona class 3rd Rate
}
else
{
if (GetMySimpleName(PChar) == "Jack Aubrey")
{
GiveShip2Character(PChar, "HMS_Bellona", "Bellona", -1, ENGLAND, true, false); // Bellona class 3rd Rate
}
else
{
[other stuff]
}
}
That looks even better! Also allows easily adding more characters in the future without heavily rewriting the code.Or can I do something like:
So that if the character name matches one of the cases then it will give him the relevant ship, otherwise it drops through to [other stuff], which is the period-dependent switch and cases for regular officers.Code:switch (GetMySimpleName(PChar)) case "Horatio Hornblower": GiveShip2Character(PChar, "HMS_Bellona", "Sutherland", -1, ENGLAND, true, false); // Bellona class 3rd Rate break; case "Jack Aubrey": GiveShip2Character(PChar, "HMS_Bellona", "Bellona", -1, ENGLAND, true, false); // Bellona class 3rd Rate break; [other stuff]
switch (GetMySimpleName(PChar))
{
case "Horatio Hornblower":
GiveShip2Character(PChar, "HMS_Bellona", "Sutherland", -1, ENGLAND, true, false); // Bellona class 3rd Rate
break;
case "Jack Aubrey":
GiveShip2Character(PChar, "HMS_Bellona", "Bellona", -1, ENGLAND, true, false); // Bellona class 3rd Rate
break;
// default:
[other stuff]
}
Thanks! Yes, that's exactly why I wanted to replace it with a "switch" section. It was already about to get very messy using "if" to do different things for different commodores, the problem being I can't just add a simple line at the bottom of that rank's promotions because by default they get a companion ship whereas Hornblower and Aubrey are both getting a new single ship. Commodore Nelson, by contrast, gets a frigate as a companion so he fits into the normal structure much more easily. So at Commodore level, any new character who gets a single ship does it via another "case", whereas any new character who gets a companion ship can be added with a simple "if" statement along with Nelson's.That looks even better! Also allows easily adding more characters in the future without heavily rewriting the code.
In fact, I think I had a switch exactly like that one in the Free Play StartStoryline.c for a while until I figured out we didn't actually need it there.
But it does work.
Getting better and better!Try this. A couple of ships have been switched round between "Revolutions" and "Napoleonic" after I found out when "Napoleonic" actually starts. And it turns out I don't need to give "RN_Volage" carronades because that's what it gets by default anyway.
Good point. The problem is that the real Nelson's career crossed over the time period so I'd forgotten that in this game he's stuck in his early years. I've now forced him to get both his own HMS Victory and Collingwood's HMS Queen Charlotte. Aubrey already had his own special code for all higher ranks so should not be affected.Getting better and better!
One thing to point out is that Nelson starts in Revolutions and Aubrey in Napoleonic.
I think that means that Nelson now no longer gains command of HMS Victory.
I agree so much that I took the liberty to make your heading as large as the forum would let me.And on that note, everyone:
If you would like another naval hero, please give his name and a full list of his ships, by name and type. I don't mind doing the work to add him but I'm not going to do all the research - if you want your hero added, you can do the homework!
Both would probably be best to start at rank 3, "Lieutenant", so that they can get the full range of promotion ships. This may not match up with the actual ranks at which they got those ships (neither does Michiel De Ruyter's sequence) but it's the only way to get a full range of ships, not to mention avoiding short-changing those officers by giving them tiddlers at a rank at which regular naval officers get frigates. Even then there aren't enough promotion stages to allow Nelson to get all his ships, which is why you won't get the Boreas. (Besides, that was yet another 6th rate frigate, so arranging for Nelson to get it might be realistic but it would also be boring.)I've now finally tried out the new system, and I have to say that it is quite ingenious. I have a few points that I think needs attention though:
...
- The Nelson start gives you the rank "Commander" (with 22 relation points) and the 6th rate frigate "Blanche" rather than HMS Badger.
- The Aubrey start also gives you the rank "Commander" (also with 22 relation points) and the Unité class frigate "Lively" rather than the HMS Sophie (as you intended).