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:
Play with Raya (I’m not sure if this also happens with the other kingdom)
Wait for a merchant that sells you stone.
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
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.
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:
Play as Rayya
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.
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.
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.
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.
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.