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

Cannot Confirm Pickpocket bug

Levis

Find(Rum) = false;
Staff member
Administrator
Creative Support
Programmer
Storm Modder
I got my pocket picked and when I stole it back he had all my money, about 575k, and so did I.

Do you have a savegame where this happened?
 
Quick look through the code suggests this shouldn't be happening:
Code:
    case "moneydouble":
       PlayStereoSound("INTERFACE\took_item.wav");
       {
         // Aconcagua: use pickgold stored at "stolen" instead of whole money
         pickgold = sti(NPChar.pickgold);
         AddMoneyToCharacter(PChar, pickgold);
         // Aconcagua: need to take money from char, too -> attacking afterwards does not double stolen money!
         AddMoneyToCharacter(NPChar, -pickgold);
         Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You got") + " " +  NPChar.pickgold + " " + XI_ConvertString("gold."));
         if(AUTO_SKILL_SYSTEM) { AddPartyExPChar(PChar, "Sneak", 100+pickgold/4)); }
         else { AddPartyExp(PChar, 100+pickgold/4)); }
       }
@Jason, can you give us the exact sequence of events, including the dialog options you used and how you eventually stole your money back?
 
@Levis: It just occurred to me that weird stuff in dialogs may occur because of reused variables.
Here's an example that I just ran into:
Code:
      RandQuestSum = RandSum("Few");
       d.Text = RandQuestSum  + DLG_TEXT[126] + GetMyAddressForm(NPChar, PChar, ADDR_CIVIL, false, false) + DLG_TEXT[127];
       Link.l1 = DLG_TEXT[128];
       Link.l1.go = "node_26";
       Link.l2 = DLG_TEXT[129];
       Link.l2.go = "exit";
     break;

     case "Node_26":
       if(makeint(PChar.money)>=RandQuestSum)
       {
        PlayStereoSound("INTERFACE\took_item.wav");
         AddMoneyToCharacter(pchar, -(RandQuestSum));
Note how 'RandQuestSum' is defined in a different case than where it used later.

It appears that each dialog is loaded twice now with the new dialog system that you made.
So while the above always used to work fine, I'm not sure if it still does!
It might be that the game exits the dialog before proceeding to the next case, which would leave incorrectly initialized variables.

Could that have affected @Jason's report too?
It shouldn't though, because it looks like "pickgold" in the Enc_walker.c dialog file is stored in an NPChar attribute, which should persist regardless of dialogs being opened and closed. :confused:
 
As far as I know in the old system this was the case also already. but it does seem to be the culprit.
Saving the value in a NPChar attribute should do the trick
 
Though the actual example from the opening post DOES already do that. So that doesn't quite match up.

I wonder where else there may be such instances. That example I posted was from the Jack Sparrow Henry dialog file.
 
As nobody has reported this again, I'm marking this as "Cannot Confirm".
 
Back
Top