1029 posts
Location
Missouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension
Posted 01 December 2012 - 11:19 AM
I'm trying to make a save format that is a program itself, but get attempt to consentrate nil and string. It is in a function using the varubles that the function has (ex. function ex(var1, var2, var3)) and it writes in with fs.writeLine all on one line. How do I fix this?
CODE:
--DEVOLPING MODES--
devmode = true
--devmode will skip people talking.
savedev = true
--savedev will auto-save as what you enter opon start.
--DEVMODE CHECKS--
if savedev == true then
print("score level itemnum items name") ;
stuff = read()
failsodoafter = true
end
--FUNCTIONS(yes some of them are inside the code...)
--[[SAVING THE GAME]]--
function save( sscore, slevel, sitemnum, sitems, sname)
--sname is hanging off
--if fs.exists(""..sname.."") == true then
if devmode == false then
return fin
else
saveit = fs.open("testsave", "a")
saveitvar = { "loadingsave = true score = "..sscore.." level = "..slevel.." itemnum = "..sitemnum.."" }
saveit.writeLine(saveitvar)
saveit.close()
return fin
end
end
if failsodoafter == true then
save(stuff)
end
3790 posts
Location
Lincoln, Nebraska
Posted 01 December 2012 - 11:20 AM
It's because you assume that Chuck Norris will play nice with the other variables. In reality, he killed them all.
1029 posts
Location
Missouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension
Posted 01 December 2012 - 11:21 AM
-.- real help please, that was an example.
2217 posts
Location
3232235883
Posted 01 December 2012 - 11:33 AM
-.- real code please, that was a joke.
1029 posts
Location
Missouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension
Posted 01 December 2012 - 11:47 AM
I posted the code now. Not the full code, just what's being executed. I am currently just testing this, I do the inputs on the read() thing myself with 1, 1, 1, etc.
2217 posts
Location
3232235883
Posted 01 December 2012 - 11:57 AM
if failsodoafter == true then
save(stuff)
end
needs more args