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

Ships Sailing in Port/Shore Scene

<!--quoteo(post=335169:date=Jul 5 2009, 07:51 AM:name=Seb)--><div class='quotetop'>QUOTE (Seb @ Jul 5 2009, 07:51 AM) <a href="index.php?act=findpost&pid=335169"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->And what about attacks?! I'm thinking about the The scene were the black pearl attacks port royal in COTBP?<!--QuoteEnd--></div><!--QuoteEEnd-->
That indeed would be cool... however you do not actually get to see that scene in the storyline... As you are in jail at the time <img src="style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
The mod makes a ship start sailing at the moment you load into the location and will not stop sailing until you leave.
An attack would require the ship to sail INTO the port and then stop, which I haven't got the slightest clue how to do.
Firing cannons could be possible with particle effects, but REALLY not easy, since you'd have to figure out the x,y,z location of the cannons.
You probably wouldn't be able to use the regular cannon fire code. :(
 
Last edited:
The following code makes ALL ships sail in the port scene:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->        // PB: Test -->
        ref lcn = &Locations[FindLocation(rPlayer.location)];
        string islandstr = lcn.island;
        for(j = 1; j < 7; j++)
        {
            DeleteAttribute(characterFromID("Cr" + islandstr + j),"sailaway");
            characters[GetCharacterIndex("Cr" + islandstr + j)].sailaway = true;
        }
        // PB: Test <--<!--c2--></div><!--ec2-->
Now we'd need to decide how frequently and how many ships moving would be good.
1. For each ship, there's a random (low) chance that it goes sailing
2. There's a random chance that one ship goes sailing and that ship is then selected randomly

Problems with this whole mod concept:
- A ship that sails away will be back in port after the next location reload
- Ships sail through each other and probably sometimes through land too
 
But we don't know which ship ends up at which locator.
I suppose it's some sort of sequential thing where the player ship is put on the first, then the player companions (IF present),
any quest ships and then coast raiders. But I haven't got the slightest clue how to handle all that.
Would probably be as complicated as fixing the Different Flags mod and that has the priority right now.
 
I would like it to see the port bustling with more activity, but not to look stupid <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
This seems to work quite alright as a first test version:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->        // PB: Sailing Ships -->
        ref lcn = &Locations[FindLocation(rPlayer.location)];
        string islandstr = lcn.island;
        for(j = 1; j < 7; j++)
        {
            DeleteAttribute(characterFromID("Cr" + islandstr + j),"sailaway");
            if(rand(2) == 0) characters[GetCharacterIndex("Cr" + islandstr + j)].sailaway = true;
        }
        // PB: Sailing Ships <--<!--c2--></div><!--ec2-->
 
If I enter that into the console, will it make the ships sail?
If you download and install the lastest Experimental Mods it is already in there ;)

If you have any new work yourself make sure you winmerge your work so you don't loose your work :D
 
That code is to be included in PROGRAM\Locations\locations_loader.c:
Code:
		// PB: Sailing Ships -->
ref lcn = &Locations[FindLocation(rPlayer.location)];
if(CheckAttribute(lcn, "island"))
{
string islandstr = lcn.island;
if(GetAttribute(Islands[FindIsland(islandstr)], "skipCR") != true)
{
for(j = 1; j < 7; j++)
{
DeleteAttribute(characterFromID("Cr" + islandstr + j),"sailaway");
if(rand(2) == 0) characters[GetCharacterIndex("Cr" + islandstr + j)].sailaway = true;
}
}
}
// PB: Sailing Ships <--

// ASVS -->
if(CheckAttribute(rCharacter,"sailaway"))
{
if(!CheckAttribute(rCharacter,"Ship.Strand"))					rCharacter.Ship.Strand = false;
if(!CheckAttribute(SeaCameras,"camera"))						SeaCameras.Camera = "SeaShipCamera";
if(!CheckAttribute(rCharacter,"ship.cannons.Charge"))			rCharacter.ship.cannons.Charge.Type = GOOD_BALLS;
if(!CheckAttribute(rCharacter,"TmpPerks.LongRangeShoot"))		rCharacter.TmpPerks.LongRangeShoot = false;
if(!CheckAttribute(rCharacter,"TmpPerks.shipspeedup"))			rCharacter.TmpPerks.shipspeedup = false;
if(!CheckAttribute(rCharacter,"TmpPerks.shipturnrateup"))		rCharacter.TmpPerks.shipturnrateup = false;
if(!CheckAttribute(rCharacter,"TmpPerks.sailingprofessional"))	rCharacter.TmpPerks.sailingprofessional = false;
if(!CheckAttribute(rCharacter,"TmpPerks.stormprofessional"))	rCharacter.TmpPerks.stormprofessional = false;
if(!CheckAttribute(rCharacter,"TmpPerks.turn"))					rCharacter.TmpPerks.turn = false;
rCharacter.Ship.stopped = false;
rCharacter.Ship.Speed.z = 1.5;
}
else
{
rCharacter.Ship.stopped = true;
rCharacter.Ship.Speed.z = 0.0;
}
// ASVS <--
Ship_PrepareShipForLocation(rCharacter);
It will give every ship in the port scene a random chance to go sailing.
Additionally, any non-"coast raider" ship that is in port (player/companion/quest-ship)
that has the .sailaway attribute will sail away too.
This you can do through console or a quest/dialog case, for example:
Code:
			// PB -->
GiveShip2Character(characterFromID("Barbossa"),"BlackPearl","Black Pearl",-1,PIRATE,true,true);
setCharacterShipLocation(characterFromID("Barbossa"), "Deserted_Island_shore_01");
characters[GetCharacterIndex("Barbossa")].sailaway = true;
// PB <--
DoQuestReloadToLocation("Deserted_Island_shore_01", "officers", "reload1_3", "Barbossa_leaves_for_now2");
The ships go sailing upon a location reload but once you're loaded into a location,
you can't make a ship start sailing without reloading to the location again.

Note that the ships don't care where they sail to (in Puerto Rico, the ships sail right INTO the town),
nor are the "go to sea" locators closed if it's the player ship that goes sailing.
And next time you enter the location, the ships will be back again. But it's a start.

As Captain Maggee points out, this is included in the recent Experimental Mods update,
so you might want to get that. It seems to work pretty well and comes recommended. :yes
 
Let's move this thread for everyone to see, considering it's included in Alpha 9.5 Patch 3.
 
:gday
The Ships sailing in the ports look really good. :sail

I landed on a jetty recently (can't remember which port) and the ships on each side of me both started to sail away :woot

I turned round and watched them go.

Then I realised they were both sailing straight for my ship :shock

I waited for the crash - but they calmly sailed right through my ship as though it was not there. :rofl
 
Yep; that can happen. And Puerto Rico is worse; visit that port a few times and see what happens. :rofl
This mod looks good; sometimes. And sometimes it looks really stupid.
Just like the "Ships anchored in port scene" mod. :(
 
I tried setting a negative speed or a speed along another axis than the z-one, but that just has the same effect.
So no sailing backwards (would've been nice for overtaking situations) or sailing down (sinking).
I do seem to have observed that ships will change course to some extent in the port scene, but not actually properly avoid collisions.
It seems that although the speed is set to 1.5, faster ships do end up going faster than slower ships.
 
Back
Top