GTAMP.com

Grand Theft Auto Media Press
It is currently Sun Apr 20, 2014 6:23 pm

All times are UTC




Post new topic Reply to topic  [ 51 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: GTA2 Tile Selektor
PostPosted: Sun May 22, 2011 2:09 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1063
Location: GTAMP.com
Download:
Attachment:
tile-selektor-setup.zip [563.32 KiB]
Downloaded 623 times

VB6 source code:
Attachment:
2011-11-02-tsbm.zip [94.8 KiB]
Downloaded 188 times

This is a modified version of GTA2 File Editor. GTA2 File Editor was created by Stephen Dawkins, Exc0r5 and Gavin Rudd.

The tile selector in the official map editor has a bug that displays most tiles as white until you click on them. This program works around that issue by using its own tile viewer and syncing it with the map editor when you click on a tile.

Sektor added the map editor listbox/window controlling code. Ben Millard fixed some bugs, made various changes to the GUI, made the window always on top and modified the tile viewer to adjust the number of columns and rows displayed when you resize.

Attachment:
ts02.jpg
ts02.jpg [ 39.35 KiB | Viewed 4219 times ]


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Sun May 22, 2011 3:41 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 964
if you add scroll wheel support 2 way support, so you can use the pick tool without displaying the left panel it would be perfect.

_________________
yur sa'nok ngeyä


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Sun May 22, 2011 4:17 pm 
Offline
User avatar

Joined: Mon May 18, 2009 9:40 pm
Posts: 406
Location: Nowhere.
Very nice, but could be made better with scroll wheel support, like elypter said

_________________
You just lost the game.


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Sun May 22, 2011 5:28 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 449
Location: Estonia
Nice work Sektor and Ben.

Maybe this helps adding wheel support:

http://vb.mvps.org/samples/HookXP/

http://visualstudiomagazine.com/article ... wheel.aspx

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Sat May 28, 2011 5:39 pm 
Offline

Joined: Sat May 16, 2009 6:14 am
Posts: 848
Location: London, UK
Changelog for the version I just sent privately to Sektor:

  1. Window size, position and state are now remembered by using Windows registry.
  2. Re-arranged the GUI so tabs are on the right, merged with scrollbar and Refresh button.
  3. Renamed some tabs to be shorter, giving more space for scrollbar in new GUI.
  4. F5 is now a shortcut for Refresh.
  5. Up and Down scroll by 1 row.
  6. PageUp and PageDown scroll by nearly one page: the first (or last) fully visible row will remain fully visible, so you can keep track of context.
  7. Fixed a bug where there was sometimes an empty row after all the tiles.
  8. Fixed a bug at startup, when only the tiles in the initially visible area were visible. (Might still see this when going from a short .sty to a long one.)
Ran out of time to add scrollwheel support, sorry. Now off for a night out but will return somewhen tomorrow.

Ideas
  1. Tabs might just be removed so this project can be focus entirely on selecting tiles.
  2. The project it was based on is available online...somewhere? Maybe add it to GTA2 Tools page?
  3. Just realised that Ctrl+R should be a shortcut for Refresh. Easily added but can't right now.
  4. Using a small icon instead of the letter "R" might be better for the Refresh button. It has a tooltip to help explain, for now.

_________________
BenMillard's GTA5 Races, Off-Roading and Deathmatches | GTA2 Multiplayer Levels | Mission Code Tutorials | GTA2 YouTube Videos


Last edited by BenMillard on Sun May 29, 2011 4:54 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Sat May 28, 2011 8:43 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1063
Location: GTAMP.com
Thanks for the updates. I added Tile Selektor and GTA2 File Editor to the tools page.

I attached the Nullsoft installer script and icon (just if someone wants to improve the installer or package it themselves).


Attachments:
installer.7z [1.97 KiB]
Downloaded 128 times
Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Sat May 28, 2011 8:56 pm 
Offline
User avatar

Joined: Wed Mar 17, 2010 4:07 am
Posts: 401
Location: Wales, UK
Looks good :)

Hopefully the scroll-wheel support will be added in future, make it a lot easier!

As you mentioned, only the tile selector is useful in the map editor since we already have STY editors out there for the sprites/fonts etc. If the other tabs can be removed that'd be good.

Also, with the refresh shortcut, F5 seems the more common than Ctrl+R so perhaps keep it as F5? Also, you could change the button caption from saying "Refresh" to a little refresh icon with a tooltip saying refresh also.

8-)

_________________


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Sun May 29, 2011 4:47 pm 
Offline

Joined: Sat May 16, 2009 6:14 am
Posts: 848
Location: London, UK
Just sent an updated version to Sektor with these changes:

  1. Basic scrollwheel support. One unit of scroll equals one row in the list.
  2. Scrollwheel support ignores "smooth scrolling" magnitudes and the Windows "scroll by this many lines" multiplier.
  3. Simply pressing R will Refresh the view. Ctrl+R and F5 also work.
  4. Tabs are now covered up by the scrollbar.
Sektor will probably upload the new version once he has checked my changes, if he approves them.

A couple of loose ends which I keep forgetting about:

  1. Scrollwheel should work in Tile Selektor even when it doesn't have focus. (Is that possible in VB6?)
  2. Update the Tile Selektor if DMA Editor has picked a different tile. (Avoiding fights and race conditions between them.)
  3. Give focus to DMA Editor when any tile is clicked in Tile Selektor.
  4. Remove all redundant controls and code.

_________________
BenMillard's GTA5 Races, Off-Roading and Deathmatches | GTA2 Multiplayer Levels | Mission Code Tutorials | GTA2 YouTube Videos


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Sun May 29, 2011 5:32 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 449
Location: Estonia
I wonder is the installer really needed?

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Sun May 29, 2011 5:36 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1063
Location: GTAMP.com
The installer is required because this VB6 program needs OCX files registered and users should never have to do that manually.

I attached Ben Millard's updated version to the first post.


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Fri Jun 03, 2011 9:53 am 
Offline
Mugger
User avatar

Joined: Fri May 06, 2011 11:43 am
Posts: 16
Location: Munster, Germany
Is it possible to remove the window decorations? So you only have the window itself without borders and a title bar...

That would make this quite handy tool even a bit handier :)

cheers,
2Ray


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Fri Jun 03, 2011 10:00 am 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 964
afaik it is possible to do this in autoit. it would also be possible to position the window inside the editor automatically

_________________
yur sa'nok ngeyä


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Sat Jun 04, 2011 5:02 pm 
Offline
Mugger
User avatar

Joined: Sun Feb 21, 2010 10:03 pm
Posts: 17
You could use this to put the list into gta2 map editor itself, making it appear as part of gta2 editor:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Also nice to see someone actually using Gavin's code after all this time, this was his late version SRC i released?
To people who don't know about it, it is this:
http://www.mathpudding.com/temp/gta2fesrc.zip (Gavin Rudd's nearly complete sty editor written in VB around year 2002, parts of it were used to help me make my sty editor (delta stream decoder) )


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Sat Jun 04, 2011 6:15 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1063
Location: GTAMP.com
It looks like the same code. There's a lot of room for optimisation. When it opens a STY file, it goes through each tile, writes it to disk as temp.bmp and then reads it from disk. There is really no good reason for writing to disk, it could all be done in RAM.

The code is still much better than most of my code and I'm impressed he was able to create it in 2002.


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Wed Jun 08, 2011 8:17 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1063
Location: GTAMP.com
I found a post of mine from 2007 about a tile selector:
Quote:
Posted 22/06/07 at 18:20:54
I'm sure Delfi has the skills to take over the interface for the GTA2 map editor and add his own style viewer. It could select the same tile in the real interface but hide it from view. He was able to change the GTA2 network screen completely but that is a much more basic interface. He's a busy man though and this would take some effort.

I thought it was amusing, especially since 4 years later, I ended up doing it myself*.

* With lots of help


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Wed Jun 08, 2011 11:24 am 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 821
the internet makes time seem squashed...

_________________
"Only Silky Milky implants by Zaibatsu feel and taste like the real thing."


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Mon Jun 13, 2011 1:01 am 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 449
Location: Estonia
Here is my version, with plenty of bugs, but it integrates automatically to DMA window and moves his own ass to correct position when you move DMA window.

Thousands of thanks and credits go to: Ben Millard, Sektor, JernejL.
Screenshot for you here.

Click on thumbnail
Image

I must go to sleep now, i will return and will tell you more guys.
I have many ideas, how to make it better.

And i will post the source (Delphi).

Code is yours guys, but i just basically translated it to Delphi and added some nice things to it.

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Mon Jun 13, 2011 1:08 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1063
Location: GTAMP.com
Cool. This does deserve to be done properly or at least better than my attempt. I'd rather work on GH ;)

Translating my window controlling code to Delphi might have been harder than just going to MSDN :lol: (not really they both would use same API calls).

Now where is the download?


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Mon Jun 13, 2011 9:25 am 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 449
Location: Estonia
Hi Sektor.

Well you always could do the same things in VB i guess.
I dunno.


I just translated the most important stuff, finding gta2 editor handle, clicking on listbox etc.
But it's not complete yet, because tiles drawing order is not same as in DMA editor and it clicks on wrong tiles in DMA.
Also, it loads sty from my temp folder, instead of locating it in registry.

I just wanted to test it guickly.


And there is some more stuff to be done, i could upload the messy incomplete source if you want? Or the exe. It atleast shows how it looks like.

I will improve it of course and the final source will be available anyway.
I have plan to rewrite it in assembler, to make it as fast as possible.

I didn't bother to mess with SetParent anymore.
I tried it and didn't get good results. So just decided to remove all the unneeded borders, make it topmost, position to DMA gta2 tiles tab and move it, whenever dma editor moves.

More checks are needed for that thing, for ex: if DMA editor is active (has focus) or not, is it minimized or not.
And hide the selector accordingly.


Also hide it from windows taskbar, etc small things.


EDIT:

I attached simple demo.
Just run DMA editor first and then this tool.
If you close DMA editor, then tool closes also.


STE.STY must be in C:\TEMP\ !!!

ie:
c:\temp\ste.sty


EXE is clean, don't worry. I checked it.

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
 Post subject: Re: GTA2 Tile Selektor
PostPosted: Mon Jun 13, 2011 2:27 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1063
Location: GTAMP.com
Nice it loads the tiles nearly instantly. As you said, the tile order isn't exactly the same, so it gets it wrong sometimes. It follows the map editor window around (you can see it catching up but it's good enough). ASM isn't needed since it's speedy already but if that's what you want to do, it would be cool.

Will you add the option to resize the window so you can see many tiles without scrolling? After you fix the bugs of course.

If you undock the map editor's 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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 51 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group