GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
Razor
Lunatic
Lunatic
Posts: 456
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: GTA2 Font Topic - txt2gta2 released!

Post by Razor »

User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - txt2gta2 released!

Post by Cuban-Pete »

Razor wrote:here you are:

http://gtrix.republika.pl/czcionka.htm
Thanks.

Should I add all those colours?

I'm not sure if I can get the polish signs in it, you see, my program language (Python) doesn't show them in the system... perhaps I can try to install polish language on pc...
"Mmmm, your eyes are so beautiful."
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - txt2gta2 released!

Post by Cuban-Pete »

I added those colours and 2 fonts.

Next release (if i got time) will contain street and car sign text and perhaps be written in c++. I'm gonna try it anway... :geek: :D

é (special characters) and polish stuff not yet added... :(
"Mmmm, your eyes are so beautiful."
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - txt2gta2 released!

Post by Cuban-Pete »

Salamander asked if he could see/download the source code, anybody else also interested? If there are more, I might release it. I know that it's a simple program, but still, it is somehow *my* code. lol :lol:
"Mmmm, your eyes are so beautiful."
Heri
Jaywalker
Jaywalker
Posts: 5
Joined: 28 Dec 2009, 22:03
GH nick: Heri

Re: GTA2 Font Topic - txt2gta2 released!

Post by Heri »

I'm really newb in C++, but I really want to see it. D:
User avatar
Salamander
Janitor
Janitor
Posts: 145
Joined: 01 Apr 2009, 20:38
GH nick: Salamander
KingSalamander
Sally
[00]
Contact:

Re: GTA2 Font Topic - txt2gta2 released!

Post by Salamander »

This is Python not C++.
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - txt2gta2 released!

Post by Cuban-Pete »

Ok, I'm going to release the source, but.......

***You may not release a new version without my written permission!***

I want to keep the amount of releases and different versions to the minimum for such a 'simple' program. You can use the code/idea in your own projects or to help me code better (fix bugs), but not release another/new txt2gta2 without my persmission. :)

Now that the air is cleared, here it is:
released-source-v1.11.zip
***You may not release a new version without my written permission!***
(2.74 MiB) Downloaded 599 times
This source code is actually v1.11 (instead of v1.1) because I fixed little type mistake in GUI. Currently I'm thinking about adding support for car and street font. The signs you get when you enter a car or a new street. After that I will try to step away from Python and convert the code by hand to C++ to get real windows program. The goal is to have as little separated files as possible (so perhaps also include alphabet in .exe, if that is possible - imagemagick.exe might be difficult to include...)
"Mmmm, your eyes are so beautiful."
User avatar
B-$hep
Immortal
Posts: 572
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

I think you should not worry.
Looks like Python code / syntax is a big mess.
That's why i don't like it.
Of course it's just my personal opinion about Python.

And i recommend you to switch to C++ or some BASIC.
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - txt2gta2 released!

Post by Cuban-Pete »

B-$hep wrote:And i recommend you to switch to C++ or some BASIC.
I'm trying C++ now, but I got this weird and freaking annoying problem that the build icon in visual studio 2008 is greyed out... wtf...
"Mmmm, your eyes are so beautiful."
User avatar
B-$hep
Immortal
Posts: 572
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

We solved this one hopefully.
As i said, if you encounter any problems or questions, let me know.
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - txt2gta2 released!

Post by Cuban-Pete »

B-$hep wrote:We solved this one hopefully.
As i said, if you encounter any problems or questions, let me know.
Again thanks.

Currently I first implemented support for license plate of car in python . This could perhaps also be nice for people who make their own cars, now they can add very quickly the name with correct license plate image.

Below are examples, i'm not going to release this yet (I think) because next release will be written in c++ (if all goes ok).
Attachments
result.png
result.png (10.4 KiB) Viewed 27878 times
result1.png
result1.png (8.02 KiB) Viewed 27878 times
"Mmmm, your eyes are so beautiful."
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - txt2gta2 released!

Post by Cuban-Pete »

I read system() is not very safe and slow. Do you guys got any advise for an alternative?

I'm also using the windows system to copy files, perhaps I can better let imagemagick do that. However I still need to call to the imagemagick .exe,
"Mmmm, your eyes are so beautiful."
User avatar
B-$hep
Immortal
Posts: 572
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

What and where you need to copy?
The more info you can post the better help you can get.

I use system("pause") in my C++ apps to wait for keypress.
Never used it for anything else.


CopyFile() is good one. I use it alot.
You must include windows.h header:

Code: Select all

#include <windows.h>
More about this function:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - txt2gta2 released!

Post by Cuban-Pete »

I made some nice progress in C++ (menu is working), i'm starting to understand it better. I also got the special characters working. The problem was with latin-1 letter numbering and ASCII numbering. Now I just renamed the letter image files to the ASCII numbering. :)

Current problem I'm having is resource stuff in the .exe. I got an icon working and got an .png in it, but I have no idea how to use the .png then. I also want to add the alphabet letters into the .exe, but is it possible to work with folders or something like that? You see, in normal font folder the images are called 33 up to 200 and this is also in large font folder etc. (else I might need to add 'menu' or 'large' behind the numbers)

I (want to) use system() to call convert.exe (of imagemagick) and add the commands to it it like +append. However, perhaps I can include/resource the convert.exe in the main .exe (so I don't need to use system()), but how do you call/get it and how do you add the +append things to work then?
"Mmmm, your eyes are so beautiful."
User avatar
B-$hep
Immortal
Posts: 572
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

Can you update the first post and upload the fixed version?
I would like to test spec. chars.

If i understand you correctly you need to pass imagemagik the images from exe resources?
Is there any specific reason? For protection?

One chance is to extract each image only when you need it, to some temporary folder (windows temp) and when you don't need it anymore, you just delete them.

So in general i recommend you to extract them to windows temp folder, set their attributes to "hidden+system" and use them. If they are not needed anymore (on application close), just delete them.

I think there is no easy way to pass data from resources to imagemagik. And for such simple console app this is too advanced stuff to mess with.
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - txt2gta2 released!

Post by Cuban-Pete »

B-$hep wrote:Can you update the first post and upload the fixed version?
I would like to test spec. chars.
If you don't mind, I will not update first post until I get rewrite in C++ done (I think, if all goes well, I can get it done next week). If you need it earlier, you can download the attached zip and let it replace normal and large folders in alphabet. :)
B-$hep wrote: I think there is no easy way to pass data from resources to imagemagik. And for such simple console app this is too advanced stuff to mess with.
Ok, I'll keep convert.exe and the images first outside the main/program .exe. Perhaps when I try Visual Studio Form (GUI) I can take a look at it again.

Going from Python to C++ gives some problems, like there is no real *easy* list or dictionary. For example, this does not work, how can I get it to work?

Code: Select all

char colorList[] = {
	"0",				//normal
    "b39564",			//light brown
    "white",			//white
    "a2d0ff",			//bright blue
    "95bfea",			//dark blue
    "0099ff",			//Veteran
    "ffff6e",			//VIP
    "ffa34f",			//Administrator

    "0",				//Custom 
    "eccbff",			//Elvis Mafia
    "ff6312",			//Krishna
    "61ff18",			//Loonies
    "ffd26d",			//Mad Island Mafia
    "007b46",			//Prison Mafia
    "3852ff",			//Redneck
    "dd2c2c",			//Russian Mafia
    "ffb600",			//Scientists
    "4000ff",			//Yakuza
    "7a8c8f"			//Zaibatsu 
};
Attachments
alphabet.zip
(189.4 KiB) Downloaded 579 times
"Mmmm, your eyes are so beautiful."
User avatar
B-$hep
Immortal
Posts: 572
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

Thanks for alphabet. Special chars work fine for the 2 fonts you provided.
Will you add support for other fonts also? Do the other fonts support special chars?

About your code.
Hmm, what are you doing with this list?
Are you taking values from the list by some index or by name?

You could try this:

Code: Select all

static char *colorList[] = {
   "0",            //normal
    "b39564",         //light brown
    "white",         //white
    "a2d0ff",         //bright blue
    "95bfea",         //dark blue
    "0099ff",         //Veteran
    "ffff6e",         //VIP
    "ffa34f",         //Administrator

    "0",            //Custom
    "eccbff",         //Elvis Mafia
    "ff6312",         //Krishna
    "61ff18",         //Loonies
    "ffd26d",         //Mad Island Mafia
    "007b46",         //Prison Mafia
    "3852ff",         //Redneck
    "dd2c2c",         //Russian Mafia
    "ffb600",         //Scientists
    "4000ff",         //Yakuza
    "7a8c8f"         //Zaibatsu
};

More about this all:
http://msdn.microsoft.com/en-us/library ... 80%29.aspx
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - txt2gta2 released!

Post by Cuban-Pete »

Thanks, that works. I'm taking values from list with index. The list corresponds with the color menu on screen. The char/string/static and stuff is still a bit difficult for me. In Python that all goes automatic. :)

If I got it right, normal font has most support for special chars and the others have just like large font, only some letters special. I will make in new release also that the other fonts support special characters (for as much the game gives images). I already got lower a-z convert to capital A-Z working (for fonts that only support capital), perhaps I will also add this convert for the special characters, but it will require a convert table or something...
"Mmmm, your eyes are so beautiful."
Razor
Lunatic
Lunatic
Posts: 456
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: GTA2 Font Topic - txt2gta2 released!

Post by Razor »

Sweet :D
result.png
result.png (10.56 KiB) Viewed 27825 times
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: GTA2 Font Topic - txt2gta2 released!

Post by Cuban-Pete »

I released version 2. C++ was very hard, lots of rebuilds and vague error's, but pulled it off. :D WOOHOO.

Please give crit, is my english in program correct for example? Thanks!
"Mmmm, your eyes are so beautiful."
Post Reply