• 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 Opium Smuggling: Fast Travel Remains Disabled Even After Quest Completes

I think I may be playing the Quest in the wrong way:facepalm - perhaps you are supposed to play it as an agent of the Governor
Thats the way I play it, when I tested it out. Havent keep the logs and savegame
because I though it was solved.
 
Of course you should also be able to play it as a proper smuggler.
But whether you actually can, I have no clue.
Would not surprise me at all if there were errors with it.
 
I have played the Opium Smuggling Quest through to the end - working for the Governor.

I still have the problem of Fast Travel not being restored when I finish the quest. :shrug

Attached is a Save in Cayman Port - I have to go to Cayman Governor - give him last report - exit - then go back and talk to him again ( say Have you had time to look at the reports I made ) - this generates final entry in the Quest Book and ends the quest . { Quest book does not close as there is not code for that - updated Quests_side.c file attached to correct this}

When I then leave the Governor - Fast Travel in the Port & Town is still disabled -

in the compile .log -
Code:
OPIUM SMUGGLING set new ambush
Quest name Set_Next_Ambush FOUND in CommonQuestComplete
SETTING MUSIC: music_english_governor
SETTING MUSIC: music_english_governor
Quest name Hand in Final Smuggling Report FOUND in SideQuestComplete   <<<<<<----- Hand in Final report
Reload: Process started for locator_name = reload1 and lockedReloadLocator =
reload_cur_island_index = -1
reload_cur_location_index = 404
reload_island_index = -1
reload_location_index = 399
Start reload
PauseAllSounds
ReloadStartFade
ItemLogic: On unload location
ReloadEndFade
** Whr: CreateWeatherEnvironment - iCurWeatherhour = 9, theHour = 9
Equip Character Donald Aguilar with blade4+3 his nation: 0 blade nation=
Equip Character Patrick Buttery with blade49 his nation: 0 blade nation=
Equip Character Christian Brazier with blade20 his nation: 0 blade nation=
Equip Character Gryffen Maiden with bladeC18+1 his nation: 0 blade nation=
Equip Character Henry Frere with blade1+3 his nation: 0 blade nation=
Equip Character Edmond Freeland with bladeC6 his nation: 0 blade nation=
ItemLogic: On load location Grand_Cayman_town
ItemLogic: found 0 buttons
ItemLogic -> randItem draw: no model for item Grand_Cayman_town.spyglass1
Quest name Opium_Ambush FOUND in CommonQuestComplete                           <<<<<------ Still trying to generate Soldier Ambush 
OPIUM SMUGGLING set new ambush
Quest name Set_Next_Ambush FOUND in CommonQuestComplete
SETTING MUSIC: music_eng_town
SETTING MUSIC: music_eng_town


Two Other Things

When Fast Travel is disabled - Is it possible to have the normal Fast Travel disabled X icon used - instead of having all the icons display with the log message at the top left of the screen. ( see Images )

Potc_B14Beta4_FT_Normal_Disable.jpg PotC_B14Beta4_FT_Opium_Disable.jpg


Also

My Buyers List for Opium included - Rian Dekkers - One of the women outside Kralendijk Townhall - who starts The Strange things Going On in the Caribbean Side-quest

PotC_B14Beta4_Opium_Buyer.jpg

Is the Buyers List supposed to include Quest Characters - what happens if you do that quest first and they are not there when you come to do the Opium Quest

Each time you'll start a game the buyers will be selected randomly, so this will be different every time. It's even possible one buyer might be in the opium den :p. Hence the rule you need to go to one other buyer before going back to the previous one. There is a sligt possebility there are 2 character on jamaica chosen. But if that is the case you are just very lucky :p.

Does this mean that the Buyers are selected when you first start the game ? :shrug

Is it possible that it could select say Nigel Blythe - or Artois Voysey on Nevis -- or Rhys Bloom in Port Royale. :shrug


:drunk
 

Attachments

  • quests_side.c
    454.3 KB · Views: 119
  • -=Player=- Cayman.7z
    598.6 KB · Views: 111
  • compile_SmugFT.log
    17.1 KB · Views: 130
  • system_SmugFT.log
    3.6 KB · Views: 112
When I then leave the Governor - Fast Travel in the Port & Town is still disabled
That is strange! The quest close and Fast travel enabled when I leave the Governor or it was doing it
when I tested it. (see post 17 here)
 
That is strange! The quest close and Fast travel enabled when I leave the Governor or it was doing it
when I tested it. (see post 17 here)

I know - so I don't know what is happening - :facepalm

@ANSEL -- If you have a moment could you take a look at the walkthrough I have put on the Wiki here:

Opium Smuggling - A Smugglers Life for Me | PiratesAhoy!

and see if I have missed anything. Or done anything wrong.

All comments & suggestions are appreciated.

Thanks
 
Last edited:
Maybe I can look at some stuff this weekend. No promises though.
Please remind me on Saturday.
 
@Talisman: I have gone through the walkthrough and it looks fine to me.
Suggestion: Continue Smuggling until some of the smugglers on the beach are killed (by coastguards or you) – search their bodies – eventually you will find some Opium on one of them - or go to Jamaica and buy some opium at the Opium den.
I have to say, I'm not quite familiar with Lewis quests yet.
 
Is the Buyers List supposed to include Quest Characters - what happens if you do that quest first and they are not there when you come to do the Opium Quest
The GetSmugglingGuildMembers function contains a check on the "questchar" attribute so quest characters won't be added.

Does this mean that the Buyers are selected when you first start the game ? :shrug
I just checked: It is generated at the moment you go through the "Opium/Smuggling explanation dialog".

Is it possible that it could select say Nigel Blythe - or Artois Voysey on Nevis -- or Rhys Bloom in Port Royale. :shrug
Good question! They don't have the "questch" attribute, so yes they could. Which is probably bad once you have hired them.
They DO have the "isOfficer" attribute though, so I have now edited the GetSmugglingGuildMembers function to avoid those characters too.
See attached. This doesn't crash the game, but is otherwise untested....

My Buyers List for Opium included - Rian Dekkers - One of the women outside Kralendijk Townhall - who starts The Strange things Going On in the Caribbean Side-quest
She is a special case. She's sort-of "half" a quest character, because she's also a sort-of regular citizen.
Quest characters don't change their name if a town is owned by a different nation in a different period.
Because Kralendijk is Spanish in Early Explorers, we deliberately REMOVED that attribute from those three towngirls.
So the game doesn't consider her to be a "quest character".

I'm not sure what is the best solution there....
As far as I can tell, once she has been placed, she remains there for the entire game and never is removed again.
No harm in it then?
 

Attachments

  • smuggling.c
    68.6 KB · Views: 128
I still have the problem of Fast Travel not being restored when I finish the quest. :shrug

Attached is a Save in Cayman Port - I have to go to Cayman Governor - give him last report - exit - then go back and talk to him again ( say Have you had time to look at the reports I made ) - this generates final entry in the Quest Book and ends the quest . { Quest book does not close as there is not code for that - updated Quests_side.c file attached to correct this}

When I then leave the Governor - Fast Travel in the Port & Town is still disabled -
I think the culprit is here:
Code:
    case "Opium_Ambush":
       //Clean up previous dialog
       if(CheckAttribute(pchar,"quest.opium_smuggling.guards.send"))
       {
         if(sti(pchar.quest.opium_smuggling.guards.send) > -1)
         {
           sld = getCharacter(sti(pchar.quest.opium_smuggling.guards.send));
           LAi_SetGuardianType(sld);
           sld.Dialog.CurrentNode = "First time";
         }
       }
       pchar.quest.opium_smuggling.guards.send = -1;
       //Time for the ambush
       if(CheckCharacterItem(pchar,"opium"))
       {
         //Only go if the character has opium
         int radius = 30;
         int closeidx = FindGuards(radius); //return -1 if there are no guards nearby; otherwise it returns the closes guard in the quest attributes
         String guardid = "Guard"+closeidx;
         if(closeidx > 0)
         {
           //If the closest guard is still too far away, they won't spot you and you'll be safe
           if(stf(pchar.quest.opium_smuggling.guards.(guardid).dist) < 25)
           {
             //There are type guard close by so they can ambush you
             int chance = getOpiumCaughtChance();
             if(DEBUG_SMUGGLING>2)trace("OPIUM SMUGGLING check if guard talks to you with chance: "+chance);
             if(rand(100)<chance)
             {
               sld = getCharacter(sti(pchar.quest.opium_smuggling.guards.(guardid).idx));
               if(DEBUG_SMUGGLING>2)trace("OPIUM SMUGGLING send guard: "+sld.id);
               LAi_SetActorType(sld);
               LAi_ActorDialog(sld, pchar, "", 120, 0);
               pchar.quest.opium_smuggling.guards.send = pchar.quest.opium_smuggling.guards.(guardid).idx;
               sld.Dialog.Filename.SmugglerGuard = "Smuggler_Guard.c";
               sld.Dialog.CurrentNode = "OpiumCaught";
             }
           }
         }
       }
       if((GetDataYear() >= sti(pchar.quest.opium_smuggling.expyear)) && (GetDataMonth() >= sti(pchar.quest.opium_smuggling.expmonth)) && (GetDataDay() >= sti(pchar.quest.opium_smuggling.expday)))
       {
         if(DEBUG_SMUGGLING>2)trace("OPIUM SMUGGLING expired");
       }
       else
       {
         Lai_QuestDelay("Set_Next_Ambush",0);
       }
     break;

     case "Set_Next_Ambush":
       if(pchar.quest.opium_smuggling.active == "1")
       {
         if(DEBUG_SMUGGLING>2)trace("OPIUM SMUGGLING set new ambush");
         pchar.quest.opium_smugglingset.win_condition.l1 = "ExitFromLocation";
         pchar.quest.opium_smugglingset.win_condition.l1.location = pchar.location;
         pchar.quest.opium_smugglingset.win_condition = "Opium_Ambush";
       }
       else
       {
         if(DEBUG_SMUGGLING>0)trace("OPIUM SMUGGLING ended");
       }
     break;
The "Next Ambush" ALWAYS gets set if you have pchar.quest.opium_smuggling.active == "1" .
And that gets set to "0" ONLY if you get caught by a "Smuggler Guard" and decide not to fight.
So there is most definitely some functionality completely missing! :shock

For one thing, why in case "Opium_Ambush" can Lai_QuestDelay("Set_Next_Ambush",0) be called even if you don't actually HAVE Opium??? It isn't inside the if-statement.
Out of curiosity, can you give Opium to your officers? If so, that would be an exploit. If not, the solution might be simple.

Also in case "Set_Next_Ambush" I would expect to see a CheckCharacterItem(pchar,"opium") in there somewhere.

And also pchar.quest.opium_smuggling.active = 0; should be added in several other spots where it is appropriate to stop the "checking process" again.

That already gives us three potential solutions. Maybe you can figure out what would be the best way to do it?

When Fast Travel is disabled - Is it possible to have the normal Fast Travel disabled X icon used - instead of having all the icons display with the log message at the top left of the screen. ( see Images )
I think the AllowFastTravelForSmuggling() function should already do that. That one DOES have a CheckCharacterItem(pchar,"opium") line.
That means Fast Travel is probably disabled properly as long as you actually carry the opium and the quest is active.
I think you get the behaviour you describe only if the "Ambush Loop" is NOT be aborted as per above but you also don't carry opium.
Which means it should be fine during the quest, but the quest isn't properly ended.

Clearly this feature was never finished quite properly. Thanks for testing it and tying up its loose ends! :cheers
 
Out of curiosity, can you give Opium to your officers? If so, that would be an exploit. If not, the solution might be simple.

:yes - Yes you can give the Opium to your Officers - this appears to stop the guards from spotting you. But Fast Travel is still disabled.



The "Next Ambush" ALWAYS gets set if you have pchar.quest.opium_smuggling.active == "1" .
And that gets set to "0" ONLY if you get caught by a "Smuggler Guard" and decide not to fight.
Also after the guard challenges you and you surrender the Opium - Fast travel appears to remain disabled :shrug

The Fast travel is always disabled if you buy Opium from the Opium Den – whether or not you are doing the Opium Quest:

In file opium_wasted-dialog.c ( for the seller in the Opium den)


Code:
case "Buy1":

  TakeNItems(PChar, "opium", 1);
  AddDialogExitQuest("Opium_set_first_ambush"); <<<<<<<<<<<<
  AddMoneyToCharacter(PChar, -1*sti(NPChar.opiumprice)*1);
  PlayStereoSound("INTERFACE\took_item.wav");
  dialog.text = DLG_TEXT[16];
  Link.l1 = DLG_TEXT[17]
  Link.l1.go = "Exit";
  break;


  case "Buy12":

  TakeNItems(PChar, "opium", 12);
  AddDialogExitQuest("Opium_set_first_ambush");  <<<<<<<<<<<<
  AddMoneyToCharacter(PChar, -1*sti(NPChar.opiumprice)*12);
  PlayStereoSound("INTERFACE\took_item.wav");
  dialog.text = DLG_TEXT[16];
  Link.l1 = DLG_TEXT[17]
  Link.l1.go = "Exit";
  break;


  case "Buy72":
  TakeNItems(PChar, "opium", 72);
  AddDialogExitQuest("Opium_set_first_ambush");  <<<<<<<<<<<<<
  AddMoneyToCharacter(PChar, -1*sti(NPChar.opiumprice)*72);
  PlayStereoSound("INTERFACE\took_item.wav");
  dialog.text = DLG_TEXT[16];
  Link.l1 = DLG_TEXT[17]
  Link.l1.go = "Exit";
  break;

  }

}

These call AddDialogExitQuest("Opium_set_first_ambush"); in Quests_conmmon.c

The dialog exit from the seller in the Opium den sets up the guards to spot you if you are carrying Opium ( Opium Ambush ) & thus disables Fast Travel.

Getting Opium other ways – eg finding it on the bodies of dead smugglers on the beach – does not affect the guards or Fast Travel .

Attached is a Save from the Nat Hawk Story (beginning ) - I have just reported to Silehard about the French invasion of Speightstown – have 2 officers - & am standing outside the Opium Den about to go inside and Buy some. – If you want to test things

:read
 

Attachments

  • -=Player=- Jamaica. Port Royale. Center. May 11th, 1750.7z
    502.9 KB · Views: 91
Yes you can give the Opium to your Officers - this appears to stop the guards from spotting you.
That doesn't sound good, does it? Maybe should be made into a Quest Item so they can't be given away?
Alternatively, ideally officers should be checked as well. But that does nothing to solve your problem.

Also after the guard challenges you and you surrender the Opium - Fast travel appears to remain disabled :shrug
Try executing pchar.quest.opium_smuggling.active = 0; through console and see if that helps.
You may have to reload to another (two?) locations before it would have an effect.

The Fast travel is always disabled if you buy Opium from the Opium Den – whether or not you are doing the Opium Quest:
That is probably intentional. You should be able to get caught if you carry opium, regardless of whether you work for the governor or not.

Getting Opium other ways – eg finding it on the bodies of dead smugglers on the beach – does not affect the guards or Fast Travel .
That sounds unintentional. I figure ideally it should happen if you carry opium.
 
@Talisman: Would you agree with me that it would make sense if the "potentially getting caught" functionality is linked to "carrying opium" rather than any sort of quest-related stuff?
I have some ideas on how to rework the code to make that happen. Might simplify things a bit....
 
@Talisman: Would you agree with me that it would make sense if the "potentially getting caught" functionality is linked to "carrying opium" rather than any sort of quest-related stuff?
I have some ideas on how to rework the code to make that happen. Might simplify things a bit....

That would make sense :yes - also put something in the quest book entry which

except

If you start a game with the occupation Smuggler - you are given some Opium among the starting items ( have to be removed otherwise the guards will catch you right at the beginning of the game before you have even got started. )

Also you will probably have to stop the player transfering the Opium to their Officers.

That doesn't sound good, does it? Maybe should be made into a Quest Item so they can't be given away?
Alternatively, ideally officers should be checked as well. But that does nothing to solve your problem.

If you make Opium a Quest item - will the player still be able to use it - and thus benefit/suffer from the effects as at present ? :sick

:drunk
 
That would make sense :yes - also put something in the quest book entry which
Is there something missing from that sentence?

If you start a game with the occupation Smuggler - you are given some Opium among the starting items ( have to be removed otherwise the guards will catch you right at the beginning of the game before you have even got started. )
You mean to remove those Opium items from the Smuggler start, right?
That's easy. :yes

Also you will probably have to stop the player transfering the Opium to their Officers.
I think just setting the item price to 0 will serve to do that.
In initItems.c find:
Code:
n = InitItem(n,"opium", "",     "Levis",  2, 0.00,  1,  100, 0,  0, 144, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  1); // Opium
Replace with:
Code:
n = InitItem(n,"opium", "",     "Levis",  2, 0.00,  1,  0, 0,  0, 144, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  1); // Opium
Then press F11 to make the change take effect.

If you make Opium a Quest item - will the player still be able to use it - and thus benefit/suffer from the effects as at present ? :sick
With the price = 0 trick I suggest above, I think that should indeed remain working.
I'd appreciate if you double-check that though. :doff
 
Is there something missing from that sentence?

I was going to add something but changed my mind

so it should just read -" That would make sense :yes"

You mean to remove those Opium items from the Smuggler start, right?
That's easy. :yes

:yes

I think just setting the item price to 0 will serve to do that.
In initItems.c find:
Code:
n = InitItem(n,"opium", "",     "Levis",  2, 0.00,  1,  100, 0,  0, 144, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  1); // Opium
Replace with:
Code:
n = InitItem(n,"opium", "",     "Levis",  2, 0.00,  1,  0, 0,  0, 144, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  1); // Opium
Then press F11 to make the change take effect.


With the price = 0 trick I suggest above, I think that should indeed remain working.
I'd appreciate if you double-check that though. :doff

Will this affect the price that the opium is sold for in the Opium den ?

:drunk
 
Will this affect the price that the opium is sold for in the Opium den ?
Good question.
For some reason the initItems.c value doesn't seem to be used.
Looks like it uses this rather bizarrely simple function instead:
Code:
int GetOpiumPrice()
{
   return 100;
}
So it should be fine.
 
Great! That at least confirms the issue is where I thought it was.
And gives you a temporary solution too.
I'll see if I can sort out the proper fix I have in mind tomorrow.
 
I think just setting the item price to 0 will serve to do that.
In initItems.c find:
Code:
n = InitItem(n,"opium", "",     "Levis",  2, 0.00,  1,  100, 0,  0, 144, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  1); // Opium
Replace with:
Code:
n = InitItem(n,"opium", "",     "Levis",  2, 0.00,  1,  0, 0,  0, 144, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  1); // Opium
Then press F11 to make the change take effect.

This works - :onya

Stops player from transfering/exchanging opium with an officer - & Opium can still be used/consumed by player.:dance

:bow

:cheers
 
Back
Top