ResourceFormatSaver C# _Save signature

Godot Version

Godot 4.3 stable

Question

I’m having a problem that’s making me feel really dumb right now. I’m trying to implement a ResourceFormatSaver in C#, but when I try to compile it spits out the response 'ChartFormatSaver._Save(Resource, string, int)': no suitable method found to override. My signature is public override Error _Save(Resource res, string path, int flags), which seems to match the one provided in the Godot docs, so I’m not sure what’s going on. All my other overrides in the class work, and I’ve tried tweaking things like changing the method name to _save or the return type to an int to no avail. Am I missing something obvious here, is this a bug with Godot, or is something else at play?

After an absurd amount of digging due to C# sources not being easily available, I finally found the problem! flags is a bitmask, which means that the C# sources use a uint instead of a regular int. This isn’t really conveyed well in the docs at all, so I might PR something to the page on C# API differences to GDScript.

1 Like