Issues with `FlxFrame.checkValidName`
- Haxe version: 4.3.4
- Flixel version: 5.6.2
- OpenFL version: ?.?.?
- Lime version: ?.?.?
- Affected targets:
in flixel 5.6.1 (?), a new function was added to FlxFrame, that being checkValidName. the function warns for invalid (?) frame names i presume
this function seems to cause more issues then it solves however, when compiling one of my projects in debug, i get bombarded with errors from this line. the game still functions the same, the only issue is i have a ton of errors flooding my log
the errors being:
for reference, here is the xml i am referencing (converted to txt due to isses with github) alphabet.txt
i have to ask, is this FlxFrame function required? in it's current state the only mention of it i've seen is it causing issues with pre-existing projects
if this function must be kept, i would like to atleast know how to fix these errors
can you share the code used to load the xml?
while trying to create a simplified repro, i've realized it might be an issue with the project i'm working with, i can't reproduce it in a new flixel template using the previously mentioned xml
this is the original class i was working with, however it does have a lot of seemingly (?) unrelated functionality, which is why i wanted to cut it down
for clarity, frames is loaded using another function, getSparrowAtlas, however, this function is essentially a shortcut to FlxAtlasFrames.fromSparrow
i haven't been able to deduce why this code fails, and my smaller repro doesn't
while trying to create a simplified repro, i've realized it might be an issue with the project i'm working with, i can't reproduce it in a new flixel template using the previously mentioned xml
I don't need a simplified repro, though thanks for trying, I just need a snippet from the project showing how you are parsing the txt and creating the animations
👍
im pretty sure the issue here is because when you generate a spritesheet in flash/adobe animate from the stage instead of the library, it adds "instance" followed by a number, which i think is the amount of versions of one symbol that you are exporting (like different scales maybe?) but i havent really tested this. it does still add this to every symbol regardless of how many versions there actually are and also doesnt really tell you and as said before happens depending on how you make a spritesheet
👍
Any updates on my previous request @DetectiveBaldi ?
👍
Any updates on my previous request @DetectiveBaldi ?
I linked the class with the XML error in my last comment, from what I can gather the animations are added here
The associated XML can also be found here
im pretty sure the issue here is because when you generate a spritesheet in flash/adobe animate from the stage instead of the library, it adds "instance" followed by a number, which i think is the amount of versions of one symbol that you are exporting (like different scales maybe?) but i havent really tested this. it does still add this to every symbol regardless of how many versions there actually are and also doesnt really tell you and as said before happens depending on how you make a spritesheet
This seems to be the case, removing the number seems to fix the issue in most cases, however in certain cases, the error still seems to occur?
The error also seems to happen if the XML name has an exclamation point in it
looking into this, again. is the issue that addByPrefix doesn't work on "foo bar 00001" if the prefix is "foo" or something?
looking into this, again. is the issue that
addByPrefixdoesn't work on "foo bar 00001" if the prefix is "foo" or something?
Yes, that seems to be the issue, I can now reliably reproduce the error.
var sprite:FlxSprite = new FlxSprite();
sprite.frames = FlxAtlasFrames.fromSparrow("assets/images/alphabet.png", "assets/images/alphabet.xml");
// sprite.animation.addByPrefix("#", "# bold", 24, true); // Causes error
sprite.animation.addByPrefix("#", "# bold instance", 24, true); // Runs successfully
add(sprite);
The animation on the XML being: # bold instance 10000, # bold instance 10001, etc
I think in this case it should try and parse the numbers in "instance 00001" and warn you that you should either generate better frame names, or include "instance " in your prefix