Page 6 of 91

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

Posted: Fri Aug 01, 2014 11:20 pm
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.

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

Posted: Sat Aug 02, 2014 7:25 am
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

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

Posted: Sat Aug 02, 2014 11:40 am
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.

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

Posted: Sat Aug 02, 2014 1:09 pm
by DaedalusYoung

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

Posted: Sun Aug 03, 2014 7:14 am
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.

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

Posted: Sun Aug 03, 2014 1:57 pm
by slime
It is documented in the second line of its description.

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

Posted: Sun Aug 03, 2014 2:43 pm
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?

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

Posted: Sun Aug 03, 2014 3:00 pm
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)?

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

Posted: Sun Aug 03, 2014 3:02 pm
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.

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

Posted: Sun Aug 03, 2014 3:11 pm
by IceQB

Code: Select all

cam_speed_minus = 17 - cam_speed_minus
Thanks, its very simple!