View Full Version : Using archives in ONScripter
I'd like to create a new archive to store edited image files in Tsukihime, but lack a sar archive encoder to create arc1.sar. Would it be possible to use both arc.sar and whatever.nsa at the same time?
From what I understand ONS doesn't really use the arc or nsa commands anymore, but will instead automatically look for arc.sar or arc.nsa and continue in arc1.sar/arc1.nsa if it cannot find a resource, is this correct? At the very least, telling ONS to nsa does not make it unable to find a resource in arc.sar, even if the arc command is commented out in 0.txt. Does anyone know what ONS really does do to determine where to get the necessary resources?
You can always run it under Filemon and check which files it tries to open. Move the originals for maximum effect.
Using the following commands in *define:
having only arc.nsa (and arc1.nsa with practically the same contents) available, filemon shows ONS opening arc.nsa and arc1.nsa, then failing to open arc.sar and then loading 0.txt. It searches for arc.sar a couple of times more, but is able to load graphics from both arc.nsa and arc1.nsa.
Adding arc.sar to the directory, it's the same up to loading 0.txt, after that it only tries to read from arc.sar, not finding the graphics it needs.
Reversing the two codelines at the top has no notable effect. removing both codelines makes ONS not find anything at all. It looks like ONS automatically searches for arc.sar and arc?.nsa, but does not actually read from them until it is specifically told to do so.
What's more annoying is that, even if you tell ONS to only 'nsa' (thus, remove the 'sar' command above), it still ONLY uses arc.sar if it is available... >_>
It's clear from the source that ONScripter will never read from an .nsa if a .sar is present, but it should be simple enough to modify so that it will try an .nsa if the file is not found in the .sar.
The code in question is in NsaReader.cpp. NsaReader::getFile(), NsaReader::getFileLength(), and NsaReader::open() are the three functions where there are obvious problems.
Hahaha, yeah, now that I know where to look even I can see it will never work as it is now. Thanks a lot for the tip. ^^
vBulletin® v3.8.6, Copyright ©2000-2017, Jelsoft Enterprises Ltd.