Tutorial How to Make a tile template Config

Discussion in 'Starbound Modding' started by thesidofevil, Jul 15, 2015.

  1. thesidofevil

    thesidofevil Void-Bound Voyager

    other than making you want to rip your hair out tile templates can be a very useful tool when making new materials/tiles

    one of these features can be remaking the whole tile template system of your mod to include extra tile textures.
    EXAMPLE:
    [​IMG]

    To start off we need to make the file, for me i will name it something related to the mod, or you can name it whatever but always put a .config at the end of it.

    Open the file up and put:
    [​IMG]
    It is recommended to use Notepad++ : https://notepad-plus-plus.org/

    after you added the brackets add in:
    [​IMG]
    pieces are the shapes or textures that you put into the config to make them appear:
    [​IMG]
    What is going on here is the definition of a piece, the name for my piece is "Horizontal" because that is the piece it is representing, the name can be anything but if it is too long it can get very confusing.

    "textureSize" is the size [x, y] of the piece you are selecting:
    [​IMG]
    The image above use 8X8 textures between the magenta lines.

    "texturePosition" is exactly that, the position of the texture on the sheet [x, y]

    ok, the next two things
    "colorStride" and "variantStride" are difficult to understand so just set colorStride's [x, y] to [0, y] y here being the height of the texture sheet. Now set variantStride to [x, 0] x as the width of the texture sheet

    it should look something like this now:
    [​IMG]

    I did make a mistake in the image before this one, you NEVER EVER put a , after the very last piece definition so if you were to do multiple pieces do something similar to this:
    just remember what i said about comma's

    "Piece1" : {
    "textureSize" : [8, 8],
    "texturePosition" : [0, 0],
    "colorStride" : [0, 26],
    "variantStride" : [26, 0]
    },
    "Piece2" : {
    "textureSize" : [8, 8],
    "texturePosition" : [9, 0],
    "colorStride" : [0, 26],
    "variantStride" : [26, 0]
    }

    now we go on to the difficult part:

    paste this after the pieces part

    "rules" : {
    "EqualsSelf" : {
    "entries" : [
    {
    //"EqualsSelf is if a tile of the same ID is on selected Axis
    "type" : "EqualsSelf"
    }
    ]
    },
    "NotEqualsSelf" : {
    "entries" : [
    {
    //inverse does the opposite of what the type is, so this one is if the tile up or down, left or right does not equal the ID of this one
    "type" : "EqualsSelf",
    "inverse" : true
    }
    ]
    },
    "Connects" : {
    "entries" : [
    {
    "type" : "Connects"
    }
    ]
    },
    "Empty" : {
    "entries" : [
    {
    "type" : "Connects",
    "inverse" : true
    }
    ]
    }
    }

    your config should now look like this:
    [​IMG]

    Now we are on tot he part that caused me to go insane but i figured it out for all of you!
    [​IMG]

    ok,
    NotEqualsSelf is if the tiles in the selected direction are either empty or they do not equal the ID of the selected tile
    [0, 0] or [x, y[ of this is easier to understand here:
    [​IMG]
    at the very end at the pieces part there is a [x, y] or [0, 0] this is the offset of the texture, for me it is 0, 0 because the game defaultly uses 8 x 8 textures, this can be any resolution but you do have to modify the config a ton to get it to work, JUST REMEMBER THE THING ABOUT COMMAS, i hope you like the tutorial but there is one last thing

    in your material file at the renderTemplate part type in the string to where the template is located so my config was placed at the tiles folder of my mod, so i would put "renderTemplate" : " /tiles/tutorialTemplate.config"
    COOOMMMMAAAAASSSS!!!!!
     
    GonDragon and The | Suit like this.
  2. Panthera Pardus

    Panthera Pardus Subatomic Cosmonaut

    Hello Together,

    I just stumbled about this Tutorial, and was surprised by its content. Therefore I'm sorry to ask this. But does that mean, that it's possible to create my own custom template.config file? And would the game recognize and use it?
    If it works like that, it would be very usefull for my window material.

    Joy and Happiness
    Panthera Pardus

    Edit: No Answer needed. I just tested it. I copied the pipetemplate.config and renamed it to customtemplate.config. Added a link in my testmaterial and startet the game. My Testmaterial was used like expected, which is awesome.:headbanging:
    thesidofevil, thank you very much for this Tutorial. That will decrease my windowmaterial from 13 files down to 2 Files, and at the same time I could increase its complexity, which is amazing. I would never have thought to create an own template.config file. Therefore, many many thanks. :up: Have a nice Day and

    Joy and Happiness
    Panthera Pardus
     
    Last edited: Oct 11, 2015
  3. thesidofevil

    thesidofevil Void-Bound Voyager

    That's exactly why i looked into tile .templates to lo change a really ugly texture sheet to an organized one.
     
  4. Panthera Pardus

    Panthera Pardus Subatomic Cosmonaut

    Hello Together,

    it is allmost done. The only thing left to do, are the color variants. After that I can remove it from my testing mod. But before I do that, I definitly will go to bed. It was a long night.
    thesidofevil,.....
    Thanks.png
    Just a short Example how it looks. By the way, the old file contains 13 different elements each element is an own material. The new version is only one Material which contains 47 Elements.
    My bed is calling. Therefore, have a nice Day or Night and

    Joy and Happiness
    Panthera Pardus
     
    Ickura likes this.
  5. thesidofevil

    thesidofevil Void-Bound Voyager

Share This Page