Home   Help Search Login Register  

Author Topic: Saving a variable after server restart  (Read 2400 times)

0 Members and 1 Guest are viewing this topic.

Offline ModestNovice

  • Members
  • *
Saving a variable after server restart
« 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:
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Saving a variable after server restart
« Reply #1 on: 17 Jan 2009, 18:57:56 »
Nope, you still need to use ArmALib. Nothing has changed there ;P
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline ModestNovice

  • Members
  • *
Re: Saving a variable after server restart
« Reply #2 on: 17 Jan 2009, 20:29:58 »
lol thanks Spooner  ;)
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley


Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: Saving a variable after server restart
« Reply #4 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 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... ;)
try { return true; } finally { return false; }

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Saving a variable after server restart
« Reply #5 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.
"When 900 years YOU reach, look as good you will not!"

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: Saving a variable after server restart
« Reply #6 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? ;)
try { return true; } finally { return false; }

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Saving a variable after server restart
« Reply #7 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
« Last Edit: 22 Jan 2009, 15:15:23 by Planck »
I know a little about a lot, and a lot about a little.