Merchant selling stone, price is 0 and can't be bought

Title: Stone price is 0, buy button is disabled.

Summary: While playing with Raya kingdom, sometimes I have the chance to buy stone which is always very cheap (and I don’t like to mine for it), sometimes it is labeled as low as 0 gold. When that happens, I can’t buy it as all buttons get disabled when the stone is selected.

Steps to reproduce:

  1. Play with Raya (I’m not sure if this also happens with the other kingdom)
  2. Wait for a merchant that sells you stone.
  3. The price varies, if it is 0, you can’t buy it.

Expected Results: Buttons enabled so I can buy it. (if 0/free is not intended, round it up to 1 gold)

Actual Results: Clicking on the buy 1/10/all button does nothing, all disabled.

Version Number and Mods in use: 0.13 release 489 x64 build.

System Information: Windows 10, 4 GB ram, i3 1.7 GHz and Intel HD Graphics 4400

2 Likes

Hey there @BrunoSupremo, welcome to the Discourse! Thanks for the report. Can you verify if you are running any mods?

In the mods folder there is only the 2 raya smod and radiant and stonehearth smod

1 Like

OK, thanks for checking. I don’t think trading items are intended to cost less than 1 gold each, as that would make them unbuyable. Going to page @sdee and @yshan to see this when they return from their vacation.

2 Likes

Title: Merchant selling stone for 0 and I can not purchase it.

Summary: Vosker Saji’s Polished Earths arrived at my town and I notice stone was selling for 0 and because I was going to be cheeky I wanted to buy it, but all the buy buttons are disabled.

Steps to reproduce:

  1. Play as Rayya
  2. Wait for merchant with stone that is selling for 0

Expected result: Should be able to purchase or make the price not be able to reach 0.

Actual: Am not able to buy stone

Picture:

Version: Alpha 13. I am not using any mods.

System: Windows 8.1 Intel Core i7-3630QM 2.40GHz
8GB RAM 64bit
Intel HD graphics 4000

1 Like

Alright, got it (I think)!

Did some digging, and here is what I have found:

The stonecutter shop is defined in stonecutter_shop.json, which is located in mods\rayyas_children\data\gm\campaigns\trader\arcs\encounters. In that json is the following line:

"overall_price_multiplier": 0.8,

Next, looking at hunk_of_stone.json, that defines a basic stone (located in mods\stonehearth\entities\resources\stone\hunk_of_stone), you can find stone’s value in gold:

"stonehearth:net_worth": {
         "value_in_gold": 1,

Finally, a look at the trading ui (shop_bulletin_dialog.js located in mods\stonehearth\ui\game\bulletin\bulletin_dialog\shop_bulletin_dialog) reveals the following:

_updateBuyButtons: function() {
      var self = this;

      var item = self.$('#buyList').find(".selected");
      var cost = parseInt(item.attr('cost'));

Based on the way JavaScript pareseInt works, it will look for all numbers in the first parameter, up to the first invalid character for the specific number system it is converting to. In this specific case the parameter appears to be "0.8" As there is not a second parameter in the function, it defaults to base 10 (how we humans count). As it is parsing the number to an integer, decimals are not allowed, so a decimal in the function would be an “invalid character,” and thus stop the parser, leaving 0 as the remaining integer.

3 Likes

The story of my entire Java class last semster. Haha

Might need to add a checking statement to make sure all 0 are turned to at least 1. :wink:

3 Likes

Summary:
Stones only cost “0g” at merchants, which makes it impossible to buy them.

Steps to reproduce:

  1. Play the game and wait for a merchant, which sells ores and stones.
  2. Select the stone and try to buy some.

Expected Results:
You can buy stone and “lose” some of your gold in return, like every other item in game.

Actual Results:
Stones are listed with a price of 0g, which (probably correctly) disables the buying buttons, which makes it impossible to buy stones.

Attachments:

Version Number and Mods in use:
Alpha 14 Steam unstable, v0.13.0, dev 2786 x64, no mods

System Information:
Windows 10, 64 Bit

Hey!

Thanks for the report, This bug has already been posted:

http://discourse.stonehearth.net/t/merchant-selling-stone-price-is-0-and-cant-be-bought/18705

Hope this helps, :slightly_smiling:

2 Likes

I have been counting on the automatic search when you start a new topic, and it didn’t come up, so sorry for the repost… ^^

Don’t worry, better to repost than to have no post about it at all.

Sad to see that it didn’t get fixed yet :frowning:

After they fix the higher priorities ones they will come to this, for sure.

1 Like

oh… It showed up in the automatic search for me, so I didn’t post this one. Maybe I should have posted in the other to up that one to recent. It only showed up when I was finished writing the thing, which is odd. Not sure how that works.

Anyway, just glad to know someone else noticed that and hopefully when they get quite a few of the major things sorted they can get all these minor ones. :smiley:

i’m pretty sure the auto-search for when you’re creating a new topic takes all the words you currently have and compares it to other posts, so for each word you write it compares it again.

make sense? and i’m probably wrong about that…

1 Like

Nope, that’s correct…though it does factor the title in as well. The issue we have here is that most of the words we use are similar to most other posts…how many topics on this forum use the word “game” or “Hearthling” or “error/bug”…so it isn’t always perfect.

3 Likes