How do I add Sprites to Custom Units (Depreciated after 0.49.19) - MegaMek/megamek GitHub Wiki
This is going to assume that you've got a custom unit based of an existing unit. i.e. You've modified an existing Marauder to Marauder Damn Good. Also you've read the Custom Unit wiki entry. To do this you'll need a good text editor and we recommend Notepad ++.
Going into this is every important to understand that everything is CASE SENSITIVE and WHITE SPACE SENSITIVE.
- Regardless of what you hear or read online DO NOT MODIFY mechset.txt.
- Head to \data\images\units
- Open "localclient_mechset.txt" file with the text editor
- You will see this
- Before we get into making the entry we should clarify some of the guidance text in the file. Using the below as examples.
Its important to understand the difference between "chassis" and "exact". In the unit selector you'll see this.
All units will use the "chassis" level sprite unless an exact "chassis AND model" are defined.
chassis "Marauder" "mechs/marauder.png" This means anything with the chassis name "Marauder" will use the sprite in the images\units\mechs folder called "marauder.png"
exact "Marauder MAD-Da Best" "mechs/marauder db.png" This means the unit called "Marauder MAD-Da Best" will use the exact image called "mechs/marauder db.png". If that image doesn't exist if will show nothing
Everything goes between the red lines in the screen shot. Also....Do not put a # in front of the chassis or exact, if causes MegaMek to skip that line.
Using the existing chassis level sprite
If you just want to use the chassis level sprite for an existing unit for you unit you don't need to do anything. i.e you are ok with your "Da Best" model having the stock Marauder sprite.
Wanting to use model of an existing unit.
If you've made a variant of an existing chassis and want to use an existing sprite you would do exact "Marauder MAD-Da Best" "mechs/Marauder_3L.png"
Making a whole new sprite for a whole new unit
If you've made a whole new unit AND a whole new sprite. Then you'd need to make sure the image file is in the right images folder. i.e Mechs in data\images\units\mechs folder. We recommend images be in PNG, most most image types will work (well...jpeg can give issues).
Then you'd need to decide if you want to use the "chassis" line or "exact" line. For example the new unit chassis name is "Felis" you'd make an entry like this
chassis "Felis" "mechs\felis.png"
Then all models named Felis would use this sprite. You could create variants of the Felis with unique sprites and they could be like this.
exact "Felis House Panther" "mechs\felis panther.png"
exact "Felis Tuxy" "mechs\felis tuxy.png"
exact "Felis Tabby" "mechs\felis tabby.png"
You can save the file and restart MegaMek and the units should up with custom unit with the sprite showing.
TIPS
-
You can look in mechset.txt for examples but remember DO NOT EDIT the file. It changes between every version of MegaMek.
-
I know this works on Windows. Highlight the unit name in the preview window, HIT CTRL-C and then you can paste the exact name into the file.
-
Also DO NOT use # in front of the sprites you are trying to add this tells MegaMek to ignore the lines in the file.
-
Between versions you'll need to copy ONLY the localclient_mechset to the new version.