Gamesave Editor Won't Write.. Help?

Rawr8675309 Oct 12, 2013

  1. Rawr8675309

    Rawr8675309 Newbie
    0/47

    Joined:
    Oct 16, 2012
    Messages:
    47
    Likes Received:
    13
    Trophy Points:
    0
    Console:
    Xbox
    Hey, so.. I've made a gamesave editor.. It works quite well... except when it comes to saving/writing the file. It worked at one time, but I recently remodeled it and it... died.


    Could anyone help me figure out what I'm doing wrong?

    Here's the code I've used in the past (no longer working):


    Private Sub SaveChangesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveChangesToolStripMenuItem.Click
    Try
    Dim Writer As New PackageIO.Writer(FilePath, PackageIO.Endian.Big)

    MsgBox("Your changes have been applied!")
    Catch ex As Exception
    MsgBox(ErrorToString)
    End Try
    End Sub
     
  2. MastaOfEvil

    MastaOfEvil Dev XPG Developer Lifetime Gold TeamXPG
    0/47

    Joined:
    Dec 21, 2011
    Messages:
    660
    Likes Received:
    330
    Trophy Points:
    0
    Gender:
    Male
    Console:
    Xbox
    Code:
    Private Sub SaveChangesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveChangesToolStripMenuItem.Click
            Try
    
                //Sets up Writer
                Dim Writer As New PackageIO.Writer(FilePath, PackageIO.Endian.Big)
    
    
                //You need to actually write something, there are a lot of 
                //different options if you type Write.
                Writer.WriteInt32(999999999)
    
    
                //Always close the Reader or Writer
                Writer.Close()
     
                MsgBox("Your changes have been applied!")
            Catch ex As Exception
                MsgBox(ex.ShowMessage)
            End Try
        End Sub
    
     
  3. Rawr8675309

    Rawr8675309 Newbie
    0/47

    Joined:
    Oct 16, 2012
    Messages:
    47
    Likes Received:
    13
    Trophy Points:
    0
    Console:
    Xbox
    I do have it set up to write stuff, it's just... Here, I'll post a shorter version of it.

    Public Class Offline
    Dim StoryTime As String
    Dim FilePath As String


    Private Sub Readfile()
    Try
    Dim Reader As New PackageIO.Reader(FilePath, PackageIO.Endian.Big)

    Reader.Position = 54624
    StoryTime = Reader.Position
    NumericUpDown1.Text = Reader.ReadInt32

    Catch ex As Exception
    MsgBox(ErrorToString)
    End Try
    End Sub
    Private Sub WriteFile()
    Try
    Dim Writer As New PackageIO.Writer(FilePath, PackageIO.Endian.Big)

    Writer.Position = StoryTime
    Writer.WriteInt32(NumericUpDown1.Text)

    MsgBox("Your changes have been applied!")
    Catch ex As Exception
    MsgBox(ErrorToString)
    End Try
    End Sub

    Private Sub LoadGamesaveToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadGamesaveToolStripMenuItem.Click
    Dim Open As New OpenFileDialog
    Open.Title = "Open Soulcalibur V Gamesave!"
    Open.ShowDialog()
    FilePath = Open.FileName
    Readfile()
    End Sub

    Private Sub SaveChangesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveChangesToolStripMenuItem.Click
    Try
    Dim Writer As New PackageIO.Writer(FilePath, PackageIO.Endian.Big)

    MsgBox("Your changes have been applied!")
    Catch ex As Exception
    MsgBox(ErrorToString)
    End Try
    End Sub
    End Class

    There's quite a few more than the "StoryTime", but.. yeah.

    I had this setup before the remodel and it worked fine, but it's not now.
     
  4. Rawr8675309

    Rawr8675309 Newbie
    0/47

    Joined:
    Oct 16, 2012
    Messages:
    47
    Likes Received:
    13
    Trophy Points:
    0
    Console:
    Xbox
    Oh.. I think the reader not being closed prevented it from writing.. Once i added that in, it worked just fine.


    Now.. If only I can figure out how to save it as a new file in a new folder as opposed to overwriting the original...
     

Share This Page

Close