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

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.
Locked
User avatar
murks
Party member
Posts: 185
Joined: Tue Jun 03, 2014 4:18 pm

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

Post 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?
jalamaya
Prole
Posts: 21
Joined: Wed Jan 13, 2016 9:14 pm

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

Post 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?
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

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

Post by Nixola »

You access it the same way. Files in the save folder are checked before the files in the .love our source folder.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
jalamaya
Prole
Posts: 21
Joined: Wed Jan 13, 2016 9:14 pm

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

Post 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
User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Above the Pocket Dimension
Contact:

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

Post 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...
@HugoBDesigner - Twitter
HugoBDesigner - Blog
jalamaya
Prole
Posts: 21
Joined: Wed Jan 13, 2016 9:14 pm

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

Post 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
User avatar
FroggestSpirit
Prole
Posts: 11
Joined: Tue Jan 26, 2016 7:13 pm

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

Post 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?)
This isn't easy to say, but…
adge
Citizen
Posts: 54
Joined: Mon Dec 14, 2015 8:50 pm

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

Post 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
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

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

Post 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
Last edited by Nixola on Thu Jan 28, 2016 5:22 pm, edited 1 time in total.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Above the Pocket Dimension
Contact:

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

Post by HugoBDesigner »

@Nixola I think you meant to use 'ipairs' on the first function example, rather than 'pairs'
@HugoBDesigner - Twitter
HugoBDesigner - Blog
Locked

Who is online

Users browsing this forum: Google [Bot] and 4 guests