thesupersonic16 / DALTools

A collection of tools aiming to help modifying files for the DATE A LIVE Visual Novels
MIT License
37 stars 6 forks source link

PSVita database and script opening fatal error #22

Closed ancuteum closed 3 years ago

ancuteum commented 3 years ago

Hello! I'm trying to open the database file and script file from ps vita date-a-live, but I get an error. Pls help!

SDE Info:

    Version: 1.12.0
    Args: 
    StartDir: F:\DALTools v2\
    Process Level: User
    GamePath: 
    DataBasePath: F:\DALTools v2\database.bin

Exception:

    Type: STSCDisassembleException
    Message: Failed to disassemble the script file . Got opcode 0xD4 at 0x0000003C in "" There is no opcodes larger than 0x93!
    Source: DALLib
    Function: Void Load(DALLib.IO.ExtendedBinaryReader, Boolean)
    StackTrace: 
       at DALLib.File.STSCFile.Load(ExtendedBinaryReader reader, Boolean keepOpen)
       at DALLib.File.STSCFileDatabase.Load(ExtendedBinaryReader fileReader, Boolean keepOpen)
       at DALLib.File.FileBase.Load(Stream stream, Boolean autoDecompress, Boolean keepOpen)
       at DALLib.File.FileBase.Load(String path, Boolean keepOpen)
       at ScriptDatabaseEditor.MainWindow.ChangeDatabase(String path)
       at ScriptDatabaseEditor.MainWindow.LoadButton_Click(Object sender, RoutedEventArgs e)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at ScriptDatabaseEditor.App.Main(String[] args)
    InnerException: 
thesupersonic16 commented 3 years ago

The database editor is actually only meant to work for the RR remake which the Vita version might have different code. Can you send the Script folder and if possible a decrypted eboot file so I can take a look to see if they are similar?

ancuteum commented 3 years ago

https://drive.google.com/drive/folders/1Bt6PhBZQdx3hTgFkyoIrosQPvfP4qXqR?usp=sharing

thesupersonic16 commented 3 years ago

Does the PS Vita version of the game include artbooks and Drama CDs?

ancuteum commented 3 years ago

No, it doesn't.

thesupersonic16 commented 3 years ago

Try this and let me know if it works or not.

Release.zip

ancuteum commented 3 years ago

DatabaseEditor opens and saves the file, thank you. But DialogueEditor couldn't save the file =(

SDE Info:

    Version: 1.0.2
    Args: 
    StartDir: F:\DALTools3\
    Process Level: User
    ScriptPath: F:\release_win64_7\PCSG00599_decrypted_new\Script\Script.pck

Exception:

    Type: ArgumentNullException
    Message: String reference not set to an instance of a String.
Parameter name: s
    Source: mscorlib
    Function: Byte[] GetBytes(System.String)
    StackTrace: 
       at System.Text.Encoding.GetBytes(String s)
       at DALLib.File.STSCFile.Save(ExtendedBinaryWriter writer)
       at ScriptDialogueEditor.STSCFileDialogue.Save(ExtendedBinaryWriter writer)
       at DALLib.File.FileBase.Save(Stream stream)
       at ScriptDialogueEditor.MainWindow.SaveScript()
       at ScriptDialogueEditor.MainWindow.SaveButton_Click(Object sender, RoutedEventArgs e)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at ScriptDialogueEditor.App.Main(String[] args)
    InnerException: 
ancuteum commented 3 years ago

I also used an English translated script file from reddit, and it worked well. Maybe the Japanese script file is not saved due to system restrictions?

thesupersonic16 commented 3 years ago

There shouldn't be any system restrictions, Pretty sure its an error on my end. Try this. The file size seems to change when saved so I'm not sure if that will effect how the game will load the files.

Release.zip

ancuteum commented 3 years ago

The file is saved successfully. But when I try to run it on the device, error c2-12828-1 appears. 2021-01-16-150729

thesupersonic16 commented 3 years ago

Does both of the files cause the error? Or does one of the two cause it? Like does any of the two files alone work or not.

ancuteum commented 3 years ago

When I changed the database file, there is no change in the game, but it runs. When I change the script file, the game doesn't start and gets an error.

thesupersonic16 commented 3 years ago

I guess we will look at the database issue later and first get the Script pck working. Does this at least get the game running?

Release.zip

ancuteum commented 3 years ago

Sorry, changing the database file works) 2021-01-16-154053

ancuteum commented 3 years ago

Oh, it works! Thank you very much! 2021-01-16-154502

thesupersonic16 commented 3 years ago

Great! Please let me know if you encounter any more issues by reopening this issue with a new comment.

if you need to repack the .pck files manually using PCKTool, make sure to add -s in the command line.

ancuteum commented 3 years ago

Another problem. FontEditor crashes when opening font files. I added these files to Google Drive. Please see what you can do.

ancuteum commented 3 years ago

Also, textool seems to pack the file incorrectly. After packaging, it is no longer unpacked. I also added an example tex file to Google Drive.

thesupersonic16 commented 3 years ago

FontEditor is kinda useless on the PC version, not sure if it works for the PSV but I updated it while at it. It seems the PSV version doesn't support kerning and variable width which makes sense since the game is in Japanese. (Make sure Monospace Only is checked or else the program will crash) As for TEXTool, I made some changes which might fix your issue.

Let me know if it all works or not.

Release.zip

ancuteum commented 3 years ago

textool now packs files successfully, but on vita it doesn't work - black screen.

thesupersonic16 commented 3 years ago

Do you know how to use a hex editor? If you do I would like to know what would happen with a quick change.

ancuteum commented 3 years ago

I know how to use hex editor a little)

thesupersonic16 commented 3 years ago

Open your new .tex file and at 0x0F where it should say 01 Change it to 81 then save and let me know if the file loads.

ancuteum commented 3 years ago

Did I do it right? Безымянный

thesupersonic16 commented 3 years ago

Yeah like that. Save it and let me know if the file loads this time.

ancuteum commented 3 years ago

So, it doesn't work.

thesupersonic16 commented 3 years ago

Does editing title.tex work? (both repacking it and editing the 01 to 08).

Can you also upload the unedited logo.tex file aswell?

thesupersonic16 commented 3 years ago

Actually it might be an alignment issue. Try this. (no need to hex edit with this version)

Release.zip

ancuteum commented 3 years ago

I went back to the title.tex file, edited it, and tried running it again. It didn't work. I uploaded the edited file to Google Drive, maybe I'm doing something wrong?

thesupersonic16 commented 3 years ago

Just wait a little. I'm checking the differences with the PC and the PSV. I'll send another release soon.

thesupersonic16 commented 3 years ago

Try this.

Release.zip

ancuteum commented 3 years ago

Unfortunately, it didn't work.

thesupersonic16 commented 3 years ago

You could also try enabling compression. Make sure you are using the newest zip I sent and open the .xml file for the texture and scroll down until you see this

<Compress>false</Compress>

Change the false to true like

<Compress>true</Compress>

Then save and drag the xml file into TEXTool.

ancuteum commented 3 years ago

Yes, it worked! Thanks!

thesupersonic16 commented 3 years ago

Oh. Never seen a game that uses .tex that required compression. Well let me know if you see any more issues. I might keep this issue open for a while just in case.

thesupersonic16 commented 3 years ago

Closing due to inactivity. Please reopen the issue if you have any issues.