Spriteframes change when the game is run or the editor is restarted

4.2.1 Godot Version

Hi, i have a strange problem.
I have been building a game for a couple months with no issue, but since yesterday evening my crocodiles are being replaced with half a horse.

So, i am instansiating NPC’s in the node mainMap using a scene called npc which has an AnimatedSprite2D node as a child, this contains a default spriteframe called bandit_Spriteframe.res.

The npc scene has an: @export var SF_Resource: Resource -line so custom spriteframes can be added through the editor. I also have a ready function with: $AnimatedSprite2D.set_sprite_frames(SF_Resource) to set the new spriteframe given in the editor.

This has been working fine, until yesterday. Now, whenever i look at things in the editor using @tool, everything looks fine, but on startup or after restarting the godot editor, the crocodile_spriteframe has everything removed exept one animation called IdleS, which has its frames replaced with those of another animation of a horse. Incidentally, as the horse is bigger, the crocodile becomes half a horse, alternating between front and back. I have tried simply making a new spriteFrame, but this instead made my crocodiles into half bald old men after running/restarting the editor.

I have deleted the horse spriteFrame and the old man spriteframe. the default bandit spriteFrame has no horses or old men.

I have no idea what is causing this. Can some rogue code rewrite spriteFrames on restart? Can there be spriteFrames saved in memory that take over new ones?

Appreciate any help, i am completely stumped even after using google and reading through the spriteFrame methods(!) Glad to show code if anyone knows what to look for.

As a new member i can’t upload to the site, i uploaded a video of the phenomena to google drive: crocohorse.mp4 - Google Drive

Thanks

EDIT ---- It seems the malfunctioning spriteFrame and all new spriteFrames are automatically given a dependency to the tileset.png file in the horse folder. Still dont know how to fix this, but its something!

EDIT2 ---- I did not solve this, but i found a workaround. For anyone in the future: I had to rename the tileset.png files of horse and old man. Somehow godot decided these should be used over anything else. If anyone can explain this behaviour i would love to know what is going on, but for now it “works”.