OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: ModestNovice on 17 Jan 2009, 18:09:54

Title: Saving a variable after server restart
Post by: ModestNovice on 17 Jan 2009, 18:09:54
I am just wondering if anyone knows if it is possible in ArmA alone, to save a variable and retrieve it after a server restart/crash. of course if you have any ideas how to?  :confused:
Title: Re: Saving a variable after server restart
Post by: Spooner on 17 Jan 2009, 18:57:56
Nope, you still need to use ArmALib. Nothing has changed there ;P
Title: Re: Saving a variable after server restart
Post by: ModestNovice on 17 Jan 2009, 20:29:58
lol thanks Spooner  ;)
Title: Re: Saving a variable after server restart
Post by: kju on 18 Jan 2009, 17:30:20
you can try the old OFP hack

http://community.bistudio.com/wiki/saveStatus
http://community.bistudio.com/wiki/loadStatus

Sinews_of_War and WGL5 used it for OFP.
http://community.bistudio.com/wiki/Sinews_of_War
Title: Re: Saving a variable after server restart
Post by: Worldeater on 21 Jan 2009, 02:29:13
Neither command is working properly for me (at least when used in regular missions, I haven't checked them for campaigns). ProcMon (http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx) tells me that ArmA uses the wrong path to find the "objects.sav":

Code: [Select]
C:\Users\<username>\Documents\ArmA Other Profiles\<playername>\Saved\C:\Users\<username>\Documents\ArmA Other Profiles\<playername>\objects.sav

Looks like someone at BIS should look up the difference between an absolute and a relative path again... ;)
Title: Re: Saving a variable after server restart
Post by: Wolfrug on 22 Jan 2009, 10:40:11
If you try using saveStatus/loadStatus in a SP (and, I assume, MP) environment, the boolean the command returns will be FALSE -> i.e., the saving failed. So I don't know if that 'works' any more, or how it did when it did. :)

Wolfrug out.
Title: Re: Saving a variable after server restart
Post by: Worldeater on 22 Jan 2009, 12:22:05
Well, it simply has to fail since this path won't be found on any system. :D

My yet to be finished injection DLL could be able to detect this and return a fake handle (so ArmA thinks the file exists but is actually accessing some other file). But then if one has to use some sort of "ScriptLink" he won't need this feature anyway.

Anyway, is the filestructure of the objects.sav described somewhere? Or do I have to create a dummy campain and reveng it on my own? ;)
Title: Re: Saving a variable after server restart
Post by: Planck on 22 Jan 2009, 15:10:02
My recollection is that these 2 commands save and load to and from the Campaigns folder using the supplied file name.

At least for OFP, not sure about ArmA.


Planck