Page 1 of 1

ItemProductPrototype::type is not always required

Posted: Wed May 06, 2026 9:00 pm
by DaleStan
Comparing the 1.1 and 2.0 documentation makes me believe that ItemProductPrototype::type is required in 2.0. However, with the mod Tricky Old Nick, --dump-data (output attached) produces at least one rocket_launch_products entry with no type. For example, at line 65882:

Code: Select all

        {
          "name": "nullius-guide-drone-nickel-1",
          "amount": 1,
          "probability": 0.2
        }
Under what circumstances is type optional in an ItemProductPrototype?

Re: ItemProductPrototype::type is not always required

Posted: Thu May 07, 2026 5:29 am
by boskid
In 2.0, `type` is required only in places where there is selection between ItemProduct and FluidProduct. Since rocket_launch_products is always an ItemProduct, there is no need to check what type it is becuase only items are allowed.

As for 2.1, there will be a change that makes code consistent with docs: `type` will be always mandatory regardless of prototype taking only ItemProduct or any product. This means that this data you mentioned will throw an error due to missing type.