"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
smunnelsnakzruule
Prole
Posts: 8
Joined: Thu Oct 13, 2016 12:36 pm

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

Post by smunnelsnakzruule »

Hmm, sorry I would prefer not to use the canvas, I hear it has issues and I want to work with the (primary?) buffer.
I guess I'll have to render it the old fashion way and append all my drawables to a list to be rendered in a virtual rect which is scaled using.. math.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post by zorg »

What kind of issues did you hear?
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
evgiz
Citizen
Posts: 83
Joined: Mon Aug 29, 2016 11:05 pm
Contact:

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

Post by evgiz »

smunnelsnakzruule wrote:Hmm, sorry I would prefer not to use the canvas, I hear it has issues and I want to work with the (primary?) buffer.
I guess I'll have to render it the old fashion way and append all my drawables to a list to be rendered in a virtual rect which is scaled using.. math.
For my game I use canvases extensively and haven't had any issues at all, nor have I heard of anyone else having any. If there are issues they must be fairly small and only in edge cases. Doing everything a canvas has to offer using math sounds horrible and like a lot of extra work! :o
Computer science student and part time game dev! Currently working on Depths of Limbo! :cool:

Check out the game website DepthsOfLimbo.com! :ultrahappy:
And my personal website with all my projects evgiz.net! :megagrin:
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

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

Post by Jasoco »

Canvas has no issues. Especially on 0.10.0 where it is guaranteed to work since it doesn't run on machines that don't have support anyway.

Use them.
User avatar
PiFace
Prole
Posts: 28
Joined: Mon Sep 05, 2016 5:35 pm
Location: Brazil

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

Post by PiFace »

Hey guys, I was testing love.filesystem.remove, and something kinda weird was happening to me: it never actually deleted a file the fisrt time the love.filesystem.remove command was called in the game. Only when I called it a second time (or anytime later) it actually worked. To prevent this from happening, I wrote the command twice, as the game goes on even if no file was found or deleted. But do you have any ideas why that was happening? o.O
User avatar
slime
Solid Snayke
Posts: 3161
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 »

Can you write a minimal example that people can test?
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

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

Post by Positive07 »

Also was the file inside the save directory? LÖVE can't delete files that are not in the save directory
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
PiFace
Prole
Posts: 28
Joined: Mon Sep 05, 2016 5:35 pm
Location: Brazil

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

Post by PiFace »

Positive07 wrote:Also was the file inside the save directory? LÖVE can't delete files that are not in the save directory
Yes, it was in the save directory.
slime wrote:Can you write a minimal example that people can test?
Yes

This is the function that deletes the deck file (it is a card game). This file extension is specific for the decks, but they are just .txt
'deckList' is a table with the names of each deck.
'deck' is the index of the currently selected deck.
'deckDir' is just a string used by other functions in the same file, referring to where the decks should be saved. I kept it in a variable so I could change it later if necessary. (for now, it's just a folder called 'decks')

Code: Select all

function deckDelete(deck,deckList)
    if deckList[deck] then
        love.filesystem.remove(deckDir .. '/' .. deckList[deck] .. '.dhcd')
        love.filesystem.remove(deckDir .. '/' .. deckList[deck] .. '.dhcd')
        table.remove(deckList,deck)
    end
    return deckList
end
Edit: the deckList table is made when the game loads, according to the files inside that deckDir folder.
So, for example, if the 'deck' variable was 3 and the deckList table contains 15 strings that correspond to the files inside the deckDir folder, deckList[deck] will be, in this case, the third deck, ('test deck (3)' for example). The line should become:

Code: Select all

love.filesystem.remove('decks/test deck (3).dhcd')
It seems there's nothing wrong with it, and indeed there isn't, but somehow, only during the first time this command is run, nothing happens.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

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

Post by Positive07 »

That example is not enough, those functions work if used like that, please provide a .love file that actually shows what the error is
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
PiFace
Prole
Posts: 28
Joined: Mon Sep 05, 2016 5:35 pm
Location: Brazil

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

Post by PiFace »

:huh: ... well, nevermind, after making a window to confirm the deletion (those "Are you sure you want to do this?" popups) it just works as intended. Sorry to bother .-.
That example is not enough, those functions work if used like that, please provide a .love file that actually shows what the error is
Yeah, now that I come to think of it, the problem could not be inside that function, it was somewhere else, but now that it's gone, I think it doesn't matter anymore.
Locked

Who is online

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