The Dink Network

extrating a var from other savegame?

April 4th 2018, 06:34 PM
duckdie.gif
crypto
Peasant They/Them
 
So ..

if you say
save_game(12) at some point in a script

can you load a variable value from that save game?

without actually loading that save game?

--
I assume no, thought it mite be possible though.
--

I know why would i want too?,

My reason is
To have a backup of variable values.

April 4th 2018, 08:04 PM
dinkdead.gif
Nope don't think so.

It sounds like you might want to take a look at supervars

Edit: The only similar thing you can do is
int &somevariable = 1234;
save_game(&somevariable);

//and then later check if that number exists:
if (game_exist(&somevariable))
{
 //do something
}

But I doubt that helps. Unless you want loads of saved games cluttering up the place.

Edit 2: Re. supervars, search for "Multiple values in one variable" in that file as they aren't called supervars there (I think that's what Redink1 called them?)
April 5th 2018, 10:21 AM
wizardg.gif
LeprochaUn
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
Magicman was able to carry some form of data from one save file to another. I don't remember exactly what he did, but you might want to have a look at this. As that file provides an example doing some weird stuff with save data and it might be what you're looking for.
April 5th 2018, 11:22 AM
duckdie.gif
crypto
Peasant They/Them
 
alrightly i'll have look, Thanks ..

well thats answered my for loop question, no while either i assume ..

so just to check that box, flow control is done by goto only ?
April 5th 2018, 11:33 AM
peasantm.gif
shevek
Peasant They/Them Netherlands
Never be afraid to ask, but don't demand an answer 
Goto and if, that is correct and very annoying...

As for loading variables from other save games: it's possible, but probably not in the way you want. When you load a save game, it will load ALL variables that are stored in it. However, the current function continues running (at least if it's used script_attach(1000), which you probably want to do in that case). This means you can load a game and then refuse to continue where it left off.

Magicman did not do that in waitwut; that's a trick where he changed the ini file during runtime and showed that this change was preserved even through restart_game() (but not through save+quit+start+load.)

An example of what I described can be found in my dmod "Karel ende Elegast". It uses only one save game (-1) and checks if it contains a completed game. If so, it stays in the title screen when you try to load it.
April 5th 2018, 11:52 AM
duckdie.gif
crypto
Peasant They/Them
 
ya so you can't say swap vars between save games to exceed the max ~200 .... thats what this was about really ...

So i'll have to rethink somethings ..... thankfully still way under my limit ..