Sawakita
Youngster
aka Noodles
Posts: 41
|
Post by Sawakita on Jul 30, 2010 4:21:40 GMT -5
I hope I'm not going off topic, but I need help. A couple of weeks ago I began working on a TownMap editor like this, but for RBGY. The problem is that I'm not so skilled in computer programming and so far I've done the GUI, the load function and a "map-builder" (= you can create your map in the window). I don't know how to tell the program to put the hex values resulting from the created map into the Rom. Can anyone tell me how to do it (by the way, I use Visual Basic 6)? Or I upload the project as it is at the moment and you see what I've actually done so far (because I'm not sure I explained it very well) Here are two screenshots...
|
|
|
Post by Harrison on Jul 30, 2010 4:53:21 GMT -5
Heh, well there goes my next program idea (Though I might make one too for cross-platform usage) Anyways, it's probably completely different in VB, but the way it's done in Freepascal is, you tell the variable that the file stream is stored in (In my programs, Rom), and tell it to position itself at the beginning of where you want to write the data (Rom.Position := Location). You then have to use the write procedure, by telling it what variable to write from, and how long to write (Rom.Write(MapData,SizeOf(MapData))). However, this is only writing the file in RAM. To save it, you have to use SaveToFile to write it to disk (Rom.SaveToFile(FileName)). A quick search shows VB to be similar. Here should help you out.
|
|
|
Post by Masterge77 on Jul 30, 2010 18:06:52 GMT -5
I would like the R/B/Y Town Map editor, but most of us just hack G/S/C, it might be useful for those who want to hack R/B/Y though (Now if only there was a tileset editor and AGIXP for R/B/Y....)
|
|
Sawakita
Youngster
aka Noodles
Posts: 41
|
Post by Sawakita on Jul 30, 2010 18:27:47 GMT -5
Lack of R/B/Y tools doesn't annoy me too much for three reason: first, if we would have as much tools as 3rd gen, we'd become like those who only use tools and don't know what are doing; second reason, 1st gen hacks would become banal and boring like most of 3rd gen ones (not that some of those aren't good, but are really few, in my opinion). And third reason: who needs more tools, when all you have hexeditors, tile editors (that btw allows you to edit tileset), and a map editor (just because editing one block at time is a colossal waste of time!). And don't forget we're lucky to have almost every offset documented by our predecessors (the road now is almost completely paved).
Returning intopic, Harrison: i don't know your programming code, but does freepascal have GUI objects like pictureboxes, and stuff similar to visualbasic? because i made an array of pictures for each tile of the map (320 in total!!) and i was wondering if there's a smarter method to build the townmap..? Perhaps you haven't this problem since townmap in gsc isn't compressed with RLE, right?
|
|
|
Post by Harrison on Jul 31, 2010 12:57:30 GMT -5
Oh wow, that is really inefficient. I just used an array of bytes that corresponded with the correct tile ($00, $01, etc etc). If you export the map and open it up in a hex editor, that's all that the map is stored as in memory. When the map is drawn, it references the Tileset array (which is $00 to $2F of Bitmaps made from tileset.bmp), and draws the corresponding one to the canvas.
|
|
|
Post by Harrison on Aug 2, 2010 3:12:47 GMT -5
Thanks to Datacrystal, I've found how the game determines which areas belong to which map. It's a single byte at $90FB8 that tells the game how many locations are in Johto. I'm going to add in the reading of this byte, as well as a way to change it. Anything else you guys can think of for me to add/change when I do this (other than reading tileset from ROM )? EDIT: Just found the pointers for both maps too, so I'll get it to follow them as well.
|
|
|
Post by Miksy91 on Aug 2, 2010 8:23:08 GMT -5
Great But does changing it have an effect on the flying data ? I'm going to move Olivine and Blackthorn to Kanto so do you know if it just hops from Johto to Kanto and all over again (Ecruteak (Johto) - Olivine - (Kanto) - Mahogany (Johto) - Blackthorn (Kanto) - Indigo P. (Johto)) ?
|
|
|
Post by Tauwasser on Aug 2, 2010 9:40:58 GMT -5
There are actually two offsets for those values and all have to be changed accordingly. I remember that different routines that display the map would use own limits for determining Johto and Kanto. In any case, if you expand flying coordinates, you will have to append to the flying table in order for the game not to crash I think.
cYa,
Tauwasser
|
|
|
Post by Harrison on Aug 2, 2010 11:10:33 GMT -5
Miksy, for what you're doing, you're going to have to change the order of the areas in the Fly-to and area names table.
Yeah, it looks like there are other offsets I'll need to find as well, that tells the game where the Kanto areas start, and how many locations are in Kanto. I think I'll either just read them from ROM, and let the user hex edit the rom if they want to change the number of areas for each map, or let them change it, but add a warning that it may cause the game to crash.
|
|
|
Post by Miksy91 on Aug 2, 2010 12:50:25 GMT -5
Would it be a possibility to find the offsets for that ? If so, I'll make it so that you can't fly to Olivine or Blackthorn until you reach Kanto.
|
|
Melash
Camper
Pokemon Hacker
Posts: 52
|
Post by Melash on Aug 2, 2010 15:55:38 GMT -5
I think that is a great idea, being able to add more labels. Also reading the tilesets from the ROM, haha.
|
|
|
Post by Harrison on Aug 3, 2010 20:11:34 GMT -5
Miksy, Mateo told the table earlier. "x92386 = Cursor/map name data! Format: Xloc, yloc, Name pointer [2 bytes] That will be for Gold, probably Silver too. Crystal is likely to be different but you can find it pretty easily once you know what you're looking for." Crystal's table is located at $1CA8C5.
I think (for now), adding new areas will have to be done via hex editor. My plans for the next release are: 1. Adjust the loop that handles reading area names to combine the number from $90FB8 and the number of Kanto maps (byte still needs to be found) 2. Find where the game is told that Kanto starts (changing $90FB8 to a higher number makes Kanto areas show up in both Kanto and Johto) and use it to automatically change the map when that number is passed in the area drop box 3. Read pointers instead of the actual map locations (though I can't see why you'd need to repoint the maps)
|
|
|
Post by swampert22 on Aug 12, 2010 7:36:18 GMT -5
Hey Harrison, your programming has inspired me to get back into ROM Hacking again, and re-write my programs in Lazarus I have been using Ubuntu for about a year now, and was dissapointed to find that my programs didn't work when run through WINE or other such programs. Besides, open source is the way to go right? I'll probably start with something simple first and post it here in the next few weeks Swampert (Back from the Dead)
|
|
|
Post by Harrison on Aug 13, 2010 3:06:02 GMT -5
Haha, awesome. Looks like now's the time for me to admit that you're actually the reason I started making programs, because I was annoyed at how all RBY/GSC Tools (which you had on your site) were closed source. If you ever need help or something, feel free to hit me up on AIM (Username: HarrisonHopkins).
I've been distracted lately (finally have my car), but I'll get back to work on finishing this soon.
|
|
|
Post by Masterge77 on Aug 13, 2010 15:13:21 GMT -5
Actually, I'm glad that more tools for R/B/Y/G/S/C are starting to appear.......
|
|