pichorra Posted February 26, 2012 Share Posted February 26, 2012 C&C95 cell replacer. Use it at your own risk! ALWAYS BACKUP YOUR MAPS! THE TOOL ITSELF DOES NOT CREATE ANY BACKUP Usage: open a command prompt on the folder that the cell_replacer is. then you can use it typing: cell_replacer -f MAPFILE.BIN -w ID firstcell secondcell... example: cell_replacer -f bogusmap.bin -w 0500 67 68 135 4095 That will replace the IDs of cell 67, 68, 135 and 4095 with 0500 (Water rock in Temperate). Getting the Cell number: XCC: CCWMAP: Easy, huh Download HERE. Get the binary for your operating system. If you are crazy like me and like to use an older Windows version (such as 98), there is a DOS binary there too . You can edit the source the way you want too. Bugs: Post here. If you want to post an enhancement of this application, fell free. TODO list: - Replace all X cells with Y ID with Z id. - Add better memory managment. The fixed Array is pretty unsecure and it will crash the application if you give anything bigger than 8kb. C&C95 bin maps are always 8kb, so, there won't be problem with it. DONE - Add Sole Survivor and Red Alert Support. This application will also be the base for an .bin fixer. It will replace all cell ID that crash the map editor and replace it with an neutral cell. Currently know cell IDs (they are all in Hexadecimal): 0500: Water Rock. (Temperate) 5A00: Passable Cell, but Unbuildable. (Temperate) This is awesome for Multiplayer maps. Stop those base-rush guys! FFFF: Normal Cell. (Temperate). Those IDs can also work for other theaters, but the cell itself can be all black, crashing when opened in map-editor. cell_replacer2.zip Link to comment Share on other sites More sharing options...
pichorra Posted February 26, 2012 Author Share Posted February 26, 2012 Reserved. I will try to get All cells ID and somehow post here Link to comment Share on other sites More sharing options...
Nyerguds Posted February 29, 2012 Share Posted February 29, 2012 all cell IDs? http://nyerguds.arsaneus-design.com/cnc95upd/inirules/tilesets.ini These are decimal though. And are just the actual tilesets (first byte value), not the actual tile numbers (second byte) for useful stuff. The information below it does give you each tileset's dimensions though. Anyway, with that list converted to hexadecimal, it's just a matter of looking up these tileset files in the theater mixfiles (or heck, in xcc editor; it shows these filenames in the status bar on mouse over) and finding interesting cells on them Link to comment Share on other sites More sharing options...
Chimas Posted March 1, 2012 Share Posted March 1, 2012 Pichorra, I have some interest on this issue. I'll pass by the cncnet chat eventually to talk about it. Maybe next weekend. Link to comment Share on other sites More sharing options...
pichorra Posted March 3, 2012 Author Share Posted March 3, 2012 Newsflash!: In DOS C&C, the .BIN first id starts in the savegame at 0x5E0 . The common difference is 9C. Add C to 5E0 and you will get the 2nd cell id. Do it while the 4096-rd times and you will get the .bin trough the savegame. (dos). Haha Solo, the missing .bin maps can now be recovered I will just adapt my application to do it, 'cause i do not want to do it all by one. I can make my computer do that xD forget it Link to comment Share on other sites More sharing options...
Nyerguds Posted March 4, 2012 Share Posted March 4, 2012 Neat! Won't get the inis though. I don't really understand your explanation though... it saves all map tile IDs +9C? that's weird, illogical, and would cause it to overflow, imo. Link to comment Share on other sites More sharing options...
pichorra Posted March 4, 2012 Author Share Posted March 4, 2012 Forget it. It is at somehow the first 1500 cells are in a ordenated way, the others i dunno Well, I got Hifi's memory hack. I will aim it at dosbox running C&CDOS, and get the cells from there. mwahahah Well. I gave up about doing it directly from the savegame. THe game only seems to store the non-FF 00 bytes cells there. Now the only hope is to manage it to read the memory after the savegame is loaded, Like i have said before. Link to comment Share on other sites More sharing options...
Nyerguds Posted March 10, 2012 Share Posted March 10, 2012 Actually, if it only stores non-FF00 cells, it should have coordinates with them, somehow... Link to comment Share on other sites More sharing options...
Myg Posted March 12, 2012 Share Posted March 12, 2012 Pichorra, if you want us to assist; please post a sample save file for analysis; otherwise I would reckon your just overthinking it and should assume its simpler then you expect it to be. Link to comment Share on other sites More sharing options...
Nyerguds Posted March 14, 2012 Share Posted March 14, 2012 From what I see in the code, the map is probably saved as an array of cell OBJECTS though, rather than the binary .bin data. Link to comment Share on other sites More sharing options...
Myg Posted March 14, 2012 Share Posted March 14, 2012 That makes a lot of sense Nyer, so whats the struct of a cell like? Link to comment Share on other sites More sharing options...
pichorra Posted March 14, 2012 Author Share Posted March 14, 2012 Alright. Look at the attachment. main.old.c is trough Direct "Sav2bin" way. main.c is what i'm trying to do messing with the Windows's memory. The issue is that I don't know ANYTHING about those handle stuff, and Hifi seems dead. Another Thing: It seems to simple Ignore all empty cells. That mean that FF00, FFFF and all others from that kind of isn't stored in the savegame separatelly. The code is messy. Don't annoy me with it. Savegame.001 is a full FFFF ID map. Savegame.002 is the one that i'm trying to convert. Savegame.003 is the one that I was using for testing. It was from a full 0x5555 ID Map Tore: Add crappy .txt support attachment! bin_recoverer.zip Link to comment Share on other sites More sharing options...
Nyerguds Posted March 16, 2012 Share Posted March 16, 2012 That makes a lot of sense Nyer, so whats the struct of a cell like? Don't have a clue. Never really looked at those structs, besides those of hardcoded data arrays like music and warheads, which I can actually see in ida without debugging. Link to comment Share on other sites More sharing options...
Myg Posted March 23, 2012 Share Posted March 23, 2012 Bleh, when ya do; gimme a shout: I'd love to see how Westwood represented them. Link to comment Share on other sites More sharing options...
pichorra Posted July 6, 2013 Author Share Posted July 6, 2013 Update Relased! - Removed the 8kb buffer. Now the tool directly replace the ID into the file. - Added checks to avoid users from selecting an wrong file. - It is now a command line application. - Added binaries for DOS and Unix-like (all binaries are compiled with GCC, except for the DOS one, which uses OpenWatcom compiler). Link to comment Share on other sites More sharing options...
Nyerguds Posted July 9, 2013 Share Posted July 9, 2013 Can you add the ability to globally replace all occurrences of one specific tile by another specific tile, instead of giving cell numbers? For example, cell_replacer -f bogusmap.bin -o FF00 -w BA04 with the -o specifying the original cell bytes to replace What on earth does the "-w" stand for anyway? Link to comment Share on other sites More sharing options...
pichorra Posted September 16, 2013 Author Share Posted September 16, 2013 Can you add the ability to globally replace all occurrences of one specific tile by another specific tile, instead of giving cell numbers? For example, cell_replacer -f bogusmap.bin -o FF00 -w BA04 with the -o specifying the original cell bytes to replace What on earth does the "-w" stand for anyway? Wow, I just saw that today I will when I get time I can't remember why I put that -w there, probably I had my reasons when I was writting it. Actually that code looks pretty ugly Link to comment Share on other sites More sharing options...
Nyerguds Posted September 16, 2013 Share Posted September 16, 2013 lol. Link to comment Share on other sites More sharing options...
Chimas Posted October 27, 2013 Share Posted October 27, 2013 Pichorra, I have some maps here that I can't open, do you want a copy to make some tests? Link to comment Share on other sites More sharing options...
pichorra Posted October 28, 2013 Author Share Posted October 28, 2013 Sure, Post it Link to comment Share on other sites More sharing options...
Nyerguds Posted October 29, 2013 Share Posted October 29, 2013 The old DOS mix manager is really handy in detecting such errors, btw. It shows the errors on the fly as you switch between theater views when looking at .bin files. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now