Ships
Ships are different in that they use quite a few images.
There is the image of the ship when its flying around. This is actually a long series of pictures of the ship facing at different angles which are run through quickly so it appears to be rotating (like stop motion photography). There is one of these (and a mask) for every ship that appears in the game.
For playerships (eg the Wolfen) there is also the image of the ship which appears when you select the ship you want to fly at the beginning of the game (which I think is the same image that appears when you go to the Ship's Interior screen), the ship's armor display at the bottom right of the screen, the shield image and the images of the armor segments that appear to fade as your ship gets damaged.
========================
As the first example we'll use the Charon Frigate (scCharonFrigateRaider) from CharonPirates.xml because I think it looks really cool (although they have killed me quite a number of times).
Its image code is:
Code: Select all
<Image imageID="&rsCharonFrigateImage;" imageWidth="140" imageHeight="140"/>
and from the bottom of the same file,
Code: Select all
<Image UNID="&rsCharonFrigateImage;" bitmap="Resources\CharonFrigate.jpg" bitmask="Resources\CharonFrigateMask.bmp" loadOnUse="true"/>
The 'Image UNID=' info is often at the bottom of the same file so its worth checking there first if you're looking for it.
Interestingly there are no 'imageX=' and 'imageY=' coordinates here. This is because the game will automatically assume the coordinates are 0,0 unless told otherwise. I included them in the station image examples above only to show how images work. They didn't need to be there.
The images are actually 140 x 2800 pixels so I wont show all of it here just the top part. The full image goes down for 20 ship images.
So you can see what looks lke a ship turning is actually just the next picture down being shown really quickly so you can't see the individual frames. The 2800 pixel height of the images divides by the width (140) to give 20. This is what is known as a 20 facings ship (other examples are 40 facings or 120 facings ships). For one complete spin of the ship when it is flying it runs through the 20 images and then starts at the top again (or the other way if the ship spins in the opposite direction). The more facings a ship has the smoother it looks when it turns, plus it's sometimes easier to aim with more facings in your ship. The game assumes that a ship image has 20 facings unless told otherwise as we will see later.
================================
On to playerships. Using the Wolfen as an example.
The Wolfen is quite common in the game, not just as a playership. In the Resources folder there are a number of images of it or used by it..
ArmorHUD_Wolfen.bmp
ArmorHUDShip_Wolfen.jpg
MediumShips1.jpg and MediumShipMask.bmp
ShieldsHUDWolfen..jpg and ShieldsHUDDefaultMask.bmp
ShipsWolfenGunship.jpg and ShipsWolfenGunshipMask.bmp
WolfenGunshipHD.jpg and WolfenGunshipHDMask.bmp
WolfenLarge.jpg and WolfenLargeMask.bmp
and more
In Commonwealth.xml there is a Wolfen Gunship with the image code:
Code: Select all
<Image imageID="&rsMediumShips1;" imageX="768" imageY="0" imageWidth="48" imageHeight="48"/>
and from StdTypes.xml
Code: Select all
<Image UNID="&rsMediumShips1;" bitmap="Resources\MediumShips1.jpg" bitmask="Resources\MediumShips1Mask.bmp" />
This is the Wolfen you see flying around doing its own thing. Its image is found in MediumShips1.jpg and MediumShipsMask.bmp and is mixed in alongside other medium sized ships. The game selects out the Wolfen image by going across 768 pixels (and down 0 pixels), starting from there and getting an image 48 pixels by 48 pixels as the starting image. It then uses the 19 other Wolfen images below to make the ship look like it is turning.
===================================
In KorolovShipping.xml you will find Volkov, a Wolfen-based wingman.
Code: Select all
<Image imageID="&rsWolfenGunship;" imageX="0" imageY="0" imageWidth="48" imageHeight="48" rotationCount="40"/>
and from StdPlayerShips.xml:
Code: Select all
<Image UNID="&rsWolfenGunship;" bitmap="Resources\ShipsWolfenGunship.jpg" bitmask="Resources\ShipsWolfenGunshipMask.bmp" loadOnUse="true"/>
The images here are 48 x 1920 pixels. This makes it a 40 facings ship and in the 'imageID=' line above you will see at the end 'rotationCount="40"'. This lets the game know there are 40 images of the ship to scroll through, not the default 20 facings.
======================== ========
Finally there is the Wolfen Playership. this is the one you pilot if you select Wolfen at the beginning of a game.
Its in PlayerShips.xml and has the code:
Code: Select all
<Image imageID="&rsWolfenGunshipHD;" imageX="0" imageY="0" imageWidth="48" imageHeight="48" rotationCount="120"/>
and once again from StdPlayerShips.xml,
Code: Select all
<Image UNID="&rsWolfenGunshipHD;" bitmap="Resources\WolfenGunshipHD.jpg" bitmask="Resources\WolfenGunshipHDMask.bmp" loadOnUse="true"/>
As you can see by the 'rotationCount=' value this is a 120 facings ship. The images are 48 x 5760.
Note in all these versions of the Wolfen the image is 48 pixels square. This determines how big the ship looks when you are flying around. These ship sizes vary from small like the Hornet Battlepod 32x32 up to big like the Phobos Dreadnought and CSCs at 256x256.
=============================
Version 1.7a1a has 20 facings versions of all ships. It also has 40 and 120 facings versions of the Wolfen, Sapphire and EI500. There is an expansion pack call Stars Of The Pilgrims HD available at kronosaur.com which has 120 facings versions of all or at least most ships (not sure on this).
============================
Two final concerns for playerships. At the bottom of StdPlayerShips.xml there are more listings for the Wolfen.
Code: Select all
<Image UNID="&rsWolfenArmor;" bitmap="Resources\ArmorHUD_Wolfen.bmp" />
<Image UNID="&rsArmorHUDShip_Wolfen;" bitmap="Resources\ArmorHUDShip_Wolfen.jpg" />
<Image UNID="&rsWolfenLarge;" bitmap="Resources\WolfenLarge.jpg" bitmask="Resources\WolfenLargeMask.bmp" loadOnUse="true" />
and in Compatibility10.xml
Code: Select all
<Image UNID="&rsWolfenShields;" bitmap="Resources\ShieldsHUD_Wolfen.bmp" />
The armor and shield images are already well explained in other tutorials or posts. Briefly you need a shield display as well as an armor display and the armor segments which go with it. The main thing to know is that you need these to have a playership.
The other is the 'UNID="&rsWolfenLarge;"'. This is a 320 by 320 pixel image of the ship which is used when you select your playership at the beginning of the game and (I think) appears when you go to the Ship's Interior screen. This image should always be 320 x 320 pixels no matter how large or small your ship is.
PS The Deimos destroyer has this code:
Code: Select all
<Image imageID="&rsDeimos;" imageWidth="170" imageHeight="170" rotationOffset="-30"/>
I have no idea what rotationOffset does. Just letting you know it exists.
PPS Another example of using ship images is a tricky bit of coding by George which shows freighter and Charon ship images and information in the Korolov Shipping stations. I don't understand the code but I'm impressed by the outcome.