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

Need Help More direct-sail encounters

Thanks for testing so quickly and the feedback

No problem :doff

Hm, that was my next step too, for the upcoming weekend probably. How did you change it, code-wise

Well I don't know to code so I hope I did it right,all I did is this

Code:
} else {


if (bDirectSail && CheckAttribute(rPlayer, "directsail.encounter")) { // if set so in DirectsailCheck() random encounter ships are created

switch(rand( 10 ) ) //Don Lasagnetti - The Black Admiral: added random function for sea battles in direct sail mode. 1 - 3 fleets possible.
{

case 1:
rPlayer.ship.pos.x = stf(Login.PlayerGroup.x); // so that DirectEncounter doesn't use OLD coords
rPlayer.ship.pos.z = stf(Login.PlayerGroup.z);
DirectEncounter(stf(Login.PlayerGroup.ay));
break;

case 2:
rPlayer.ship.pos.x = stf(Login.PlayerGroup.x); // so that DirectEncounter doesn't use OLD coords
rPlayer.ship.pos.z = stf(Login.PlayerGroup.z);
DirectEncounter(stf(Login.PlayerGroup.ay));
break;

case 3:
rPlayer.ship.pos.x = stf(Login.PlayerGroup.x); // so that DirectEncounter doesn't use OLD coords
rPlayer.ship.pos.z = stf(Login.PlayerGroup.z);
DirectEncounter(stf(Login.PlayerGroup.ay));
break;

case 4:
rPlayer.ship.pos.x = stf(Login.PlayerGroup.x); // so that DirectEncounter doesn't use OLD coords
rPlayer.ship.pos.z = stf(Login.PlayerGroup.z);
DirectEncounter(stf(Login.PlayerGroup.ay));
break;

case 5:
rPlayer.ship.pos.x = stf(Login.PlayerGroup.x); // so that DirectEncounter doesn't use OLD coords
rPlayer.ship.pos.z = stf(Login.PlayerGroup.z);
DirectEncounter(stf(Login.PlayerGroup.ay));
break;

case 6:
rPlayer.ship.pos.x = stf(Login.PlayerGroup.x); // so that DirectEncounter doesn't use OLD coords
rPlayer.ship.pos.z = stf(Login.PlayerGroup.z);
DirectEncounter(stf(Login.PlayerGroup.ay));
break;

case 7:
rPlayer.ship.pos.x = stf(Login.PlayerGroup.x); // so that DirectEncounter doesn't use OLD coords
rPlayer.ship.pos.z = stf(Login.PlayerGroup.z);
DirectEncounter(stf(Login.PlayerGroup.ay));
break;

case 8:
rPlayer.ship.pos.x = stf(Login.PlayerGroup.x); // so that DirectEncounter doesn't use OLD coords
rPlayer.ship.pos.z = stf(Login.PlayerGroup.z);
DirectEncounter(stf(Login.PlayerGroup.ay));
DirectEncounter(stf(Login.PlayerGroup.ay));
break;

case 9:
rPlayer.ship.pos.x = stf(Login.PlayerGroup.x); // so that DirectEncounter doesn't use OLD coords
rPlayer.ship.pos.z = stf(Login.PlayerGroup.z);
DirectEncounter(stf(Login.PlayerGroup.ay));
DirectEncounter(stf(Login.PlayerGroup.ay));
break;

case 10:
rPlayer.ship.pos.x = stf(Login.PlayerGroup.x); // so that DirectEncounter doesn't use OLD coords
rPlayer.ship.pos.z = stf(Login.PlayerGroup.z);
DirectEncounter(stf(Login.PlayerGroup.ay));
DirectEncounter(stf(Login.PlayerGroup.ay));
DirectEncounter(stf(Login.PlayerGroup.ay));
break;

}

DeleteAttribute(rPlayer,"directsail"); // clears tags from player

}
 
Could it be that crashes happens because fleets are generated at same place?
Could be. If the ships end up on top of each other, the game engine might get confused with all the collision detection.
If so, perhaps try:
Code:
DirectEncounter(stf(Login.PlayerGroup.ay)-0.1);
DirectEncounter(stf(Login.PlayerGroup.ay));
DirectEncounter(stf(Login.PlayerGroup.ay)+0.1);
That way the angle is different for each encounter.
The numbers are probably in radians, so you may have the tweak them a bit.
 
As far as I'm concerned this works as intended.Encountering one fleet most of the time,sometimes two and rarely tree.If you have bad reputation (like me :wp) and can't trade or accompany merchant ships,only thing that you can do is to turn pirate,but with ship like lugger you can't make a fortune.But with this feature and with brain of a pirate you can make a living by teaming up with a stronger side and of course with pirates :drunk
 
As far as I'm concerned this works as intended.Encountering one fleet most of the time,sometimes two and rarely tree.If you have bad reputation (like me :wp) and can't trade or accompany merchant ships,only thing that you can do is to turn pirate,but with ship like lugger you can't make a fortune.But with this feature and with brain of a pirate you can make a living by teaming up with a stronger side and of course with pirates :drunk
@Grey Roger: Do you think it is worth considering to put this in the main mod then?
Perhaps with a toggle on it, because the existing approach might not be the cleanest (or safest?) solution.
 
It would be great if more people could test it.In my case game crashed only once and I play it often,"empty" encounters happens VERY rarely and I don't found them annoying,But as I said it would be nice to be tested by more people
 
I wonder if Don Lasagnetti made some improvements
Don Lasagnetti was last seen: Apr 24, 2018 :(
I did include him in the Promotion PM today, so hopefully he'll get a notification on that and decide to visit again.
 
I have some questions about encounters

1.Can you encounter fleet that comes from behind the ship?

2.Can you encounter ships when sailing around the Island?

3.Can you encounter ships when your ship is not moving?

4.Can you encounter only one ship?

5.Can you encounter ships that sail at same direction you are sailing?
 
1. Only if you vary the 'ay' where they're generated:
Code:
DirectEncounter(stf(Login.PlayerGroup.ay)-0.1);
DirectEncounter(stf(Login.PlayerGroup.ay));
DirectEncounter(stf(Login.PlayerGroup.ay)+0.1);

2. There are already ships generated around islands.

3. Maybe if you're not moving and far from an island?

4. I think there are one or a few encounter types with a single ship.

5. Don't know...
 
2.Ships that are generated are the same nation as the forts on that island?

3.I wondered if you could wait for an action near a friendly island.

4.Do you think that's realistic?
 
2.Ships that are generated are the same nation as the forts on that island?
Sometimes they're hostile - so-called "coastal raiders". It's a bit silly if they spawn near the fort, and even sillier if you're there under a false flag because they may be friendly to your true nation and you can't join in the fight or you lose your Letter of Marque. So all you can do is wait for the fort to sink them before you can moor.
3.I wondered if you could wait for an action near a friendly island.
If there are hostile ships which were spawned when you arrived, you could go looking for them. If no hostile ships were spawned then you'll be waiting for a long time in the hope that direct sail spawns a new encounter. You'd be quicker to dock, visit the governor, and ask for a ship hunting mission.
4.Do you think that's realistic?
Single ships sailing by themselves? Of course. Ships didn't always sail around in groups.
 
But if you go from the port to the ship it's always the case.
Huh? It is indeed more likely for ships of the same nation to be generated around an island, but other nations do appear as well.

What I meant is,Do you think it's realistic for it to happen so rarely?
This is affected by PROGRAM\Encounters\Encounters_init.c .
You're welcome to have a look through that and suggest any changes you might have.
If I recall, that file has not been changed much compared to the original game and only a few REALLY BIG encounters were added.
So it could indeed be that single ship encounters are underrepresented.
 
Don't forget that there's game balance as well as realism to consider. Shifting the odds in favour of single ship encounters means it's easier to defeat them, so it would be even easier than now to make a fortune by pirating or privateering.
 
Hello and good evening everyone, :ahoy

I'm sorry for going all silent for roughly a year, but life tends to get in the way. Finally though I've found some time to finalize this, and for me the attached sea.c variant is working properly, apart from occasional crashes that seem to be caused by too many ships for my workstation to handle, as far as I can tell from error and compile logs at least (~5% crashrate for me).
Unfortunately, I did not find a more elegant solution (that I could convince to work smoothly) than the rand-function. So now it's randomizing between 1-3 fleets of any nation (more fleets of one nation possible, deliberately).

It would be great if a few of you with hardware younger than 10 years could test and give feedback whether or not crashes happen too. :whipa


Also, I've noticed that I kept running into the same names on pirates ships rather often and searched for the file responsible, is it possible that not all names in ships_name are actually used? I have the impression some names in there never appear at all... What's the experience of others who play a lot?:type1?
Anyways, I nearly doubled the possible names for pirate ships, the file is attached too. Here are the names I added, if they could be looked over briefly and deemed alright, the file could be added to the next version too:

Devil,Demon,Sea Devil,Sea Demon,Ocean Devil,Ocean Demon,Merciless,Plaguebringer,Black Queen,Black King,Red Queen,Fishking,Hunter,Avenger,Blackdeath,Infection
Seawitch,Grey Witch,Red Witch,Black Witch,Black Knight,Nightstalker,Stealthy,Sneaky,Deathbringer,Golden King,Golden Queen,Hawk,Seawolf,Blackshark,Red Shark,Nightwolf,Wolf,Predator
Old Hag,Ocean Hag,Seagiant,Black Giant,Deathwish,Glorious,Infamous,Bad luck,Revenge,Goldseeker,Ruby,Emerald,Sapphire,Diamond,Black Diamond,Red Blood,Bloodred
Vampire,Nightlord,Nightlady,Empty Pockets,Forsaken,Topaz,Bloodred Garnet,Lucky,Fortunate,Abyss,Hellraiser,Headless Rider,Ghost,Misty,Poisonous,Snakebite,Venom,Lupus
Sinner,Heretic,Hand of Midas,Troublemaker,Trouble,Swift Danger,Dangerous,Silent Thief,Intruder,Veni Vidi Vici,Media Nox,Orcus,Exitus,Pestilentia


Getting back to playing now, I've clean installed the latest version recently and it's running really smoothly, better than any previous version. I found not a single bug so far and the only CTDs I had happened only after I played around with direct-sail encounters again. Also, the new content I found until now is great and it's always a joy to return to this game :cheers
:ship
 

Attachments

  • sea.c
    59.6 KB · Views: 162
  • ships_name.c
    24.7 KB · Views: 152
Back
Top