Page 1 of 1

[2.0.43] dump-data json has fraction for ItemProduct amount

Posted: Fri Apr 18, 2025 2:43 pm
by moon69
ItemProductPrototype#amount states that amount should be a uint16:

Code: Select all

amount :: uint16
but doing a --dump-data shows a fractional amount for some recipes in data-raw-dump.json. EG:

Code: Select all

"uranium-cannon-shell-recycling": 
    {
      "type": "recipe",
      "category": "recycling",
      "results": 
      [        
        {
          "type": "item",
          "name": "cannon-shell",
          "amount": 0.25,
          "extra_count_fraction": 0.25
        }, ...
It seems to affect recycling recipes where "extra_count_fraction" > 0.

Re: [2.0.43] dump-data json has fraction for ItemProduct amount

Posted: Fri Apr 18, 2025 2:52 pm
by boskid
This is hard to classify because what you see is raw data without any rules enforced that would get applied when creating prototype instances. There may be also leftovers from data stage if mods put some data that are unused by the game itself. Fixing this would be like plugging a single hole in a colander.

Re: [2.0.43] dump-data json has fraction for ItemProduct amount

Posted: Fri Apr 18, 2025 3:14 pm
by Bilka
Not a bug. Refer also to viewtopic.php?p=593577#p593577 and 109077