• 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

After I identified to relevant pieces of code (I believe), I've got several options doing parts of what I was trying to achieve, but not one without issues.
So here I am again, frustrated as I seem unable to find out why exactly it behaves strangely.
AGH. I'm sorry to hear that!
I've read your post, but I'm confused for now as well.
And unfortunately I haven't a clue how to find the time needed to help you.

Perhaps @The Nameless Pirate would be willing to attempt to investigate?

I already told you about this ages ago, right?
Tutorial - Modding Tips & Tricks

But as far as I could tell, the boarding code is all over the place in several files and folders, same with land fights, it seems. I have gone through 30+ ´files and tried to find out how to clear the whole boarding scene properly, to no avail. Nothing I've tried seems to be the function which is responsible. Is anyone familiar with that system by any chance? I'm out of ideas where else to look/what else to try.
Or perhaps there is a chart displaying the logic behind the many files, where often several seem to address some aspect of the same functionality?
A chart? That'd be nice! :rofl

Nope, unfortunately the PotC code is one helluva convoluted mess. :facepalm
 
Good morning,

I'm going on holiday, but afterwards I'll gladly try any possible solutions you might find, thanks The Nameless Pirate!

And thanks Pieter, I've been going back to the tutorial often when stuck somewhere, yes. :modding

Also, in the meantime I've looked through the models a bit and there are so many nice ones that never appear in the game except in storylines, I assume…

Is there a reason for them not appearing as random NPCs other than the sheer amount of time it takes to look through them all?

If not, I would gladly take that upon me, I've done it for a few models already, but it seems to not work properly.

Added in initModels.c variations of the following lines, I understood I can add multiple to one model, mostly used just one though:
AssignModelType(isstart, model, OFFIC_TYPE_FIRSTMATE, 1.0);
AssignModelType(isstart, model, "Captains", 1.0);
AssignModelType(isstart, model, "Sailors", 1.0); - for Boarding models?
AssignModelType(isstart, model, "Mates", 1.0); - for sailors escorting you ashore?

Now most don't seem to appear though, would I have to do something else? Increase a number somewhere or anything?

And there are those very basic models, mostly from storylines, I guess:
Code:
 model.description =  "";
 model.id    =  "wr_oman2";
 model.FaceId = 505;
 model.nation   =  BROKEN;
 model.assigned =  true;
 AddCharacterModel(model);

Would they require more work too to appear properly or is that sufficient already?

Also, are there models that should absolutely not appear in the game randomly?
 
Also, are there models that should absolutely not appear in the game randomly?

For example Geralt should not appear randomly in my opinion, same goes for every main character in any storyline.
Since they are considered unique people and have a big role in the game.

And maybe historical figures, characters from different series Hornblower for example should also not appear randomly.
 
Also, in the meantime I've looked through the models a bit and there are so many nice ones that never appear in the game except in storylines, I assume…

Is there a reason for them not appearing as random NPCs other than the sheer amount of time it takes to look through them all?
Everything starting with "wr_" is from @Jack Rackham's Woodes Rogers storyline.
He likes having unique content in there, so I expect he prevented them from appearing at random on purpose.
 
Good evening,

I've spent some time the past two weeks trying to achieve continued playing after a failed boarding attempt, I think this should allow the option for playing without ever needing to reload due to game restrictions.
Started out with a toggle, but I think basing it on the survival chance should be enough, refraining from adding more toggles to internal settings.

After I identified to relevant pieces of code (I believe), I've got several options doing parts of what I was trying to achieve, but not one without issues.
So here I am again, frustrated as I seem unable to find out why exactly it behaves strangely.

The most workable solution so far was to use GameOverE, which has me ending up in a dinghy, but it behaves strangely.
I'm getting the lock to F1 as if I had died on land (telling me to wait for the tavern medics to leave) and at the same time I fail to clear the boarding scene.
I found the culprit not allowing me to go to the main menu, but I'm totally unable to tell where it is disabled again, NoSave.Resurrection == false and similiar attempts did not work for me either.
Code:
    if(CheckAttribute(GetMainCharacter(), "NoSave.Resurrection"):
    {
        LogIt(TranslateString("", "You can't save or load until") + " " + GetMyFullName(ResurrectingOfficiant) + " " + TranslateString("", "leaves."));
        return;
    }
But as far as I could tell, the boarding code is all over the place in several files and folders, same with land fights, it seems. I have gone through 30+ ´files and tried to find out how to clear the whole boarding scene properly, to no avail. Nothing I've tried seems to be the function which is responsible. Is anyone familiar with that system by any chance? I'm out of ideas where else to look/what else to try.
Or perhaps there is a chart displaying the logic behind the many files, where often several seem to address some aspect of the same functionality?

As it stands now, my change, while technically working, is totally not playable and without help I won't be able to get it working properly, but I suspect it's just a minor step to finalize.
I'm already able to direct sail, sail-to and use the worldmap, but once I enter land-mode, the previous boarding scene is placed over the actual environment, which blocks me from doing anything but fast-travel.
Here is GameOverE for your reference:
Code:
void GameOverE()
{
    ref mc = GetMainCharacter();
    if(rand(100) + (sti(mc.skill.Sneak)*3) > DEATHRATE)    // BF mar05
    {    //ccc new survival section
// KK
        if (HasSubStr(mc.ship.type, "Tartane") == true || mc.ship.type == "Gunboat") {
            GameOverOrg("sea");
            DeleteSeaEnvironment();
            return;
        }
// <-- KK
        Event("DoInfoShower","sl","MainMenuLaunch",true);    //TIH - black out the screen to hide uglyjunk
        LAi_SetCurHPMax(mc);
        mc.lost.ship.type = GetCharacterShipID(mc); // PB: So you can get her back if necessary
        GiveShip2Character(mc,SHIP_LIFEBOAT,"Lifeboat",-1,GetServedNation(),false,false);
// KK -->
        SetCharacterGoods(mc, GOOD_BALLS   , 0);
        SetCharacterGoods(mc, GOOD_GRAPES  , 0);
        SetCharacterGoods(mc, GOOD_KNIPPELS, 0);
        SetCharacterGoods(mc, GOOD_BOMBS   , 0);
        AddCharacterGoods(mc, GOOD_WHEAT   , 2);
        AddCharacterGoods(mc, GOOD_RUM     , 2);
// <-- KK
        mc.lifeboatlaunch = true;    //TIH - better check for when they sank
        Sea_ReloadStart();
        PostEvent("DoInfoShower",100,"s","");    //TIH - clears black screen
        PlaySound("#ship_sinking");        //ccc mar20 // KK
        Log_SetStringToLog(TranslateString("","You manage to launch a boat in the last moment."));    //ccc mar20
        Log_SetStringToLog(TranslateString("","With a few mates you escape from disaster."));    //ccc mar20
    } else {    //ccc call original GameOver function
        GameOverOrg("sea");
        DeleteSeaEnvironment();
        return;
    }
}

Also, attached the sea.c file and internal settings, I believe I didn't change anything else for more direct encounters to work.

AGH. I'm sorry to hear that!
I've read your post, but I'm confused for now as well.
And unfortunately I haven't a clue how to find the time needed to help you.

Perhaps @The Nameless Pirate would be willing to attempt to investigate?

I already told you about this ages ago, right?
Tutorial - Modding Tips & Tricks


A chart? That'd be nice! :rofl

Nope, unfortunately the PotC code is one helluva convoluted mess. :facepalm

Unfortunately as of now, i have taken a look at the code and haven't found what is wrong with it either.:(:modding
If at some point i find out some thing i will post the answer but as of now i am confused.
You never know sometimes things like this may be really simple and the answer comes randomly, after you've taken a break for example. :shrug
 
Btw I never stopped "testing" this it's a part of my game for like 2 years now and I don't remember the last time my game crashed, and btw my PC is not modern at all, I also tested it on my laptop too, same thing no crashes. I still use my noobie code for it tho because I didn't liked the same chances for encountering 1,2 and 3 fleets, so I made it like this:

70% to encounter 1 fleet
20% to encounter 2 fleets
10% to encounter 3 fleets

I think it's more realistic :/
 
By "fleet" you mean "ships" right @STARk7 ? Or am I assuming the obvious? I'm confused. A fleet consists of 2 or more ships.
 
By "fleet" you mean "ships" right @STARk7 ? Or am I assuming the obvious? I'm confused. A fleet consists of 2 or more ships.
No, the idea is to generate two or even three fleets when a random encounter happens during direct sail. That is, two (or three) separate groups of multiple ships.

My own experience is that this crashes the game about 1/3 of the time. Admittedly, for testing, I'd set the probability of a multiple encounter rather higher than @Don Lasagnetti or @STARk7. That just meant I was more likely to get a multiple encounter, therefore more likely to get a crash resulting from a multiple encounter. It's a problem with the game engine so is unlikely to be fixed.
 
Last edited:
No, the idea is to generate two or even three fleets when a random encounter happens during direct sail. That is, two (or three) separate groups of multiple ships.

My own experience is that this crashes the game about 1/3 of the time. Admittedly, for testing, I'd set the probability of a multiple encounter rather higher than @Don Lasagnetti or @STARk7. That just meant I was more likely to get a multiple encounter, therefore more likely to get a crash resulting from a multiple encounter. It's a problem with the game engine so is unlikely to be fixed.

The game crashes that often to you with it?
 
I remember my game crashed few times when I just started testing it, but honestly after that I don't remember my game crashed after "Sail Ho" message...
 
The game crashes that often to you with it?
Yes, if I include the code to allow multiple encounters during direct sail, the game is likely to crash while trying to sail to another island. Especially if it's a long journey such as Bonaire to Hispaniola so that I'm likely to have several encounters, some of which will be multiple.

The game crashed immediately after the "Sail Ho" message. I didn't have the chance to see what I'd encountered but "compile.log" showed a record of a double encounter.
 
And game sometimes(rarely) crashes without obvious reason so I wasn't sure if my game crashed because of this
 
Yes, if I include the code to allow multiple encounters during direct sail, the game is likely to crash while trying to sail to another island. Especially if it's a long journey such as Bonaire to Hispaniola so that I'm likely to have several encounters, some of which will be multiple.

The game crashed immediately after the "Sail Ho" message. I didn't have the chance to see what I'd encountered but "compile.log" showed a record of a double encounter.

I'm really surprised by that
 
Back
Top