Confirmedusers
711
edits
Lazy Warlock (talk | contribs) |
m (Updated navbox to new content navbox.) |
||
(24 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
<languages/> | |||
<translate> | |||
<!--T:1--> | |||
{{GameVersion|1.19}} | |||
__FORCETOC__ | __FORCETOC__ | ||
Before customizing textures, it's suggested you read [[Basic Item]] first in order to understand this tutorial. | Before customizing textures, it's suggested you read the [[Basic Item]], [[Basic Block]] and [[Basic Entity]] pages first in order to understand this tutorial. This tutorial describes how to apply textures to items, blocks, and entities. In addition to this tutorial, there is a [[Modding:CompositeTexture|reference]] for all of the fields within a texture. | ||
== Texturing an Item == | == Texturing an Item == <!--T:2--> | ||
=== Flat Texturing === | === Flat Texturing === <!--T:3--> | ||
<!--T:4--> | |||
Texturing your items and blocks in vintage story is quite simple, but there's some things to consider when using shapes. Lets start off with just using a flat texture for an item: | Texturing your items and blocks in vintage story is quite simple, but there's some things to consider when using shapes. Lets start off with just using a flat texture for an item: | ||
<!--T:5--> | |||
<code>texture: { base: "item/resource/texture" }</code> | <code>texture: { base: "item/resource/texture" }</code> | ||
<!--T:6--> | |||
If your item has a variant you can also use it in the textures, even without the byType function: | If your item has a variant you can also use it in the textures, even without the byType function: | ||
<!--T:7--> | |||
<code>texture: { base: "path to texture/texture-{variant}" }</code> | <code>texture: { base: "path to texture/texture-{variant}" }</code> | ||
=== Shape Texturing === | === Shape Texturing === <!--T:8--> | ||
<!--T:9--> | |||
If your item is rendered with a custom shape using <code>shape: { base: "path to shape" }</code> you can control it's textures using the plural version "textures". Doing so requires that you use the same "#texture" identifier used on each side of a shape cube. | If your item is rendered with a custom shape using <code>shape: { base: "path to shape" }</code> you can control it's textures using the plural version "textures". Doing so requires that you use the same "#texture" identifier used on each side of a shape cube. | ||
<!--T:10--> | |||
Lets see an example. First we'll look at a few cubes in a shape JSON: | Lets see an example. First we'll look at a few cubes in a shape JSON: | ||
<!--T:11--> | |||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json"> | ||
{ | { | ||
Line 52: | Line 63: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<!--T:12--> | |||
Now we can assign the #texture references from our item or block JSON using this format, which can also utilize variants in the regular {variant} format: | Now we can assign the #texture references from our item or block JSON using this format, which can also utilize variants in the regular {variant} format: | ||
<!--T:13--> | |||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json"> | ||
textures: { | "textures": { | ||
"metal": {base: "path to metal texture" }, | "metal": {"base": "path to metal texture" }, | ||
"wood": {base: "path to wood texture" } | "wood": {"base": "path to wood texture" } | ||
}, | }, | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<!--T:14--> | |||
This is a useful method since both "metal" and "wood" can be assigned to multiple cubes within the shape JSON. | This is a useful method since both "metal" and "wood" can be assigned to multiple cubes within the shape JSON. | ||
=== Voxelized Texture Shapes === | === Voxelized Texture Shapes === <!--T:15--> | ||
If you decide | <!--T:16--> | ||
If you decide you want a variant of an item to not be rendered using a JSON shape you can use the <code>voxelizeTexture</code> property when defining a shape. For example, an older version of the redmeat.json itemtype contains: | |||
<!--T:17--> | |||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json"> | ||
shapebytype: { | "shapebytype": { | ||
"redmeat-vintage": { base: "item/empty", voxelizeTexture: true }, | "redmeat-vintage": { "base": "item/empty", "voxelizeTexture": true }, | ||
"*": { base: "item/food/meat/red" }, | "*": { "base": "item/food/meat/red" }, | ||
}, | }, | ||
texturesbytype: { | "texturesbytype": { | ||
"redmeat-raw": { | "redmeat-raw": { | ||
"meat": {base: "item/food/meat/raw" } | "meat": {"base": "item/food/meat/raw" } | ||
}, | }, | ||
"redmeat-cooked": { | "redmeat-cooked": { | ||
"meat": {base: "item/food/meat/cooked" } | "meat": {"base": "item/food/meat/cooked" } | ||
}, | }, | ||
"redmeat-cured": { | "redmeat-cured": { | ||
"meat": {base: "item/food/meat/cured" } | "meat": {"base": "item/food/meat/cured" } | ||
}, | }, | ||
"redmeat-vintage": { | "redmeat-vintage": { | ||
"item/empty": { base: "item/food/meat/vintage" } | "item/empty": { "base": "item/food/meat/vintage" } | ||
} | } | ||
}, | }, | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<!--T:18--> | |||
We can see here that only the "vintage" variant will be rendered as a regular voxelized item texture, while the rest will use the redmeat shape and apply their texture to it. | We can see here that only the "vintage" variant will be rendered as a regular voxelized item texture, while the rest will use the redmeat shape and apply their texture to it. | ||
== Texturing a Block == | == Texturing a Block == <!--T:19--> | ||
=== Simple Block === <!--T:20--> | |||
<!--T:21--> | |||
Blocks are textured a little differently since they default to generic "cube" shape. This means they don't use the singular "texture" method, and instead always use a version of the plural "textures": | Blocks are textured a little differently since they default to generic "cube" shape. This means they don't use the singular "texture" method, and instead always use a version of the plural "textures": | ||
<syntaxhighlight> | <!--T:22--> | ||
textures: { | <syntaxhighlight lang="json"> | ||
all: {base: "path to texture*"} | "textures": { | ||
"all": {"base": "path to texture*"} | |||
}, | }, | ||
</syntaxhighlight> | </syntaxhighlight> | ||
"all" will give every side the same texture, but we can easily customize each side, especially if we want to use some block behaviors like <code>"Pillar"</code> or <code>"HorizontalOrientable"</code> | === Texturing Other Block Faces === <!--T:23--> | ||
<!--T:24--> | |||
When assigning textures "all" will give every side the same texture, but we can easily customize each side, especially if we want to use some block behaviors like <code>"Pillar"</code> or <code>"HorizontalOrientable"</code>: | |||
<syntaxhighlight> | <!--T:25--> | ||
textures: { | <syntaxhighlight lang="json"> | ||
up: { base: "path to top texture" }, | "textures": { | ||
down: { base: "path to bottom texture" }, | "up": { "base": "path to top texture" }, | ||
south: { base: "path to back texture" }, | "down": { "base": "path to bottom texture" }, | ||
north: { base: "path to front texture" }, | "south": { "base": "path to back texture" }, | ||
west: { base: "path to left texture" }, | "north": { "base": "path to front texture" }, | ||
east: { base: "path to right texture" }, | "west": { "base": "path to left texture" }, | ||
"east": { "base": "path to right texture" }, | |||
}, | }, | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Keep in mind that if you're using the <code>"Pillar"</code> or <code>"HorizontalOrientable"</code> behaviors you'll need directional variants for each (such as updown, northsouth, eastwest etc.) and you'll likely have to organize it using the ByType functionality. | <!--T:26--> | ||
Keep in mind that if you're using the <code>"Pillar"</code> or <code>"HorizontalOrientable"</code> behaviors you'll need directional variants for each (such as updown, northsouth, eastwest etc.) and you'll likely have to organize it using the ByType functionality. Great examples of these are the <code>log.json</code> (Pillar) and <code>altar.json</code> (HorizontalOrientable) blocktypes. | |||
== Texturing an Entity == <!--T:27--> | |||
=== Basic Entity Texture === <!--T:28--> | |||
<!--T:29--> | |||
All entities utilize a shape, but generally they are applied using a single entity map texture, which is essentially a texture file with each cube side mapped onto it. Doing this manually would be incredibly tedious, and is best done with the Vintage Story Model Builder found [[VS Model Creator| here]]. | |||
<!--T:30--> | |||
Once you have your properly mapped out texture you can assign it to your entity: | |||
<!--T:31--> | |||
<code>texture: { base: "path to texture map" }</code> | |||
=== Alternative Entity Textures === <!--T:32--> | |||
<!--T:33--> | |||
After defining the first texture, you can also add alternatives to the same entity. For example, in the <code>wolf-male.json</code> entitytype: | |||
<!--T:34--> | |||
<syntaxhighlight lang="json"> | |||
"texture": { "base": "entity/wolf/wolf1", "alternates": [ { "base": "entity/wolf/wolf2" }, { "base": "entity/wolf/wolf2" }, {...} ] } | |||
</syntaxhighlight> | |||
Each successive alternative should be numbered (starting with 1). Entities choose a random texture when they spawn for the first time. | |||
{{Navbox/ | <!--T:35--> | ||
{{Navbox/contentmodding}} | |||
</translate> |