[Tool] Torchtools - Save Editing (UPDATE: v1.1, 02/08/10)

mattdeslmattdesl Posts: 157
edited May 2013 in Mod Showcase
torchtoolsheader.png

This is a work in progress. Not everything here has been finalized, and the project is in early alpha testing stages.


Torchtools is an open source Java class library which provides a base layer for 3rd party Torchlight tools. It also includes some simple GUI tools for common tasks. Primarily, Torchtools focuses on reading and writing Torchlight's save files (.svt and .bin), but other features are also in the works.

In simpler terms: I'm developing a collection of open-source Torchlight-related tools, and some of them deal with SVT editing.

More Info
http://code.google.com/p/torchtools/

Torchlight File Format Specification (WIP) Updated Feb 8, 2010
Part of the project involves understanding Torchlight's save file format, so I figured I'd do my best to share what I've learnt.
http://code.google.com/p/torchtools/wik ... htFileSpec

Tool: SVTInfo Updated Feb 8, 2010
SVTInfo is a Python API for reading and writing SVT files. It originally began as a port of the Java version, but for a number of reasons, it is now taking over as the primary platform for the future of Torchtools.

The SVTInfo package includes a command-line tool as well as a "bare bones" GUI tool. The command-line tool is particularly useful for 3rd party applications that do not use Java (such as TorchLeech). The GUI tool was written to allow users to visually read and change all known properties of an SVT file.

(Not included in v.07)
svtgui2.png
svtgui.png

Command-line Tool:
svtinfo.exe 1.svt -out output.txt

Example Output:
#generated by svtinfo.exe v.02 on 2010-01-15 01:51
file = 1.svt
class = Destroyer
difficulty = Hard
**** = False
cheater = False
name = Zo
level = 3
levelxp = 10887
fame = 1
famexp = 632
gold = 103
pet_name = Spot
pet_type = Dog

Read More: Updated May 7, 2010
PyTorchtools Wiki
Frequently Asked Questions

Download SVTInfo: Updated Feb 8, 2010
SVTInfo v.1.1 (Binaries Only)

Browse Python Source Code Updated Frequently
http://torchtools.googlecode.com/svn/tr ... orchtools/

Notice to Steam Cloud Users
These tools make changes to the save files. If Steam asks, use the local save. Alternatively, you could run Steam in offline mode.

Java Version
The project initially started as a Java API, but since it has been slowly migrating to Python. The Java tools and code, albeit outdated, will not be removed.
Tool: Hex Helper
A very simple Java tool to convert string/decimal values to hexidecimal and vice versa, very useful for hex editing.
torchtoolshex.png

Tool: Mini SVT Editor (Deprecated) Updated Jan 19, 2010
Note: This tool is being replaced by a Python version.

This Java tool can rename your player and pet, change difficulty, and transfer gold between saves.
minitool1.png

e.g. Below I've changed "Vera the Cheat" to "Vera the Scavenger" (although I could have changed it to anything). I've also used color codes to give it some in-game oomph:
torchtools2.png

The name is actually:
|cFFFFBA00Vera|u the |cFFFA0FB0Scavenger|u

Known Bugs with Alpha 024:
  • If your pet is not a cat or dog (i.e. changes from fish), the pet renaming may not work and making changes may cause problems with save files. To be safe, wait until your pet returns to normal before using the editor. This should be fixed in the next update.

Changes: Updated Jan 19, 2010
Alpha 067:
  • Fixed problem with a file staying open when a new file is selected (thus not allowing you to properly rename certain files)
  • Changed the way in which the pet info is found, hopefully this is more reliable
  • Added a MiniEditor_debug.bat file for debugging
  • Added -nopet option to MiniEditor to disable pet I/O

Tool: Cheat Wipe
Note: Since this is in early Alpha stage, I recommend manually backing up your save files before editing them just to be safe.

A Java tool which removes "the Cheat" from player name and resets the player's cheat flag to OFF.
torchtoolscheat.png

Download Java Tools Updated Jan 19, 2010
Download the executables for the tools here:
Torchtools Binary (Alpha 067)

Browse Java Source Code Updated Frequently
Until the code is more stable, you can checkout the latest revision from SVN:
http://torchtools.googlecode.com/svn/trunk/

See the Wiki for API documentation:
How-To: Using The TLSave Class
How-To: Creating New "Mini Tools"

More tools and content to come. I'll edit this post with updates as they come along.
Torchtools - An open-source save editing toolset
Rename characters & pets, transfer gold, change difficulty, etc.
«1

Comments

  • Looks very cool and professional. I will be following this eagerly.
    "Hit that? Its not so far away. Here, let me load up my Exploding Shot..." - Valeria
  • IrbisIrbis Posts: 251
    wow cool :D ill use the coloring asap!
    can you please explain how to do it correctly?
    "Hey, sis... check this out!"
    "Where are your pants? OHMYGOD IS THAT A CACTUS?"
    "I'm almost to Ordrak... hold on... "
    "I'M CALLING THE POLICE!"
  • mattdeslmattdesl Posts: 157
    edited January 2010
    The coloring is very easy. Just paste this in, replace XXXXXX with your color hex string (e.g. FFBA00 for gold, FA0FBO for purple, etc), and change ColoredNameHere to your player name.
    |cFFXXXXXXColoredNameHere|u
    

    Use online Color to Hex converters (search google) to get the hex string, a color picker like Photoshop, or simply use the "Font color" button when posting a reply on these forums.

    Updates: Abstracted the "mini tool" base class, so that writing other "mini tools" is now extremely easy. I just finished a "Cheat Wipe" tool to remove "the Cheat" from the player name and to reset the cheat flag to OFF. Since I've made some major changes to the code base, again I suggest backing up manually before testing out the editors! I'll update the binaries release shortly with the new tool.
    Torchtools - An open-source save editing toolset
    Rename characters & pets, transfer gold, change difficulty, etc.
  • This is by far the best work regarding save files I've seen thus far. Very organized and...awesome!

    I instantly bookmarked the save file format page because I'm very interested in it. I'm also curious as to what kind of CRC/checksum/validation a save file has (so you can't just rename some file to .svt and expect it to work), but that probably won't be realized for a while.

    As a side note, maybe you'll find this character properties post and this item properties post useful.

    Definitely looking forward to your progress!
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots.

    So far, the universe is winning.
  • freddyfreddy Posts: 326
    I just finished a "Cheat Wipe" tool to remove "the Cheat" from the player name and to reset the cheat flag to OFF.

    i'm no longer marked as a cheater but have still no access to the sharedstash so i guess the 'reset the cheat flag to OFF' part doesn't work as intended.


    greetz
    freddy
  • mattdeslmattdesl Posts: 157
    edited January 2010
    freddy wrote:
    I just finished a "Cheat Wipe" tool to remove "the Cheat" from the player name and to reset the cheat flag to OFF.

    i'm no longer marked as a cheater but have still no access to the sharedstash so i guess the 'reset the cheat flag to OFF' part doesn't work as intended.


    greetz
    freddy
    Hm, it works fine on all the saves I've tested.

    Do you mean clicking the shared stash will do nothing? Or do you mean you have no shared stash in town?

    If you have no shared stash in town, then you just need to spawn one with the console. Stand near where you would like your shared stash, and then type Shared Stash in the console and exit (only spawn one, as it will be permanent!). If this marks you as a cheater, you can simply exit and re-CheatWipe before loading the character.

    Later versions will hopefully reset the cheat flag and replace the missing shared stash.
    Torchtools - An open-source save editing toolset
    Rename characters & pets, transfer gold, change difficulty, etc.
  • freddyfreddy Posts: 326
    ah yes, removing the cheat flag and adding shared stash per console command worked fine (doesn't mark you as a cheater again). thanks!

    but one more question: how do i remove a shared stash ?? 3 stashes in the middle of a street are pretty annoying :D
  • mattdeslmattdesl Posts: 157
    I haven't found a way except by editing the .SVT file itself. If you want, you can send your SVT file to me (rapidshare/megaupload) and I'll see whether I can clean it up.
    Torchtools - An open-source save editing toolset
    Rename characters & pets, transfer gold, change difficulty, etc.
  • freddyfreddy Posts: 326
    hm, it's not that important. it's just a char i test my mods and items with. i don't use any console commands on my play chars.

    thx for helping me again and for this project. it's very interesting and helpful!

    greetz
    freddy
  • Hello mattdesl, we search for a possibility to display/analyse savegames for our extended backup function in TLeech. For this purpose we need a tiny application with command line parameters and the ability to hide dialogs/messages with user interaction. Maybe something like
    svteditor.exe /svt=filename /export=filename /silent
    
    The "dataexport" is for an option to export all known data from a savegame in a plain text file with a simple format like
    name=Slasher
    class=Destroyer
    level=34
    gold=23564
    petname=Kitty
    difficulty=Very hard
    
    and all other stuff you are able to rip of the SVT files. The "silent" parameter is to surpress all user interaction (dialogs/forms/all stuff which pops up) to get it able to run as a batch job for multiple savegames. "Silent" is a common parameter used by most software products (like installers). If you want to realize this request, we can integrate your tool in a smart way: If the player get your tool and copy it to the TLeech binary we will detect it and activate additional features (not only to extract infos but also to start your tool with predefined savegames from a list and so on...). Be sure we will mention your copyright.
    TorchLeech - a free mod manager for Torchlight. --- powered by Runic Games Fansite.
  • can someone tell me what the error "Could not find the main class: E:\Torchtools\MiniEditor.jar. Program will exit." means???
  • mattdeslmattdesl Posts: 157
    edited January 2010
    If you want to realize this request, we can integrate your tool in a smart way: If the player get your tool and copy it to the TLeech binary we will detect it and activate additional features (not only to extract infos but also to start your tool with predefined savegames from a list and so on...). Be sure we will mention your copyright.
    Sounds good. I take it you'll be adding the additional features by changing the source?

    I'm fine with that -- you're free to make changes and distribute altered versions with or without their source code. As long as my name is in the Help > About and the LGPL notice is included somewhere, you can go wild with it. ;) I also don't care where the copyright notice is; it could be a text file distributed with the program if you'd like.

    EDIT: Misread.. see my next reply
    can someone tell me what the error "Could not find the main class: E:\Torchtools\MiniEditor.jar. Program will exit." means???
    This often happens when the tool can't find a library that it depends on. The lib folder -- included in Torchtools_bin_a.049.zip -- needs to be next to the jar files in order for things to work. The extracted Torchtools folder should look like this:
    lib
    CheatWipe.jar
    HexHelper.jar
    MiniEditor.jar
    readme.txt
    version.txt

    Make sure your folder setup looks like this. Also, make sure there is a file inside the lib folder. Try double-clicking MiniEditor.jar, and let me know what happens.

    If the problem persists:
    What operating system are you running? What version of Java are you using? (Click here if you don't know)
    Torchtools - An open-source save editing toolset
    Rename characters & pets, transfer gold, change difficulty, etc.
  • my folder looks like what you say it should although the hex thing has a slightly different name.
    lib
    cheatwipe.jar
    hexhelper.jar
    minieditor.jar
    readme
    version

    No i have not made any changes to this at all.

    I have the latest Java installed since i made sure to download and install the latest version today. The OS is Microsoft Windows Vista Home Basic, Service Pack 2.

    EDIT:
    in the lib folder there is a file called swing-layout-1.0.3 and it is a .jar file.
  • GioGio Posts: 39
    I don't want to speak for TorchLeech, so don't take what I say as absolute truth here, but I believe that they were asking if you would write a program with the functionality they mentioned in their post. It seems like a nifty proposal if I'm right about that. ^^

    - Gio

    PS: I'm pretty sure TorchLeech is German or so, because they type with the same patterns as an exgirlfriend of mine from Bottrop, Germany. I could be imagining it, of course; it's not like typed words have aural accents. =/
  • mattdeslmattdesl Posts: 157
    edited January 2010
    I don't want to speak for TorchLeech, so don't take what I say as absolute truth here, but I believe that they were asking if you would write a program with the functionality they mentioned in their post. It seems like a nifty proposal if I'm right about that. ^^
    Ah! :lol:

    I'll see what I can do. Right now the API is programmed in Java, so any executable will ultimately need the JVM to run. Eventually, I hope to port the API to other languages. In the meantime, I will include some command-line functionality to the MiniEditor tool.

    EDIT:
    I'm thinking of using Python to create a small "svtdump.exe" command-line tool (no GUI). This would be more independent and more efficient for TorchLeech, since it won't rely on the JVM.
    Succubuzz wrote:
    my folder looks like what you say it should although the hex thing has a slightly different name.
    lib
    cheatwipe.jar
    hexhelper.jar
    minieditor.jar
    readme
    version

    No i have not made any changes to this at all.

    I have the latest Java installed since i made sure to download and install the latest version today. The OS is Microsoft Windows Vista Home Basic, Service Pack 2.

    EDIT:
    in the lib folder there is a file called swing-layout-1.0.3 and it is a .jar file.
    Interesting. Maybe you could try the following?
    1. Create a new text file in the Torchtools folder, name it "RunEditor.txt" or something
    2. Paste the following into the text file:
      java -Djava.ext.dirs=lib -jar MiniEditor.jar
      pause
      
    3. Save the file and rename it to "RunEditor.bat" to make it a batch file (if Vista is hiding file extensions, see here).
    4. Double-click the batch file to run the editor.

    To run the other tools: make a copy of the batch file, right-click the copy and select "Edit" to open it in Notepad, then replace MiniEditor.jar with the filename of the tool you'd like to run.

    Thanks! :) Let me know how it goes.
    Torchtools - An open-source save editing toolset
    Rename characters & pets, transfer gold, change difficulty, etc.
  • well it no longer gives me that error. when using that bat thing my PC says " 'Java' isnt recognized as an internal or external command, program or batchfile" so i guess i know now that the problem lies somewhere else :/
  • mattdesl wrote:
    You were asking about a command-line tool to dump SVT file info. Here's one I whipped up today that should give you that functionality. [...] The filesize is a tad large at the moment, I'll try to trim it down for the next version.
    Thanks a lot for your PythonTorchtools especially the command line tool. This could be a good solution for TorchlightArmory and its savegame upload section too. If you are changing the tool to reduce its size maybe you can take a look at the following part: I saw that the tool generates log files to the folder where the application itself is installed. Be sure to not get into trouble when you cann't write these files. Since Windows Vista the default user has no write permission to folders to special folders like "program files". I would like it if you can add a parameter for generating log files in the same way as for the output file, maybe
    -log .../logfile.txt
    -errorlog .../errorlogfile.txt
    
    This give us more control over where which files will be saved (we want to keep up clean with temporary files). If we add no log parameter there should be created none of them. Maybe you can take care of not writing empty files (like the 0 bytes errorlog atm) too - just cosmetics. But so far it looks great, just tried some simple tests with my own SVTs and the results are correct as far as i remember my characters.

    Are you going to support this python port with bugfixes and improved SVT parsing when you update your Torchtools in Java?
    TorchLeech - a free mod manager for Torchlight. --- powered by Runic Games Fansite.
  • mattdeslmattdesl Posts: 157
    Are you going to support this python port with bugfixes and improved SVT parsing when you update your Torchtools in Java?
    Yes, I'll try to.

    Cleaned up the source file a bit, trimmed down the size, packed it into a single .EXE file (no DLLs), and added a couple new parameters:
    -log logfile.txt
    		Creates a log file and redirects standard output to it.
    	-errlog errlogfile.txt
    		Creates an error log file and redirects error output to it.
    	-silent
    		Nothing will be printed to the console, and no log files will be created.
    

    Download v04:
    http://code.google.com/p/torchtools/dow ... fo_v04.zip

    I can trim it down even more, hopefully I'll have time to do that this week. Also, I'm using a different installer to build the EXE, so let me know if there are any problems.

    Soon I plan to add an XML format for output. :)
    well it no longer gives me that error. when using that bat thing my PC says " 'Java' isnt recognized as an internal or external command, program or batchfile" so i guess i know now that the problem lies somewhere else :/
    Odd. This means that it wasn't added to your environment variables. The first thing I'd suggest is to reinstall, but since you just did that... A quick fix (aside from changing environment variables) would be to replace the batch file I mentioned earlier with the following:
    "C:\Program Files\Java\jre1.6.0_03\bin\java.exe" -Djava.ext.dirs=lib -jar MiniEditor.jar
    pause
    

    Where the first path should point to your own Java version.

    I'll look into why this might be happening and get back to you on it.
    Torchtools - An open-source save editing toolset
    Rename characters & pets, transfer gold, change difficulty, etc.
  • <3
    TorchLeech - a free mod manager for Torchlight. --- powered by Runic Games Fansite.
  • mattdeslmattdesl Posts: 157
    Made some changes to the svtinfo.exe, adding XML support. However, it got a little larger than I expected, so I'm going to hold off on another release until I can trim it down.

    Also, made some changes to the MiniEditor:
    • Fixed a problem with files staying open when a new file is selected (thus not allowing you to properly rename certain files)
    • Changed the way in which the pet info is found, hopefully this is more reliable
    • Added a MiniEditor_debug.bat file. If you can't run it or are running into problems, try running debug mode (double-click the batch file).
    • If you're having trouble with save files, it may be due to problems reading pets. For now, you can disable pet reading by editing the contents of MiniEditor_debug.bat to:
      java -Djava.ext.dirs=lib -jar MiniEditor.jar -nopet
      pause
      

    Download Torchtools version Alpha 067
    http://code.google.com/p/torchtools/dow ... _a.067.zip

    This should clear up most of the problems with pets.


    EDIT: Also updated the first post with information about the Python port.
    Torchtools - An open-source save editing toolset
    Rename characters & pets, transfer gold, change difficulty, etc.
  • i tested the Mini Editor, and "Cheat Flag Removal" tool, both worked nicely with no errors.
    i see there is a difficulty change option, so why not add a ****/not **** option too?
  • mattdeslmattdesl Posts: 157
    Thanks for testing and feedback. :)

    I'll look into a **** option. I'm trying not to make MiniEditor a cheating tool, so if a **** option allows players to circumvent **** death, I won't add it. However, I'm planning on a "general purpose" editor that includes many more features than the MiniEditor (some of which might be considered cheats). At the moment, I'm just trying to ensure that the platform I'm working on is stable and reliable before diving into larger tools.
    Torchtools - An open-source save editing toolset
    Rename characters & pets, transfer gold, change difficulty, etc.
  • You can take a look at your svtinfo working with TLeech - version 1.4a released 10 minutes ago. Thanks for your support, we will continue to integrate your TorchTools.
    TorchLeech - a free mod manager for Torchlight. --- powered by Runic Games Fansite.
  • def7antdef7ant Posts: 155
    Could you possibly add a Level editing function?
    Running the Steam version, and console doesn't work. :(
  • DideroDidero Posts: 90
    def7ant wrote:
    Could you possibly add a Level editing function?
    Running the Steam version, and console doesn't work. :(
    I'm using the Steam version of Torchlight, and the console works fine for me.
    To enable the console, navigate to the Torchlight folder in the 'Application Data' folder (in Windows XP it's "C:\Documents and Settings\[username]\Application Data\runic games\torchlight"). There, open "settings.txt", and find the line "CONSOLE :0". Replace the zero by a one, and save the file. Make sure you don't change the encoding of the file though, otherwise the game will crash. If you edit the file with Windows' Notepad, I believe the file encoding stays the same.
    Or, in case you don't want to fiddle with all of this, TorchLeech can change Torchlight options too. Go to 'Extras'->'Torchlight Options...'. There's a checkbox 'Enable Console' there.
    Now the console should work in-game, even in the Steam version :)
    Creator of:
    -Total Respec mod (v2.0, Jan. 10 2010)
    -Faster Walking mod (v1.0, Nov. 11 2009)
    Uploader of:
    -Ferret Pet mod (ferret itself made by Runic) (v1.1.1, Jan. 4 2010)
  • def7antdef7ant Posts: 155
    Cool, thanks Didero. I'll try it out later..
  • Didero wrote:
    def7ant wrote:
    Could you possibly add a Level editing function?
    Running the Steam version, and console doesn't work. :(
    I'm using the Steam version of Torchlight, and the console works fine for me.
    To enable the console, navigate to the Torchlight folder in the 'Application Data' folder (in Windows XP it's "C:\Documents and Settings\[username]\Application Data\runic games\torchlight"). There, open "settings.txt", and find the line "CONSOLE :0". Replace the zero by a one, and save the file. Make sure you don't change the encoding of the file though, otherwise the game will crash. If you edit the file with Windows' Notepad, I believe the file encoding stays the same.
    Or, in case you don't want to fiddle with all of this, TorchLeech can change Torchlight options too. Go to 'Extras'->'Torchlight Options...'. There's a checkbox 'Enable Console' there.
    Now the console should work in-game, even in the Steam version :)
    Torchleech CAN enable console in STEAM version. tested too, as i bought it off steam.
  • mattdeslmattdesl Posts: 157
    You can take a look at your svtinfo working with TLeech - version 1.4a released 10 minutes ago. Thanks for your support, we will continue to integrate your TorchTools.
    Looks great! Thanks for integrating it with TorchLeech. :)
    def7ant wrote:
    Could you possibly add a Level editing function?
    Running the Steam version, and console doesn't work. :(
    Hey there. Level editing won't be added to MiniEditor because I'd rather not make it a "cheating" app.

    However, I'm currently working on a command-line tool that will allow you to edit your players more rigorously. At the cost of being somewhat less user-friendly (no GUI yet), it will allow for much more editing options than the MiniEditor. For example, you can unretire a character, change **** mode, change player fame/level, add extra skill/stat points, change gold, etc.

    Expect more updates soon.
    Torchtools - An open-source save editing toolset
    Rename characters & pets, transfer gold, change difficulty, etc.
  • DideroDidero Posts: 90
    Maybe I'm overlooking something, but is the sourcecode for SVTInfo in the SVN folder on Google Code too? All I could find were Java files, while I remember you saying you made SVTInfo in Python.
    I'm starting with Python myself, and I'm curious as to how you've made the program.
    Creator of:
    -Total Respec mod (v2.0, Jan. 10 2010)
    -Faster Walking mod (v1.0, Nov. 11 2009)
    Uploader of:
    -Ferret Pet mod (ferret itself made by Runic) (v1.1.1, Jan. 4 2010)
  • mattdeslmattdesl Posts: 157
    Didero wrote:
    Maybe I'm overlooking something, but is the sourcecode for SVTInfo in the SVN folder on Google Code too? All I could find were Java files, while I remember you saying you made SVTInfo in Python.
    I'm starting with Python myself, and I'm curious as to how you've made the program.
    Still haven't gotten around to uploading SVTInfo's source. Will do so sometime today.

    It's relatively easy to program, especially with Python. Just a matter of reading bytes and packing/unpacking them depending on their type (int, string, long, etc). Then, it's simply seeking to the proper point in the file (e.g. 4 bytes in for class name) and calling the right read() functions.

    EDIT: Source is up for Python port.
    http://torchtools.googlecode.com/svn/tr ... orchtools/
    Torchtools - An open-source save editing toolset
    Rename characters & pets, transfer gold, change difficulty, etc.
«1
Sign In or Register to comment.