"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
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

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

Post by davisdude »

Alternatively, you can use the io. library. Permission will not be granted on some people's computers, however.

You could also use bash files for Windows.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Whatthefuck
Party member
Posts: 106
Joined: Sat Jun 21, 2014 3:45 pm

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

Post by Whatthefuck »

undef wrote:
Whatthefuck wrote:How would I go about making a directory in 'Documents' ? I'm on Windows, of course.
The only place where you are allowed to write is %appdata%/yourgame.
Yet somehow I managed to write into the Documents folder, but wasn't able to make a directory there. :p
Whatthefuck
Party member
Posts: 106
Joined: Sat Jun 21, 2014 3:45 pm

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

Post by Whatthefuck »

Also, is there a way to read all the files found in appdata/LOVE/gamename folder?
I need to save files there with varying names (user defined), but I can't find a way to actually read through all those files.
User avatar
DaedalusYoung
Party member
Posts: 413
Joined: Sun Jul 14, 2013 8:04 pm

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

Post by DaedalusYoung »

Whatthefuck
Party member
Posts: 106
Joined: Sat Jun 21, 2014 3:45 pm

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

Post by Whatthefuck »

DaedalusYoung wrote:With love.filesystem.getDirectoryItems?
Yeah, I figured that out after I posted the question. The fact that it checked in the appdata folder as well wasn't documented, so I was confused. I added that part there in case others get confused too.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post by slime »

It is documented in the second line of its description.
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

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

Post by Jeeper »

Now I did make a thread about it, but I thought I would post here as well ^_^

http://www.love2d.org/wiki/Fixture:setFilterData

I am having some trouble understanding how to use the filterData properly. What I want to do is this:

I have a player and a monster. Both of them will be shooting projectiles.
Player should not collide with monster.
Player and monster should not collide with own bullet.
Players bullet should collide with monster and vice versa.

You get to set 3 things, categories, mask, group. But there is no real description on what the difference between them are and what they do.

Anyone who can shed some light on this?
User avatar
IceQB
Citizen
Posts: 67
Joined: Sat Nov 03, 2012 1:11 pm

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

Post by IceQB »

Hi guys.

I have a very, very long code:

Code: Select all

if cam_speed_minus >= 16 then
	cam_speed_minus = 1
	elseif cam_speed_minus >= 15 then
	cam_speed_minus = 2
	elseif cam_speed_minus >= 14 then
	cam_speed_minus = 3
	elseif cam_speed_minus >= 13 then
	cam_speed_minus = 4
	elseif cam_speed_minus >= 12 then
	cam_speed_minus = 5
	elseif cam_speed_minus >= 11 then
	cam_speed_minus = 6
	elseif cam_speed_minus >= 10 then
	cam_speed_minus = 7
	elseif cam_speed_minus >= 9 then
	cam_speed_minus = 8
	elseif cam_speed_minus >= 8 then
	cam_speed_minus = 9
	elseif cam_speed_minus >= 7 then
	cam_speed_minus = 10
	elseif cam_speed_minus >= 6 then
	cam_speed_minus = 11
	elseif cam_speed_minus >= 5 then
	cam_speed_minus = 12
	elseif cam_speed_minus >= 4 then
	cam_speed_minus = 13
	elseif cam_speed_minus >= 3 then
	cam_speed_minus = 14
	elseif cam_speed_minus >= 2 then
	cam_speed_minus = 15
	elseif cam_speed_minus >= 1 then
	cam_speed_minus = 16
	elseif cam_speed_minus >= 0 then
	cam_speed_minus = 16
end
It is possible to make this in a short loop (for)?
User avatar
DaedalusYoung
Party member
Posts: 413
Joined: Sun Jul 14, 2013 8:04 pm

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

Post by DaedalusYoung »

Code: Select all

cam_speed_minus = 17 - cam_speed_minus
if cam_speed_minus == 17 then
    cam_speed_minus = 16
end
No for loop needed, that would actually be more complicated anyway.
User avatar
IceQB
Citizen
Posts: 67
Joined: Sat Nov 03, 2012 1:11 pm

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

Post by IceQB »

Code: Select all

cam_speed_minus = 17 - cam_speed_minus
Thanks, its very simple!
Locked

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests