Skip to content
creator_2013 edited this page Jul 24, 2020 · 5 revisions

How to create a spawn icon for your Photon vehicle

This instruction will discribe how to create a spawn icon for your photon vehicle. This instruction only goes over the most basic steps and most basic settings, there are a lot of other things that can be done, mainly with the original image, but this guide will not go in to that at depth.

Feel free to explore photo editing guides online or photography guides to improve your screenshots if you want to learn more about those steps after you complete this guide.

Step 1 – Take your screenshot

The first step is to start with a good photo, this should idealy be a screenshot of your photon vehicle with a clear background. Observe how spawn icons for other vehicles that you like look and try to imitate that. Also observe how small the spawn icons are in your game, keep this in mind when taking the screenshot.

Spawn icons are always exact squares, but there is also text added to the bottom, this is something you have to keep in mind when taking the picture, especially if you use a widescreen monitor, try to imagine a square box around your vehicle and some space below it for text when you take your screenshot.

Screenshot example

Step 2 – Prepare your photo - Crop and Resize

The next step is to take your screenshot and open it in your photo editing software of choice. In this guide we will use the free software paint.net but the steps can be reproduced in most photo editing softwares.

If you know the basics of photo editing, you can skip this part of the guide and go straight to step 3 after crating a 512x512px jpeg, if not the next few steps will guide you through doing that in paint.net.

The first thing we need to do with the photo is to make it square, to do this we use the crop function.

1. Click the selection tool in the toolbox
2.

This section needs to be improved. Here is a link to some random dudes blog.

After we’ve made the photo square we need to resize it. The next step will require that the picture is one of a few set sizes and for this purpuse we will create a file that is exactly 512x512 px.

1.
2.

When you're done you should have something like this

cropped screenshot

Save the file in a good place, we will need it in the next step.

Step 3 – Create VTF file

Images that are used in the source engine that garrys mod runs on use a special format called VTF, this is used for graphical elements, vehicle skins and a lot of other things, but most important for us, spawn icons. To convert the picture you prepared in step 2 we use a tool called vtfedit to convert it to a VTF file.

1. Import the file in to vtfedit by clicking the import button at the top or file > import. Note that you can not use the open function to open the file you prepared in step 2, you have to import it.

Import to VTFedit

2. Use the default settings when importing. Should you happen to fiddle with the settings in such a way that it does not work any more, here is a screenshot of settings that work.

Default settings

3. Have a quick look at the picture that opens and make sure that it matches your expectaions. Remember that it will be shrinked so it does not have to be increadibly pretty but make sure it’s still square and that you can see your entire car, and that it’s not squished.

After import

4. Save the finished VTF file. Make sure that you give it a name that’s easy to recognize, unique and does not include special characters or spaces. An example would be jooiiees_super_cool_adminwagon.vtf. Save it in a good spot until later.

Step 4 – Create a VMT file

VMT files are in a nutshell used to tell the game what files to look for where, the VMT file will contain information about your car and where the game can find your VTF file containing the spawn icon. The creation of the VMT file is very important and you have to create it exactly as described, if not the game will not find your spawn icon.

1. Create a blank text file that has the same filename as your vehicle name, for example if my vehicle is called jooiiees adminwagon the file shoulde be called jooiiees adminwagon.vmt. When creating this file, spaces are allowed but certain special characters are not allowed in filenamed, eg ’ and should be avoided in your name. The name of the vehicle can be found in the lua file for the vehicle, look for the string local VehicleName near the top of the file and use the name that’s between the quotes.

2. Edit the VMT file and paste the code below in your file. Only update the last part of the path, we will put everything in the right place after that.

"UnlitGeneric"
{
    $basetexture "vgui/entities/YOUR FILENAME GOES HERE"
    "$vertexcolor"         1
    "$vertexalpha"         1
    "$nolod"               1
}

after you edit the file, it should look something like this:

"UnlitGeneric"
{
    $basetexture "vgui/entities/jooiiees_super_cool_adminwagon"
    "$vertexcolor"         1
    "$vertexalpha"         1
    "$nolod"               1
}

3. Save the file next to the VTF file from before in that good place, we will use it later.

Step 5 – Put the files in the right spot

Now we need to create the folder where we will put everything. If you’ve done every step until now right it should just be a matter of copy and paste.

1. Navigate to your addon folder where you installed the lua file
2. Create folders that are called materials > vgui > entities
3. Paste the VMT file and VTF file in the folder entities

After you’re don't it should look something like this.

Folder structure

Your file browser will probably look different, don't worry, the structure will still be the same

Step 6 – Test it

That should be it, restart your game and see if you have a super cool spawn icon

Spawn menu