Converting old maps to "modern hammer"

  • Site Migration: See bugs? Report them here. Want something changed or have an idea? Suggest it here.

YOYOYO

15 crashes and counting
aa
Jul 10, 2017
552
433
OK, So. I got a new computer after my last too... past away? Anyway I was bringing the maps I've been working on back, but after a bit, instead of opening the certain map "cp_cattle_a1" it just showed the error "(position of the map) , line 1: unexpected symbol '{'

I've been told this is because I was using an older hammer when I started the map, but now with the new hammer, It won't work.

Help please, I've dedicated way too much of my life into control point cattle.
 

Freyja

aa
Jul 31, 2009
2,942
5,524
Hammer for TF2 hasn't changed in terms of VMF structure for like 9 years. That's not the problem, your map sounds like it's corrupt. How to fix that could be anything, so please post your VMF
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,341
917
How do I do that? Do I make a download forum?
Nah, just attach it to your next post in this thread using the "upload a file" button.
 

henke37

aa
Sep 23, 2011
2,075
509
How do I do that? Do I make a download forum?
Making an entire forum is way overkill. If you wanted to, you'd just upload the file on your own website. But yeah, just attach it to this thread instead, simpler for everyone that way.
 

YOYOYO

15 crashes and counting
aa
Jul 10, 2017
552
433
Thanks guys, well, here's the broken vmf, tell me how I screwed up! :)
 

Attachments

  • cp_cattle_a1.vmf
    309 KB · Views: 56

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,341
917
I opened YOYOYO's VMF in Notepad++ alongside one of my own working VMF files, and there are some distinct differences. Here's the first 50 lines of YOYOYO's VMF alongside the VMF for cp_cathedral_a4:
Code:
{
"classname" "worldspawn"
"detailmaterial" "detail/detailsprites_2fort"
"detailvbsp" "detail_2fort.vbsp"
"maxpropscreenwidth" "-1"
"skyname" "sky_tf2_04"
"mapversion" "360"
{
( -256 128 -48 ) ( 192 128 -48 ) ( 192 -256 -48 ) DEV/REFLECTIVITY_50B [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 0.25 0.25 
( -256 -256 -64 ) ( 192 -256 -64 ) ( 192 128 -64 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 0.25 0.25 
( -256 128 -48 ) ( -256 -256 -48 ) ( -256 -256 -64 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( 192 128 -64 ) ( 192 -256 -64 ) ( 192 -256 -48 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( 192 128 -48 ) ( -256 128 -48 ) ( -256 128 -64 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( 192 -256 -64 ) ( -256 -256 -64 ) ( -256 -256 -48 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
}
{
( -256 320 -48 ) ( 192 320 -48 ) ( 192 128 -48 ) DEV/REFLECTIVITY_70B [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 0.25 0.25 
( -256 128 -64 ) ( 192 128 -64 ) ( 192 320 -64 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 0.25 0.25 
( -256 320 -48 ) ( -256 128 -48 ) ( -256 128 -64 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( 192 320 -64 ) ( 192 128 -64 ) ( 192 128 -48 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( 192 320 -48 ) ( -256 320 -48 ) ( -256 320 -64 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( 192 128 -64 ) ( -256 128 -64 ) ( -256 128 -48 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
}
{
( 192 624 -48 ) ( 384 624 -48 ) ( 384 -256 -48 ) DEV/REFLECTIVITY_70B [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 0.25 0.25 
( 192 -256 -64 ) ( 384 -256 -64 ) ( 384 624 -64 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 0.25 0.25 
( 192 624 -64 ) ( 192 624 -48 ) ( 192 -256 -48 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( 384 -256 -64 ) ( 384 -256 -48 ) ( 384 624 -48 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( 384 624 -64 ) ( 384 624 -48 ) ( 192 624 -48 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( 192 -256 -64 ) ( 192 -256 -48 ) ( 384 -256 -48 ) CUSTOMDEV/DEV_MEASUREGENERIC01BLU [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
}
{
( 384 -256 128 ) ( 384 640 128 ) ( 400 640 128 ) DEV/REFLECTIVITY_40B [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 0.25 0.25 
( 384 640 -64 ) ( 384 -256 -64 ) ( 400 -256 -64 ) DEV/REFLECTIVITY_40B [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 0.25 0.25 
( 384 -256 -64 ) ( 384 640 -64 ) ( 384 640 128 ) DEV/REFLECTIVITY_40B [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( 400 640 -64 ) ( 400 -256 -64 ) ( 400 -256 128 ) DEV/REFLECTIVITY_40B [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( 384 640 -64 ) ( 400 640 -64 ) ( 400 640 128 ) DEV/REFLECTIVITY_40B [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( 400 -256 -64 ) ( 384 -256 -64 ) ( 384 -256 128 ) DEV/REFLECTIVITY_40B [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
}
{
( -272 -256 128 ) ( -272 320 128 ) ( -256 320 128 ) DEV/REFLECTIVITY_40B [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 0.25 0.25 
( -272 320 -64 ) ( -272 -256 -64 ) ( -256 -256 -64 ) DEV/REFLECTIVITY_40B [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 0.25 0.25 
( -272 -256 -64 ) ( -272 320 -64 ) ( -272 320 128 ) DEV/REFLECTIVITY_40B [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( -256 320 -64 ) ( -256 -256 -64 ) ( -256 -256 128 ) DEV/REFLECTIVITY_40B [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( -272 320 -64 ) ( -256 320 -64 ) ( -256 320 128 ) DEV/REFLECTIVITY_40B [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
( -256 -256 -64 ) ( -272 -256 -64 ) ( -272 -256 128 ) DEV/REFLECTIVITY_40B [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 0.25 0.25 
}
{
( -272 -272 128 ) ( -272 -256 128 ) ( 400 -256 128 ) DEV/REFLECTIVITY_40B [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 0.25 0.25 
( -272 -256 -64 ) ( -272 -272 -64 ) ( 400 -272 -64 ) DEV/REFLECTIVITY_40B [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 0.25 0.25
cp_cathedral_a4 said:
Code:
versioninfo
{
    "editorversion" "400"
    "editorbuild" "7650"
    "mapversion" "548"
    "formatversion" "100"
    "prefab" "0"
}
visgroups
{
}
viewsettings
{
    "bSnapToGrid" "1"
    "bShowGrid" "1"
    "bShowLogicalGrid" "0"
    "nGridSpacing" "16"
    "bShow3DGrid" "0"
}
world
{
    "id" "1"
    "mapversion" "548"
    "classname" "worldspawn"
    "detailmaterial" "detail/detailsprites_trainyard"
    "detailvbsp" "detail_trainyard.vbsp"
    "maxpropscreenwidth" "-1"
    "skyname" "sky_granary_01"
    solid
    {
        "id" "104"
        side
        {
            "id" "126"
            "plane" "(192 -128 -48) (32 -128 -128) (0 -128 -128)"
            "material" "TOOLS/TOOLSCLIP"
            "uaxis" "[1 0 0 0] 0.25"
            "vaxis" "[0 0 -1 0] 0.25"
            "rotation" "0"
            "lightmapscale" "16"
            "smoothing_groups" "0"
        }
        side
        {
            "id" "125"
            "plane" "(32 128 -128) (192 128 -48) (192 128 -32)"
            "material" "TOOLS/TOOLSCLIP"
            "uaxis" "[1 0 0 0] 0.25"
            "vaxis" "[0 0 -1 0] 0.25"
            "rotation" "0"
 

Pocket

Naylte ven, naylte yen.
aa
Nov 14, 2009
4,652
2,479
So it sounds like you at least need to add
Code:
world
to the beginning of the file. That other stuff looks like it might be optional, and/or get added automatically when you open the file.
 

Coding Ethan

L2: Junior Member
Oct 12, 2014
94
89
So it sounds like you at least need to add
Code:
world
to the beginning of the file. That other stuff looks like it might be optional, and/or get added automatically when you open the file.
kinda looks that way, but some other info seems to be missing also, gonna try write a script to make it more closer to a 'new' vmf.
EDIT1: Got brushes working
jIi0vuR.png
 
Last edited:

YOYOYO

15 crashes and counting
aa
Jul 10, 2017
552
433
OK, just an update, I have tried decompiling bsp to vmf, and it worked... sorta. So It finally opened, but half of it was off the grid, and I couldn't drag it back. So I just cried myself to sleep :\
 

YOYOYO

15 crashes and counting
aa
Jul 10, 2017
552
433
Jesus Christ this is a mess.
OK, so, now the decompiled version doesn't work, but It has the same error about the code having the unnecessary { symbol. I think it has something to do with the code, So Spud lord, how did you open it with notepad?

Also for some reason the other maps still work.
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,341
917
On Windows, right-click on the VMF and you should see an "open with" option. You'll be presented with a list of apps, select Notepad.
 

YOYOYO

15 crashes and counting
aa
Jul 10, 2017
552
433
Didn't work. Not sure if its a map anymore, how much I gone deep into and changed stuff. I don't wanna restart my project.

So what I did was go into the code and delete whatever it says was "unexpected" or whatever TF. So I changed it, and It just said a different one was wrong. I don't know what happened to messed it up so much. I opened it on my new computer, and tried to change all the options, like turning the default entity to prop_static.
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,341
917
Well yes, characters like { and others are used for syntax formatting in the VMF format. They're usually used to mark the start or end of a large block of data, such as a brush. When it says it didn't expect one of those characters, it means there is one specific instance somewhere in the VMF where Hammer found that character but wasn't expecting one, which confused Hammer and prevented Hammer from reading and opening the file. Going through and deleting every instance of that character would have created more problems than it would have fixed, as now Hammer wouldn't have had those brackets marking where a block of data starts or ends.

At this point your best solution is to see what CodingEthan managed to do above. It would appear he got your brushwork back at least, so at most all you have to do is reconstruct your entities and game logic- hopefully not too difficult if you were using prefabs.

Good luck.
 

Another Bad Pun

In the shadows, he saw four eyes lit by fire
aa
Jan 15, 2011
782
1,767
You could always try deleting hammer.exe or the /bin folder and then validating files. Should replace your stuff with brand new, working files.
 

Coding Ethan

L2: Junior Member
Oct 12, 2014
94
89
I got brushes, brush entities and entities working, some stuff seems missing like entity I/O, can't find it at all in the old/broken vmf.
Made a simple tool for people to use in the future if they get odd vmf files like this too: Github Link
 

Attachments

  • cp_cattle_a1_fix.vmf
    659.8 KB · Views: 44

YOYOYO

15 crashes and counting
aa
Jul 10, 2017
552
433
You could always try deleting hammer.exe or the /bin folder and then validating files. Should replace your stuff with brand new, working files.
Already tried that, and also, so Ethan, it works pretty well, and I thank you for the work you've put into this, but once again its all off the grid. The tool thing spud suggested doesn't work if you can select everything. Which I can't for some reason.