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

Fixed Smuggling: Save On Beach Breaks Getting Caught

jsv

Freebooter
Storm Modder
It seems that when you reload from a save made on the shore in the middle of a smuggling deal, something is not reinitialized properly and you no longer get caught.
Normally, with DEBUG_SMUGGLING=2 I see periodic "SMUGGLING get chance to get caught" messages. After reload they disappear completely.
That explains in part my initial lack of success in being intercepted.
 
Thanks for catching that, @jsv! I made this a separate issue so @Levis will be sure to see it when he is around again. :doff
 
Hmm I thought I made something for that. Will look.
 
Well, this one is fixed, I think.

But, as always, there is yet another problem. But it doesn't seem to do anything with this one, so I'll make a separate thread.
 
@Pieter Boelen no it isn't. It could be because he saved and the location loaded the time changed and therefore he is out of the "safe window" and therefore he is caught very quick.
Use the DEBUG_SMUGGLING toggle to get these log messanges. It will tell you the chance you are going to get caught. and it will show if they catch you or not.
Code:
if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING caught chance is "+chance_get_caught+" in "+(100*SMUGGLING_TIME_CHANCE_MULT));
        if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING Evaded the Coastguard (for now)");
 
@Pieter Boelen no it isn't. It could be because he saved and the location loaded the time changed and therefore he is out of the "safe window" and therefore he is caught very quick.
Use the DEBUG_SMUGGLING toggle to get these log messanges. It will tell you the chance you are going to get caught. and it will show if they catch you or not.
Code:
if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING caught chance is "+chance_get_caught+" in "+(100*SMUGGLING_TIME_CHANCE_MULT));
        if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING Evaded the Coastguard (for now)");
This is what I got:
Code:
Done loading
storyline\FreePlay\quests\both_reaction.c not loaded, loading now!
storyline\FreePlay\quests\quests_reaction.c not loaded, loading now!
bool CreateParticleEntity()
!!! Reload to Cayman_Shore_01 (index=412)
** Whr: CreateWeatherEnvironment - iCurWeatherhour = 8, theHour = 8
ItemLogic: On load location Cayman_Shore_01
ItemLogic: found 0 buttons
ItemLogic: Loaded model items\\pursem
==> BuildSettings: New settings applied
==> BuildSettings: New settings applied
SETTING MUSIC: music_jungle
SETTING MUSIC: music_jungle
SMUGGLING load Coastguard patrol and pursuit
Equip Character Dougal Dormer with bladeC2+2 his nation: 0 blade nation=
Equip Character Lionel Lappin with blade27+1 his nation: 0 blade nation=
Force_GetShipType: Maxclass = 7, Minclass = 8, Per = Golden Age of Piracy, Nat = Britain, Type = War, Loop = 0, Ship ID = Gunboat
Force_GetShipType: Maxclass = 7, Minclass = 8, Per = Golden Age of Piracy, Nat = Britain, Type = War, Loop = 0, Ship ID = Barque3_50
Force_GetShipType: Maxclass = 7, Minclass = 8, Per = Golden Age of Piracy, Nat = Britain, Type = War, Loop = 0, Ship ID = Cutter2
Quest name Rand_ContrabandInterruption FOUND in CommonQuestComplete
Quest name Rand_CoastalPatrolAppear FOUND in CommonQuestComplete
The only thing I can make of that is that @Hylie Pistof managed to be caught and saved before the coastguard actually appeared.
Strange part is: There is only 1 second inbetween those events, so that must have been some good timing on this part! :shock
 
I can only say that I stop and save before I talk to the smuggler every time I smuggle, so if things start happening as soon as I enter that map now, then I will have to remember to start saving BEFORE I go to the beach.
 
I will look into it more ... because it seems to be triggered by something else....
Else this should also be logged:
Code:
SMUGGLING Coastguard found you!

And I don't see it, so the quest Rand_ContrabandInterruption is called by something else...
So it could indeed be he just save on the wrong moment and there is a 1 second delay ...
We could check that in a character dump I believe..
 
I can only say that I stop and save before I talk to the smuggler every time I smuggle, so if things start happening as soon as I enter that map now, then I will have to remember to start saving BEFORE I go to the beach.
Stuff does indeed happen as soon as you enter the beach, so if you want to abuse the "Save/Load" power, you would indeed need to do that.

Of course our hope is that if you do get caught, rather than reload and try again, you'll just deal with the consequences of being caught.
If the chance of being caught is reasonable, that should be quite possible, no?
If you don't ever want to be caught (or have your false flag detected), that is a different story altogether.

Anyway, in this case the save I am checking is one made AFTER you already made the deal, I think.
So that make it rather a non-issue; I was just surprised.

I will look into it more ... because it seems to be triggered by something else....
Else this should also be logged:
Code:
SMUGGLING Coastguard found you!

And I don't see it, so the quest Rand_ContrabandInterruption is called by something else...
So it could indeed be he just save on the wrong moment and there is a 1 second delay ...
That is the only explanation that I could think of.
 
about preventing getting caught:
There is even an option to have the coastguard not bother you at all ;) it's hidden in a quest somewhere. It has a bit of a risk but if you do the governor quest for the smuggling you can tell the coastguard you are working for the govenor.
 
@Levis: Under which circumstances should there be coastguard ships waiting for you now at sea?

In Hylie's save Pchar.quest.contraband.fromsea is TRUE, but they aren't there if I immediately reload to sea upon loading.
Seems that they're generated only as soon as those soldiers are generated.
This is intentional, right? So if you aren't caught even if you ARE in an "unsafe window", you can get away without a sea battle?
 
Just thinking out loud here, but I notice that sometimes you soldiers come from the sea and sometimes from elsewhere.
That is random as far as I can tell. Would be quite cool if they would ALWAYS come from the sea if Pchar.quest.contraband.fromsea is TRUE.
And likewise that they NEVER come from the sea if it is FALSE. That way players would be able to tell if there is a coastguard ship awaiting them.
 
Just thinking out loud here, but I notice that sometimes you soldiers come from the sea and sometimes from elsewhere.
That is random as far as I can tell. Would be quite cool if they would ALWAYS come from the sea if Pchar.quest.contraband.fromsea is TRUE.
And likewise that they NEVER come from the sea if it is FALSE. That way players would be able to tell if there is a coastguard ship awaiting them.
This should be the case...
It might be the fromsea isn't reset so thats why it might do weird stuff...but it was planned to be like that.
 
Code:
    int fromseachance = 50;
    if(CheckCharacterPerk(Pchar,"AdvanceSmuggling"))
    {
        fromseachance = fromseachance*0.5;
    }
    if(rand(100)<50)
    {
        locator = FindCoastGuardLocator(true);
        Pchar.quest.contraband.fromsea = true;
    }
    else
    {
        locator = FindCoastGuardLocator(false);
        Pchar.quest.contraband.fromsea = false;
    }

according to this it should work...
This is how the locator finder works:
Code:
string FindCoastGuardLocator(bool BySea)
{
    aref reloads, reloadref;
    int i;
    if(BySea)
    {
        //By Sea
        ref island = &Islands[FindIsland(loadedlocation.island)];
        makearef(reloads,island.reload);
        for(i=0;i<GetAttributesNum(reloads);i++)
        {
            reloadref = GetAttributeN(reloads,i);
            if(reloadref.go == loadedlocation.id)
            {
                return reloadref.emerge;
            }
        }
       
    }
    else
    {
        //By Land
        makearef(reloads,loadedlocation.reload);
        for(i=0;i<GetAttributesNum(reloads);i++)
        {
            reloadref = GetAttributeN(reloads,i);
            if(reloadref.label == "Jungle.")
            {
                return reloadref.name;
            }
        }
    }
    return "";
}
 
Where is that From Sea Chance used in that code you posted???

Is that new stuff or should it already be doing that?

Is that From Sea determined only at the time of being caught then?
I assumed it was set earlier, but maybe I misunderstood.
Maybe that is why it seemed inconsistent; because it IS inconsistent.
 
Where is that From Sea Chance used in that code you posted???

Is that new stuff or should it already be doing that?

Is that From Sea determined only at the time of being caught then?
I assumed it was set earlier, but maybe I misunderstood.
Maybe that is why it seemed inconsistent; because it IS inconsistent.

This isn't new. The fromseachance should be used in the rand(100) check but I see I forgot it there. Will fix that.
And indeed it is only set when you are caught.
 
Then for all I can tell, it does what it is meant to. It all seemed a bit odd, but for now I believe that is in appearance only. :doff
 
Then for all I can tell, it does what it is meant to. It all seemed a bit odd, but for now I believe that is in appearance only. :doff
Why is it odd?
If they come from sea there will be a ship if they come from land there wont.
its just not predetermined if they will come from sea or not untill they actually catch you.
 
Back
Top