Awesome. Let me fix that and I’ll get back to you.
Thanks!
Awesome. Let me fix that and I’ll get back to you.
Thanks!
Hello again!
I finally got my Arduboy FX today. I was trying to build some Arduboy FX data using Mr.Blinky’s tool, but I cannot get it to work!
Here’s the error I’m getting:
ERROR in line 4: Bad label: image_t
FX data build failed!
Here’s the code it’s complaining about:
/******************************************************
Shadows and Eternity FX data file :
******************************************************/
image_t dolorreLogo = "../assets/dolorreLogo.png"
image_t saeTitle = "../assets/saeTitle.png"
image_t selectionLine = "../assets/selectionLine.png"
image_t helpText = "../assets/helpText.png"
image_t creditsText = "../assets/creditsText.png"
@Mr.Blinky, do you have any idea why this is happening? I’ve looked at (and can build the Arduboy FX data for and send it to my Arduboy FX) the basic-example code.
Any help would be greatly appreciated.
Perhaps this might be because one of the images might be missing? Can you confirm everything is intact, and the paths to the images are correct?
Since you only got the error on line 4, I’d think it must have something to do with one of your files. Try removing line 4, and see if you get the same error. If you do, it might be something bigger.
Hi @Ard_Flamingo,
I tried you suggestion, and I still get an error, but for a different line.
ERROR in line 3: Bad label: image_t
FX data build failed!
In that case, it seems it’s affecting all five lines.
I think I have found the problem however. I don’t think you’re using image_t
correctly.
Taken from the fxdata.txt
file:
to create a constant to point to a FX resource, a similar format as in C(++):
is used.
image_t FXlogo = "FX-logo.png";
image_t FxSprite = "FXSprite.png";
It seems you’re missing some semicolons. Possibly the “..
” before the path in your previous post could be messing it up as well, but I don’t know what they’re for so I wouldn’t know.
Hm… It seems to be something with the path. As per one of the other suggestions in the help text, I put it all on one line.
image_t dolorreLogo = "../assets/dolorreLogo.png", saeTitle = "../assets/saeTitle.png", selectionLine = "../assets/selectionLine.png", helpText = "../assets/helpText.png", creditsText = "../assets/creditsText.png";
I think it has something to do with the path? It’s now giving me this error:
FileNotFoundError: [Errno 2] No such file or directory: 'E:\\Dropbox\\Arduboy FX\\Shadows and Eternity Game\\Menu Test\\Menu_Test\\fxdata\\../assets/dolorreLogo.png", saeTitle = "../assets/saeTitle.png", selectionLine = "../assets/selectionLine.png", helpText = "../assets/helpText.png", creditsText = "../assets/creditsText.png'
FX data build failed!
I got it working after playing around with it some.
Here’s the code I ended up with (after putting the assets in the same folder as the fxdata.txt file):
/******************************************************
Shadows and Eternity FX data file :
******************************************************/
image_t dolorreLogo = "dolorreLogo.png";
image_t saeTitle = "saeTitle.png";
image_t selectionLine = "selectionLine.png";
image_t helpText = "helpText.png";
image_t creditsText = "creditsText.png";
Aha! So it was semicolons!
I think it would be better if you moved them back to the assets folder since it would make everything more organized. The problem likely occurred because you put a stray “..
” before the paths.
See here, it’s looking for the “..
” in the path, but since your folder name doesn’t have a “..
” in the name, it can’t find the files/folder. So, the path wont work.
For example, in this line (but all of them have this issue) it’s trying to find the “..
” folder. Not the “assets” folder.
selectionLine = "../assets/selectionLine.png"
The fix: just remove the “..
” in front of all your paths.
As a wise someone once told me: “readability is king”
It’s always a great idea to organize your files
Nope. I do not have semicolons in my game’s fxdata.txt file.
The ‘…’ says ‘go up a directory’ and you may not need them if the assets directort is a subdirectory of the fxdata directory.
That’s probably the root of your problem.
The FX data isn’t actually C++ code, it’s being parsed by a separate parser that doesn’t follow all the same rules of C++, so attempting to declare multiple variables on a single line probably upsets the parser.
Stick to declaring one per line.
The fact it doesn’t follow C++ parsing rules is also likely why (according to what @filmote says - I haven’t tried it myself) the semicolons are optional.
If you’re developing from a folder set to use Dropbox, there’s always a possibility that some of your missing file issues are because Dropbox hasn’t properly synchronised.
You’re probably better off developing in a normal folder and then copying to Dropbox when you’re done. (Or better yet, just use something like GitHub or GitLab.)
Recommended reading:
(Note that /
(probably) doesn’t mean ‘root’ on Windows.)
It probably seems a bit strange, but it’s very useful.
I see I’m late to the party.
It shouldn’t compain about image_t being a bad label as it’s a defined keyword. Do you still have a copy of the bad file and could you zip it up and send it to my by PM?
semi colons and comma’s don’t matter.
Looks like I broke something in the string handling. Currently there can be only one string/filename at a line.
Weird. It shows the paths with semicolons in the fxdata.txt
file.
I feel quite silly now hehe
Oh, I see! So it basically goes out of the current directory. Makes sense.
Okay, so I figured it out! (thanks to you guys!)
It was Dropbox. I moved the files out of Dropbox and went back to this code:
/******************************************************
Shadows and Eternity FX data file :
******************************************************/
image_t dolorreLogo = "../assets/dolorreLogo.png"
image_t saeTitle = "../assets/saeTitle.png"
image_t selectionLine = "../assets/selectionLine.png"
image_t helpText = "../assets/helpText.png"
image_t creditsText = "../assets/creditsText.png"
And it works! No issues whatsoever.
So if anyone else has this problem, don’t use your code straight out of Dropbox. Just use it for backing up files.
(I feel silly because I already knew Dropbox didn’t play nice with code. I had encountered issues with it and code before. I guess that’s what happens when you haven’t done any coding in 5+ years.)
When you say “don’t matter”, do you mean they’re treated as if they aren’t there?
If so, @Dolorre’s original
image_t dolorreLogo = "../assets/dolorreLogo.png", saeTitle = "../assets/saeTitle.png", selectionLine = "../assets/selectionLine.png", helpText = "../assets/helpText.png", creditsText = "../assets/creditsText.png";
Is effectively:
image_t dolorreLogo = "../assets/dolorreLogo.png"
saeTitle = "../assets/saeTitle.png"
selectionLine = "../assets/selectionLine.png"
helpText = "../assets/helpText.png"
creditsText = "../assets/creditsText.png"
In which case the missing image_t
s aren’t present.
I haven’t seen the language rules documented anywhere, so I’m just guessing.
I’ve got another issue when setting mine up. For some reason, it cannot find pillow:
Arduino: 1.8.19 (Mac OS X), Board: "Arduboy FX, Arduboy optimized core, Cathy3K (starts with menu)"
Arduboy FX Arduino plugin v1.05 by Mr.Blinky Jan 2022 - Jan 2023
Executing /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 /Users/om/Documents/Arduino/tools/fxdata-build.py /Users/om/Documents/Arduino/Super Ardu Smash/Super-Ardu-Smash/fxdata/fxdata.txt
FX data build tool version 1.14 by Mr.Blinky May 2021 - Jan 2023
Using Python version 3.10.5
dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so' (no such file), '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
PILlow python module not found or wrong version.
Make sure the correct module is installed or placed at /Users/om/Documents/Arduino/tools
FX data build failed!
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
It seems perhaps it’s an error with the architecture? Something about having arm64, but needing x86_64.
I have also deleted the pyserial, python, and pillow folders inside of the plugin (since I already have them installed)
See here:
pip list
)
Also, is there a way to get this working in VSCode?
Edit: verbose output
Arduino: 1.8.19 (Mac OS X), Board: "Arduboy FX, Arduboy optimized core, Cathy3K (starts with menu)"
Arduboy FX Arduino plugin v1.05 by Mr.Blinky Jan 2022 - Jan 2023
Executing /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 /Users/om/Documents/Arduino/tools/fxdata-build.py /Users/om/Documents/Arduino/Super Ardu Smash/Super-Ardu-Smash/fxdata/fxdata.txt
FX data build tool version 1.14 by Mr.Blinky May 2021 - Jan 2023
Using Python version 3.10.5
dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so' (no such file), '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
PILlow python module not found or wrong version.
Make sure the correct module is installed or placed at /Users/om/Documents/Arduino/tools
FX data build failed!
Arduboy FX Arduino plugin v1.05 by Mr.Blinky Jan 2022 - Jan 2023
Executing /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 /Users/om/Documents/Arduino/tools/fxdata-build.py /Users/om/Documents/Arduino/Super Ardu Smash/Super-Ardu-Smash/fxdata/fxdata.txt
FX data build tool version 1.14 by Mr.Blinky May 2021 - Jan 2023
Using Python version 3.10.5
dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so' (no such file), '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
PILlow python module not found or wrong version.
Make sure the correct module is installed or placed at /Users/om/Documents/Arduino/tools
FX data build failed!
Try updating to latest versions. from terminal try:
(sudo) python3 -m pip install --upgrade pip
then
python3 -m pip install --upgrade pyserial
I still get the same error :(
I also did a re-install of pillow yesterday.
It seems related to Apple changing from intel to arm architecture. If you google for this you’ll find a few suggestions that may work for you too.
Ah, great. Just when I thought everything (the whole “why, oh WHY did Apple switch to arm, now nothing gonna work ”) was fixed
:/
I’m okay with using the scripts manually however. It actually didn’t work last time I tried but I just tried it right now and it seems like I just forgot the "
lol but it is all working dandy right now!