I’ve been looking online for a Lua library to run Python files, and similarly for Javascript, but I’ve had no luck. I did find Lunatic-Python, but it seems to not like Defold’s dependency system, and has not been updated in the last 2 years, so it probably wouldn’t work anyway.
What I’m trying to do is use Google Sheets API from a Defold project. I figure a Javascript file would likely already be compatible because Defold seems to go hand-in-hand with Javascript and JSON files already.
I would prefer running a Python file, as I’m only just getting familiar with JS, but either way works. I want to be able to get one of these two options working for a Jam that is starting in a few days.
If someone could point me to an example, or library to use, I’d be very appreciative.
Yeah, it’s a bit of a stretch, but I wanted to see if I could get it to work because I was familiar with it.
I just need it as a simple scoring system. I would send the score to the Python or JS file, and then either could access the API and input the new info. I could then retrieve the info freely at any time to write the highscores on screen without having to mess with any type of server system.
This would be on PC, so Windows, and preferably also Mac and Linux.
Sadly, that wouldn’t work. It has to be a stand-alone solution.
The options I’ve found so far:
Run a Python or JavaScript file with new score info (Not possible without os.execute?)
Compile a JavaScript or Python file in Lua (Imports break?)
I’ve found a few library’s for JavaScript to Lua compilers, but I don’t believe those would work either. In order for the API to work, it requires a Google authentication dependency, which I don’t believe I can get in Lua. If I were to compile the Javascript file to Lua, I’m pretty sure the dependency would no longer work.
Honestly this seems to be way too unsupported to be worth it.
I may have a solution. I can make the Python file standalone and have the OS execute it from the directory, instead of using the Python interpreter (which most people probably wouldn’t have).
Thanks. I took a look at that beforehand, but I couldn’t understand much of what was going on in the examples, so I started looking for different options.