Results 1 to 17 of 17

Thread: How to - Edit Unit Cards

  1. #1
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: Some 'How To's'

    Modding Resource Header

    Title: How to - Edit Unit Cards
    Posted by: Myrddraal
    Modding area: Units (appearance)
    Required programmes: Vercingetorix's X-Pak, An image editor capable of editing .tga format, Notepad (or other text editor)
    Related links: xpak Tutorial
    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.
    Last edited by Myrddraal; 07-26-2005 at 11:36.

  2. #2
    warning- plot loss in progress Senior Member barocca's Avatar
    Join Date
    Dec 2000
    Location
    (*disclaimer* - reality may or may not exist, in some societies reality is a crime, punishable by life)
    Posts
    5,341

    Default Unit Cards in detail

    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)

    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.

    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


    cut away the background


    reduce the image size progressively until it fits into the blank-unit-card

    this image is 100x110 - too large, but then i dont want the entire image on the card

    paste the image onto the unit card,


    now the fun part,
    change your magic wand to 0 tolerance
    /

    hide the background layers


    using your magic wand click in the transparent area, then right click and select similar,


    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


    now we want to make all the rgb channels invisible,

    and the alhpa channel visible,
    ALSO we need to be able to edit the alphap channel

    when you do this your toolbox (on the left) will change to greyscale mode - this is good


    now we quite simply edit/fill the selected area BLACK
    and leave the area behind the unit WHITE



    put the channels back in the correct order
    (hiding the alpha channel)


    Switch back to layers and make them all visible


    Flatten image


    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




    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...

    he did not stand a chance...


    Cheers,
    B.
    The winds that blows -
    ask them, which leaf on the tree
    will be next to go.

  3. #3
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: How to - Edit Unit Cards

    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.

    They were done as I say and the grey background is visible, together with the numbers.
    In my opinion this greatly simplifies the procedure.

  4. #4

    Default Re: How to - Edit Unit Cards

    Thanks, barocca. Another great way to get a screenshot for your unit (if you don't have 3dsMax) is to use the movie_cam. It allows you to zoom all the way down to ground level and take pictures like these (done by Prof).
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  5. #5
    warning- plot loss in progress Senior Member barocca's Avatar
    Join Date
    Dec 2000
    Location
    (*disclaimer* - reality may or may not exist, in some societies reality is a crime, punishable by life)
    Posts
    5,341

    Default Re: How to - Edit Unit Cards

    Quote Originally Posted by Monkwarrior
    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.

    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.
    The winds that blows -
    ask them, which leaf on the tree
    will be next to go.

  6. #6

    Default Re: How to - Edit Unit Cards

    I use Photoshop and that definitely supports transparency for tgas.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  7. #7
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: How to - Edit Unit Cards

    I will try to explain, in spite of my bad English (sorry )

    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:


    - Then I clear the "background" from the screenshot and this is the result:


    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à!

    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.

    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.

  8. #8

    Default Re: How to - Edit Unit Cards

    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...
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  9. #9
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: How to - Edit Unit Cards

    Quote Originally Posted by Epistolary Richard
    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?
    Code:
    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.

  10. #10

    Default Re: How to - Edit Unit Cards

    Yep, that's what I meant by the dictionary tag

    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?
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  11. #11
    warning- plot loss in progress Senior Member barocca's Avatar
    Join Date
    Dec 2000
    Location
    (*disclaimer* - reality may or may not exist, in some societies reality is a crime, punishable by life)
    Posts
    5,341

    Default Re: How to - Edit Unit Cards

    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.
    The winds that blows -
    ask them, which leaf on the tree
    will be next to go.

  12. #12
    Swiss Amoured Pikeman Member Roberto's Avatar
    Join Date
    Oct 2005
    Location
    England
    Posts
    31

    Default Re: How to - Edit Unit Cards

    how do you take pictures if you don,t have a print screen key?

  13. #13

    Default Re: How to - Edit Unit Cards

    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.
    Last edited by cunobelinus; 01-07-2006 at 12:55.
    "Do you have blacks, too?" —to Brazilian President Fernando Cardoso, Washington, D.C., Nov. 8, 2001
    "Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we."
    —Washington, D.C., Aug. 5, 2004
    "I want you to know. Karyn is with us. A West Texas girl, just like me."
    —Nashville, Tenn., May 27, 2004

    how stupid george bush is !

  14. #14

    Default Re: How to - Edit Unit Cards

    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.

  15. #15

    Default Re: How to - Edit Unit Cards

    2 questions:

    How do I cut away the background?

    Can you give me instructions how to do this in Paint Shop Pro?
    Down with the enemies of Byzantium!
    The Bartix thread is good for your health!

  16. #16

    Default Re: How to - Edit Unit Cards

    The Xpak link does not work...any idea of where I can get it?
    thx

  17. #17
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: How to - Edit Unit Cards

    Not used mods before? Looking for something small and fun?!
    Download the:

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO