Black Gate Money Changer

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Nickisaacson
Posts: 24
Joined: Thu May 14, 2020 1:34 pm

Black Gate Money Changer

Post by Nickisaacson »

Has anyone else noticed that Cynthia, the money changer doesn't always give you what she says she will?

I'm currently messing around in the BG quests and interactions mod.

For example, i had just returned from treasure hunting around Britannia, went to see Cynthia, and she told me i was getting 2100 gold from my bars and nuggets. I got about 1600.

I promptly went back to Sentri's house (a.k.a my hideout) and deposited the loot.

Next i went into the shape browser and found the gold bar and created 40 of them and counted them as i place them in my empty back pack. She told me i was getting 4000 gold, but i got 740. And they didn't go into my back, they went into Sentri's until he was maxed out with weight, and that was it.

I seem to remember from playing original BG in actual DOS that the inaccurate counting was an issue occasionally.

Can anyone else verify this?

Thanks.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Black Gate Money Changer

Post by Dominus »

hmm, something to test. If you can't hold more you should get the "you are too encumbered" or so message, but maybe that was only in SI?
Try if you get the correct amount if you have hackmover enabled
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Gotcha!
Posts: 354
Joined: Thu May 14, 2020 1:34 pm

Re: Black Gate Money Changer

Post by Gotcha! »

In Serpent Isle NPCs pass items on to your friends for sure, but I can't remember if this is also the case in TBG.
One would assume that they would at least drop it on the ground. Or perhaps she did, and the remaining 500 is behind a wall?
Nickisaacson
Posts: 24
Joined: Thu May 14, 2020 1:34 pm

Re: Black Gate Money Changer

Post by Nickisaacson »

After my first post, I did another test.

I made everyone leave the party, so that it was just the Avatar. I removed all his inventory items. Gave him an empty backpack with 30 gold bars (31/120 weight). She identified 3000 and i got 3000.

Dom,
As far as the hackmover aspect, in the first post, when i exchanged 2100 and got 1600-ish hackmover was enabled.

The 40 gold bar test had hackmover disabled, and the avatar only was carrying armor and an empty backpack. Strength was set to 60. (8/120 weight). Sentri had no armor and the avatar's heavy backpack with 18 strength (28/36 weight). All the gold went to Sentri.

Gotcha, unfortunately, there was no wall for the money to be hidden by.

I will do more testing this evening any post results.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Black Gate Money Changer

Post by Knight Captain »

Using the hackmover when doing transactions has led to unexpected results.

There are different intrinsics in Usecode around giving items to the party, so it is possible BG uses a less robust form than SI does. It's been a long while since I've looked at BG's source however.
NotStanley4330

Re: Black Gate Money Changer

Post by NotStanley4330 »

I have played BG through DOSBox a lto, and I have purchased things and all the party members will say "I will take that" until it is all in bags, at least as far as I know. I haven't looked into it in detail but I think it works that way originally in BG.
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Black Gate Money Changer

Post by Wizardry Dragon »

The problem is likely with Q&I ... as when you override a conversation, you override the _whole conversation_ and it likely has a subfunction that is supposed to deal with overflows that it isn't calling properly.

One limitation of the vanilla game (not sure if is present in Exult) is you can only deal with so many stacks of an item at a time, so manipulating large stacks of different things (in this case, money) can get dicey. Vanilla was using some clever things to get around this. Unfortunately, at least around the time I was developing TFL actively (and thus, Alun was developing Q&I actively, I had sought permission to implement it as part of TFL), overriding a conversation was all or nothing - so for instance to add NPC spellcasting to Jaana, we had to override her entire conversation tree. I am unsure if this still holds true, but it would certainly seem a reasonable explanation.

If it no longer holds true, I can and probably will work out a workaround for TFL that I can make available.

~ Wiz
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Black Gate Money Changer

Post by Knight Captain »

Looking at the BG source usecode, Cynthia uses UI_add_party_items which is known to give partial amounts in BG only:
http://exult.info/seventowers/ucc_ref.p ... arty_items

It looks like there is a check for the space or weight limit, but it is not clear if it works as expected. Here's the relevant source:
labelFunc042A_019E:
case "exchange" atend labelFunc042A_02D2:
var0003 = UI_get_schedule_type(UI_get_npc_object(0xFFD6));
if (!(var0003 == 0x001E)) goto labelFunc042A_02C7;
message("\"Dost thou have some gold that thou wouldst like to exchange?\"");
say();
var0004 = Func090A();
if (!var0004) goto labelFunc042A_02C0;
var0005 = Func0931(0xFE9B, 0x0001, 0x0285, 0xFE99, 0xFE99);
var0006 = Func0931(0xFE9B, 0x0001, 0x0286, 0xFE99, 0xFE99);
if (!(var0005 || var0006)) goto labelFunc042A_0209;
var0007 = true;
goto labelFunc042A_020D;
labelFunc042A_0209:
var0007 = false;
labelFunc042A_020D:
if (!(!var0007)) goto labelFunc042A_021B;
message("\"I can see thou hast no nuggets or bars of gold. Whatever gold thou mayest possess is already the coin of the realm. I cannot help thee anymore than that.\"");
say();
goto labelFunc042A_02BD;
labelFunc042A_021B:
message("\"We can exchange thy gold nuggets and bars into spendable coin for thee. I will give thee ten gold coins for each gold nugget and one-hundred gold coins for each gold bar.\"");
say();
var0008 = UI_count_objects(0xFE9B, 0x0285, 0xFE99, 0xFE99);
var0009 = UI_count_objects(0xFE9B, 0x0286, 0xFE99, 0xFE99);
var000A = (0x000A * var0008);
var000B = (0x0064 * var0009);
var000C = (var000A + var000B);
var000D = UI_add_party_items(var000C, 0x0284, 0xFE99, 0xFE99, true);
if (!(!var000D)) goto labelFunc042A_0285;
message("\"Oh, my. Thou canst not possibly carry that many gold coins. Thou must return when thou dost have more space in thy pack.\"");
say();
goto labelFunc042A_02BD;
labelFunc042A_0285:
var000E = UI_remove_party_items(var0008, 0x0285, 0xFE99, 0xFE99, true);
var000F = UI_remove_party_items(var0009, 0x0286, 0xFE99, 0xFE99, true);
message("\"And here are ");
message(var000C);
message(" gold coins for thee in return, ");
message(var0000);
message(". I thank thee for thy business.\"");
say();
labelFunc042A_02BD:
goto labelFunc042A_02C4;
labelFunc042A_02C0:
message("\"Very well. Mayhaps another time.\"");
say();
labelFunc042A_02C4:
goto labelFunc042A_02CB;
labelFunc042A_02C7:
message("\"Please come to The Mint during regular daytime hours.\"");
say();
labelFunc042A_02CB:
UI_remove_answer("exchange");
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Black Gate Money Changer

Post by Dominus »

I did create a bug report a while ago I just noticed :)
https://sourceforge.net/p/exult/bugs/1878/
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Locked