Palettes

From wiki
Revision as of 05:01, 3 October 2017 by DeamonHunter (Talk | contribs) (Updated properties. Tutorial will be updated at a later point.)

Jump to: navigation, search

In Staxel, *.palette files are used to specify two things;

  • An image which specifies what colour is replaced with another colour
  • The image which represents the palette in the Character Creator

These palette files are then used to colour different things including Accessories and Species.


Creating a Palette for Player Models

A palette is basically an optional colour scheme for a given accessory model. Models do not necessarily need to support palettes (you can have a completely unpalettable model designed to only have one colour scheme), but models which are designed to support palettes can essentially have any number of colour schemes limited only by the number of palettes defined.


In essence, a palette is an image with two rows of different colours. The top row of colours are the colours you want to replace, and the bottom row are the colours you want to replace the colour above with.


To create a palette you must first have a model to base the palette off. Without a model, a palette is basically useless. Once you have acquired a model to work with;

  1. You will first need to create an image in your favourite image software. (Photoshop, Gimp, even Paint is fine for this.) The size of the image will be 16 pixels per colour you want to change in the width(For Example if you want to change 4 colours, you will need to make your image 64 pixels wide) while being exactly 32 pixels high.
  2. Start by setting the top left most 16x16 grid to the first colour that you want to change. Once that 16x16 is filled, fill the 16x16 to the right of it with the second colour. Keep doing this until all colours are filled. This gives the basis on which your Palette is set.
  3. When that is done, you can now choose which colours you want to replace the originals with, and fill the space underneath that colour. Continue until you are done.
  4. Save it as a "*.png" file. You can now move that to a mod folder but we aren't done yet.

Example of a palette that replaces 4 colours.


With that, you have now created the image that is required for a palette. You will then need to create an icon for your palette. This icon gets displayed in the menu representing the palette.

  1. Go back to the image editor, and create another image, this time exactly 12x12 in size.
  2. Fill this with anything you like, such as having a "S" for "Suzy's Hair Colour". A recommendation would be to have a solid colour representing the main colour of your hairstyle.
  3. Save this image as a *.png file. (If you want, name this as the same as the file containing the palette but append " icon" to it.)

Example of a non-standard Icon to represent a palette.


With those two images made, we are now ready to actually tell the game "Hey this is a palette!" So we need to create a *.palette file with the following inside of it;

{
  "code" : "mods.modname.uniquenamehere",
  "icon" : "mods/Modname/NameOfIcon.png",
  "palette" : "mods/Modname/NameOfPalette.png"
}

What these properties do is described below.

With this the palette is now ready to be added to models. You may now add/edit the following line in any *.accessory file to include the code name from your palette.

"palettes" : [ "mods.modname.palette1", "mods.modname.palette2"] 

And if everything went according to plan, you can now select your custom palette from your model.


Config Options

"code"

Valid options (String): A unique string which identifies what Palette this is.

Default Value: No default value is specified. Always need to provide your own.


This option is required to uniquely identify any palette. This string must be unique to all other codes, but does not have any other requirements.


"groups"

Valid options (List of String ): A list of strings each containing the code of a Palette Group.

Default Value: If not specified, will not be added to any groups.


These are what Palette Groups this Palette should be added to. Palette Groups allow uses to add their own palettes to other accessories without needing to edit files. Feel free to use one of, or all of, the four groups Staxel provides.


"icon"

Valid options (String): A string that contains a path which points to an image.

Default Value: No default value is specified. Always need to provide your own.


This is the image that is shown inside of Character Creator. This has no affect on the actual palette.


"palette"

Valid options (String): A string that contains a path which points to an image.

Default Value: No default value is specified. Always need to provide your own.


This is the image that is actually used to colour Accessories and Players. The image should be 32 pixels high and should be a multiple of 16 wide. For more information on how to create the palette, go to #Creating a Palette for Player Models


"priority"

Valid options (Integer): Any valid integer number.

Default Value: If not specified, the highest possible integer is used. This effectively makes it so that this palette will appear last in the group.


This property affects the order in which palettes can be seen from within the Character Designer. The lower the number, the higher up this will appear in the list.