Search found 42 matches

by yal2du
Sun Jun 18, 2023 12:39 am
Forum: Support and Development
Topic: File wont save [SLOVED]
Replies: 15
Views: 9895

Re: File wont save

The file name can differ as the user enters it.
https://love2d.org/wiki/love.filesystem

prob need to sanitize the user input. love.filesystem.write will only write to specific directories (detailed in docs above) and it sounds like the path being specified isn't one of them.
by yal2du
Sun Jun 18, 2023 12:17 am
Forum: Support and Development
Topic: Love with Coroutine Window say's "Not Responding."
Replies: 1
Views: 2638

Re: Love with Coroutine Window say's "Not Responding."

function instance:update() while self.sheActive do self:move() print(self.x, self.y) end end looks like an infinite loop. also there is no yield /resume like you'd need with a coroutine. here is link to lua coroutine docs https://www.lua.org/manual/5.1/manual.html#5.2 that said, i don't think you'd...
by yal2du
Thu Jun 15, 2023 3:46 am
Forum: Support and Development
Topic: How to call update() or draw() from two different lua files?
Replies: 4
Views: 2657

Re: How to call update() or draw() from two different lua files?

Note if you require() the same file twice: local script_a = require("a") local script_b = require("b") local script_c = require("b") script_b and script_c will be pointing to the same table: assert(script_b == script_c,"Not the same!") i.e. it does not load th...
by yal2du
Thu Jun 15, 2023 3:31 am
Forum: Support and Development
Topic: How to call update() or draw() from two different lua files?
Replies: 4
Views: 2657

Re: How to call update() or draw() from two different lua files?

In love2d, the top level file is main.lua. You can use require() to include objects defined in other scripts. For example, you could have main depend upon two scripts, say a.lua and b.lua. Each of these return a table with one key set, "update" whose value is the function defined in the sc...
by yal2du
Fri Jun 09, 2023 7:18 pm
Forum: Support and Development
Topic: Random number generator? [SOLVED]
Replies: 5
Views: 2553

Re: Random number generator?

hi, might want to include code that proves your assertion; transcribing code from an image is work and prone to error. here's a piece of test code, also provides platform info (prints to console so run it from shell using love c .exe): local seedlo, seedhi = love.math.getRandomSeed() local minimum, ...
by yal2du
Fri Jun 09, 2023 2:25 pm
Forum: Support and Development
Topic: Garbage going crazy
Replies: 26
Views: 35021

Re: Garbage going crazy

But this array of functions is an important part of the project and can't really be changed to something else. interesting thread. necroing to mention a quick edit that made original garbage.love run the same regardless of function order (mode 1 or 2). 1) initialize the contiguous op array beginnin...
by yal2du
Thu Jun 08, 2023 3:46 am
Forum: Support and Development
Topic: number expected, got nil
Replies: 2
Views: 1967

Re: number expected, got nil

lua uses array indices starting at 1, and in love.load() you set snake.bodyX = {0} where the implied index is 1 not 0. so just guessing that your problem is here: for i = 1, snake.length, 1 do snake.bodyX[i] = snake.bodyX[i - 1] snake.bodyY[i] = snake.bodyY[i - 1] end when i = 1, i- 1 = 0. and there...
by yal2du
Wed Jun 07, 2023 1:40 pm
Forum: Support and Development
Topic: read depth buffer [solved]
Replies: 2
Views: 1604

Re: read depth buffer

That's probably because you're trying to draw an 32 bit floating point image to the screen. You need to turn its values into a range that can be drawn with 8 bits. thanks, had checked this earlier and the depth (at least on my hardware win10/radeon) is written to every color channel in a vec4 float...
by yal2du
Wed Jun 07, 2023 4:53 am
Forum: Support and Development
Topic: read depth buffer [solved]
Replies: 2
Views: 1604

read depth buffer [solved]

tldr: how do i save/access the depth buffer contents from a render? if i modify groverburger's simplest 3d example to render the spinning cube to a special canvas: local lg = love.graphics canvas_settings = { ["type"] = "2d", ["format"] = "depth32f", ["re...
by yal2du
Mon Jun 05, 2023 6:09 pm
Forum: Libraries and Tools
Topic: Groverburger's 3D Engine (g3d) v1.5.2 Release
Replies: 218
Views: 475286

Re: Groverburger's 3D Engine (g3d) v1.5.2 Release

If you want to use a depth buffer with the main screen, you need to set it up in love.conf (or love.window.setMode) - just setting t.window.depth = 24 should do it, but I haven't seen that being done in the g3d code I've looked at. this (adding t.window.depth to conf.lua) fixes the depth testing is...