Modding Help Stardew Valley .json Variables

Discussion in 'Mods' started by viciou, Feb 14, 2018.

  1. viciou

    viciou Aquatic Astronaut

    So, to start it off, I want to make my own Custom Farming Machines. I actually looked at Platonymous' machines' .json file and was wondering if the variables created are custom variables created for Stardew Valley alone. If I may ask, may I know the details for these variables?

    "texture"
    "readyindex"
    "pulsate"
    "tileindex"
    "time"
    "frames"
    "production"
    "id"
    "legacy"
    "prefix"

    This line of code:

    "materials":
    [
    {
    "index": 184 (what is "index? I know there are item IDs for each item, but what is this for? also, what is a negative index?)
    }
    ]


    This another line of code (what does it mean in general):

    "materials":
    [
    {
    "index": 771,
    "stack": 3
    }
    ]


    Thank you in advance!
     
    • Loscoz

      Loscoz Space Hobo

      In programming, an index is normally used to relate to objects in an array, it's normally a unique whole number starting at 0, based on the samples I'd say the index = item id but I would have to see a bit more code for context. Now for the negative index I am new to mod sdv but in the past games I've seen them used as sample/test items, debug objects or objects that have been removed from the game/prerelease items.
       
      • Digus

        Digus Spaceman Spiff

        If the index are the item ids, negative index are categories.

        "materials":
        [
        {
        "index": 771,
        "stack": 3
        }
        ]

        probably mean that to make this machine you need 3 items of index 771.
        if it were a negative number, it would mean that you need any item of that category.
         

        Share This Page