if the renderer settings are stored in lua, then they will need to be edited.
otherwise if the renderer settings are the main window settings e.g. FXAA, V-Sync, etc... then these are best edited in the options screen as the game will sometimes need to restart to see the changes.
Also note: we have a new game menu coming soon courtesy of planetX which will replace the current options screen. Just got to find some time to fit it in
Json does not save xml files, it saves json, although the name extension being xml should not be wrong.
rapidjson.load(File_Folder .. filename);
Have you printed File_Folder to check whether it has a slash afterwards
- Code: Select all
lprint( File_Folder ); -- does the string look right
lprint( filename ) -- is the filename correct.
-- if its missing the slash, then add the slash in.
File_Folder .. "/"..filename
yes, you must define the json_obj, looking at the script, apart from that, i dont see why it wouldnt work.
p.s. This versions is seriously taking some doing, it has such major changes it feels new lol
( ... it still looks the same though ...
) v1.0 will be skyline's best form yet.
JSON Script Example:- Code: Select all
-- | Requires the 0.9.7 preview version of skyline or later.
obj = 0;
function onInit(objID)
obj = objID;
end
function onKeyDown( key )
-- | on key one, we will serialize the table to file.
if(key == "1")then
lprint("#&127,127,127:Saving table to JSON...")
-- | First Lets create a lua table and fill in some data to test with.
local tempTable = {};
tempTable["playername"] = "Joe";
tempTable["lastName"] = "Bloggs";
tempTable[0] = { ["a"]="Hello", [3]=200};
tempTable[1] = "World";
-- | Second: create a json object based on the table, this contains the correct
-- | metatable for the code to write the JSON data properly.
jsonObj = rapidjson.object(tempTable)
-- | Third; Lets dump the new object into a json file.
-- | > The pretty at the end is to create more readable lines. Setting false will write into one line.
-- | > For a specific location on a Hard drive e.g. E:/myFile.json
-- | > You can name the extension to whatever you want ... *.tableData, *.player etc...
rapidjson.dump(jsonObj, "myfile.json", {pretty=true});
lprint("#&127,255,127:Saving table to JSON Complete!");
end
-- | on key two, we will load the files data into a table and print the data.
if(key == "2")then
lprint("#&127,127,127:Loading table to JSON...")
-- | Load the json file into a table.
myData = rapidjson.load("E:/myfile.json");
-- | Print the data to the in game screen.
sprint("playername = "..myData["playername"]);
sprint("lastName = "..myData["lastName"]);
sprint("0 = "..myData[tostring(0)]["a"]);
sprint("0 = "..myData[tostring(0)][tostring(3)]);
sprint("1 = "..myData[tostring(1)]);
lprint("#&127,255,127:Loading table to JSON Complete!");
end
end