• 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

Like i said it did work before, so something must have changed to make it not work anymore.
 
Up to what point did you test?
If I understand correctly from @Talisman, it does still work.
But rather than just getting the officer back, as a bonus you also get an extra player character.
That wouldn't be obvious unless you check the Passengers Interface afterwards or leave the location.

My first gut feeling is that the problem might be because one of the functions used is meant to get a character index rather than the ref that it gets now.
But I can't access the code for a while to actually double check that.
 
Up to what point did you test?
If I understand correctly from @Talisman, it does still work.
But rather than just getting the officer back, as a bonus you also get an extra player character.
That wouldn't be obvious unless you check the Passengers Interface afterwards or leave the location.

My first gut feeling is that the problem might be because one of the functions used is meant to get a character index rather than the ref that it gets now.
But I can't access the code for a while to actually double check that.
I've checked it all. Also the returning etc because it gave some problems before too.
I will take a look at it.
 
I've checked it all. Also the returning etc because it gave some problems before too.
I will take a look at it.
Managed to hyjack my brother's computer and had a look at the code.
Looks like my gut feeling wasn't wrong. This is the relevant function call:
Code:
int SetOfficersIndex(ref _refCharacter,int _OfficerNum, int _OfficerIdx)
But this is how it is used for the smuggling officer return:
Code:
        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;
Note that "NPChar" is the ref to the character and not an index.

I think this will fix the problem:
Code:
        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, sti(NPChar.index)); // PB: Use index instead of reference
        break;

Extract attached to PROGRAM\QUESTS to try this. :doff
 

Attachments

  • quests_common.zip
    36.8 KB · Views: 97
Hmmm....I copied that from somewhere else but seems it was wrong there too then.... Dunno where I copied it from anymore.
But indeed seems to be the problem.
 
Hmmm....I copied that from somewhere else but seems it was wrong there too then.... Dunno where I copied it from anymore.
I just searched the entire PROGRAM folder for SetOfficersIndex and indeed found one spot where it was also wrong.
Here in Enc_Walker.c:
Code:
        case "enlist_me1":
            SetOfficersIndex(PChar, -1, NPChar);
            LAi_SetOfficerType(NPChar);
            Diag.CurrentNode = "got_officer";
            DialogExit();
        break;
You must have been unlucky to copy it from there, which was literally the only spot in the game where it wasn't correct. :facepalm

Anyway, it's actually lucky for us: At least we now caught BOTH and otherwise we may not have found out for a long time to come. :onya
 

Attachments

  • Enc_Walker.zip
    9 KB · Views: 86
Sounds like my luck :wp

Guess my testing did work cause I only tried it while having 1 officer....
 
:ahoy

Used new quest_common.c from Post #24.

This now works OK. :yes


No extra player characters - officer returns OK ( both with times & without) - No Black screen of death when you try to leave the tavern.

So everything here appears fixed :thumbs1 :bow.





:cheers
 
Last edited:
:ahoy


With @Levis latest files ( 11 Nov) this bug has returned. :modding

See Images - includes Black Screen of Death when you try and leave the tavern.

:drunk
 

Attachments

  • PotC Smug Double_1.jpg
    PotC Smug Double_1.jpg
    181 KB · Views: 80
  • PotC Smug Double_2.jpg
    PotC Smug Double_2.jpg
    249.8 KB · Views: 77
  • PotC Smug Double_4.jpg
    PotC Smug Double_4.jpg
    38.7 KB · Views: 82
  • error_SD.log
    3.5 KB · Views: 90
  • compile_SD.log
    99.4 KB · Views: 94
  • system_SD.log
    8.9 KB · Views: 99
Probably Levis didn't have my fix for this one in his own game.
I'll make sure to keep it in mine though!
Thanks for catching, @Talisman. :cheers
 
I will update it for the next update of the zip :). thanks for catching it
 
Back
Top