[Tools] Scheme Creator - for creating scheme.nxmi colour swaps

Started by WillLem, December 03, 2024, 07:04:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WillLem

Scheme Creator is a simple tool to help with sprite recolouring in a Neo/SuperLemmix style. It works by generating text output which can then be copypasted into the relevant scheme.nxmi file of whichever style you're working on. The file itself can be found in styles\name_of_style\lemmings\ and contains all the data for recolouring the sprites to their various different states (e.g. Athlete, Neutral, Zombie, etc.)

Please read before using Scheme Creator

Scheme Creator does not directly generate or read from scheme.nxmi files for various reasons, including that the file is responsible for handling animation data as well as recolouring data. Read/write functionality may be added at a later date if there's enough demand for it.

:lemming: :lemming: :lemming: Before you begin, make a backup copy of whichever scheme.nxmi file you're going to be working on, and leave that one unedited just in case. Scheme Creator is very easy to use, but there is the possibility of accidentally overwriting data so it's worth having a backup copy that can be referred to or restored from later if any mistakes are made! :lemming:  :lemming:  :lemming:

How to use Scheme Creator

The form consists of a table of fields, each of which contains the necessary state recolouring data for a specific feature of the sprite. The feature (e.g. LEMMING_HAIR) is placed into the far left column, and then each subsequent field along that row contains the recolouring data for each state (e.g. Athlete, Zombie, Neutral) that will be applied to that feature:


N.B. All states must be accounted for by at least one feature. It's not necessary to recolour every state for every feature though, so some fields can be left blank (or if you prefer, add "NoChange" to the field as per the screenshot example); for instance, in the default style, only the LEMMING_TUNIC feature is recoloured for the Neutral state, so no data is needed for LEMMING_HAIR or LEMMING_SKIN in the Neutral column.

A note on re-shading:

Since the Normal colour data for LEMMING_TUNIC and LEMMING_TUNIC_SHADE (i.e. x4444EE and x3030A0 respectively) is paired together in the $SHADES section of scheme.nxmi, the Neutral LEMMING_TUNIC colour will also be re-shaded without having to specify a shade in this table. The LEMMING_TUNIC_SHADE feature in the table above is there in order to optionally specify re-shading colours for certain states (i.e. Selected, Rival, and Rival-Selected). This can therefore be done in the event that the automatic re-shading is undesirable for any reason.

Follow these steps to add the relevant colouring data for each feature:

:lemming: 1) Click the Sprite Feature field and enter the name of the sprite feature you want to edit (e.g. "LEMMING_HAIR")

:lemming: 2) Click the Normal field to enter the Hex colour data for the sprite's normal state (e.g. for the default sprites the lemmings have green hair, the correct code for which is x00BB00). If you're creating your own lemming sprites, you can use Paint.Net or this online Hex generator to find the correct Hex code for your sprites.

N.B. The format for the Hex code must be a lower-case "x" followed by the 6 digit code (e.g. 00BB00). If using the online Hex generator, replace the "#" with "x".

Don't hesitate to ask for assistance if you need any help with Hex codes.

:lemming: 3) Repeat step 2 for the "-Athlete" and "-Selected" fields. Note that these will recolour Normal-Athlete and Normal-Selected lemmings.

:lemming: 4) Repeat step 2 for the "Rival", "-Athlete" and "-Selected" fields. Note that these will recolour Rival, Rival-Athlete, and Rival-Selected lemmings respectively.

N.B. Since Rival-Athletes and Rival-Selected lemmings need to be distinguishable from Normal-Athletes and Normal-Selected lemmings, they need their own recolouring field. At least one sprite feature (e.g. Hair, Tunic, Skin) must be recoloured for the style to be compatible with Rival levels in SuperLemmix.

N.B. If using this tool for a NeoLemmix style, these fields can be left blank.

:lemming: 5) Repeat step 2 for the "Zombie", "Neutral" and "Invincible" fields. Note that these will recolour Zombies, Neutrals and Invincible lemmings.

N.B. If using this tool for a NeoLemmix style, the Invincible field can be left blank.

:lemming: 6) Click the Generate Spriteset Recoloring button to open a dialog populated with text. This text must be copypasted (there's a button at the bottom for copying the text to the clipboard) into the scheme.nxmi file for your style. The correct place to put it is in the $SPRITESET_RECOLORING section, it should look like this:

$SPRITESET_RECOLORING
...
... (paste lines of data here)
...
$END

N.B. Take care when copypasting. If the scheme contains recolouring info that is not included in the text generated by Scheme Creator, this should be kept as it is in the existing scheme.nxmi file and added to the bottom of the copypasted list.

For example, the default scheme.nxmi has the following lines:

  LEMMING_BUILDER_SACK xFF2222
  LEMMING_UMBRELLA xDD0000
  LEMMING_SWIMMER_HAIR x288F75
  LEMMING_SWIMMER_CLOTHES xAC9FD0

These are for reference only and are not actually included in the state recolouring by default. These can be optionally added if the user wants to recolour these sprite features in their own copy of the default style. Your sprites may include similar features that you don't explicitly want to recolour, but want to keep a handy reference of; this is the place to keep that info!

:lemming: 7) Click the Generate State Recoloring button to open a dialog populated with text. This text must be copypasted (there's a button at the bottom for copying the text to the clipboard) into the $STATE_RECOLORING section of the scheme.nxmi file. It should look like this:

$STATE_RECOLORING
...
... (paste lines of data here)
...
$END

N.B. This section will typically be much longer than the $SPRITESET_RECOLORING section, and is responsible for specifying the actual color swaps themselves. As with step 6, it's important to make sure you aren't copying over any existing recolouring data not included in Scheme Creator's output - for example, there might be a sprite feature that gets recoloured but that you haven't added to the table in Scheme Creator.

:lemming: 8) Click the Add New Feature button to add another feature (e.g. Tunic) that might need to be recoloured. Then, repeat steps 2-7 to add the necessary recolouring data for that feature. Remember, it's not necessary to recolour every feature for every state; as long as each state has at least one feature that gets recoloured, your style will be compatible.

N.B. As a general rule, it's a good idea to add every sprite feature that gets recoloured, but you may wish to make a quick edit to one of your styles, and so will only need the data for whichever feature you're recolouring. Just make sure to take care when copypasting the generated output to your scheme.nxmi file.

Optionally, use Save/Load to save your edits for later use:

To make the whole process a bit easier, Scheme Creator also has a Save/Load option, which is particularly useful if you're in the process of working on a sprite set, or if you haven't yet decided on the full recolouring data for your sprites and want to work on the scheme over different sessions.

N.B. As noted above, this will not save or load a scheme.nxmi, but instead will save the inputted field data to a .ini file, which can then be loaded into Scheme Creator later. Give the .ini file a title that you will recognise as whichever style you're working on, and you can come back to it later to make quick edits.

N.B. If using the Save/Load option, it probably makes sense to add all sprite features that might get recoloured, or for which you might want to make a note of, to the table. That way, the output will always reflect every existing state recolouring and there's less chance of accidentally leaving something out or overwriting something you didn't mean to overwrite.

N.B. Any saved .ini files will always be stored in the same directory as Scheme Creator, so you may wish to keep the Scheme Creator in its own folder.



If you have any questions, or if the instructions aren't clear, please do ask and I'll respond as soon as I can.

The attachment contains the latest version of Scheme Creator, plus the default scheme.nxmi and DefaultScheme.ini as examples that you can experiment with to get used to using the program if you wish.

Happy scheme creating! :lemcat: