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

Discussion many small ships in the harbor

Jan Marten

de ZeeRoovers Group
Storm Modder
That's a good idea ...
I have no idea yet. Search for a solution
010.jpg
 
I think. How can you bring many small ship to the pier? I have no idea Pieter.
I found the picture in a forum.
 
In POTC I would have to add 11 ship locators to the current location, probably "ships_other" type.
Then assign ships with that boat model to 11 characters.
And place those ships in the right harbour location.
 
I think. How can you bring many small ship to the pier? I have no idea Pieter.
I found the picture in a forum.
Indeed in PotC it shouldn't be too difficult, like @Jack Rackham says.
We added a lot of modded code to control where ships end up in port.
Check the Build Mod "locations_loader.c", if I recall.

This is also where we place small ships next to piers, but large ships at anchor in the bay.
And also the scenic "sailaway" ships that sail around in the background while you walk around on shore.
 
People. Have you ever tried to dock with such a ship at a pier. Very unlikely, that it works.
Settlements in the 17th century are located in natural bays.
Shallow water, not a properly developed port. It's about the many small boats in the harbor.

020.png
 
I will test that. Bermuda's pirate settlement. No ships, nowhere
I think these are locators problems.

030.png

040.png
 
Have you ever tried to dock with such a ship at a pier. Very unlikely, that it works.
In the PotC: New Horizons mod, we added some code to distinguish between "jetty ships" and "bay ships".
Small ships that do fit next to the pier, show up docked alongside, but the big ones like you show end up where they belong in the bay.
We had some issues in the past where "too large" ships ended up at the pier, but we fixed those and it works pretty well now.
 
@Grey Roger, do you have any chance to look up in New Horizons in which files the "jetty" ship and "sailaway" code is used?
I know it is in ships_init.c and I think also locations_loader.c, but I'm not entirely sure and I don't have time to look it up.

Those would be the files for @Jan Marten to look at if he wants to reproduce the functionality we added.
That functionality allows far greater control over which ships show up in port, where they show up and also allows them to move around while you walk ashore.
 
"jetty" is a ship attribute set in "ships_init.c" and presumably determines whether the ship will appear moored at the dock or sitting out in the open sea. Boolean function "jettyship" is defined in "CharacterUtilite.c" and checks the "jetty" ship attribute.

"sailaway" is a character attribute and can be set pretty well anywhere, e.g. in a character definition or in quest code. It appears to be checked in function "LocLoadShips", defined in "locations_loader.c".

A ship whose captain has the "sailaway" attribute moves but there's no check on where the ship goes. I have watched a ship sail straight out of the port and into the island, where it didn't stop due to the collision, it just kept going further inland. xD
 
"jetty" is a ship attribute set in "ships_init.c" and presumably determines whether the ship will appear moored at the dock or sitting out in the open sea. Boolean function "jettyship" is defined in "CharacterUtilite.c" and checks the "jetty" ship attribute.
Where is the boolean function 'jettyship' used? That's also in "locations_loader.c", right?

"sailaway" is a character attribute and can be set pretty well anywhere, e.g. in a character definition or in quest code.
There were also a whole bunch of other additions that had to be made somewhere for this to work without errors, but I can't remember where.
I found the original thread though where I experimented with "a simple virtual sailor"'s discovery to make this work.
See here for the relevant details: Ships Sailing in Port/Shore Scene
If that is still correct, then indeed all needed code should be limited to "locations_loader.c".

A ship whose captain has the "sailaway" attribute moves but there's no check on where the ship goes. I have watched a ship sail straight out of the port and into the island, where it didn't stop due to the collision, it just kept going further inland. xD
Absolutely true! Usually it works fine. Except when it doesn't. That's when it becomes hilarious. :rofl

The proper solution would be to ensure that ALL "ship" locators where "sailaway" is supported should be rotated to always point towards the sea.
However, that is a lot of tedious work and this weirdness is barely ever reported by anyone, so I think we're getting away with leaving it as-is.
Let's just consider it one of our gazillion other Easter Eggs! :wp
 
Thanks for confirming, @Grey Roger!

I think. How can you bring many small ship to the pier? I have no idea Pieter.
Look at the "locations_loader.c" file from PotC: New Horizons.
Possibly also "ships_init.c" and "CharacterUtilite.c" for the "jetty"/"jettyship" code.
I expect the same code tricks will work in AoP/CoAS/SD/TEHO as well.
 
"ships_init.c" just has a line
Code:
refShip.Jetty  = false;
in the ship's definition if the ship is not to be moored at a jetty.

Boolean function "jettyship" is quite simple:
Code:
bool JettyShip(ref chr)
{
   int nShipType = GetCharacterShipType(chr);
   if (nShipType <0 || nShipType >= SHIP_TYPES_QUANTITY) { return false; } // PB: Prevent CTDs
   aref ship; makearef(ship, chr.ship);
   if (CheckShipAttribute(ship, &ShipsTypes[nShipType], "Jetty"))
       return sti(GetLocalShipAttrib(ship, &ShipsTypes[nShipType], "Jetty"));
   else
       return GetMaxCrewQuantity(chr) < 400; // Armada
}
If the character's ship has the "jetty" attribute then the result is the attribute. If not, it's down to crew size - anything with 400 crew or more is assumed to be too big to moor. (I can't find any ships with the "jetty" attribute explicitly set to "true". It seems to be used for ships which have small crews and large hulls, usually merchants.)
 
Indeed in theory, "jetty" COULD be set to 'true' for some ships, but we only used it if we found a ship next to the pier that didn't fit there.
That's a really obvious check. It's difficult to do a "reverse" check though.
If you really want to make sure ALL ships that COULD show up at the jetty actually do, you could try to lower that 'GetMaxCrewQuantity' check.
Then, with trial and error during gameplay, start setting other ships to 'false' in ships_init.c .

It is possible. But I doubt it's worth the effort. As far as I can tell, it works fine as it is now.
And sometimes you do get to see an NPC ship moored along the pier, which makes for a nice sight, I reckon.
Claire Larousse's custom brig in Puerto Rico is a nice example, if I recall.
 
Thank you very much. I look at it. Will take a while.
At the moment I have other problems.
Pirates Diary - will be available in 4 languages. German, French, Italian and Spanish.
 
Back
Top