User:Tomodachi94/CGCG

Feel free to write this down if you want and turn it into a guide

--Retep988, in response to Tomodachi94's incessant questions about how Template:Cg works.

Crafting grids (Cgs) are used to emulate machines in crafting recipes. There are many nuances for creation of Cgs, but they are straightforward once you know them.

This tutorial assumes you use GIMP for all image editing. Other image editors will work, but the instructions may be different.

Getting the image of the GUI
The first thing that must be done is obtaining the texture of the GUI from the mod's assets. If the mod is open-source (on a site like GitHub or Bitbucket), you first must navigate to that repository.

If the mod is closed-source, the process takes slightly longer. First, copy the mod  file into another location. Rename the file, replacing  with. Extract the  file.

You then need to navigate to a folder called, where   is the identifier of the mod. This folder will be in a  folder if you are retrieving the asset from source. This folder should contain one (or more) PNG files, which are the texture for the GUI of the machine.

The asset should look something like this:



Note the presence of the inventory grid (the lower left) and the progress bar (upper right), along with the machine's actual UI (upper center).

Resizing and cropping the image
Open the full asset in your image editor. For this example, we will use GIMP.

Crop the image down to just the machine's UI using, deleting the inventory and progress bar. Keep some space at the top for the name of the machine. Clean up the edges using the color picker and brush, then click. Click the  dropdown and change it to , then change the upper value to. Under the  section, change   to. After changing the  dropdown, press the   button.

The GUI should look something like this:



After doing all of this, save the file to your disk and upload it using Special:Upload. Name the file in the format.

Creating the template
Copy this bit of text into a new page named, disambiguating the title if necessary:

Replace the  and   values with the largest possible coordinates. This is where keeping GIMP (or your image editor) open comes in handy; hover over the lowest right corner of the image and input the coordinates shown on the status bar.

Inspect the texture and determine the coordinates of each inventory slot. Some inventory slots fit tiles perfectly, while others are padded. A tile is 32x32, so do some math to find the center of the slot.

Add the following text in the indicated line, repeating it for as many cells are present in the machine:

Increment the number for each row you have created. The  has a few conventions for naming:
 * If there is a single input cell, that cell should be named.
 * If there is a single output cell, that cell should be named.
 * If there is are multiple input cells, each cell should be named using a combination of letters and numbers.
 * If there are multiple outputs, each cell should be named  followed by a number.

Progress bars
TODO

The End
Final result: