GTA2 Font Topic - TXT2GTA2 (Version 3 Released!)

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
User avatar
B-$hep
Immortal
Posts: 571
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

Sorry, i found that my IntToString doesn't work for license plates.
I don't know why. If you generate the plates it will display that file not found.

Can you debug this part by yourself?
Something goes wrong in there.
If it doesn't start working, use your old version of IntToString.
User avatar
Sektor
Boss
Boss
Posts: 1426
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 Font Topic - txt2gta2 released!

Post by Sektor »

Try ShellExecute and SW_HIDE.
User avatar
B-$hep
Immortal
Posts: 571
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

Of course, Sektor is correct.
I was wondering why all the mess around "system()".
Is there any particular reason why you use it?

As Sektor said, you can execute almost anything you want with ShellExecute and you can control it's window, command line etc.
Hide it, maximize it, show it as it is and so on.

Read more about it here:
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 »

B-$hep wrote:Of course, Sektor is correct.
I was wondering why all the mess around "system()".
Is there any particular reason why you use it?

As Sektor said, you can execute almost anything you want with ShellExecute and you can control it's window, command line etc.
Hide it, maximize it, show it as it is and so on.

Read more about it here:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
I only use system() because that worked with version 2 and the other ones I tried never freaking work. Always some kind of weird error. It seems that I'm actually working now with .NET and C++ at the same time. The GUI functions in Visual Basic 2008 is from .NET, I didn't know that, I just used it. Learning C++ and .NET at the same time is confusing, for example, the stupid System::String^ isn't native/normal C++ is it?

To be honest, I cannot get the ShellExecute working... :cry:

I add #include <shellapi.h> and ShellExecute(NULL, "open", "imagemagick\\convert.exe", NULL, NULL, SW_SHOWNORMAL);
And what do I get: error LNK2001: unresolved external symbol "extern "C" struct HINSTANCE__ * __stdcall ShellExecuteA(struct HWND__ *,char const *,char const *,char const *,char const *,int)" (?ShellExecuteA@@$$J224YGPAUHINSTANCE__@@PAUHWND__@@PBD111H@Z)
"Mmmm, your eyes are so beautiful."
User avatar
B-$hep
Immortal
Posts: 571
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

You forgot to link shell32.lib.
Under Project->Properties choose Linker.
Then you will see Command Line.
Click on it. Then you will see empty white box on the window.

Type this in: shell32.lib
Click OK and build EXE again.


Im using VC++ Express but the project options window should be same.


Try this, if doesn't work, let me know.


EDIT: you said .NET and C++. So you actually use managed C++ and not the native WIN32 one?

When you started working on GUI version of your tool, what project did you created with VS Wizards?


CLR->Windows Forms Application ?
Or Win32->Win32 Project?
User avatar
B-$hep
Immortal
Posts: 571
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

OK, as it turned out that it's a managed C++ and you can't use the usual ShellExecute.

You could use Process::Start method
http://msdn.microsoft.com/en-us/library ... start.aspx

Code: Select all

Process::Start("IExplore.exe");
http://msdn.microsoft.com/en-us/library ... 71%29.aspx
Read the whole page, it has info about command line also.

But i don't see any chance to hide the window. Probably you could send message to window (SW_HIDE).

But first try to make it work for you and worry about hiding flashing console window later.

EDIT: almost forgot. You must add this to the top of your code:

Code: Select all

using namespace System::Diagnostics;
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 »

New color system is getting shape.

Example text input: [1]Cuban-Pete [5]likes [7]fast [15]cars and [10]woman!

Output:
result.png
result.png (2.3 KiB) Viewed 27895 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 »

Anybody any idea how to convert System::String^ to std::string? I use string to get into system(), but the user input is in System::String^.

Do you guys also perhaps know why running my program the first time (after computer restart) takes pretty long, but the next time it goes very quick? How can I fix that?
"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 fixed the string thing, perhaps a bit "ugly", but it works:

Code: Select all

string SystemToString(String ^blabla){
   int lenght = blabla->Length;
   string realString = "";
   for (int i=0; lenght > i; i++){

	realString += char(int(blabla[i]));
   };
	
   return realString;
};
"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 fcked it all up, just when I was almost at the end. I removed a resource image in the (resX?) by hand (I just needed to update the preview image) and now I get LNK2005 error's... this really sucks. Do you guys know a way to find the problem by hand?

What I did was rename an image to "222" and added a new one, but removed the "222" again or something like that...

:cry: :cry:
"Mmmm, your eyes are so beautiful."
User avatar
B-$hep
Immortal
Posts: 571
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

Damn, so many posts here already. Didn't notice.

What errors exactly? How many of them?
User avatar
Sektor
Boss
Boss
Posts: 1426
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 Font Topic - txt2gta2 released!

Post by Sektor »

I finally got around to trying this program. It's cool.

I used it to generated some text for this page.
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 »

Sektor wrote:I finally got around to trying this program. It's cool.

I used it to generated some text for this page.
Thanks. The page looks nice.
"Mmmm, your eyes are so beautiful."
User avatar
B-$hep
Immortal
Posts: 571
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

How is your work on GUI or this tool going?
If you have some problems, post them here.
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 »

It's going good.

Only small problem with a function, you can only check the System::Object^ sender with the real name and not a string.
I also wanted to do colouring in richTextBox, but I don't get that working. I can make for example "[0]" to grey color, but if there is another [0] in the richtextbox, I can't get it....
"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 »

Code: Select all

				if (this->radio_large->Checked == true){
					this->example_large->Visible = true;
					this->example_normal->Visible = false;
					this->example_menu->Visible = false;
					this->example_street->Visible = false;
					this->example_car->Visible = false;
				};
This is not very efficient if you do it 5 times, is there better way?
"Mmmm, your eyes are so beautiful."
User avatar
B-$hep
Immortal
Posts: 571
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

What are they?
Buttons? Labels? Checkboxes?


You could all hide all at once with simple panel.
Put panel on the top of the controls and hide / unhide just this panel.
Always wear safety glasses while programming.
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 »

They are images.

I have no idea about cleaning up strings/integers. Is that necessary? (garbage collection?)
"Mmmm, your eyes are so beautiful."
User avatar
B-$hep
Immortal
Posts: 571
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 Font Topic - txt2gta2 released!

Post by B-$hep »

.NET has garbage collector, you don't need to mess with that.
It automatically collects garbage.


But where are your images? On the main form?
Always wear safety glasses while programming.
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 »

yeah, they are example images of the font the user selected.

I thought perhaps this is possible (but it did not work):

this->example_car->Visible, this->example_normal->Visible = false;
"Mmmm, your eyes are so beautiful."
Post Reply