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

WIP Increasing Companion Limit

irR4tiOn4L

Landlubber
Storm Modder
I just really wanted to foster some discussion (again) on whether its possible to get more than 4 ships.

Now i know that you cant have more than 4 companion slots -

But what if you had AI ships that generated whenever you entered the sea map, and were given your nationality and orders to defend you. Perhaps a second interface method might be used to give orders to these ships.

This would be just like an encounter with lots of other AI ships, albeit on your side and with you having limited control over them.

Perhaps you might treat these ships as an independent squadron. Would allow for fleets.

Ideas?
 
I don't know but something similar to the crewmembers on shore mod could be done. I mean like hireing other captains with their ships to escort you.
 
I can't see <b>why</b> anyone would want to have an entire fleet to command...

My reasoning is: It's the game about pirates, not about Admiral Nelson career <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> The way it is presented now satisfies me: nominally you have one ship, but you have three extra slots in case you want to bring home your prizes <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
This is Akella's reasoning for four ships: If they'd add more ships, they'd need to add a whole tactical system for very big ship-to-ship battles.
 
My idea was something like this: Some vagabonds you meat in town, may turn out to be captains, with their own fleet of 1 to 4 ships you should have an option to hire them to travel with you for some time. His/Her ship(s) are not under your control, they only appear as allies and fight by your side but that's all.

I don't know but maybe the game has something similar to this. If it ain't exactly like what I said, this advice could be an improvement... in my oppinion.
 
Ahh if only it could be done... sadly I believe all this code is rather buried in the core files of the game... heck, even AoP is still locked at 4 companions... to some extent this historically holds true for most the examples of pirates and piracy in general... small ships, big crews, heavily armed, small numbers (of ships)... I would have to do some homework to recall any pirates or privateers for that matter, that where known to opperate any flotillas beyond 4 for any significant period of time (more then a month, while they would take a prize and canibalize her in some lonely bay). The only outstanding exceptions to this general rule was when there where planned expeditions to take/sieze/harrass an enemy port... and these events usually consisted of military and suplimental privateers... and rarely lasted very long.

On this note I would like to see perhaps some expansion on the concept of the flotilla... set officers to it... (not just a pilot) couple extra commands... things of that nature to facillitate there function... which at the present mostly consist of them eating me out of house and home... I dont even think any of the officer available commands (leveled up perks) work asside from launching boarders to a fort.

I like your ideas on this though, and can think of some excellent working examples in other games... the "x" series for example... notably x-3 the reunion, has the ability to own and opperate hundreds of ships and bases simultaneously, performing any number of functions remotely such as trading, defense, attack, mining... all sorts of goodies.

At the end of the day though, PoTC/SeaDogs is a decent 'underated' game (pirate adventureish thing), but it falls short of a sailing simulation... unfortunately for those of us who enjoy the age of sail, as it where... we really have no game that defines our genre to any great extent; atleast not in a quality modern format.

If all I needed was a cooking pot, and a spoon... I would mix PoTC, SHIII, X-3, and a couple other little titles (space rangers 2) together... for flava'.
 
What irR4tiOn4L suggests might be possible. But somebody would need to code it in. And I don't know who would want to.
 
- THREAD MERGE -

I’ll bet this one has been discussed a’plenty! Anyway, this is more for personal pleasure, I couldn’t imagine the developers thinking about allowing more than four ships unless a concept is a) very stable and b) very balanced.

So far I have managed to bring up the “Assign Officer” window when capturing a ship while I already have four at sea including my own. However, it is not allowing me to move a passenger over to any of the slots, all I have is the luxury of staring at a screen I shouldn’t be able to access. So what it is I need to be looking at? Since I have gotten this screen up in the first place I’d expect to be able to move people into the empty slots, without regard for what happens after I leave the ransack menu (the game might die horribly for all I know, but that would be a start).

I assume I need to look at the right file, which is obviously not the one I’ve already edited. What I have noticed in several files is lots of ‘for’ statements checking if a value is less than 4, which I presume to be related to the current number of companions, and changing those is how I got the screen up. I’m quite new to this code but I imagine it’s easy enough to change every single one of those to a variable instead of a raw number, and then I simply set that variable to whatever I need, let’s just say 4 for simplicity. In other words, instead of saying “if x is less than 4” it says “if x is less than y”, where ‘y’ is the maximum number of companions. This way I could change the variable on-the-fly without having to edit lots of files. I mean, characters.h has already defined the maximum number of companions, can I just use that or do I have to assign a variable to match it somehow? If I do set a variable then do I need to declare it as global, plonk it in a file which contains what are essentially global variables, or what?

UPDATE - Mission Accomplished!

untitled-jpg.26755
 
Last edited:
Indeed replacing the "4" with a MAX_COMPANIONS variable should be quite doable.
As you noticed, that variable already exists, but it isn't consistently in use.

That is just the simple part though, even if it will be annoying as you need to crawl through all files and update those values of "4" to use the correct variable.
Then assuming that the game will be OK with having more companions (no guarantees on that!),
the nasty part is updating all the interfaces to display properly for more than 4 companions.
I don't think doing that would be simple at all. Interfaces are notoriously labourous to update correctly.

My recommendation is always for people to start modding with small and relatively simple projects.
So I must ask if you are absolutely certain that you want to try this.
 
I’ve already changed a lot of those variables to exceed 4 but at first I wasn’t getting anywhere because they didn’t seem to affect ransacking, probably more to do with berthing and doing swaps with player ships. I’ll see what happens if I replace “4” with “COMPANION_MAX”.

It’s all experimental at the moment, I’m just curious as to whether or not I can actually capture, and control, a fifth ship at sea. I was thinking about the idea of being able to do this in the mod, but the catch could be (either due to balance, engine limitations or simply because nobody would have the enthusiasm to sort out the interface) that as soon as the player leaves the sea all additional ships disappear without a trace (this could mean sacrificing an officer, but that might be more beneficial than sinking the captured ship and especially so if two enemy fleets are present).
 
I think in theory the game can probably handle it. NPC fleets can have more than four ships as well, after all.

Companions are notoriously stupid though, so having more of them doesn't necessarily help much.

The main issue are the interfaces though. I don't see that being sorted out in a hurry as most of them pretty much rely on the "four squares".
Adding a fifth/sixth square in there would require some substantial redesigning there.... :unsure
 
I’ve noticed a lot of variables relating to “four pics” or the such, so I get what you’re saying. I can also imagine that if I had say 10 ships at sea, I’d probably spend more time navigating around (or into) them than I would shooting the enemy! At least if I can get something working for my own purposes I could maybe improvise to an extent. For example, any transfers between the additional ships would have to be done at sea. If I want to sell one then I’d probably have to berth my main ship, buy a dinghy and then swap ships at sea to the one I want to sell - that would be awkward, but workable.
 
Thanks! I’ve just changed all of the relevant occurrences of “4” to equal “COMPANION_MAX”, which I have set to 10, and it works just fine... the “Assign Officers” screen becomes available. It definitely is not available if the maximum companions variable is default and I have four ships already. All I have to do now is get my officers in those slots. :)
 
When you have something workable, please upload the files you changed.
Might as well be included in the mod, even if the default value remains at 4. :doff
 
I was thinking that. ;) Anyway, I can’t seem to find what is stopping me from moving officers across - I click the officers and the empty boxes but nothing actually happens.

How can I force boarding to go straight to the cabin? It’ll really help me speed things up, but obviously I wouldn’t want to be doing that while playing the game properly.
 
Anyway, I can’t seem to find what is stopping me from moving officers across - I click the officers and the empty boxes but nothing actually happens.
Check the involved interface code.

How can I force boarding to go straight to the cabin?
I'm not at all sure. Maybe set all ships in ships_init.c to have 0 decks, then press F11?
 
Check the involved interface code.
Well, I’ve managed to narrow it down to line #123 in ransack_main.c...
Code:
   if(newCurNod!="")
   {
     SetCurrentNode(newCurNod);
   }
   else
   {
     RecalculateCargoLoad( xi_refCharacter );
     RecalculateCargoLoad( refEnemyCharacter );
     DeleteAttribute(xi_refCharacter,"InterfaceParam");
     for(i=1;i<COMPANION_MAX;i++) /**/
     {
       if(GetCompanionIndex(xi_refCharacter,i)==-1)
       {
         pCharacter.InterfaceParam.i1 = i;
         break;
       }
     }
   }
This is the only entry which needs to be changed in order to enable the assign captain button. I’ll look at the other transfer interfaces.
I'm not at all sure. Maybe set all ships in ships_init.c to have 0 decks, then press F11?
I’ll certainly give that a try!
 
Last edited:
That’s one problem I have is that I don’t know where GetCompanionIndex is initially defined. I’ve ran a search for the variable, I have a lovely list now of something like 50 files. Interestingly enough, LogInterface.c is already using “COMPANION_MAX” in one place, but then proceeds to use “4” afterwards.

Another thing I need to think about is that some of these functions could be referring to the amount of officer slots, not companions.
 
Back
Top