Surfpup's tConfig Mod Wiki
Advertisement
Difficulty: noframe
Time: 5 minutes


noframe

Under Construction
This page has been marked as under construction, which means information may change rapidly as it updated, or that the page is awaiting updates.


Modifying Textures[]

This tutorial will show you how to change original textures in Terraria. Yep, this is indeed possible and it is easy to do too, only requires a tiny bit of code. If you want to have your own dirt tiles for example, this is the only way to do it at the moment.

Requirements[]

  • At least a basic understanding of how mods work.
  • tConfig must be installed correctly. See the Install Guide, if you have problems.
  • You need atleast tConfig v0.23.0. You can always download the newest version here: v0.38.

Preparations[]

Before you can start, you have to create a blank file named "World.cs" in a subfolder of your mod called "Global", if you haven't already. This file will contain all of our code. Also of course you need a image of the texture you want to replace. Create a folder named "Gore" if you haven't already and put your png file in there.

Textures of original tiles[]

Tile Template

Tile template created by Hedgen

Be warned, if you replace the dirt texture, all other textures that merge with dirt will look wrong! In this example we assume our png file is named "StoneTexture". Okay, now open "Global.cs" and insert this code:

public void Initialize()
{
   Main.tileTexture[0] = Main.goreTexture[Config.goreID["StoneTexture"]];
}

The number in the brackets of Main.tileTexture contains the number of the tile you want to replace. Number zero is dirt, number one is stone, number two is grass, etc. For a full list, just look at List of Tiles. Also, you need to replace the name "StoneTexture" with whatever you named your png file, since this will replace the original file.

That's all, you're done!

- S. P. Gardebiter 05:44, April 14, 2012 (UTC)

Advertisement