Space Engineers

Space Engineers

Eat. Drink. Sleep. Repeat!
Siv 18. aug. 2022 kl. 23:43
Integration help
Hey, I'm having trouble with this item I'm working on. It is higher than EDSR in load order, the item spawns in game with no errors, blueprints work, it is consumable, everything works. I looked at the physicalitem/consumableitem definitions in EDSR, Plant and Cook, and Kuvat's Algae mod to make sure I was doing it right. I appear to be.

And yet, when consuming the item, <Stats> aren't updating and the game acts as if Time="" is set to zero. Any ideas?

<PhysicalItem> <Id> <TypeId>ConsumableItem</TypeId> <SubtypeId>LeafyGreens</SubtypeId> </Id> <DisplayName>Leafy Greens</DisplayName> <Description>Yummy Healthy Leafy Greens</Description> <Icon>Textures\GUI\Icons\Sapling.png</Icon> <IconSymbol>Greens</IconSymbol> <Size> <X>0.03</X> <Y>0.03</Y> <Z>0.03</Z> </Size> <Mass>0.5</Mass> <Volume>0.5</Volume> <Model>Models\Sapling.mwm</Model> <PhysicalMaterial>None</PhysicalMaterial> <Stats> <Stat Name="Water" Value="0.01" Time="7"/> <Stat Name="Food" Value="0.01" Time="7"/> <Stat Name="Health" Value="0.01" Time="7"/> </Stats> <MinimalPricePerUnit>100</MinimalPricePerUnit> <MinimumOfferAmount>1000</MinimumOfferAmount> <MaximumOfferAmount>10000</MaximumOfferAmount> <CanPlayerOrder>true</CanPlayerOrder> </PhysicalItem>
< >
Viser 1-3 af 3 kommentarer
CosmicDonut 18. dec. 2022 kl. 8:50 
You might try changing the values to whole numbers. I think, the stats are all treated like ints.
Siv 18. dec. 2022 kl. 18:06 
Okay, thanks!
CosmicDonut 27. dec. 2022 kl. 22:14 
I think I was confused. It's when you inflict damage. The amount of damage can only be whole numbers. Your floats here are fine.

You might try adding in the "type" meta data attribute in the "PhysicalItem" tag, as he does in the farming mod files. I know it doesn't always matter:

<PhysicalItem xsi:type="MyObjectBuilder_ConsumableItemDefinition">
<Id>
<TypeId>ConsumableItem</TypeId>
<SubtypeId>ApplePie</SubtypeId>
</Id>
<DisplayName>Apple Pie</DisplayName>
<Description>a delicious snack, high in carbs</Description>
<Icon>Textures\GUI\Icons\ApplePie.png</Icon>
<Size>
<X>0.05</X>
<Y>0.05</Y>
<Z>0.05</Z>
</Size>
<Mass>0.25</Mass>
<Volume>0.25</Volume>
<Model>Models\ApplePie.mwm</Model>
<PhysicalMaterial>None</PhysicalMaterial>
<Stats>
<Stat Name="Sleep" Value="-0.01" Time="5"/>
<Stat Name="Food" Value="0.1" Time="7"/>
</Stats>
<MinimalPricePerUnit>500</MinimalPricePerUnit>
<MinimumOfferAmount>3</MinimumOfferAmount>
<MaximumOfferAmount>24</MaximumOfferAmount>
<MinimumOrderAmount>300</MinimumOrderAmount>
<MaximumOrderAmount>18000</MaximumOrderAmount>
<CanPlayerOrder>true</CanPlayerOrder>
</PhysicalItem>
< >
Viser 1-3 af 3 kommentarer
Per side: 1530 50