Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this .
Vandie
Prole
Posts: 12 Joined: Sun Sep 08, 2013 8:22 pm
Post
by Vandie » Sun Sep 08, 2013 8:26 pm
Im Having a problem with my save database.
Code: Select all
--save data
gamefile = love.filesystem.isDirectory ('CriminalData' )
if gamefile then
else love.filesystem.mkdir( 'CriminalData' )
end
tempsavedata = {
roomnum = 1,
lightnum = 1,
tablenum = 1,
monitornum = 1,
casenum = 1,
player = 1,
money = 250
}
lastsave = 0
savetimer = 0
view = 1
displaytitle = true
if love.filesystem.isFile('save.txt') then
loadSave()
else
initialsave()
loadSave()
end
it saves everything exept the money variable ... i am thankfull for any help
Last edited by
Vandie on Mon Sep 09, 2013 8:59 pm, edited 1 time in total.
Code: Select all
Dear Math, please grow up and solve your own problems, I'm tired of solving them for you...
Quote my 9 year old brother...
Code: Select all
How can you make sure you never miss your target? Shoot first, and whatever you hit, call it the target.
Quote My dad...
Vandie
Prole
Posts: 12 Joined: Sun Sep 08, 2013 8:22 pm
Post
by Vandie » Sun Sep 08, 2013 8:43 pm
sure
Last edited by
Vandie on Mon Sep 09, 2013 4:53 pm, edited 1 time in total.
Code: Select all
Dear Math, please grow up and solve your own problems, I'm tired of solving them for you...
Quote my 9 year old brother...
Code: Select all
How can you make sure you never miss your target? Shoot first, and whatever you hit, call it the target.
Quote My dad...
Robin
The Omniscient
Posts: 6506 Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:
Post
by Robin » Sun Sep 08, 2013 10:22 pm
Other than the fact that you save every frame(!) due to a bug in love.update
* , it seems to load the money thing just fine. Can you be more specific about the problem you're having and how to reproduce it (basically what steps I need to take to see the problem in action)?
* This:
Code: Select all
if savetimer > (lastsave + 60) then
--do fuck all
else
save()
lastsave = savetimer
end
should be:
Code: Select all
if savetimer > (lastsave + 60) then
save()
lastsave = savetimer
end
Vandie
Prole
Posts: 12 Joined: Sun Sep 08, 2013 8:22 pm
Post
by Vandie » Mon Sep 09, 2013 9:48 am
thanks ill try it out wwhen i get back from school
if it dosent fix the problem ill see if i can explain how to reproduce the problem
Code: Select all
Dear Math, please grow up and solve your own problems, I'm tired of solving them for you...
Quote my 9 year old brother...
Code: Select all
How can you make sure you never miss your target? Shoot first, and whatever you hit, call it the target.
Quote My dad...
Vandie
Prole
Posts: 12 Joined: Sun Sep 08, 2013 8:22 pm
Post
by Vandie » Mon Sep 09, 2013 3:37 pm
if i change the amount to save money as it will not update it
Code: Select all
Dear Math, please grow up and solve your own problems, I'm tired of solving them for you...
Quote my 9 year old brother...
Code: Select all
How can you make sure you never miss your target? Shoot first, and whatever you hit, call it the target.
Quote My dad...
Robin
The Omniscient
Posts: 6506 Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:
Post
by Robin » Mon Sep 09, 2013 4:23 pm
Vandie wrote: if i change the amount to save money as it will not update it
You mean you change
tempsavedata ? Because that is ignored if save.txt already exists.
Vandie
Prole
Posts: 12 Joined: Sun Sep 08, 2013 8:22 pm
Post
by Vandie » Mon Sep 09, 2013 4:54 pm
yes i do but on this updated version
Code: Select all
Dear Math, please grow up and solve your own problems, I'm tired of solving them for you...
Quote my 9 year old brother...
Code: Select all
How can you make sure you never miss your target? Shoot first, and whatever you hit, call it the target.
Quote My dad...
Robin
The Omniscient
Posts: 6506 Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:
Post
by Robin » Mon Sep 09, 2013 5:31 pm
You deleted the line
which means it never saves.
Your construction with SaveData/tempsavedata is really weird, but it should work fine otherwise.
Vandie
Prole
Posts: 12 Joined: Sun Sep 08, 2013 8:22 pm
Post
by Vandie » Mon Sep 09, 2013 6:40 pm
thanks a ton robin
it worked !
Code: Select all
Dear Math, please grow up and solve your own problems, I'm tired of solving them for you...
Quote my 9 year old brother...
Code: Select all
How can you make sure you never miss your target? Shoot first, and whatever you hit, call it the target.
Quote My dad...
Users browsing this forum: Bing [Bot] , Google [Bot] and 6 guests