Вы находитесь на странице: 1из 24

How to create a Gun Tutorial

For this tutorial we are going to use 3 tools:


Photoshop
STI-Edit
XML Editor

Chapter 1, creating the Images

First of all we will need a copy of Photoshop to create the .bmp image file and the pallet used
to create our gun. For this tutorial I have choosen the Swedish made PWD, CBJ-MS.

First up we need some to do some background researching, most weapons characteristis and
stats can be found on various internet sites, in this case I have used info and images from this
site this site. Basically we will need a picture of the left side view of the gun (since this is the
point of view used in JA2). Since I could not find a flat picture of the left side, I used a right
hand view and flipped it in photoshop and used a left side perspective view of the gun as a
refrence.
Using this information its time to start painting, so first of we are going to eliminate the
background of the gun we selected, use the magic wand on the background and it will select
all pixels with that color. You might need to use the “shift” button to do a multiple selection.
Once you have selected all the background its time to invert the selection.

In this way you have only the gun selected. Now with the gun selected its time to cut it out to a
new layer (layer by cut).
This done its time to hide the gun for a second, to do this unchek the eye in the layers menu.
Now you will have only a white (or transparent) background, now this is good, but we need a
clear blue background which JA2 later makes transparent in game. The color used is have the
following code 0.0.227.
Once the background is all blue (you might want to use a big brush for this) its time to re-scale
the image, look up a gun similar to your one with sti-edit to use as a guide in size (in my case I
will use the scorpion). Now you should have a image aproximantly 71 x 50 px. (in the image
menu choose size)

You will see that your detailed photo of the gun is not so very detailed any more, but this is all
good, since what we want to do is draw a new image pixel by pixel over the original image. An
important note is that you could use a photo, but so scaled down and with only 256 colors it
wont look very good ingame.
So its time to use you artistic skill. This is kind of a painting in coloring book, since you all ready
have a image to paint over its easy to get the proportions right, but you will need to take som
artistic liberties to make the gun look gun in so few pixels. Here I leave it to every one to paint
in their on personal way. As a side note a comon mistake that people not used to Photoshop
do is to use the paintbrush, which even in 1 pixel size still “paint” close by pixels.

To activate the Pencil tool hold the mouse left button for some time over the brush button to
see the sub menu, from here select the pen.
Now that we have finished our first gun its time to add the final touches. First of all let’s delete
the layer with the original image,. Now we only have two layers, the blue background and the
gun.
Now save this archive as a photoshop image, to make changes easier later on.
Now here comes the important part, its now time to turn the final product into a .bmp image.
But first we need to index the image, wich later on will let us export the pallet used so we can
import it in sti.edit. Lets index the colors of the image with the following options: pallet =
exact, Forced = none, no transparency and all options on Off. As you see you image will be
turned into a 256 colors only image, if you have done everything right you should not even see
a change in you gun.
And as you also can see the is now only one layer. Now save this file with the .bmp exstension,
I usually use the prefix bigit followed by the name to make identification easier later on. Now
we just need to save the pallet to make gun show up with the right colors in the sti-editor. To
do this go to the following option: Image>Mode>Color Table
Once thepallet is saved its time to open up the .psd (photoshop ) image with the layers. Now
we need a image about half the size that goes in the inventory. To make things easy I once
again use the sti-edit to check on the image size of the gun I use as reference. In this case you
should scale the image to about 33x22 px.
Every big item image uses its own pallet, this is not the case for the inventroy size and tile size
images who are allcollected in one single.sti file. For now we will not do much to the .sti file
except exporting the pallet in use so that you can make sure your inventory size image has the
right colors. (the archive we are looking for is called MDGUNS.sti and is located in the 1.13
data/interface)
The sti editor is in german, but luckly it’s a simple program and its easy to find the right button.
(Palleten spechiern, which means save pallet)

Once you have exported the pallet its time to import it into photoshop. Make sure tha you
save the pallet in .act (photoshop) format in sti-edit.
Now once again we open photoshop image and we load the pallet. (import collor swatch in
english)

You image will not change its colors but you will se that most of the colors you used in the big
image are no longer avaliable, especially for me since I have chosen a green gun (bugger!).
Now you image should be rezised to about 31 x 21 px so its time to do some more painting,
but this time its very important to only use the colors from the imported pallet.

Once you are happy whit the result, its time to make the bright green outline of the gun. Now
you should have something like this.(make sure the gren is the gren from the imported pallet)

Now once again convert it to an indexed color image and save it as a .bmp image. I usualy use
the prefix interface for thses images. Now its time to reapeat this for the last step, the tile size
sprite being even smaller.
So here we go again, open the tileset sti file (in the tilset folder inside 1.13 data) and save the
pallet in photoshop format like before. Back in photoshop, once again open the .psd file,
before resizing the image make sure to spin the gun about 45º downwards, asi you can see all
guns are in the .sti editor. Now we can resize the image, say about 13 x 10 px. Now this is
small.

Import the pallet you exported from the .sti file. Now using these colors paint the tilesize
image of the gun. Do the same bright geen outline of the gun, and then convert it to an
indexed color image. Now save it as a .bmp image. Once again to make clasification easier I
usualy put the prefix Tile in front of the name.
Now we have these three images, and one pallet coresponding to the large image.
Here the fun starts, time to boot up the sti-edit, if you don’t have it open all ready (WHAT ARE
YOU WAINTING FOR SOLDIER!!!!)
Now if you are not to used to the file structure in JA2, I will make a brief overview, as you open
the data 1.13 folder inside the JA2 game folder you will se various folders. For now we are
going to focus on 3 of them, these being BigItems, Interface and tilesets.

First open the big items folder and look around, you will probobly find about 1180 files. Each of
these files corresponds with one gun, item, amunition etc. To keep things right we are going to
create a gun. So for now lets say our file will be GUN349.sti

Lets go to sti-edit and create a new item. First of all we need to load the pallet, this is very
easy. Once the pallet is loaded lets load the bmp. Image. This is just as easy.
Once we have both the pallet and image loaded in the program, its time to save it as a .sti file.
Make sure to save it in the BigItems folder with a name that’s not allready take, in my case
GUN349.STI.
Now we are going to create the inventory (read interface image) in sti-edit open the file
named MDGUNS in the Interface folder.
Here is the interesting part; there are various images inside the file so you can use the < and >
buttons to brows through the images.
In our case we want to arrive on position 348 and then add a new “frame”. This is done like
this.

Once we have created frame 349 its time to load the .bmp image for the inventory we created
before. Note that we must not load any pallet since this will mess up the other images. Now
we follow these same steps for the tileset .sti called smguns.

Its important that both the interface and tileset image are located in the same frame number
as the number you gave to you gun before. As with my example, I created GUN349.sti, and in
my mdguns .sti and smguns.sti file the respective images are both on the 349th
So now we are done with part chapter one, if you want to learn how to make you gun apear in
JA2 using the xml editor, please PM me and I will send you my paypal number and for the sum
of 25$ you will recive the second part of the tutorial.

Just kidding.

THE FUN PART!

Here all your hard work pay off. I’m going to be very brief since I think the xml editor is su easy
to use and exceptionaly user firendly im just going to look over the most basic stuff, and then
let every one explor by them self. First of to understand how the game handels weapons check
up on some diferent gunsto use as reference.
Star by selecting Items>new (ctrl.+N) Here type in the name of you creation and select the type
of item it will become, in this case we choose gun.
So far what I have done is to use the UZI as a guide aplying all the parameters that the UZI uses
to my gun, making some smaller changes.

Next step once you created a gun is to give it to a MERC, say steroid star a new game and then
contract him. This way you can see how it works in game and fine tune it a bit.

Вам также может понравиться