Implementation of an Idea
#18
*grumble* Why do you want a text database? Exporting it to XML would be so much nicer (and, well, more extensible! ;)). I've never bothered to take apart the on-disk save files, but I do have some working code that will automatically create XML dumps of every character in your character directory, whenever it gets loaded. Since Diablo loads all the characters to present a listing to you, this means they get dumped any time you start to enter multiplayer. Combine that with an XSL stylesheet to format it for presentation, and it becomes very easy to inventory your characters -- 10 at a time, no less! :) I don't play single player, so I've never checked whether it dumps those. Hopefully it doesn't, since the filenames don't distinguish between single player and multiplayer.

Transferring items between characters isn't particularly interesting to me (i.e. I haven't bothered to write it), but it is very easy. Just copy the item from player inventory into an extra buffer, fix up the inventory redirection array (to make the item disappear from inventory and free the associated space), fix the item count (to avoid strange behavior when you fill your inventory), and you're done. :) Stu probably caused corruption because he skipped one of the fix-up steps, or had the address of the array wrong and clobbered some adjoining data. I don't see anything near the inventory data that looks particularly critical to proper character function, but I've no idea how far afield he was writing.

I can see one great value to having the item automatically erased when it's exported. You can then use the export in a multi-person game and be assured that no one else will pick up the in-game copy of the item (nor any gold derived from selling the item as a disposal method).
Reply


Messages In This Thread
Implementation of an Idea - by NatNit - 04-19-2006, 06:32 AM
Implementation of an Idea - by Hammerskjold - 04-19-2006, 08:11 AM
Implementation of an Idea - by Toverkol - 04-19-2006, 09:11 AM
Implementation of an Idea - by NatNit - 04-19-2006, 06:46 PM
Implementation of an Idea - by NatNit - 04-19-2006, 06:50 PM
Implementation of an Idea - by Thenryb - 04-19-2006, 08:10 PM
Implementation of an Idea - by LennyLen - 04-20-2006, 02:00 AM
Implementation of an Idea - by NatNit - 04-20-2006, 02:19 AM
Implementation of an Idea - by Hammerskjold - 04-20-2006, 12:58 PM
Implementation of an Idea - by Thenryb - 04-20-2006, 02:47 PM
Implementation of an Idea - by NatNit - 04-20-2006, 07:35 PM
Implementation of an Idea - by NatNit - 04-20-2006, 07:40 PM
Implementation of an Idea - by Jarulf - 04-21-2006, 06:55 AM
Implementation of an Idea - by NatNit - 04-21-2006, 08:59 AM
Implementation of an Idea - by Jarulf - 04-21-2006, 01:04 PM
Implementation of an Idea - by Dako-ta - 04-21-2006, 06:33 PM
Implementation of an Idea - by GriffonSpade - 04-22-2006, 12:49 AM
Implementation of an Idea - by [vL]Kp - 04-23-2006, 12:52 AM
Implementation of an Idea - by NatNit - 04-23-2006, 01:27 AM
Implementation of an Idea - by Thecla - 04-23-2006, 02:52 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)