GTA2 Tile Selektor

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

Re: GTA2 Tile Selektor

Post by B-$hep »

Thank you Sektor, for testing and replying.

I will fix tile order and i would like to get rid of the yellow tile.

Yeah, it follows and you can see it atm, because the timer interval where this "following" is done, is a bit high. I will set it to much lower later.

Im thinking about ASM to improve my knowledge with it. This would be fun to code in ASM.


i will add resizing and probably there should be an option to choose from, always follow the DMA selector or just show it anywhere user wants and allow resizing at the same time.

You can't resize DMA selector, at least i can't do it, docked or undocked, i can't.

Sektor wrote:If you undock the map editor tile selector before starting your program then it doesn't follow properly. It does follow if I undock (drag it off the map editor) after running your program.
Thanks, i will check with Spy++, why the hell it looses the selector if it get's undocked.
That's the MFC fault again i guess.
Always wear safety glasses while programming.

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 Tile Selektor

Post by B-$hep »

Well i fixed tile index bug, it was easy.

But i still have issues with DMA editor docking.
I really don't understand why it looses the DMA listbox handle, when you undock it or why it can't find it when it's undocked.

I must also detect it somehow, so if it's undocked, i should check the handles and if they are not valid anymore, i must find the DMA editor listbox again.

Biggest problem atm actually.


I could forget it, but then i cant reposition selector if DMA listbox moves around and it causes other ugly things. It just will not look good.
Always wear safety glasses while programming.

User avatar
Sektor
Boss
Boss
Posts: 1384
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 Tile Selektor

Post by Sektor »

You could do what I did in Tile Selektor to find the undocked window. I searched the child windows of all windows with a blank window title. The one that is a ListBox with GWL_ID = 1050 is the one you want.

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 Tile Selektor

Post by B-$hep »

I noticed that in VB, it finds the undocked window.
So i guess my Delphi code is buggy.

Now i at least know what's the problem.
Always wear safety glasses while programming.

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 Tile Selektor

Post by B-$hep »

Ok, i uploaded new version. (Attached it).

I added 2 buttons to the top left corner, T and S.

First allows you to toggle TOPMOST not TOPMOST.
Second allows you to toggle: SNAP not SNAP. The second option also allows you to resize it.

It's the best i could do atm. I tested it in XP and seems to work fine.
DMA undocking bug is also "fixed".
SNAPping only works if TOPMOST is ON, otherwise you can't see the selector window anymore, because it will be behind DMA editor.

I tried to bring it to front, but i didn't have any success. So i gave up with that atm and took the option above.

If you encounter any problems, crashes or something, or have ideas for improvement, etc, let me know.

Btw, it reads STY path now from DMA editor registry keys.

Once again credits and thanks to: Ben Millard, Sektor, JernejL.
Always wear safety glasses while programming.

User avatar
Sektor
Boss
Boss
Posts: 1384
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 Tile Selektor

Post by Sektor »

Very nice.

It just needs to select tiles both ways now. If you select a tile using GTA2 map editor (by any means) then the same tile should be selected in your tool. Check if LB_GETCURSEL is the same as the tile selected in TS B-Shep.

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 Tile Selektor

Post by B-$hep »

Thanks.

It may sound strange but this seems even harder, give me some time with it.
Always wear safety glasses while programming.

BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: GTA2 Tile Selektor

Post by BenMillard »

Wow, the performance is amazing! :shock: Some suggestions about the interface:
  1. Scroll the tiles vertically, not horizontally. That makes the keyboard and mouse controls intuitive.
  2. Re-arrange the tiles if the size of the window changes the number of visible columns. (Avoids horizontal scrolling.)
  3. Provide normal buttons for Minimise, Maximise/Restore and Exit. Then it can be used separately from Map Editor, to browse textures. (Try doing this with Tile Selektor, it's really interesting just to browse - and useful for map makers!)
  4. Maybe provide the Control Box as well, so Alt+Space, Letter shortcuts can perform Minimise/Maximise/Restore actions.
  5. Size of scrollbar "thumb" should match the relative size of visible area, like in Tile Selektor. Currently it's always a small, default size.
  6. Snap To Window is probably not useful, as nobody moves the editor around a lot. (It's always maximised in the screenshots I see.)
  7. Topmost is probably not needed either. Tile Selektor was only topmost when it was in "Restored Down" mode. You could enhance this, so there must also be a Map Editor window open - otherwise it just acts like a normal window.
  8. Could you link it to the res-hacked map editor, so it always launches the selector whenever you open a map? Not essential but would be convenient.
Can we call this Tile Selektor 2 with B-$hep credited as the lead programmer? It was Sektor's concept with code adapted from an earlier project, with refinements by me. B-$hep's re-written version has transformed it even further.

User avatar
T.M.
Immortal
Posts: 957
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 Tile Selektor

Post by T.M. »

Oh yeah, looks/works nicer now, is it possible to remove the window borders so it looks more like part of the UI? that would be nice. Is it normal that the tool closes if map editor isnt open ?

Few suggestions:
- Make it display the tiles in 4x4 groups like the tilepages are normally set (look how stytool shows them). this will make it easier to browse the tiles since theyre mostly grouped into 4x4 groups anyways.
- Vertical scroll only: fit the 4x4 tile groups into the current width.

I made a bat file for launching the editor with this script, works nicely:

Code: Select all

start "" "Editor.exe"
start "" "TileSelector-B-Shep.exe"
save these lines as .bat file and run! (yes... run for your lives!)

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 Tile Selektor

Post by B-$hep »

Hi T.M.
I didn't know that you also use this tool.

Yep, if DMA editor is closed, this tool is closed because it is meant to use with DMA editor.
I actually forgot to remove borders if SNAP is on. I will fix that in next version.

And i guess drawing tiles properly is neverending problem. I really must make it better.

Thanks for the ideas and testing.
Always wear safety glasses while programming.

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 Tile Selektor

Post by B-$hep »

BenMillard wrote:Wow, the performance is amazing! :shock:
Hi Ben. I didn't notice your post, sorry.
Anyway, i think this video fits perfectly here: ;)



I love Delphi, speed is one of the reasons.

Thanks for all the ideas, i will try to implement them now.

I messed around with some stuff today and added the transparency also, like in VB version.
I will now try to draw them better than before, for resizing, scrollbars, etc...
Always wear safety glasses while programming.

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 Tile Selektor

Post by B-$hep »

I attached a bit better version than previous (hopefully).
Let's say that this just a maintenance release.

I fixed some bugs, added XP manifest to exe (so it will look better with default XP themes) and did some other small improvements (mainly in code).

Also improved the selected tile highlighting (now with nice white border).
The buttons, if the functionality is enabled, then the font caption is bold, if the function is turned off, then it's in default style (not bold).

It doesn't have the all requested features yet, just a bit better version that the previous one.
Attachments
TileSelector-B-Shep.zip
GTA2 Tile Selector v0.2.2 B-$hep Edition
(181.01 KiB) Downloaded 398 times
Always wear safety glasses while programming.

BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: GTA2 Tile Selektor

Post by BenMillard »

Using the 2011-07-12-tsbm codebase, I have fixed a fatal error in Tile Selektor. It now shows a blank window instead of crashing if there isn't enough memory to render the tiles.

The problem is Error 480: Can't create autoredraw image. The exact memory limit is hardware dependent and is affected by other applications which are running. This 10-year-old machine was usually fine at 1600x1200 but always fails on my my newer 1920x1200 screen.

Specifically, it would display Now the area for the tiles is left blank. Also, if Tile Selektor was maximised it is now sized down to the normal window size because that should be much smaller and therefore should render OK. That is all which has changed.

User avatar
elypter
Immortal
Posts: 1121
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: GTA2 Tile Selektor

Post by elypter »

nice to see a progress.
if it is finished i would like to pack it together with the editor exe
yur sa'nok ngeyä

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 Tile Selektor

Post by B-$hep »

No one uses my version?
Always wear safety glasses while programming.

User avatar
Sektor
Boss
Boss
Posts: 1384
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 Tile Selektor

Post by Sektor »

I put Ben's new version in an installer and added it to the first post.

I like the speed of B-$hep's version but I prefer the larger viewing area of Ben Millard's version.

User avatar
elypter
Immortal
Posts: 1121
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: GTA2 Tile Selektor

Post by elypter »

unfortunately both versions arent complete enoungh. afai.remember it was because they work only one-way. so if you use the pick tool your tool doesnt update. i cant test now because the psu of my desktop broke.
yur sa'nok ngeyä

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 Tile Selektor

Post by B-$hep »

Sorry about these "bugs". I will fix them. One can choose a version which they prefer.
I don't push anyone.

Have a nice day.
Always wear safety glasses while programming.

BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: GTA2 Tile Selektor

Post by BenMillard »

B-$hep's one is certainly the way forwards! There are many small details in the user interface of mine which suit the way I work a lot better, though.

B-$hep, would you consider making the GUI of your Selektor more like mine? I'm on Game Hunter for an hour or more each day at the moment, as I'm taking some time off work.

And finally, as Elypter points out, making the selection two-way would be convenient. (Avoiding infinite loops, of course!) Then I can pick a tile from a building in the editor and see what tiles are part of that set in the Selektor.

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 Tile Selektor

Post by B-$hep »

Of course, no problem.

As i probably pointed in ReadMe file or in my posts, all ideas, suggestions, bug reports etc are welcome.
Always wear safety glasses while programming.

Post Reply