openplanet-nl / issues

Issue tracker for Openplanet.
10 stars 0 forks source link

CopyToFileRelative alternative (extracting a file api) #202

Closed XertroV closed 1 year ago

XertroV commented 1 year ago

Copying Fids to files, b/c CopyToFileRelative doesn't seem to work.

from discord: https://discord.com/channels/276076890714800129/276076890714800129/895804760484118538

[9:48 AM]Beu: is't possible to extract a file from a titlepack with a script ? the CopyToFileRelative function seems not to work in this context [10:03 AM]Miss: No I don't think I exposed an API for this, but if you file a github issue I can take a look at it when I have time? 😄

XertroV commented 1 year ago

I think mb this was already addressed in the past. There's an 'undocumented' function: .Extract on CSystemFidFile that extracts to the Extracts folder. My alt player skin plugin uses it. The reason I say it's undocumented is that it doesn't appear in next.openplanet.dev docs, or the openplanet docs (e.g., under Fids::). Consequently, it shows up as red in vscode using the extension. I can fix that manually in the extension but mb there's a better long-term soln.

codecat commented 1 year ago

Oh true, I forgot about those hidden API's. They are kinda hard to document, because they are not from Nadeo directly (thus won't show up on the game API documentation), and they are not part of Openplanet's API per se since they are additions to Nadeo's classes (and thus won't show up on Openplanet's API either).

I try to keep these hidden API's to a minimum and document them elsewhere, but it's not always possible. Perhaps moving these API's to Fids::Extract(..) or something would be better, that way they can be documented easier.