It's gonna be difficult without some experience, so I don't know how much I can help.
You could Misc.dialog the return variables of those functions and then go from there:
local headerData = FileFormats.openLevelHeader("myLevel.lvlx")
Misc.dialog(headerData)
local levelData = FileFormats.getLevelData("myLevel.lvlx")
Misc.dialog(levelData)
The documentation on these functions is sadly sparse but by debugging like this you should be able to find out what exactly is stored where. Looking at basegame use, I was able to ascertain that headerData.data.showInMarioChallenge is a thing, and that headerData.meta exists.
Remember that "exit count" is not information easily discoverable from this. It comes down to a combination of
- manually finding Exit type NPCs that are not friendly and of different exit types
- finding warps that lead out of the level but don't lead to another level
- finding keyhole and key npcs. This is not a given, though, as the keys might be used for something else. It can always give misleading info.
- offscreen exit sections
"Okay that's cool and all but what if I wanna do it for the level you stand on on the map?
For that you can use the World class.
https://docs.codehaus.moe/#/reference/world
if world.levelObj and world.levelObj.filename ~= "" then
-- use world.levelObj.filename instead of "myLevel.lvlx"
end
Hopefully that's enough to get you started.