The Dink Network

Re: Reading Save Game Files?

December 7th 2010, 12:57 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
I know it's so simple, but I really don't know how to get the stuff out of save files for Dink to read.

Say I just want to get the values of the &strength, &defense and &magic variables, how would I go about doing that?
December 7th 2010, 03:03 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
I don't think it's quite that simple actually... I can't think of a proper way to read savegames from within Dink without loading them (in which case I don't know how to transfer the values to your current save).

May I ask where this is for? Perhaps you could try to save this data as the editor data in a non-existent map...
December 7th 2010, 03:18 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Well, my idea was to have stats/gold, etc. carry over from a previous game, and I figured it's as easy as copying a save game over directories, renaming it, finding it in Dink and reading it.

Is it possible to save it as editor data on a 'non-existent' map and copy that map over directories to have it read?
December 7th 2010, 03:20 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
right click and send to notepad and then figure what the scary bits in there are for? eg:
l Level 1 $ r L d        F
d item-fst ¶  item-bt ¶  item-sw1 ¶  

Edit: Hmm well that didnt transfer very well did it heh heh heh There was a game where you could import stats from other ones - maybe that could be helpful to see how they did that? Catacombs I think...
December 7th 2010, 04:35 AM
spike.gif
Yesh. It shouldn't be as much trouble as in Catacombs, since 108 introduced the clear_editor_info() command and the load_map() command, but still kind of awkward.

1. Copy save game to dmod's directory.
2. Load save game.
3. Somehow recognize the save game is an import, and change things to match the new game.

The simplest way I can think of to do 3 would be to use load_map() to open a map with only one screen, and have a script on that screen that importifies the save game, and then loads the proper game map. Something like this:

//import button
void click()
{
load_map("crapmap.dat","crapdink.dat");
load_game(99);
}

//script on crapmap
void main()
{
clear_editor_info()
//set globals so the ones with the same name from the save game won't have the wrong values?
//delete inventory?
//stuff?
load_map("map.dat","dink.dat");
//generic begin a new game stuff
}


PS. I can almost quarantee it won't work. (I've never tried any of this stuff, and stuff never works the first time around)
December 7th 2010, 11:39 PM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Hmm, may try and give that a go. Thanks for the help.