you can use lua to read and write to a text file so you can save local scores easily enough, i suggest taking a look at moshroom's save and load script
https://forum.game-guru.com/thread/213084
saving stuff
-- Create local variable file and link it to slotX.dat
local file = io.open("slot" .. activeSlot .. ".dat", "w")
-- Write player data and custom variables to file
file:write(
g_PlayerHealth .. "\n" ..
g_PlayerLives .. "\n" ..
g_PlayerPosX .. "\n" ..
g_PlayerPosY .. "\n" ..
g_PlayerPosZ .. "\n" ..
g_PlayerAngX .. "\n" ..
g_PlayerAngY .. "\n" ..
g_PlayerAngZ .. "\n" ..
g_First .. "\n" ..
g_Second .. "\n" ..
g_Third .. "\n" ..
g_Fourth .. "\n")
-- Write the table Counter to file
for i = 1,NumCounters do
file:write(Counter[i] .. "\n")
end
-- Save file to disk
file:close()
loading stuff
if file == nil then
Prompt("No saved game in slot " .. activeSlot .. ".")
-- If slotx.dat does exist, load previous data from file
else
-- Load player health and lives
local fHealth = file:read("*n", "*l")
local fLives = file:read("*n", "*l")
-- Load player position (these can't be used in current GameGuru version beause the neccessary LUA commands don't exist)
-- Just read the data and move on to lines that matter
local fPosX = file:read("*n", "*l")
local fPoxY = file:read("*n", "*l")
local fPosZ = file:read("*n", "*l")
local fAngX = file:read("*n", "*l")
local fAngY = file:read("*n", "*l")
local fAngZ = file:read("*n", "*l")
-- Load and set global variables (old version stuff)
g_First = file:read("*n", "*l")
g_Second = file:read("*n", "*l")
g_Third = file:read("*n", "*l")
g_Fourth = file:read("*n", "*l")
-- Load and set counters
for i = 1,NumCounters do
Counter[i] = file:read("*n", "*l")
end
for saving online it'll take more work
edit; it looks kinda complicated but its pretty simple as long as you store and read everything in the same order.
just to save your score will look more like this
-- Create local variable file and link it to score.text
local file = io.open("score.txt", "w")
-- Write score to file if it's higher than highscore
if highscore == nil or score > highscore then
file:write(score)
end
file:close()
local file = io.open("score.txt", "r")
-- If score.txt doesn't exist, return nil
if file == nil then
Prompt("No saved scores")
-- If score.txt does exist, load previous data from file
else
-- Load player score
local highscore = file:read("*n", "*l") --not 100% sure on the exact variables needed here but i assume this is ok
file:close()
and then just prompt the highscore somewhere
note, not tested so sorry if there's any errors but that's the general code
life\'s one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11