Jump to content

Gossler

Member
  • Content Count

    4
  • Joined

  • Last visited

  • Medals

Posts posted by Gossler


  1. Hey there. Im having issues saving an empty array. Im pretty new to scripting and I can read it, or at least follow it, but writing is iffy, so there is a lot of trial and error, but heres what I have. 

    I am trying to make our invade and annex server persistent because we reset it often, and we keep losing our progress as a result. 

    dbCreate.sqf

    Spoiler

    _dbCreate = ["new", "69thIandA"] call OO_INIDBI;


    ["write", ["Mission Info", "Controlled Zones", controlledZones]] call _dbCreate;


    _cptFOB=[];
    _cptFOB = missionNamespace getVariable [format ["capturedFOBs%1", 1],[]];


    if(isNil (_cptFOB)) then {
      sleep 1; 
      systemChat "No Captured FOB's stored.";
    } else {
      ["write", ["Mission Info", "Captured FOBs", capturedFOBs]] call _dbCreate;
      sleep 1; 
      systemChat "Captured FOB's written to DB.";
    };
     


    Output in 69thIandA.ini

    Spoiler

    [Mission Info]
    Controlled Zones="["BASE"]"

     

    The controlledZones array populates as each zone is captured, but base is the default value. however, capturedFOBs doesnt populate until a FOB is captured.

    My question is, because of the way the array is stored ie: "["BASE"]", are the quotes messing stuff up? Because it seems like the script isnt running anymore after it creates the database, and my RPT doesnt throw any errors. 

    Thank you for any help! 


    Edit: 
     

    changing if(isNil (_cptFOB)) to if(isNil ("_cptFOB")) fixed write issue. INI output is now as expected. 

×