Scripting: io.open not working

Hello,

I’m trying to open a binary file in an Aseprite Lua script with the io.open() function. I get this very odd error when trying to do so: “attempt to index a function value”.

Here’s some info on the problem:

  • The path the io.open() function is trying to open is a formatted, completely valid path.
  • The file itself is a SNES graphics binary file (which works with a level editor for Super Mario World).
  • The script works perfectly fine for the script author, but not for me.
  • I’m running Windows 11 on Aseprite 1.2.33; running the script from an older version of Aseprite returned the same error.

An issue exists detailing the problem (aseprite/aseprite #3197), but it’s been inactive. We’ve only assumed that it’s because of an OS level difference, but I was wondering if anyone here really knew what the cause of the issue could be.

I’ve left a couple SNES graphics test files here for anyone who wants to try it. All you’d do is download any of the test files, add the script from main to Aseprite, run the script, hit “import .bin”, and then open the test file. For me, this will crash the editor. (There’s also a transactionless version of the script if you’d like to see the error - check the issues from the script’s repository.) If anyone can reproduce this issue and diagnose it, then I would be very thankful for your help.

It’d be super nice to get this working, because this script is so much better than my alternative option (it’s either to use Aseprite with this script and all its nice features, or to use a very old sprite editor instead that’s much harder to use).

Thanks; I really appreciate anyone that can help me out with this issue.

1 Like

Hi @bingbingyahoo27, was you able to run the script? Could you share a small snippet to reproduce the problem?

interesting fact: if you first load or create sprite, import .bin works fine. otherwise it will crash the aseprite.