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

Want to share your mod with the world? Feel free!

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

Postby mattdesl » Fri Jan 01, 2010 1:17 am

Image

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)
Image
Image

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


Example Output:
Code: Select all
#generated by svtinfo.exe v.02 on 2010-01-15 01:51
file = 1.svt
class = Destroyer
difficulty = Hard
hardcore = 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.
Spoiler: show
Tool: Hex Helper
A very simple Java tool to convert string/decimal values to hexidecimal and vice versa, very useful for hex editing.
Image

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.
Image

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:
Image

The name is actually:
Code: Select all
|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.
Image

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.
Last edited by mattdesl on Fri May 07, 2010 12:30 pm, edited 24 times in total.
mattdesl
 
Posts: 149
Joined: Wed Nov 25, 2009 11:21 am

Re: [Tool] Torchtools - Open Source Save Editing

Postby Professor » Fri Jan 01, 2010 9:45 am

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
User avatar
Professor
 
Posts: 38
Joined: Sun Dec 27, 2009 2:10 am
Location: Alaska

Re: [Tool] Torchtools - Open Source Save Editing

Postby Irbis » Fri Jan 01, 2010 9:50 am

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!"
User avatar
Irbis
 
Posts: 243
Joined: Mon Dec 14, 2009 7:57 am

Re: [Tool] Torchtools - Open Source Save Editing

Postby mattdesl » Fri Jan 01, 2010 11:02 am

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.
Code: Select all
|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.
Last edited by mattdesl on Wed Jan 20, 2010 1:29 pm, edited 1 time in total.
Torchtools - An open-source save editing toolset
Rename characters & pets, transfer gold, change difficulty, etc.
mattdesl
 
Posts: 149
Joined: Wed Nov 25, 2009 11:21 am

Re: [Tool] Torchtools - Open Source Save Editing

Postby Firvagor » Fri Jan 01, 2010 11:13 am

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.
User avatar
Firvagor
 
Posts: 72
Joined: Tue Nov 10, 2009 8:31 pm

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby freddy » Sat Jan 09, 2010 8:49 am

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
freddy
 
Posts: 312
Joined: Mon Nov 09, 2009 4:29 am

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby mattdesl » Sat Jan 09, 2010 12:29 pm

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.
Last edited by mattdesl on Sat Jan 09, 2010 7:34 pm, edited 1 time in total.
Torchtools - An open-source save editing toolset
Rename characters & pets, transfer gold, change difficulty, etc.
mattdesl
 
Posts: 149
Joined: Wed Nov 25, 2009 11:21 am

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby freddy » Sat Jan 09, 2010 5:40 pm

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
freddy
 
Posts: 312
Joined: Mon Nov 09, 2009 4:29 am

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby mattdesl » Sat Jan 09, 2010 7:33 pm

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.
mattdesl
 
Posts: 149
Joined: Wed Nov 25, 2009 11:21 am

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby freddy » Sun Jan 10, 2010 2:51 am

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
freddy
 
Posts: 312
Joined: Mon Nov 09, 2009 4:29 am

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby TorchLeech » Wed Jan 13, 2010 4:09 pm

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

Code: Select all
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

Code: Select all
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.
User avatar
TorchLeech
 
Posts: 427
Joined: Tue Nov 10, 2009 11:43 am

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby Succubuzz » Thu Jan 14, 2010 6:52 am

can someone tell me what the error "Could not find the main class: E:\Torchtools\MiniEditor.jar. Program will exit." means???
Succubuzz
 
Posts: 8
Joined: Wed Jan 13, 2010 3:57 pm

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby mattdesl » Thu Jan 14, 2010 11:01 am

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)
Last edited by mattdesl on Thu Jan 14, 2010 2:46 pm, edited 2 times in total.
Torchtools - An open-source save editing toolset
Rename characters & pets, transfer gold, change difficulty, etc.
mattdesl
 
Posts: 149
Joined: Wed Nov 25, 2009 11:21 am

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby Succubuzz » Thu Jan 14, 2010 11:50 am

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.
Succubuzz
 
Posts: 8
Joined: Wed Jan 13, 2010 3:57 pm

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby Gio » Thu Jan 14, 2010 12:05 pm

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. =/
User avatar
Gio
 
Posts: 36
Joined: Sun Dec 27, 2009 7:19 am

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby mattdesl » Thu Jan 14, 2010 2:42 pm

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:
    Code: Select all
    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.
Last edited by mattdesl on Thu Jan 14, 2010 3:08 pm, edited 2 times in total.
Torchtools - An open-source save editing toolset
Rename characters & pets, transfer gold, change difficulty, etc.
mattdesl
 
Posts: 149
Joined: Wed Nov 25, 2009 11:21 am

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby Succubuzz » Thu Jan 14, 2010 2:57 pm

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 :/
Succubuzz
 
Posts: 8
Joined: Wed Jan 13, 2010 3:57 pm

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby TorchLeech » Fri Jan 15, 2010 12:47 am

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

Code: Select all
-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.
User avatar
TorchLeech
 
Posts: 427
Joined: Tue Nov 10, 2009 11:43 am

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby mattdesl » Sat Jan 16, 2010 6:50 pm

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:
Code: Select all
   -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:

Code: Select all
"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.
mattdesl
 
Posts: 149
Joined: Wed Nov 25, 2009 11:21 am

Re: [Tool] Torchtools - Open Source Save Editing (01/04/10)

Postby TorchLeech » Sat Jan 16, 2010 8:11 pm

<3
TorchLeech - a free mod manager for Torchlight. --- powered by Runic Games Fansite.
User avatar
TorchLeech
 
Posts: 427
Joined: Tue Nov 10, 2009 11:43 am

Next

Return to Mod Showcase

Who is online

Users browsing this forum: No registered users and 2 guests