Page 42 of 91

Re: "Questions that don't deserve their own thread" thread

Posted: Sun Jan 24, 2016 8:50 pm
by murks
Thanks, I guessed that it is possible using that, but I was not sure and have not used it yet. Is the löve particle system löve-specific? Just wondering whether I can look at general particle system tutorials or löve specific ones.

As a sort of extension to this question: I have a game idea that would require lots of small pieces flying around, but physics based or pseudo physics based. Can this also be achieved using a particle system or do I need to use an actual physics engine (or at least collisions and simplified physics) for each tiny thingy?

Re: "Questions that don't deserve their own thread" thread

Posted: Mon Jan 25, 2016 5:12 pm
by jalamaya
how do you access files from the save directory (im using windows so appdata)?

if the file is inside the source folder, you just have to do is:

Code: Select all

fileLoc="(folder if theres any)/file.jpg"
but what will i do if the file is in the save directory?

Re: "Questions that don't deserve their own thread" thread

Posted: Mon Jan 25, 2016 5:22 pm
by Nixola
You access it the same way. Files in the save folder are checked before the files in the .love our source folder.

Re: "Questions that don't deserve their own thread" thread

Posted: Tue Jan 26, 2016 2:50 am
by jalamaya
Nixola wrote:You access it the same way. Files in the save folder are checked before the files in the .love our source folder.
why do i get a not exist error message when i try to load the image from the save directory?

file location: appdata/roaming/love/svdir/imageX.jpg

Code: Select all

love.filesystem.setIdentity("svdir")
src = "imageX.jpg"
image = love.graphics.newImage(src)
imageX.jpg is the only file in the svdir folder

Re: "Questions that don't deserve their own thread" thread

Posted: Tue Jan 26, 2016 3:21 am
by HugoBDesigner
If you're running an executable (rather than a .love file), then the file location would be Appdata/Roaming/svdir/imageX.jpg

But if not, could you post a picture of your imageX.jpg file with the location on top? And the part of the code responsible for loading it. Just to make sure there aren't any typos or anything like that...

Re: "Questions that don't deserve their own thread" thread

Posted: Tue Jan 26, 2016 1:46 pm
by jalamaya
HugoBDesigner wrote:If you're running an executable (rather than a .love file), then the file location would be Appdata/Roaming/svdir/imageX.jpg

But if not, could you post a picture of your imageX.jpg file with the location on top? And the part of the code responsible for loading it. Just to make sure there aren't any typos or anything like that...
i finally solved it tnx. i made a stupid mistake by declaring imageX before declaring love.filesystem.setIdentity("svdir"). its ok now

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Jan 27, 2016 5:46 pm
by FroggestSpirit
Does anyone know if you can have music and code run while an android screen is off? I want to make a music player, but I'm guessing that the feature would be in the code-runner itself if it exists (maybe a way to toggle it?)

Re: "Questions that don't deserve their own thread" thread

Posted: Thu Jan 28, 2016 12:39 pm
by adge
Can someone tell my why the output is always printed backwards if I do this:

Code: Select all

function love.load()
	listy = {first = 1, middle = 2, last = 3}

	for i, v in pairs(listy) do
		print(i, v)
	end
end


function love.update(dt)
end


function love.draw()
end
Consoles output:
last 3
middle 2
first 1

Re: "Questions that don't deserve their own thread" thread

Posted: Thu Jan 28, 2016 1:00 pm
by Nixola
Pairs doesn't have a defined order. If you need them to be printed in a specific order, use a sequence and ipairs. Two examples:

Code: Select all

--do this if you need textual indices in listy;
function love.load()
   listy = {first = 1, middle = 2, last = 3}
   order = {"first", "middle", "last"} 

   for i, v in ipairs(order) do
      print(v, listy[v]) 
   end
end


function love.update(dt)
end


function love.draw()
end

Code: Select all

--do this if you don't 
function love.load()
   listy = {1, 2, 3}

   for i, v in ipairs(listy) do
      print(i, v)
   end
end


function love.update(dt)
end


function love.draw()
end

Re: "Questions that don't deserve their own thread" thread

Posted: Thu Jan 28, 2016 4:06 pm
by HugoBDesigner
@Nixola I think you meant to use 'ipairs' on the first function example, rather than 'pairs'