How to extract/edit TL2 item files, V012 [With images]

kalamari157kalamari157 Posts: 377
edited February 2015 in General Modding
UPDATE: V012 of cienislaw's tools are out! Find them here

No longer used for Python. No point.

This will use cienislaw dat2txt and txt2dat .exe. You will need basic knowledge on how to work a computer through this tutorial.

I'd also appreciate if you try before asking.

I will also add /spoiler to images so you won't have chronic scroll-down-all-the-time.

Note: This is for version v012 (.EXE) of cienislaw's tools



Tools needed:
Download dat2txt_exe_012.rar
Torchlight 2 Extractor
~Optional~ fgaaghf's torch2packer.v3

Extract v012 somewhere where you will remember.

STEP 1: Torchlight 2 Extractor. Required Step.
Now, download, extract and run Torchlight 2 Extractor (Make sure you have it set to English and not Czech if you can't understand Czech.
XW8Fb.png
Click "Open File" near the top left and navigate to where your DATA.PAK file is in your TL2 directory is. For me it is C:\Program Files (x86)\Torchlight II\PAKS\
y9OUx.png
tFVfa.png

If you have Steam for TL2, it's more than likely going to be in C:\Program Files (x86)\Steam\steamapps\common\Torchlight II\PAKS

jFjZz.png

Set an extract path by clicking the wires near the top right. My extraction path is on my desktop.
EmVHR.png
YoNFh.png
Click save all. Give it some time, but you may run into some errors which is fine at the moment.
AsGSL.png
You will then have a MEDIA folder wherever you extracted it too with a bunch of .DAT files.
vciet.png

STEP 2-A: This spoiler is for extracting all of the .dat files in the MEDIA folder to .txt files.
First off, extract dat2txt_exe_012.rar anywhere you wish. I extracted mine to my downloads folder.

With v012, you can now drag and drop whole folders!
HOUX8.png

Or, still use the command line option:
Open up Command Prompt by pressing the windows button or clicking it, type in cmd. You may have to run as Admin. Type in
cd Wherever-your-dat2txt-folder-is
fsp34.png

Press enter.

Now, you can either type in
dat2txt.exe Wherever-Your-Media-Folder-is
Which will make a MEDIA folder in your dat2txt folder.
SFS4Z.png

Or type in:
dQgpm.png
Which will make a MEDIAA folder with all the .txt files on my desktop.
C3Uj7.png

Depending on the power of your PC, this will take about 7 minutes.

After it is done, go to whatever folder you dropped, or the MEDIAA folder and you will see A LOT of .txt files. About 16000.
XDa6s.png
You will see this if you dropped the folder. You will just see .txt files if you used the command line.

STEP 2-B: If you just want to extract one specific .txt from a .dat file, drag the .dat file into dat2txt.exe
j6DNt.png
WvdMa.png

CONGRATULATIONS! YOU HAVE SUCCESSFULLY EXTRACTED .DAT FILES TO .TXT FILES! WOO!
| How to extract/edit TL2 item files, V012 [With images] I am no longer active in the modding community. If you wish to take a project that I have made, besides the 'How to extract/edit TL2 item files', and change it as your own, you may do so.
«1345678

Comments

  • kalamari157kalamari157 Posts: 377
    edited October 2012
    Now this part is using txt2dat.exe


    Before we start this, create a folder somewhere easy like the C:\ drive. Name it anything. Mine is "Something" Now create another folder inside that named MEDIA. Like this: "C:\SOMETHING\MEDIA"
    For ease of creating more folders, hit the key CTRL+SHIFT+N in that order. Or, download this, extract, and place it in your C:\ drive so it looks like "C:\SOMETHING\MEDIA"

    ===========================================================================================================================================================================================================
    STEP 1: First thing, pick a .txt file you want to mess with. In this case for simplicity, I will be using a level 2 pistol.
    A3iCh.png
    Pistol in game before changes. I will be changing the speed.
    vvIQH.png
    The speed before the change. For every increment of 10 speed, in game it will be up by 0.08. Example: 100 speed in the .txt file is 0.80 speed in game.
    In this case, 70 speed is 0.56 speed in game.
    q5gBL.png
    Speed changed to 40 which should be 0.32
    9Uhdn.png
    ============================================================================================================================================================================================================

    STEP 2: Spoiler for Drag and drop.
    Drag and drop. Simple as that. Use txt2dat.exe.
    BmSdN.png
    You will know if it worked by the modified date.
    owLME.png

    You will also change the folders based on where the file is located. Example:
    ADD_COMBO_FIRE.DAT.txt would translate to
    MEDIA\AFFIXES\SKILLS\ADD_COMBO_FIRE.DAT
    
    And so on and so forth.

    You cannot just put the dat file in the \MEDIA\ folder and then pack or it will not work Example below.
    MN9LR.png

    STEP 3-A: This spoiler is for fgaaghf's torch2packer.
    First, download this.
    Extract it to somewhere and have the folder open in the backround. We will use this later.

    Do you have your .dat file in the correct place? Good. Make sure there are no .txt files in the folders when you plan to create the new DATA.PAK.
    Now bring forward the torchpacker window and have open the place where the SOMETHING folder is.
    Now, drag the SOMETHING folder, or whatever folder you named it, and drop it over the torch2packer.exe. It should pop up with a window saying extracted.
    The new DATA.PAK files are now named whatever your SOMETHING folder was called plus .DATA.PAK.
    Now copy both of those files into the PAKS directory of where your TL2 is and you are good to go!
    0R5O7.png

    STEP 3-B: This spoiler is for cienislaw's paktool. This works the same exact way that fgaaghf's packer does.
    First, download this.
    Extract it to somewhere and have the folder open in the backround. We will use this later.

    Do you have your .dat file in the correct place? Good. Make sure there are no .txt files in the folders when you plan to create the new DATA.PAK.
    Now bring forward the paktool window and have open the place where the SOMETHING folder is.
    Now, drag the SOMETHING folder, or whatever folder you named it, and drop it over the paktool.exe. It will flash a command prompt window.
    The new DATA.PAK files are now named whatever your SOMETHING folder was called plus .DATA.PAK.
    Now copy both of those files into the PAKS directory of where your TL2 is and you are good to go!
    0R5O7.png

    Now fire up TL2, go in game and spawn the item you modified or if it's your pack or stash check that.

    Awesome! It works!
    vvIQH.pngI5wpg.png

    Congratulations! You now have edited a txt file and converted it to .DAT and put in game!
    | How to extract/edit TL2 item files, V012 [With images] I am no longer active in the modding community. If you wish to take a project that I have made, besides the 'How to extract/edit TL2 item files', and change it as your own, you may do so.
  • thank you! very good post, very clear. you are awesome!
  • thank you! very good post, very clear. you are awesome!

    Thank you. From going to not knowing anything about Python to goofy work arounds that work, I feel accomplished.
    | How to extract/edit TL2 item files, V012 [With images] I am no longer active in the modding community. If you wish to take a project that I have made, besides the 'How to extract/edit TL2 item files', and change it as your own, you may do so.
  • im having an error message when i do this step: dat2txt.py WHERE-EVER-YOUR-MEDIA-FOLDER-IS NAME-OF-A-DIFFERENT-FOLDER-EXTRACT-SOMEWHERE

    im starting over to see if i did something wrong
  • im having an error message when i do this step: dat2txt.py WHERE-EVER-YOUR-MEDIA-FOLDER-IS NAME-OF-A-DIFFERENT-FOLDER-EXTRACT-SOMEWHERE

    im starting over to see if i did something wrong

    What is the error message? Also make sure you typed everything correctly.
    | How to extract/edit TL2 item files, V012 [With images] I am no longer active in the modding community. If you wish to take a project that I have made, besides the 'How to extract/edit TL2 item files', and change it as your own, you may do so.
  • FHlw8.png
    this is the message i get, i probably did something wrong somewhere.

    EDIT: oh wait i have to name a folder that doesn't exist yet? and it creates it?

    EDIT: yes seems to be working. i guess that was the problem
  • Fantastic. Yes, you can't have the folder already there. Glad you figured it out. :D
    | How to extract/edit TL2 item files, V012 [With images] I am no longer active in the modding community. If you wish to take a project that I have made, besides the 'How to extract/edit TL2 item files', and change it as your own, you may do so.
  • so far its working perfectly but i have a question, how do you go and do this step:

    txt2dat.py 23_09_2012.hash C:\Users\Kalamari\Desktop\MEDIA\AFFIXES\SKILLS\ADD_COMBO_FIRE.DAT.txt C:\SOMETHING\MEDIA\AFFIXES\SKILLS\ADD_COMBO_FIRE.DAT

    if the file name has a space in it?

    EDIT: lol once again i should have tried before asking, im sorry. putting "C:\etc\filename" worked
  • Don't worry, I always want to ask questions too. Again, awesome that you figured it out.
    | How to extract/edit TL2 item files, V012 [With images] I am no longer active in the modding community. If you wish to take a project that I have made, besides the 'How to extract/edit TL2 item files', and change it as your own, you may do so.
  • vuzDm.png

    worked like a charm! thanks
  • ZiddersZidders Posts: 14,342 ✭✭✭
    Awesome thread is awesome
    ItfooQF.png
  • Thanks a lot. Never donned on me that hasher wasn't the has file that the script was complaining about. =/
  • SalanSalan Posts: 2,642
    all the goodies we get to play with soon!
    Synergies Conversion mod: http://www.synergiesmod.com
    Elite monsters, Hero monsters, world bosses, rare dragons, rare trolls, three tiers of End Game Raids, Legendary Armor sets, NEW Legendary Weapons, 3 new classes, Mercenaries, and Angels!
    21971.png

    moty-250.png
  • from 007 you don't have to put hash file in command line. just make sure that it is in the same folder as all .PY files and when needed scripts will use it. you can force tools to use hash file you want by using --fhash=file_name.hash option.

    kalamari157 - please update part with hash file, because with 007 it won't work;-)
  • I am right now. Thanks for the update :)

    EDIT: Updated the posts. Should account for V006 and V007 uses.
    | How to extract/edit TL2 item files, V012 [With images] I am no longer active in the modding community. If you wish to take a project that I have made, besides the 'How to extract/edit TL2 item files', and change it as your own, you may do so.
  • only TXT2DAT uses hash file, DAT2TXT has no need for it.
  • Got it. Should be properly fixed now.
    | How to extract/edit TL2 item files, V012 [With images] I am no longer active in the modding community. If you wish to take a project that I have made, besides the 'How to extract/edit TL2 item files', and change it as your own, you may do so.
  • PhanjamPhanjam Posts: 3,297 ✭✭✭
    Fantastic work Kalamari157! The modding community owes you a debt of gratitude!
    Torchmodders
    Torchlight 1 Class Pack (TL1CP) Mod for TL2: Steam | RGF
  • sorry for noob question but when i try to extract the text media folder through the use of cmd it asks me what program to use to do the command. i tried to use python.exe but that didnt work so now im stumped and you didnt mention anything like this in the guide.
    for clarification this step: dat2txt.py WHERE-EVER-YOUR-MEDIA-FOLDER-IS NAME-OF-A-DIFFERENT-FOLDER-EXTRACT-SOMEWHERE
    i input where the folder is, i output a different folder name. and it asks which program i want it to use to complete the command :S
    please help

    edit: it asks me what program i want to use to open "dat2txt.py"
  • Show me what you enter from the time you open command prompt to when it gives you the error.
    | How to extract/edit TL2 item files, V012 [With images] I am no longer active in the modding community. If you wish to take a project that I have made, besides the 'How to extract/edit TL2 item files', and change it as your own, you may do so.
  • ArionicArionic Posts: 110
    SO, just wondering. Is it possible to copy a previous item from the files and rename it to make something new, without over writing the old files? If thats the case, I could begin to create custom items immediately.
  • I can't do drag and drop for some reason. What should I do?

    I have Win. 7 64 bit if that means something.
  • Arionic wrote:
    SO, just wondering. Is it possible to copy a previous item from the files and rename it to make something new, without over writing the old files? If thats the case, I could begin to create custom items immediately.
    it is, but to don't overwrite anything (its not only about name) you have do some things. please search forum for 'how to add/create new item' in Torchlight 1 modding section.
  • Calaminh wrote:
    I can't do drag and drop for some reason. What should I do?

    I have Win. 7 64 bit if that means something.

    Have you installed everything correctly and v007 or v008?
    | How to extract/edit TL2 item files, V012 [With images] I am no longer active in the modding community. If you wish to take a project that I have made, besides the 'How to extract/edit TL2 item files', and change it as your own, you may do so.
  • qianqian Posts: 290
    thanks for the guide
    very detailed
    BrianW wrote:
    Well, you can do full respec if you really want to. Create a mule character, spawn a [LINK DELETED] from the console and put it in your shared stash. Your target character should be able to use it without a problem.

    Thanks
  • PaulTMPaulTM Posts: 472
    Sir when I install the Py win 32 extension this Error appears:

    Copied pythoncom27.dll to C:\Windows\system32\pythoncom27.dll

    Copied pythoncomloader27.dll to C:\Windows\system32\pythoncomloader27.dll

    Copied pywintypes27.dll to C:\Windows\system32\pywintypes27.dll

    Registered: Python.Interpreter

    Registered: Python.Dictionary

    Registered: Python

    -> Software\Python\PythonCore\2.7\Help[None]=None

    -> Software\Python\PythonCore\2.7\Help\Pythonwin Reference[None]='C:\\Python27\\Lib\\site-packages\\PyWin32.chm'

    Failed to register pythonwin as editor

    Shortcut for Pythonwin created

    Shortcut to documentation created

    The pywin32 extensions were successfully installed.

    Traceback (most recent call last):

    File "<string>", line 409, in install

    File "<string>", line 219, in RegisterPythonwin

    WindowsError: [Error 5] Access is denied

    I cannot convert the DAT to Text using the method you posted.... After following every instructions and installations... my pc wont even recognize the .py files( so I cant use DAT2TXT) Please help!
    Check out my MODS:

    Tartarus EX (wip)
  • Access Denied probably means your account isn't allowing to write to that folder. Try running as admin and see if that fixes things up.

    EDIT: I used this so that I can make any files ownership of me which means full control.
    | How to extract/edit TL2 item files, V012 [With images] I am no longer active in the modding community. If you wish to take a project that I have made, besides the 'How to extract/edit TL2 item files', and change it as your own, you may do so.
  • PaulTMPaulTM Posts: 472
    I tried using the script but nothing happens.... I
    I am the admin of my computer,,,, I even tried using RUN AS ADMINISTRATOR but I got a new error:

    Traceback (most recent call last):

    File "<string>", line 409, in install

    File "<string>", line 219, in RegisterPythonwin

    WindowsError: [Error 5] Access is denied

    close failed in file object destructor:
    sys.excepthook is missing
    lost sys.stderr
    Check out my MODS:

    Tartarus EX (wip)
  • Weird. Something is not allowing you do go through with it. Hmmm. I guess try un-install re-install and run those as admin.

    And are you using the secret admin account found on Vista/7 (if you are using those OS') or the basic admin account when you set-up windows? Basic admin account doesn't have full complete control.
    | How to extract/edit TL2 item files, V012 [With images] I am no longer active in the modding community. If you wish to take a project that I have made, besides the 'How to extract/edit TL2 item files', and change it as your own, you may do so.
«1345678
Sign In or Register to comment.