• 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: Triple Player Character After Officer Returns

Talisman

Smuggler
Storm Modder
..... So I went upstairs to see about sending an officer ahead, but never saw that dialog, .........

The dialog is not obvious :facepalm - after you talk to the Smugglers Agent ( if you have a Tavern Hired Officer with you ) - talk to the officer & the 3rd option in the dialog is about smuggling.

The officer volunteers to go to the beach and come back in 24 hours - then leaves you ( gone from passenger list )

24 hours later - EITHER the officer will return by walking up to you in the tavern & you get a Quest Book entry with the safe times

OR - you get a Quest Book entry saying the officer has not returned - caught/killed by coastguards ( so don't send a good / favourite officer on this job because you can loose them:yes )

I had a small bug ( see images ) when my officer returned safely - I have had it only once so far & have been trying to replicate without success ( all my subsequent officers are caught by the coastguards .:modding


:drunk
 

Attachments

  • PotC Smug Officer_1.jpg
    PotC Smug Officer_1.jpg
    157.9 KB · Views: 86
  • PotC Smug Officer_2.jpg
    PotC Smug Officer_2.jpg
    257.1 KB · Views: 113
  • PotC Smug Officer_3.jpg
    PotC Smug Officer_3.jpg
    316.5 KB · Views: 83
  • error_DG1.log
    4.9 KB · Views: 106
  • compile_DG1.log
    16.8 KB · Views: 79
  • system_DG1.log
    18.6 KB · Views: 102
Three player characters? AWESOME! :woot

The dialog is not obvious :facepalm - after you talk to the Smugglers Agent ( if you have a Tavern Hired Officer with you ) - talk to the officer & the 3rd option in the dialog is about smuggling.
Do you reckon you can do some tweaking to the texts so that players will notice that feature exists?
 
Last edited:
Do you reckon you can do some tweaking to the texts so that players will notice that feature exists?

Attached are new Smugglers Agent dialog files - added a line where Agent suggests talking to Officer ( in same part of dialog that is discarded after you have talked to a few Agents)

:drunk
 

Attachments

  • Smuggler Agent_dialog.c
    5.9 KB · Views: 115
  • Smuggler Agent_dialog.h
    2.9 KB · Views: 94
Three player characters? AWESOME! :woot

Have just sent an Officer to scout the beaches and he managed to come back alive :dance

Unfortunately - I got the same bug as before again ( 3 player characters ) xD :facepalm

There was no error.log this time just compile & system

:drunk
 

Attachments

  • compile_DG2.log
    5.5 KB · Views: 78
  • system_DG2.log
    1.8 KB · Views: 94
Unfortunately - I got the same bug as before again ( 3 player characters ) xD :facepalm
Do you happen to have a savegame just prior to him returning and that occurring?
Having a test case would probably help in fixing that one. :doff
 
Do you happen to have a savegame just prior to him returning and that occurring?
Having a test case would probably help in fixing that one. :doff


Not just before the officer returns - :no

The only Save I have been using is the attached one - just before talking to the Smugglers Agent.

Just talk to S.A. then talk to officer and send him scouting - then spend night in room & just keep repeating till officer comes back alive.

Save is for a Free Play Game version 24 Oct.

:drunk
 

Attachments

  • -=Player=- Hispaniola.7z
    483.3 KB · Views: 82
@Talisman I have a tavern hired officer but did not think to talk to her.

:D


Ouch; old. I don't think I've got that game version myself anymore. Will have to see if I can convince your save to work anyway. :facepalm


I will update my game this evening and post a Save from the new version tomorrow. :doff


This part of smuggling is very easy to check -- Start a Free Play game - changing the occupation to Smuggler ( gives you contraband for the port you are in ) - go to tavern - hire officer - talk to Smuggler Agent -- and away you go. :yes

I am not sure when the code actually calculates/implements whether the officer is captured on not - must be sometime between when you send him & the 24 hours passing - if you go to the tavern room the time passes immediately and you get an immediate update.


PS Could someone just check that the new dialog for the Smugglers Agent is OK & makes sense. :doff


:drunk
 
I will update my game this evening and post a Save from the new version tomorrow. :doff
I'll try to make a new version today then.

This part of smuggling is very easy to check -- Start a Free Play game - changing the occupation to Smuggler ( gives you contraband for the port you are in ) - go to tavern - hire officer - talk to Smuggler Agent -- and away you go. :yes
:onya

I am not sure when the code actually calculates/implements whether the officer is captured on not - must be sometime between when you send him & the 24 hours passing - if you go to the tavern room the time passes immediately and you get an immediate update.
Would need to check in the code. Can't remember either.
@Levis would know.
 
Attached are new Smugglers Agent dialog files - added a line where Agent suggests talking to Officer ( in same part of dialog that is discarded after you have talked to a few Agents)
Included in my game now! :woot
 
@Talisman: Looks like all relevant code is in quests_common.c:
Code:
    case "Send Officer to scout":
       //Levis add smuggling questbook
       Preprocessor_AddQuestData("location",locations[FindLocation(Pchar.quest.contraband.CurrentPlace)].name);
       questbookname = "smuggle&number="+Pchar.amount_smuggleruns; //Set a questname
       AddQuestRecord(questbookname, 11);
       Preprocessor_Remove("location");
       Pchar.quest.Contraband.scout.done = true;
       //In 1 day he has to return
       NPChar = characterFromID(PChar.quest.Contraband.officerID);
       RemovePassenger(PChar, NPChar);
       NPChar.StoredFellow = True;
       if(DEBUG_SMUGGLING>2)trace("SMUGGLING removed "+NPChar.id+" as officer");
       LAi_SetActorType(NPChar);
       LAi_ActorRunToLocator(NPChar,"reload","reload1","Send Officer Gone",40);
     break;

     case "Send Officer Gone":
       NPChar = characterFromID(PChar.quest.Contraband.officerID);
       LAi_SetOfficerType(NPChar);
       ChangeCharacterAddressGroup(NPChar,"","",""); //We don't have to see him anymore
       if(DEBUG_SMUGGLING>2)trace("SMUGGLING removed "+NPChar.id+" from location");
       PChar.quest.Contraband_Scouting.win_condition.l1 = "Timer";
       PChar.quest.Contraband_Scouting.win_condition.l1.date.day = GetAddingDataDay(0, 0, 1);
       PChar.quest.Contraband_Scouting.win_condition.l1.date.month = GetAddingDataMonth(0, 0, 1);
       PChar.quest.Contraband_Scouting.win_condition.l1.date.year = GetAddingDataYear(0, 0, 1);
       PChar.quest.Contraband_Scouting.win_condition = "Send Officer time expired";
       if(DEBUG_SMUGGLING>0)trace("SMUGGLING timer set 1 day later ");
     break;

     case "Send Officer time expired":
       if(DEBUG_SMUGGLING>0)trace("SMUGGLING time expired you should go to: "+Pchar.quest.Contraband.tavern);
       PChar.quest.Contraband_Scouting2.win_condition.l1 = "location";
       PChar.quest.Contraband_Scouting2.win_condition.l1.location = Pchar.quest.Contraband.tavern;
       ref smugisland = GetIslandByIndex(sti(Pchar.quest.Contraband.islandindex));
       //First determine if the officer get caught.
       int caughtchance = getSmugglingState(smugisland)*20 + (GetDifficulty()*5);
       if(DEBUG_SMUGGLING>2)trace("SMUGGLING caughtchance for officer is: "+caughtchance);
       if(rand(99) < caughtchance)
       {
         //Officer caught
         PChar.quest.Contraband_Scouting2.win_condition = "Send Officer doesnt return";
         if(DEBUG_SMUGGLING>2)trace("SMUGGLING officer is caught");
       }
       else
       {
         //Based on your luck
         if(rand(9)<CalcCharacterSkill(PChar,SKILL_SNEAK))
         {
           //Success
           PChar.quest.Contraband_Scouting2.win_condition = "Send Officer has time";
           if(DEBUG_SMUGGLING>2)trace("SMUGGLING officer success");
         }
         else
         {
           //Failed
           PChar.quest.Contraband_Scouting2.win_condition = "Send Officer failed";
           if(DEBUG_SMUGGLING>2)trace("SMUGGLING officer failed");
         }
       }
     break;

     case "Send Officer doesnt return":
       if(DEBUG_SMUGGLING>0) trace("SMUGGLING officer was caught so lets reset stuff");
       questbookname = "smuggle&number="+Pchar.amount_smuggleruns; //Set a questname
       AddQuestRecord(questbookname, 14);
       ChangeCharacterReputation(pchar, -5);
       NPChar = characterFromID(PChar.quest.Contraband.officerID);
       DeleteAttribute(NPChar,"StoredFellow");
       DeleteAttribute(Pchar,"quest.Contraband.scout.done");
       LAi_KillCharacter(NPChar);
     break;

     case "Send Officer failed":
       if(DEBUG_SMUGGLING>0) trace("SMUGGLING officer appears in tavern");
       NPChar = characterFromID(PChar.quest.Contraband.officerID);
       ChangeCharacterAddressGroup(NPChar, Pchar.quest.Contraband.tavern, "reload", "reload1");
       LAi_SetActorType(NPChar);
       NPChar.dialog.currentnode = "Patrolschedule_failed";
       LAi_ActorDialog(NPChar,Pchar,"Send Officer back in slot",10.0,1.0);
       DeleteAttribute(Pchar,"quest.Contraband.scout.done");
     break;

     case "Send Officer has time":
       if(DEBUG_SMUGGLING>0) trace("SMUGGLING officer "+PChar.quest.Contraband.officerID+" appears in tavern");
       NPChar = characterFromID(PChar.quest.Contraband.officerID);
       ChangeCharacterAddressGroup(NPChar, Pchar.quest.Contraband.tavern, "reload", "reload1");
       LAi_SetActorType(NPChar);
       NPChar.dialog.currentnode = "Patrolschedule_got";
       LAi_ActorDialog(NPChar,Pchar,"Send Officer back in slot",10.0,1.0);
     break;

     case "Send Officer back in slot":
       if(DEBUG_SMUGGLING>0) trace("SMUGGLING officer becomes passenger again");
       NPChar = characterFromID(PChar.quest.Contraband.officerID);
       DeleteAttribute(NPChar,"StoredFellow");
       AddPassenger(PChar, NPChar, 0);
       LAi_SetOfficerType(NPChar);
       SetOfficersIndex(Pchar, -1, NPChar);
     break;
Looks like the success of the operation is determined at the time when you're supposed to meet the officer again.

One thing that definitely seems wrong in your compile.log file is that this is in there TWICE:
Code:
SMUGGLING officer becomes passenger again
Quest name Send Officer back in slot FOUND in CommonQuestComplete
SMUGGLING officer becomes passenger again
Quest name Send Officer back in slot FOUND in CommonQuestComplete
 
Looking at the code, I do see something VERY odd that could be the reason for that double compile.log entry.
Exiting the officer dialog triggers that case, but it is also triggered BEFORE that.

As a fix, I propose changing quests_common.c as follows:
Code:
    case "Send Officer failed":
       if(DEBUG_SMUGGLING>0) trace("SMUGGLING officer appears in tavern");
       NPChar = characterFromID(PChar.quest.Contraband.officerID);
       ChangeCharacterAddressGroup(NPChar, Pchar.quest.Contraband.tavern, "reload", "reload1");
       LAi_SetActorType(NPChar);
       NPChar.dialog.currentnode = "Patrolschedule_failed";
       LAi_ActorDialog(NPChar,Pchar,"",10.0,1.0); // PB: was "Send Officer back in slot"
       DeleteAttribute(Pchar,"quest.Contraband.scout.done");
     break;

     case "Send Officer has time":
       if(DEBUG_SMUGGLING>0) trace("SMUGGLING officer "+PChar.quest.Contraband.officerID+" appears in tavern");
       NPChar = characterFromID(PChar.quest.Contraband.officerID);
       ChangeCharacterAddressGroup(NPChar, Pchar.quest.Contraband.tavern, "reload", "reload1");
       LAi_SetActorType(NPChar);
       NPChar.dialog.currentnode = "Patrolschedule_got";
       LAi_ActorDialog(NPChar,Pchar,"",10.0,1.0); // PB: was "Send Officer back in slot"
     break;
That might help, but I haven't tested it yet.
 
:ahoy @Pieter Boelen

Just so you know - ( should have told you this before - apologies) - tried to leave the tavern when I had the 3 Player Characters ( game Version 24Oct ) -- you also get the 3 characters if the officer comes back & says he could not find out the times.

It causes a Black Screen & game crashes completely - no reload to location outside tavern. :shock. Have to use Task Manager to close game.

Tried before & after talking to Smuggler Agent for 2nd time - after my officer returned with the Safe times. -- Same thing happens.

Tried using Fast Travel after the Officer came back - same thing Black Screen on attempt to load new Location.

error logs attached BS1 - is without speaking to S A for 2nd time

BS2 - with speaking to SA for 2nd time.

:doff
 

Attachments

  • compileBS1.log
    10 KB · Views: 73
  • errorBS1.log
    6 KB · Views: 72
  • systemBS1.log
    177.4 KB · Views: 90
  • compileBS2.log
    6.4 KB · Views: 96
  • errorBS2.log
    4.9 KB · Views: 81
  • systemBS2.log
    13.7 KB · Views: 97
Just so you know - ( should have told you this before - apologies) - tried to leave the tavern when I had the 3 Player Characters ( game Version 24Oct ) -- you also get the 3 characters if the officer comes back & says he could not find out the times.
That doubling of that code I rectified would have applied in both cases. So if that was indeed it, both situations should be OK now.
But testing required to find out if that was the culprit behind that nasty bug or if this was just a small thing.
 
Have just played this with 5 Nov game Version.

Now there are only 2 Player Characters :D - i.e. one extra generated when officer returns.

Went and talked to Smugglers Agent after Officer returned. Then tried to exit tavern - caused Black Screen & game crashed completely. :modding

Attached Save is in tavern room waiting for officer to return - just exit room and officer should walk up stairs & talk to you.

:drunk
 

Attachments

  • PotC Smug Off_Crash_1.jpg
    PotC Smug Off_Crash_1.jpg
    176.6 KB · Views: 81
  • PotC Smug Off_Crash_2.jpg
    PotC Smug Off_Crash_2.jpg
    251.2 KB · Views: 75
  • compile.log
    15.8 KB · Views: 74
  • error.log
    4.9 KB · Views: 82
  • system.log
    14.6 KB · Views: 111
  • -=Player=- Jamaica.7z
    392.2 KB · Views: 56
So that's.... HALF the problem fixed. It still goes wrong, but only once instead of twice.
Clearly the officer return itself isn't doing what it's meant to though. :facepalm
 
hmmmm weird. this did work before.
I will take a look at it tomorrow.....

This might have something todo with the officer being removed or something :S.
He does show up in the tavern right?
 
You did add the attribute to the officer to prevent him being cleared, I did see that in your code.

I wanted to look into this one a bit further but haven't had the chance yet either.
When we find it, it probably turns out to be something quite silly. :cheeky
 
Back
Top