[Tutorial] Editing Valve's 7.5 format .VTF files

Avatar
ChickenMobile
2,460 Posts
Posted Jun 08, 2011
At the moment there is no way that I know of to open a VTF within the Portal VPK as they are currently a new VTF format (version 7.5). When I try to open them in VTFedit it says:

Error loading VTF texture:

Error:
File version 7.5 does not match 7.0 to 7.4

Here is how to open and edit one:

  • Using GFCScape (or a similar program) extract the materials you want out of the Pak01_dir.vpk- Open your texture in a Hex editor (you can find some free ones on the net. A good example is PspPad)- We want to edit the number 05 in the first line into 04 so then your VTF editing program can read the file. The number should be in the 8th hex digit value.

E.G. So you change:img
Into:
img

DO NOT SAVE OVER VALVE'S ORIGINAL FILE IN THE VPK. CREATE A SEPARATE FILE UNDER A DIFFERENT NAME.- Edit to your hearts' content.
Until VTFedit and different plugins are updated this will be the only method to edit custom textures (other than using Valve's console texture convertor).

Advertisement
Registered users don’t see ads! Register now!
Avatar
WinstonSmith
940 Posts
Posted Jun 08, 2011
Replied 4 hours later
This is great...

...except the newest versions of VTFEdit and the PDN VTF plugin can open, edit, and save VTF 7.5 files.

Avatar
walropodes
39 Posts
Posted Jun 08, 2011
Replied 2 hours later

Yeah, Nem's site is confusing. Grab a copy of the latest VTFEdit here:

http://nemesis.thewavelength.net/index.php?c=238#p238

Avatar
ChickenMobile
2,460 Posts
Posted Jun 09, 2011
Replied 17 hours later

walropodes wrote:
Yeah, Nem's site is confusing. Grab a copy of the latest VTFEdit here.

I downloaded the newest version a day ago and it didn't work. Gosh I feel stupid now :S

Avatar
msleeper
4,136 Posts
Admin
Posted Jun 09, 2011
Replied 6 hours later
:lol:
Avatar
Discofix
7 Posts
Posted Jun 01, 2013
Replied 1 year later
You saved my Year!

For those who are as lazy as :snooze: and have problems with Nems newest version: I whipped a program together, which does the Binary work stuff.

Donload: #### ChickenMobile did not approve of my program.
VTFer.exe

Enjoy.

Edit: It reqires Microsoft .Net Framework 4

Avatar
ChickenMobile
2,460 Posts
Posted Jun 02, 2013
Replied 20 hours later

Discofix wrote:
You saved my Year!

For those who are as lazy as :snooze: and have problems with Nems newest version: I whipped a program together, which does the Binary work stuff.

Download:
VTFer.exe

Enjoy.

Edit: It reqires Microsoft .Net Framework 4

I don't like the look of this post. People don't download the link.

Avatar
PortalCombat
306 Posts
Posted Jun 02, 2013
Replied 1 hour later

ChickenMobile wrote:
I don't like the look of this post. People don't download the link.

Well... new user with only one post and a link to a extern file-hoster for a .exe :lol:

I checked it with virustotal.com:

https://www.virustotal.com/de/file/6f5f ... 370167217/

Analysis and File details are looking normal and code size is in range for such a small prog.

Avatar
josepezdj
2,386 Posts
Posted Jun 03, 2013
Replied 22 hours later
Hehe... curious thing... At first this guy/gal seemed so newbie that Chicken saved his/her with a simple hexing of a file... and suddenly he/she is a coder and make his/her own little app to simplify this task? :lol:

Also, I read the post yesterday and it didn't include the link...

Anyways, no viruses/malware/spyware with Smart Security 6.0 and Avast 8.0.... Hmmm... maybe other kind of dangerous thinghie?

Avatar
FelixGriffin
2,680 Posts
Posted Jun 03, 2013
Replied 4 hours later
I'll try to decompile it, but Discofix, if you read this, could you post your source?
Avatar
Haggis
158 Posts
Posted Aug 04, 2013
Replied 2 months later
When i install the newest version i get this error The application has failed to start because its side by side configuration is incorrect, how do i solve this problem.
Avatar
josepezdj
2,386 Posts
Posted Aug 04, 2013
Replied 10 minutes later
Hey Haggis! You might want to take a look into this other thread with the same issue... it's related to the versions of MS Visual C++ 2005 Service Pack you have installed.
Avatar
Haggis
158 Posts
Posted Aug 04, 2013
Replied 19 minutes later
Thanks Jose, i have installed a few runtimes, but it is still not working. If i uninstall and put an older version of vtfedit in, it works, but when i install the latest version of vtfedit, i get this error.
Avatar
User
630 Posts
Posted Aug 18, 2013
Replied 14 days later
I resettet my computer, reinstalled vtfedit, and i have the same issue like haggis.
The old version of vtfedit works, but when the version error shows up. And the latest version just dont start (Side by side problem). I also installed the visual c++ service pack (64 bit). Still doesnt work :/

EDIT: Finally Works. @Haggis If you have a 64 bit system, just download the archived version of vtfedit and run the 32 bit .exe (x86)

Avatar
Discofix
7 Posts
Posted Aug 24, 2013
Replied 5 days later
Sorry, that I didn't answer quickly.
I don't quite know if how I can prove it is safe.At least here is the Source-code and if anyone wants the C# Project, send me a PM. I know I should have used the simple URL method.
Code
||using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
bool did = false;

    private void Form1_Load(object sender, EventArgs e)
    {
        if (MessageBox.Show("The User (you) is responsable for any corrupted, damaged or lost data.\r\nThe Creator of this Program is NOT responsable for any corrupted, damaged or lost data.\r\nDo you accept?\r\nTIPP: Always make backups!", "Terms of Servive", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
        {
            MessageBox.Show("\r\n\r\nBecause you didn't accept, I may not give you access to this program :sad:\r\n\r\n", "No Access...", MessageBoxButtons.OK, MessageBoxIcon.Error);
            Application.Exit();
        }
        else
        {
            this.AllowDrop = true;
            this.DragEnter += new DragEventHandler(Form1_DragEnter);
            this.DragDrop += new DragEventHandler(Form1_DragDrop);
        }
    }

    void Form1_DragEnter(object sender, DragEventArgs e)
    {

        if (e.Data.GetDataPresent(DataFormats.FileDrop))
        {
            e.Effect = DragDropEffects.Copy;
            did = false;
            lbs.Items.Clear();
            lba.Items.Clear();
            lbe.Items.Clear();
            TopMost = true;
            Activate();
        }
        else
            e.Effect = DragDropEffects.None;
    }

    private void Form1_DragDrop(object sender, DragEventArgs e)
    {
        int i = 0;

        string[] fileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);

        if (!did)
        {
            while (i < fileList.Length)
            {
                byte[] text = File.ReadAllBytes(fileList*);

                switch (text[8])
                {
                    case 5:
                        text[8] = 4;
                        File.WriteAllBytes(fileList*, text);
                        lbs.Items.Add(fileList*);
                        break;

                    case 4:
                        lba.Items.Add(fileList*);
                        break;

                    default:
                        lbe.Items.Add(fileList*);
                        break;
                }

                i++;
            }
            MessageBox.Show("Finished", "Finished Converting!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            TopMost = false;
            did = true;
        }
    }
}

}||

Avatar
FelixGriffin
2,680 Posts
Posted Aug 24, 2013
Replied 5 hours later
The code looks safe to me, although I'm not really a C# programmer. And the file size of the executable seems right for that code.
Advertisement
Registered users don’t see ads! Register now!
Avatar
Discofix
7 Posts
Posted Aug 30, 2013
Replied 5 days later
I know, I should have read the Externalfilerules FIRST. :notwant:
Sorry for that.
Only that I don't find a good catagory.