Converting old maps to "modern hammer"

Discussion in 'Mapping Questions & Discussion' started by YOYOYO, Jan 9, 2018.

  1. YOYOYO

    YOYOYO L6: Sharp Member

    Messages:
    399
    Positive Ratings:
    218
    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.
     
  2. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,851
    Positive Ratings:
    4,851
    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
     
    • Thanks Thanks x 1
    • Agree Agree x 1
  3. YOYOYO

    YOYOYO L6: Sharp Member

    Messages:
    399
    Positive Ratings:
    218
    How do I do that? Do I make a download forum?
     
  4. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    721
    Positive Ratings:
    495
    Nah, just attach it to your next post in this thread using the "upload a file" button.
     
    • Thanks Thanks x 1
    • Agree Agree x 1
  5. henke37

    aa henke37

    Messages:
    1,890
    Positive Ratings:
    443
    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.
     
    • Agree Agree x 3
    • Thanks Thanks x 1
  6. YOYOYO

    YOYOYO L6: Sharp Member

    Messages:
    399
    Positive Ratings:
    218
    Thanks guys, well, here's the broken vmf, tell me how I screwed up! :)
     

    Attached Files:

  7. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    721
    Positive Ratings:
    495
    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:
     
  8. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,219
    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.
     
    • Thanks Thanks x 1
  9. Coding Ethan

    Coding Ethan L69: Deviant Member

    Messages:
    69
    Positive Ratings:
    52
    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
    [​IMG]
     
    • Thanks Thanks x 1
    • Like Like x 1
    Last edited: Jan 11, 2018
  10. YOYOYO

    YOYOYO L6: Sharp Member

    Messages:
    399
    Positive Ratings:
    218
    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 :\
     
  11. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    721
    Positive Ratings:
    495
    Tools > Snap Selected to Grid
     
  12. YOYOYO

    YOYOYO L6: Sharp Member

    Messages:
    399
    Positive Ratings:
    218
    If this works, I'm probably a noob, and your Jesus. Sorry if that's not you religion.
     
  13. YOYOYO

    YOYOYO L6: Sharp Member

    Messages:
    399
    Positive Ratings:
    218
    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.
     
  14. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    721
    Positive Ratings:
    495
    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.
     
    • Thanks Thanks x 1
  15. YOYOYO

    YOYOYO L6: Sharp Member

    Messages:
    399
    Positive Ratings:
    218
    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.
     
  16. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    721
    Positive Ratings:
    495
    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.
     
  17. Another Bad Pun

    Server Staff Another Bad Pun over my dead body

    Messages:
    583
    Positive Ratings:
    1,200
    You could always try deleting hammer.exe or the /bin folder and then validating files. Should replace your stuff with brand new, working files.
     
  18. Coding Ethan

    Coding Ethan L69: Deviant Member

    Messages:
    69
    Positive Ratings:
    52
    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
     

    Attached Files:

    • Thanks Thanks x 1
    • Like Like x 1
  19. YOYOYO

    YOYOYO L6: Sharp Member

    Messages:
    399
    Positive Ratings:
    218
    You actually made it? That's cool.
     
    • Agree Agree x 1
  20. YOYOYO

    YOYOYO L6: Sharp Member

    Messages:
    399
    Positive Ratings:
    218
    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.
     
Tags: