steam_file_write(filename, data, size);

参数 描述
filename 要写入的文件的名称。
data The data to write (a string).
大小 the size of the data to be written.

返回: Real(实数)


You can use this function to write data to a file, which will then be synchronised with the Steam Cloud when the user exits the game. if the file does not exist, this function will create it for you, and if it does already exists, it will overwrite any data that is already stored within the file with the new data string. The function will return a value of 0 if it fails for whatever reason and a value greater than 0 if it succeeds.


var fname="SaveData.txt";
var data = string(global.Level) + "|" + string(global.Points) + "|" + string(global.HP);
var len = string_length(data);
steam_file_write_file(fname, data, len);

The above code will prepare a number of local variables and then use them to write to (or create) a file which will then be synchronised with the Steam Cloud.