Hello,
Unfortunately I know nothing LUA script I had to test some things ...
But basically here is the procedure to already create a basic file:
Save the in "Files\scriptbank\checkpoint 2.lua"
In your game put this script in a Checkpoint or TriggerZone area (your choice).
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
-- Player Enters Checkpoint Zone
function checkpoint2_init(e)
end
function checkpoint2_main(e)
if g_Entity[e]['plrinzone']==1 then
PromptDuration("Sauvegarde de votre progression effectuee !",3000)
PlaySound(e,0)
Checkpoint(e)
file = io.open ("saves001.lua", "w")
io.output(file)
io.write("MAPS=")
io.write(";")
io.write("POSX=", g_PlayerPosX)
io.write(";")
io.write("POSY=", g_PlayerPosY)
io.write(";")
io.write("POSZ=", g_PlayerPosZ)
io.write(";")
io.write("ANGX=", g_PlayerAngX)
io.write(";")
io.write("ANGY=", g_PlayerAngY)
io.write(";")
io.write("ANGZ=", g_PlayerAngZ)
io.write(";")
io.write("GUNS=", Collected(e))
io.write(";")
--io.write("SPEC=")
--io.write(";")
--io.write("PLAYERZONE=")
--io.write(";")
io.write("OBJNO=", g_PlayerObjNo)
io.write(";")
--io.write("FOV=")
--io.write(";")
io.write("HEALTH=", g_PlayerHealth)
io.write(";")
io.write("LIVES=", g_PlayerLives)
io.write(";")
io.write("STATS=", Checkpoint(e))
io.write(";")
io.write("End")
io.close(file)
Destroy(e)
ActivateIfUsed(e)
end
end
There's a lot of stuff that does not serve anything
!
But if you have ideas about starting this type of file to save your current game you can improve it.
It also remains to find out how to load that file (which I can not register in a specific folder: it is in "Files" by default).
After so it may just help some professional LUA language to advance ... ^^
Best Regards,
DevCore35