Making very simple buttons (and flags) for dummies

The_J

Say No 2 Net Validations
Administrator
Supporter
Joined
Oct 22, 2008
Messages
41,521
Location
DE/NL/FR
This is a tutorial for people, who have no clue about graphics, and the intention is to show how to make the most simple possible buttons and flags.
If you've already once created a button, you know at least already the same like what is written down here, no need to read further ;).

Attention: This tutorial is not meant to show anyone how to add stuff to the game. So if you don't know how to add a unit or similar things, then please take a look at this tutorial: Guide: Adding new units



Needed software
- DXTBmp. This program is needed to convert the graphics into the right format. This program is free and no payment is needed.
- IrfanView. I use this program to cut the images into the right size. You can sure use every other program to do it, but i'll use this for the demonstration. This program is also free and without payment.



Needed Skills
- Like already mentioned, you should know how to add stuff to Civilization 4
- You don't need any knowledge about graphics



Start

Okay, you have an unit without a button, for demonstration this one here will get used.



Step 1

Take a screenshot of the desired unit (for flags: Search the flag you want to have).

For beginners: How do i take a screenshot?
Spoiler :
Just hit the "print" key (to the right of F12). This will create a screenshot in My Documents\My Games\Beyond The Sword\Screenshots


Additional note:
You might want to take a screenshot from the civilopedia, or use the flying camera to get a better shot of the unit.
Flying camera: Open the Civilization4.ini (My Documents\My Games\BtS\CivilizationIV.ini, rightclick, open with wordpad or notepad), and change
PHP:
; Allow Camera Flying
AllowFlying = 0

to 1. Press ingame ctrl + alt + F to activate the flying camera.
Thanks to The_Coyote for the additional remarks :).

attachment.php




Step 2

Cut the image down to 64 * 64 pixels (for flags: 128 * 128). Pay attention, that you can still recognize what is on these pixels.
Attention: Bigger flags and buttons will bring the game to crash.

To cut it down, open the image in IrfanView, pull a border around the area you want to have as button, and then go to "Edit" -> "Crop Selection".

attachment.php


Afterwards, it will look like this:

attachment.php


Please save this part as .bmp (bitmap).



Step 3

Now you have to bring the image into the right format.
To do this, open it first with DXTBmp.
It looks then like this:

attachment.php



Because the button shouldn't look completely ugly, we'll add an alpha channel, which tells the game which parts of it should be transparent. Go "Alpha" -> "Import Alpha Channel".

attachment.php



As alpha channel, import a standard button background (supplied here). For flags, just make the alpha channel completely black.
It will afterwards look like this:

attachment.php



Now, just save it as .dds file.

attachment.php


attachment.php


Use always DDS DXT3, unless you know what you are doing!


...and done :). You now only have to add the button to your unit, and nothing else :).

attachment.php



I know, this wasn't great, and the button is not the finest in the world, but it's definitely better than using 100 times the warrior button.


I additionally recommend this tutorial: Fixing blurry buttons without Photoshop easy, else the buttons will look blurry on low settings.

Another, a bit more advanced tutorial for flags can be found here.
 

Attachments

  • crop.jpg
    crop.jpg
    154.2 KB · Views: 2,698
  • DXTBmp.jpg
    DXTBmp.jpg
    58.6 KB · Views: 2,629
  • alpha-Kanal.jpg
    alpha-Kanal.jpg
    71.7 KB · Views: 2,688
  • mit-Alpha-Kanal.jpg
    mit-Alpha-Kanal.jpg
    62.9 KB · Views: 2,663
  • dds-1.jpg
    dds-1.jpg
    74 KB · Views: 2,577
  • dds-2.jpg
    dds-2.jpg
    86.7 KB · Views: 2,640
  • button-fertig.jpg
    button-fertig.jpg
    127.4 KB · Views: 2,708
Last edited:
nice - now i have a tutorial at my hands if someone wants a button for one of my units ;)

sometimes imo it looks a bit better if you use pics from the pedia (or use the free camera), perhaps at least you could add a info for the second
 
nice - now i have a tutorial at my hands if someone wants a button for one of my units ;)

That was somehow a bit the intention :D.

sometimes imo it looks a bit better if you use pics from the pedia (or use the free camera), perhaps at least you could add a info for the second

:think: never thought about taking a screen from the pedia :think:.

:blush: how to you activate the flying camera ingame? I always forget that.
(i know about the .ini activation)
 
how to you activate the flying camera ingame? I always forget that.
(i know about the .ini activation)

like you know civilizationiV.ini -> AllowFlying = 1
ingame it´s ctrl + alt + F
 
:D you stole my screenshot: and never gave credit :lol: :D

I really should make a button for it :crazyeye:

well at least the unit has made it to somewhere important ;)
 
Hi The_J, I've followed all the instructions you gave above and have had no problem creating all the buttons I need for the Babylon 5 Mod. However, I've just made four new ones for some of the newer units and they show up as pink boxes. I've checked all the pathings and everything is correct, is there any other reason why my buttons would be pink instead of showing the image I have created?

It's OK, I figured out where I went wrong.
 
Hi The_J, I've followed all the instructions you gave above and have had no problem creating all the buttons I need for the Babylon 5 Mod.

Nice to hear :).

However, I've just made four new ones for some of the newer units and they show up as pink boxes. I've checked all the pathings and everything is correct, is there any other reason why my buttons would be pink instead of showing the image I have created?

I can only think of the tooltips for promotions, in which the icons would show up as pink, if the file name had a space in it, but else i have no real idea.

In general i'd just suspect that it's still the path, that there's something in the path name which you can't see, e.g. 2 spaces after each other, or something similar obscure.

To exclude that it's a problem with the buttons itself, i'd suggest that you upload them, so that i can test them. If they show up for me (or for someone else, if someone is faster), then we could exclude that.

Edit: Damn, should have waited a minute with the answer :D.
Will you tell us about the solution?
 
the solution was dead simple. don't add the .dds to the end of the description of the art file itself.
This is the art defines entry.
Code:
<Button>Art/Units/Dilgar_Imperium_Ships/Dilgar_Mishakur/Dilgar_Mishakur_Button.dds</Button>
So when I placed the art file into the above location I also put .dds onto the file when it didn't need it.

It appears as Dilgar_Mishakur_Button in the art folder and because it is a dds file that bit is picked up automatically.:lol: Ifelt like such a fool when i figured it out.
 
A thread is only dead if nobody is maintaining it anymore ;).

Sadly I have no idea which programms are comparable for Mac :dunno:.
But you might want to take a look at cool3a2s tutorial. It's a bit longer (and more sophisticated), but he uses GIMP, which is also available for Mac.
 
So you could use the same technique for the buttons? Cool :D
Also, does anyone know the way to take a screenshot with a Mac keyboard? There's no printscreen key...
 
Very nice tutorial The_J, it would be great if someone released a tutorial like this (this is explained with pictures, and it is much easier to figure out what to do) and something else, such as C + + codes, how to create a new CvGameCoreDLL.dll. etc.
 
Thank you :hatsoff:.

And we have tutorials for the Dll and for C++, it was recently pointed out elsewhere:
If you wanted to put the time into learning how to mod the SDK, there's two great tutorials out there that you can use. A simple guide to compiling the DLL by Asaf explains how to set up the SDK properly and easily, and An Idiot's Guide to Editing the DLL by xienwolf explains how to add a new XML value and use it in the DLL. These two tutorials should cover everything you need to do here.
 
Back
Top Bottom