[Solved] Auto Save Script

  1. 3 weeks ago

    Hey all,

    So I have gone over a few post and had a good read of the wiki with regards to the auto save script. It sounds simple enough, just put --> 900 call ALiVE_fnc_AutoSave_PNS into your init.sqf.

    However, this is not working for me. I played on my server for 1.5 hrs, I placed alive markers and spotreps for the test. I restarted the server without manually saving and the script did not seem to work. Below is what is in my init.sqf:

    [] execVM "GREUH\scripts\GREUH_activate.sqf";
    execVM "R3F_LOG\init.sqf";
    
    if (isServer) then {
    	[] call compileFinal preprocessFileLineNumbers "scripts\server\init_server.sqf";
    };
    
    900 call ALiVE_fnc_AutoSave_PNS

    Anyone know what I have done wrong?

  2. Check your server logs for ALiVE SYS DATA PNS - Local machine is not the server or local save not available! Exiting...
    If that message appears, you don't have your Data module set up correctly (make sure you have PNS set as datasource).

    Otherwise there should be an on-screen save message every 900 seconds, and log lines from each module that have persistance enabled.

    Check these sections for reference:

    https://github.com/ALiVEOS/ALiVE.OS/blob/master/addons/sys_data_pns/fnc_autosave.sqf#L31
    https://github.com/ALiVEOS/ALiVE.OS/blob/master/addons/sys_data_pns/fnc_autosave.sqf#L43-L49
    https://github.com/ALiVEOS/ALiVE.OS/blob/master/addons/sys_data_pns/fnc_autosave.sqf#L88-L146
    https://github.com/ALiVEOS/ALiVE.OS/blob/master/addons/sys_data_pns/fnc_autosave.sqf#L150-L153

  3. Thanks Whigital, I will have a look.

  4. 2 weeks ago

    So I checked the server logs, and the "ALiVE SYS DATA PNS - Local machine is not the server or local save not available! Exiting..." appeared. I then checked all my modules on the mission in the editor, everything looks good.

    I played the mission on my PC as a hosted multiplayer mission. It appears to save and you see the save message appear on the screen. I FTP the same mission to my server and it stills doesn't save.

    Anyone have any ideas why it wouldn't work on a dedicated server and would work on my PC as a hosted mission?

  5. Edited 2 weeks ago by the-star

    You need to run the following on the server side

    900 call ALiVE_fnc_AutoSave_PNS

    So, one approach is to remove it from init.sqf and put it into initServer.sqf

    init.sqf

    [] execVM "GREUH\scripts\GREUH_activate.sqf";
    execVM "R3F_LOG\init.sqf";
    
    if (isServer) then {
    	[] call compileFinal preprocessFileLineNumbers "scripts\server\init_server.sqf";
    };

    initServer.sqf

    waitUntil {
      !isNil "ALiVE_SYS_DATA_SOURCE";
    };
    
    if (ALiVE_SYS_DATA_SOURCE isEqualTo "pns") then {
      900 call ALiVE_fnc_AutoSave_PNS;
    };
  6. I will have a look at that, cheers @the-star

  7. @the-star That worked. Thank you so much :D

 

or Sign Up to reply!