Minecraftmodcustomstuff Wiki
(Removed one of the bugs since it seems to be a conflict between mods that's causing it.)
(Adding categories)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  +
{{CS1}}
 
Guis are windows in minecraft that you can open, for example, when rightclicking a block. The special interfaces of chests, furnaces, crafting benches, brewing stands, and many others are examples of this in the vanilla game.
 
Guis are windows in minecraft that you can open, for example, when rightclicking a block. The special interfaces of chests, furnaces, crafting benches, brewing stands, and many others are examples of this in the vanilla game.
   
Line 19: Line 20:
 
|-
 
|-
 
|'''guifile'''
 
|'''guifile'''
|The GUI image that is displayed when you open the gui. It muse be a 256x256 .png file.
+
|The GUI image that is displayed when you open the gui. It must be a 256x256 .png file.
 
|-
 
|-
 
|'''id'''
 
|'''id'''
Line 28: Line 29:
 
|-
 
|-
 
|'''height'''
 
|'''height'''
| As width, but starting at the bottom.
+
| The same as width, but starting at the bottom.
 
|-
 
|-
 
|'''resultx''' / '''resulty'''
 
|'''resultx''' / '''resulty'''
Line 59: Line 60:
 
|
 
|
 
The types of recipes that can be used by this crafting table. For example:
 
The types of recipes that can be used by this crafting table. For example:
usedrecipes="vanilla, myCustom";
+
usedrecipes="vanilla,myCustom";
 
will allow for crafting of all vanilla game recipes, but also those designated with the myCustom category. See [[recipes]].
 
will allow for crafting of all vanilla game recipes, but also those designated with the myCustom category. See [[recipes]].
 
|}
 
|}
Line 126: Line 127:
   
 
==Bugs==
 
==Bugs==
*In Custom Stuff 2.2.2 the mouse pointer doesn't display properly in Custom Stuff GUIs making it difficult to navigate. This bug is still present as of Custom Stuff 2.3.0
+
*In Custom Stuff 2.2.2 the mouse pointer doesn't display properly in Custom Stuff GUIs making it difficult to navigate. This bug is still present as of Custom Stuff 2.3.5
  +
**A workaround for this is to move your mouse pointer briefly out of the Minecraft window. When you move it back, your mouse pointer should remain visible. For obvious reasons, this does not work when playing in full screen.
 
[[Category:Examples]]
 
[[Category:Examples]]
 
[[Category:Scripting]]
 
[[Category:Scripting]]
 
[[Category:Bugs]]
 
[[Category:Bugs]]
  +
[[Category:Examples (CS1)]]
  +
[[Category:Update Needed]]

Latest revision as of 19:06, 22 October 2012

CS1 Custom Stuff 1

Information presented below this line is outdated syntax or information used for Custom Stuff 1. It will not work with Custom Stuff 2.

Guis are windows in minecraft that you can open, for example, when rightclicking a block. The special interfaces of chests, furnaces, crafting benches, brewing stands, and many others are examples of this in the vanilla game.

There are presently two types of GUIs, one for crafting and one for furnaces. For crafting tables, this can be done with only a .block file and a GUI file. For furnaces, you'll also need to set up a Container file.

To open a gui you use this function, called with the function trigger of your choice:

customstuff.openGui(origin, 'name123'); // This will open the gui of which name attribute is set to "name123".

You only need to change "name123" to the name of the gui you're referencing (see below), leaving the single quotes on each side of it.

Global GUI Attributes

These attributes work the same for all GUIs in Custom stuff to date. See the images in the type-specific sections below for some visual clarification.

Be aware that the only reason you need to change most of these is if you're intentionally altering the layout. Normally, the only things you will want to change are the name and guifile fields, since the basic layouts are already available to you in the customguis folder that Custom Stuff itself creates.

name The name of the gui referenced by the openGui function explained above.
type The type of the gui
guifile The GUI image that is displayed when you open the gui. It must be a 256x256 .png file.
id The ID of the gui. Used in Multiplayer. Must be unique, but is different from block and item IDs.
width This is used if your gui is smaller than 256x256. If set this to 100 the game will only use the first 100 pixels (starting at the left border)
height The same as width, but starting at the bottom.
resultx / resulty The X and Y coordinates (respectively) of the upper-left corner of the result slot.
upperinvx / upperinvy The X and Y coordinates (respectively) of the upper-left corner of the upper three rows of the inventory.
lowerinvx / lowerinvy The X and Y coordinates (respectively) of the upper-left corner of the 'hot bar' section of your inventory.
stringtext1 A string of text that can be rendered onto the gui. You can increase the number (stringtext2, etc.) to create as many as 16 lines of text.
stringx1 / stringy1 The X and Y coordinates (respectively) of the text string. As with stringtext, the number can be increased up to 16 for additional lines of text.
stringcolor1 This is the color of the string text in hexadecimal RGB format. (Use colorpicker.com to find values if you're not familiar with the format)

Crafting GUI Attributes

Craftingex

This image shows the special points on a crafting gui.

This attribute is used only for GUIs with one of the Crafting types.

craftingx / craftingy Those are the X and Y coordinates (respectively) of top-left corner of the top-leftslot of the crafting field.
usedrecipes

The types of recipes that can be used by this crafting table. For example:

usedrecipes="vanilla,myCustom";

will allow for crafting of all vanilla game recipes, but also those designated with the myCustom category. See recipes.

Example Crafting Table GUI

An example of a crafting table gui (which is also found in you customGuis folder):

name = "defaultcraft4x4";
type = "crafting4x4";
guifile = "customstuff/textures/crafting4x4.png";
id = 61;
width = 194;
height = 184;
resultx = 142;
resulty = 44;
craftingx = 30;
craftingy = 17;
upperinvx = 17;
upperinvy = 102;
lowerinvx = 17;
lowerinvy = 160;

stringtext1 = "Crafting";
stringx1 = 28;
stringy1 = 6;
stringcolor1 = 0x404040;

stringtext2 = "Inventory";
stringx2 = 17;
stringy2 = 90;
stringcolor2 = 0x404040;

Furnace GUI Attributes

Furnaceex

The important points of the furnace GUI explained.

The following attributes are used only for furnace-type GUIs.

In order to use a furnace, you must also set up a furnace-type Container, and reference that container with the container attribute in the same .block file that launches the furnace GUI.

inputx / inputy The X and Y coordinates (respectively) of the top-left corner of the 'input' slot (where the item to be cooked/smelted goes).
fuelx / fuely The X and Y coordinates (respectively) of the top-left corner of the fuel slot.
cookonguix / cookonguiy The X and Y coordinates (respectively) of the top-left corner of the progress arrow (on the GUI itself).
cookontexturex / cookontexturey The X and Y coordinates (respectively) of the top-left corner of the progress arrow animation. (The white arrow that's off to the right side by default)
cookwidth The width of the progress arrow animation. This is used by both cookonguix and cookontexturex to determine how wide an area is used in the progress animation.
cookheight The height of the progress arrow animation. This is used by both cookonguiy and cookontexturey to determine how tall an area is used by the progress animation.
burnonguix / burnonguiy The X and Y coordinates (respectively) of the top-left corner of the 'flame' between the fuel and the input (on the GUI itself).
burnontexturex / burnontexturey The X and Y coordinates (respectively) of the top-left corner of the 'flame' animation. (The colored flame that's off to the right side in the default image)
burnwidth The width of the flame animation animation. This is used by both burnonguix and burnontexturex to determine how wide an area is used by the fuel meter animation.
burnheight The height of the flame animation. This is used by both burnonguiy and burnontexturey to determine how tall an area is used by the fuel meter animation.

Bugs

  • In Custom Stuff 2.2.2 the mouse pointer doesn't display properly in Custom Stuff GUIs making it difficult to navigate. This bug is still present as of Custom Stuff 2.3.5
    • A workaround for this is to move your mouse pointer briefly out of the Minecraft window. When you move it back, your mouse pointer should remain visible. For obvious reasons, this does not work when playing in full screen.