PDA

View Full Version : How to - Edit Unit Cards



Myrddraal
01-31-2005, 11:22
Modding Resource Header

Title: How to - Edit Unit Cards

Posted by: Myrddraal

Modding area: Units (appearance)
Required programmes: Vercingetorix's X-Pak (http://www.twcenter.net/downloads/db/?act=mod&id=43), An image editor capable of editing .tga format, Notepad (or other text editor)
Related links: xpak Tutorial (https://forums.totalwar.org/vb/showpost.php?p=643512&postcount=4)
Summary: The unit card is the image that appears at the bottom of the screen in battle and when an army is selected in campaign, and also is the image used on the recruitment page. If your unit card is the 'grey peasant', then you have not created a unit card for your unit. Here's how:
__________________________________________________

How to - Edit Unit Cards

Units cards are found in the following directory:

Data\UI\UNITS

If this directory does not exist, you need to extract if using X-Pak
Here you should see a list of folders named after all the factions.

Open the folder for the faction you want to edit. Here you should see TGA files with the names of the units as declared in export_descr_units.txt but with a # in front.
For example: in Data\UI\UNITS\ARMENIA, for Armenian_Legionaries you should see:
#ARMENIAN_LEGIONARIES.TGA

This is the format you should use to name your unit card.

I suggest you open a unit card to better understand its format.

You will see that the image of the unit is generally in the bottom right hand corner, leaving the top left blank. In this blank space, the unit info will appear, so you shouldn't spill into it.

Now edit your unit card and save it using the above name format. It should be 44 by 64 pixels in size, should be compressed (in PSP click options in the save dialog) and should be 32 bit.

barocca
08-01-2005, 09:44
Unit Cards in detail
lots of images, may take a minute or two to load

Getting Transparency to work in unit cards has been problematic,
thanks to a tipoff from Intrepid Sidekick the problem is now solved

You will need is a graphics utility that can edit and access channels
(photoshop is the one i use)
A Blank Unit Card
DOWNLOAD link to BlankUnitCard (in TGA and photoshop formats) (http://www.3ddownloads.com/strategy-gaming/totalwar/RTW/Faq/BlankUnitCard-Barocca.zip)

In this image you can see the layers,
as long as your unit picture never crosses into the white rectangle in the top left your card will display the number of men in the unit correctly,
simply paste in your image, merge the layers and you are done.
http://totalwar.org/images/Guides/UC_Tute-1.jpg
But if you want one that is 100% correct, here's how

For those who dont have photoshop i'll show you how to make one IN photoshop and you can adjust the technique for your preferred image editing package

I start with a battlefield picture of the unit i want
http://totalwar.org/images/Guides/UC_Tute-2.jpg

cut away the background
http://totalwar.org/images/Guides/UC_Tute-3.jpg

reduce the image size progressively until it fits into the blank-unit-card
http://totalwar.org/images/Guides/UC_Tute-4.jpg
this image is 100x110 - too large, but then i dont want the entire image on the card

paste the image onto the unit card,
http://totalwar.org/images/Guides/UC_Tute-5.jpg

now the fun part,
change your magic wand to 0 tolerance
http://totalwar.org/images/Guides/UC_Tute-6.jpg / http://totalwar.org/images/Guides/UC_Tute-7.jpg

hide the background layers
http://totalwar.org/images/Guides/UC_Tute-8.jpg

using your magic wand click in the transparent area, then right click and select similar,
http://totalwar.org/images/Guides/UC_Tute-9.jpg

what we have now is all the transparent areas selected,
semi transparent will be blended with the blank unit card (which I made from a screenshot of a totally invisible unit card)
the end result will be minimal "white halo" aka "colour bleed"
and your unit card will look just like a bought one.

time to have some fun
change channels
http://totalwar.org/images/Guides/UC_Tute-10.jpg

now we want to make all the rgb channels invisible,
http://totalwar.org/images/Guides/UC_Tute-11.jpg
and the alhpa channel visible,
ALSO we need to be able to edit the alphap channel
http://totalwar.org/images/Guides/UC_Tute-13.jpg
when you do this your toolbox (on the left) will change to greyscale mode - this is good
http://totalwar.org/images/Guides/UC_Tute-12.jpg

now we quite simply edit/fill the selected area BLACK
and leave the area behind the unit WHITE
http://totalwar.org/images/Guides/UC_Tute-14.jpg
http://totalwar.org/images/Guides/UC_Tute-15.jpg

put the channels back in the correct order
(hiding the alpha channel)
http://totalwar.org/images/Guides/UC_Tute-16.jpg

Switch back to layers and make them all visible
http://totalwar.org/images/Guides/UC_Tute-17.jpg

Flatten image
http://totalwar.org/images/Guides/UC_Tute-18.jpg

save it as a TGA with 32 bits

rename it to the name you used for DICTIONARY in export_descr_unit.txt ("edu")
add a hash in from of the name,

the unit in this example is called briton_fanatic_f_Sword, so it is named #briton_fanatic_f_Sword.tga
drop the unit card into the correct faction folder in data/ui/units/faction

use in game
http://totalwar.org/images/Guides/UC_Tute-19.jpg


http://totalwar.org/images/Guides/UC_Tute-20.jpg
here we see the AI doing a classic stupid move, marching across the front of my line to attack some light cavalry that are miles away on my left flank - naturally i am going to hit his flank as he goes by,

this battle will be over shortly...
http://totalwar.org/images/Guides/UC_Tute-21.jpg
he did not stand a chance...


Cheers,
B.

Monkwarrior
08-01-2005, 10:10
Great tutorial! ~:)
However, I think it is much easier than you say, barocca. ~;)
If you save as tga the simple file with the transparent background, in the correct size of course, the grey background will be included in-game.

This is one example of my own unit cards.
https://img168.imageshack.us/img168/1593/unitcardscartago5pt.th.jpg (https://img168.imageshack.us/my.php?image=unitcardscartago5pt.jpg)
They were done as I say and the grey background is visible, together with the numbers.
In my opinion this greatly simplifies the procedure.
:bow:

Epistolary Richard
08-01-2005, 10:18
Thanks, barocca. Another great way to get a screenshot for your unit (if you don't have 3dsMax) is to use the movie_cam (http://www.twcenter.net/forums/showthread.php?t=29683). It allows you to zoom all the way down to ground level and take pictures like these (http://www.twcenter.net/forums/showthread.php?t=22408&page=7&pp=20) (done by Prof).

barocca
08-01-2005, 10:30
Great tutorial! ~:)
However, I think it is much easier than you say, barocca. ~;)
If you save as tga the simple file with the transparent background, in the correct size of course, the grey background will be included in-game.
In my opinion this greatly simplifies the procedure.
:bow:


you are going to have to explain that in far more detail

none of the graphic packages i tried here will allow transparency options for TGA's

do you mean as a gif? then convert to tga?

B.

Epistolary Richard
08-01-2005, 11:07
I use Photoshop and that definitely supports transparency for tgas.

Monkwarrior
08-01-2005, 11:32
I will try to explain, in spite of my bad English (sorry :embarassed: )

The first steps are as you told before:
- Taking a screenshot.
- Selecting a portion of the screenshot and creating a new photoshop file with transparent background:
https://img153.imageshack.us/img153/9740/tutorial18wj.jpg

- Then I clear the "background" from the screenshot and this is the result:
https://img153.imageshack.us/img153/5303/tutorial20mk.jpg

From this file, I select the correct portion to be shown in the card and I resize the image and the canvas to fit the size of the card (48 width, 64 height).

The last step is just simply to save the file as tga 32 bits and voilĂ !
https://img153.imageshack.us/img153/8766/tutorial39yw.jpg
On the left there is the same file saved as tga 24 bits (it has white background) and on the right the correct tga 32 bits. As you can see, the background is transparent, as it happens with the normal unit cards from the original game.

After that you must, of course, rename the file and put it in the correct folder.

I think this method is simpler. :bow:

P.S.: in case of mercenary units, even if they are recruitable by factions, the card only needs to be placed in ui\units\mercs folder. Giving mercenary_unit attribute to some widely used units is a method to save space in the mod. I did it for some auxilliary troops, available for most of factions.

Epistolary Richard
08-01-2005, 11:58
Interesting, is it the mercenary_unit tag that makes the game look in the merc folder for the unit cards? I had assumed it was just the dictionary tag...

Monkwarrior
08-01-2005, 12:36
Interesting, is it the mercenary_unit tag that makes the game look in the merc folder for the unit cards? I had assumed it was just the dictionary tag...
Well, I don't understand completely what dictionary tag means.
Do you mean this in edu?

dictionary merc_balearic_slingers ; Balearic Slingers

In that case I'm sure it is the attribute. ~;)
I remarked that when I changed the three gladiators from recruitable to mercenary (only by changing the attribute and renaming the texture in descr_model_battle from romans_something to mercs) and the cards disappeared from the menu. I moved the card to the mercs folder and problem solved. :bow:

Epistolary Richard
08-01-2005, 13:05
Yep, that's what I meant by the dictionary tag :smile:

I'm just wondering what else the mercenary_unit attribute does to the unit. Obviously it allows it to be used in mercenary pools, but it doesn't have to be. Don't mercenaries disband in a different way to regular troops as well?

barocca
08-01-2005, 15:50
perhaps you pair have later versions of photoshop than mine,
mine will not allow files using transparency to be saved as anything other than PSD files,
i can export gifs, or save as PSD, and thats all.

so while your method may be simpler, it wont work on my version.

?? the normal unit cards from the original game have white backgrounds, at least the ones in my copy of the game do.
(i have several TGA capable programs, i tried them all - white BG is all i see)
(irfanview, ultimate paint, dpaint, photoshop, ACDsee)

by using an existing background (the blank card) you dont get any "bleed" effect (no errant pixels around the image)
this can save plenty of time "cleaning up" the image

by using the alpha channel you automatically "lose" the images own background

B.

Roberto
10-03-2005, 16:35
how do you take pictures if you don,t have a print screen key?

cunobelinus
01-06-2006, 17:15
download a system such as www.howiesfunware.com that has howies print screen thing on there thats what i use it puts print screens into what ever folder you want it to so download that and it will be well worth it.
what do u think of this unit card more work needed or is it alrite. https://i7.photobucket.com/albums/y283/littlegannon/britishraidercardcopy.jpg

Burns
01-17-2006, 17:00
Alternatively I think the best solution is to load the model in 3dmax, import an animation you want to use, add lights and then render and do the rest in photoshop.

Byzantine Emperor
04-22-2006, 11:11
2 questions:

How do I cut away the background?

Can you give me instructions how to do this in Paint Shop Pro?

gargamel9
03-12-2007, 12:00
The Xpak link does not work...any idea of where I can get it?
thx

Makanyane
03-12-2007, 12:42
Xpak link moved to here:
http://www.twcenter.net/forums/downloads.php?do=file&id=43