Search found 18 matches

by Mario-Fan
Tue Oct 30, 2012 2:27 pm
Forum: Support and Development
Topic: How to save entire contents of a table to a text file?
Replies: 14
Views: 5938

Re: How to save entire contents of a table to a text file?

What I don't get is why ending with a comma doesn't work. It should and does work on my machine. Using #t doesn't work here because you are comparing it to values, instead of indexes. you only have string keys, which means #t is always 0. This is a better solution if you really don't want terminati...
by Mario-Fan
Tue Oct 30, 2012 12:00 pm
Forum: Support and Development
Topic: How to save entire contents of a table to a text file?
Replies: 14
Views: 5938

Re: How to save entire contents of a table to a text file?

Wojak wrote:You are talking about the sound?
If yes then:

Code: Select all

songMusic:setLooping( false ) 
https://love2d.org/wiki/Source
How could I have missed that?! :oops:
EDIT: I would like to know if there's a function that returns the length of a source. I couldn't find it on the Wiki.
by Mario-Fan
Tue Oct 30, 2012 10:59 am
Forum: Support and Development
Topic: How to save entire contents of a table to a text file?
Replies: 14
Views: 5938

Re: How to save entire contents of a table to a text file?

Wojak wrote:this is working on my PC:

Code: Select all

if songFile and love.filesystem.exists(love.filesystem.getSaveDirectory( ).."/"..songFile) then
	    songMusic = love.audio.newSource(songFile, "stream")
	end
I got it working, but I don't want it to loop. Can I have it open and not loop?
by Mario-Fan
Tue Oct 30, 2012 10:01 am
Forum: Support and Development
Topic: How to save entire contents of a table to a text file?
Replies: 14
Views: 5938

Re: How to save entire contents of a table to a text file?

the text file is ok, the sound file is the problem... You are using love.filesystem.exists on a sound file, while the file will exist only inside the love file... You are using a “static” mode for a file 3MB large (I recommend "stream" ) It's for when I implement a separate level editor. ...
by Mario-Fan
Tue Oct 30, 2012 8:13 am
Forum: Support and Development
Topic: How to save entire contents of a table to a text file?
Replies: 14
Views: 5938

Re: How to save entire contents of a table to a text file?

Wojak wrote:you can do it like this:

Code: Select all

 string = string.gsub (string,", }"," }") 
(“{ a = 1, c = 3, b = 2, }” should turn into “{ a = 1, c = 3, b = 2 }”)
Thanks! It still freezes on startup if there's a song.txt in the appdata folder though, so we're not quite done yet.
asdfhero.love
Still no gameplay :P
(2.82 MiB) Downloaded 286 times
by Mario-Fan
Tue Oct 30, 2012 7:30 am
Forum: Support and Development
Topic: How to save entire contents of a table to a text file?
Replies: 14
Views: 5938

Re: How to save entire contents of a table to a text file?

Erm, I want the program to put numbers into the tables in the text file and then be able to load them. I want it to save the times in the song when you have to press a button, if that makes any sense. I tend not to think about programming terms since I don't discuss programming all that much becaus...
by Mario-Fan
Mon Oct 29, 2012 4:52 pm
Forum: Support and Development
Topic: How to save entire contents of a table to a text file?
Replies: 14
Views: 5938

Re: How to save entire contents of a table to a text file?

You'll find a complete discussion of the topic (I mean your thread title) and its problems in the online Lua manual (it's for lua 2.0, but still mostly up-to-date). manual: http://www.lua.org/pil/#online serialisation: http://www.lua.org/pil/12.html A few questions: 1. Are the keys all ids (strings...
by Mario-Fan
Mon Oct 29, 2012 3:13 pm
Forum: Support and Development
Topic: How to save entire contents of a table to a text file?
Replies: 14
Views: 5938

How to save entire contents of a table to a text file?

I'm attempting to make a game that's a bit like Guitar Hero. It's currently at a very basic stage with no real eye candy. For the level editor I'm going to be using, I'm going to want to save the entire contents of four tables to a text file. Thing is, with the methods I've tried, it only saves the ...
by Mario-Fan
Thu Aug 16, 2012 4:29 pm
Forum: Support and Development
Topic: Animation won't stop, can't tell what went wrong
Replies: 4
Views: 1830

Re: Animation won't stop, can't tell what went wrong

Also, make sure use the stop() method on your playerSprites object. Fact is, when starting love.update , you use playerSprites:start() , which causes an internal variable, isRunning , to be always true. Hence, the animation will be played anytime. function love.update(dt) if gameState == "inga...
by Mario-Fan
Thu Aug 16, 2012 3:52 pm
Forum: Support and Development
Topic: Animation won't stop, can't tell what went wrong
Replies: 4
Views: 1830

Re: Animation won't stop, can't tell what went wrong

Roland_Yonaba wrote:
Mario-Fan wrote: Also, for some reason, when it's compressed, it uses the default LOVE screen size, but unpacked it works the way it should.
Make sure to create a configuration file.
Except that there already is one, skimmer.