Page 1 of 1
Yet another LoveJS Player
Posted: Sat Dec 07, 2024 7:55 am
by alexjgriffith
I've been working on tools for interactive development in lovejs. Took a small detour this week to put together a little lovejs-player, with some of the extensions my development tools rely on (websockets, and interop with JS).
https://alexjgriffith.itch.io/lovejs-player
Like all other Emscripten ports of Love2D, this version relies on Lua5.1, rather than luajit. The core virtual machine used by luajit is written in assembly, meaning it can't be compiled to wasm to run in the web.
Feedback on the tool and extensions would be appreciated. Note that the API for the websockets and js library may change. Right now it's tied directly into love2ds event system, however rewriting them to be polled will make it easier to update LoveJS in the future.
Re: Yet another LoveJS Player
Posted: Sat Dec 07, 2024 2:21 pm
by dusoft
Nice and well documented!
Re: Yet another LoveJS Player
Posted: Wed Dec 11, 2024 6:37 am
by SamR71
Having trouble getting my .love working with the tool hosted on lovejs-player
Error:
Reading Uploaded .love file
index.html:325 File main.lua does not exist on disk.
index.html:325 Error: [love "boot.lua"]:330: Cannot load game at path '/home/web_user/love/game.love'.
index.html:325 Make sure a folder exists at the specified path.
index.html:325 stack traceback:
index.html:325 [love "boot.lua"]:352: in function <[love "boot.lua"]:348>
index.html:325 [C]: in function 'error'
index.html:325 [love "boot.lua"]:330: in function <[love "boot.lua"]:126>
index.html:325 [C]: ?
index.html:325 [love "boot.lua"]:1340074251: in function <[love "boot.lua"]:42>
index.html:325 [C]: in function 'xpcall'
index.html:325 [love "boot.lua"]:357: in function <[love "boot.lua"]:355>
index.html:325 [C]: in function 'xpcall'
Re: Yet another LoveJS Player
Posted: Wed Dec 11, 2024 10:21 pm
by alexjgriffith
I've seen this error before with .love files that didn't have a main.lua in the top level. It could also happen if something in the .love file botched the b64 encoding.
Do you have a copy of the .love file you can share?
Re: Yet another LoveJS Player
Posted: Thu Dec 12, 2024 8:58 pm
by gianmichele
I had the same issue. main.lua is definitely in the top level.
I'm using a mac with osx and I know it does like to hide some crappy stuff in the zip. Maybe that?
Re: Yet another LoveJS Player
Posted: Sat Dec 14, 2024 2:40 am
by alexjgriffith
Maybe? I tested it again on several games on linux and windows and I am not getting the main.lua is missing error.
If someone is running macos could they test using the following zip command to build their project and see if it still errors out?
The script just changes to whatever game-directory your project is in, finds all files, sorts them and zips them without any extra metadata. It saves the .love file one directory up to prevent you from accidentally recursively including it in your zip file.
Code: Select all
cd game-directory && find -type f | LC_ALL=C sort | env TZ=UTC zip -r -q -9 -X ../game.love -@
Alternatively, if any of your projects are available on a git host I can test the program with them.