Jump to content

Recommended Posts

Posted

I'm about to start working on a new mod. I want to boil salt water to get salt crystals. If I get a jug of water for example can I boil water and can I determine a difference between salt and fresh water? I've not looked at water mechanics yet. Hoping fresh and salt water are two different items. Thanks in advance 

Posted (edited)

Me again ;)

there is indeed a unique item for saltwater

    "item-waterportion": "Water",
    "item-boilingwaterportion": "Hot water",
    "item-saltwaterportion": "Sea water",

as well as a unique block and bucket (containing seawater)

boiling it may be tricky though because cooking mechanics (especially liquid related) are kinda borked.  I suspect that both of the "thirst" mods have come up with a solution, but I imagine they both used c# code to make that happen.

I highly recommend joining the official Vintage Story Discord where you can get help with such things from people that are more experienced in such areas.

Not many modders come over to the forums anymore, myself included.

Edited by Spear and Fang
Posted

I am a little confused currently about cooking. I made my item already. I simply want to boil this salt water and output my item. On grid crafting I can see its easy but cooking im not sure. Here is what I have currently:

 

Item:

{
  code: "saltcrystal",
  creativeinventory: { "general": ["*"]},
  shape: { base: "game:item/gem/rough/normal/diamond" },
  textures: {diamond: { base: "saltcrystal:saltcrystal" }},
  
  maxstacksize: 16,
  
  guiTransform: {
    translation: { x: 0, y: 0, z: 0 },
    rotation: { x: 151, y: -3, z: 0 },
    origin: { x: 0.487, y: 0.08, z: 0.5 },
    scale: 12
  },
  fpHandTransform: {
    translation: { x: -0.05, y: 0.04, z: 0 },
    rotation: { x: 5, y: 100, z: 0 },
    origin: { x: 0.5, y: -0.13, z: 0.5 },
    scale: 3.4
  },
  tpHandTransform: {
    translation: { x: -0.78, y: -0.11, z: -0.7 },
    rotation: { x: -41, y: -29, z: -60 },
    origin: { x: 0.5, y: 0.09, z: 0.5 },
    scale: 0.75
  },
  groundTransform: {
    translation: { x: 0, y: 0, z: 0 },
    rotation: { x: 0, y: 0, z: 0 },
    origin: { x: 0.5, y: 0, z: 0.5 },
    scale: 12
  }
}

 

This is the cooking recipe. This is where i am lost now currently. I'm expecting the ability to "output" an item but I dont see that currently in any sample code:

{
  code: "saltcrystal",
  ingredients: [
    {
      code: "water",
      validStacks: [
        {
          type: "item",
          code: "saltwaterportion"
        }
      ],
      minQuantity: 1,
      maxQuantity: 6,
      portionSizeLitres: 6,
    },
    {
      code: "water",
      validStacks: [
        {
          type: "item",
          code: "saltwaterportion"
        }
      ],
      minQuantity: 1,
      maxQuantity: 6,
      portionSizeLitres: 6,
    },
    {
      code: "water",
      validStacks: [
        {
          type: "item",
          code: "saltwaterportion"
        }
      ],
      minQuantity: 1,
      maxQuantity: 6,
      portionSizeLitres: 6,
    },
    {
      code: "water",
      validStacks: [
        {
          type: "item",
          code: "saltwaterportion"
        }
      ],
      minQuantity: 1,
      maxQuantity: 6,
      portionSizeLitres: 6,
    }
  ]
}

I want the recipe to be 6 salt water liters x 4 = 1 salt crystal. 

Posted

Updated code:

image.thumb.png.8c76d95156a937cd0c2e0674c63c78be.png

 

New code:

{
  code: "mysaltcrystal",
  shape: { base: "game:item/gem/rough/normal/diamond" },
  perishableProps: {
    freshHours: { avg: 400 },
    transitionHours: { avg: 0.01 },
    transitionRatio: 1,
    transitionedStack: { type: "item", code: "saltcrystal" }
  },
  ingredients: [
    {
      code: "water",
      validStacks: [  { type: "item", code: "saltwaterportion" } ],
      minQuantity: 4,
      maxQuantity: 4,
      portionSizeLitres: 6
    }
  ],
  dirtyPot: true,
  dirtyPotOutput: "saltcrystal"
}

 

Posted (edited)

Latest code I cant get it to work. No tut on cooking. I might try barrel if I cant get it going:

 

 

Update:

I got the mod working ish. I can now boil salt water, fixed crashing but not out putting item currently. I hope to have this out soon to everyone. Might be a few steps to boil salt water to get salt but it should be easy to get early game when I finish. Currently you can use a jug or bucket to get salt water, boil it with a stone in pot and produce boiled salt crystal. Use the boiled salt crystal(in a bowl) in a grid. This should produce 1 salt crystal. Next use grid salt crystal and rock to get 10 salt. This is the plan but we will see if I can get it to work this way. Stay tuned  

 

 

saltcrystal.zip

Edited by Micah Holmes
Posted

I don't know how to fix this issue:

image.thumb.png.249373db529be6dac1276bd5a6b4cdd9.png

 

I keep getting "Unknown" portion.I want it to return something I can put in a bowl or something and then take the bowl with the item in grid and produce a salt crystal. 

 

{
  code: "boiledsaltcrystal",  
  perishableProps: 
    {
    type: "Harden",
    freshHours: { avg: 4 },
    transitionHours: { avg: 0.01 },
    transitionRatio: 1,
    transitionedStack: { type: "item", code: "saltcrystal:saltcrystal" }
  },
  shape: { base: "game:item/gem/rough/normal/diamond" },
  textures: {diamond: { base: "saltcrystal:saltcrystal" }},
  attributes: {
    handbook: {
      ignoreCreativeInvStacks: true,
      "groupBy": ["items-*"]
    }   
  },
  ingredients: [
    {
      code: "game:saltwaterportion",
      validStacks: [  
        { 
          type: "item", 
          code: "game:saltwaterportion",
          shapeElement: "game:bowl/water"
        } ],
      minQuantity: 1,
      maxQuantity: 1,
      portionSizeLitres: 1
    },
    {
      code: "game:stone-*",
      validStacks: [
        {
          type: "item",
          code: "game:stone-*",
          shapeElement: "game:bowl/water"
        }
      ],
      minQuantity: 1,
      maxQuantity: 1
    }
  ],
  dirtyPot: true,
  dirtyPotOutput: "saltcrystal:saltcrystal"
}

Any suggestions would be helpful. 

 

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.