Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: VMF2Map

  1. #1
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts

    VMF2Map

    I have been trying kung foo man's VMF to Map converter the last few days. I have been improving it a bit.

    Current improvements:
    I have added a form where you can select your VMF file to convert. And i have added a field where you can enter a name for your new file. After you click on 'convert' your file will be converted and downloaded.

    Further i have improved the material usage.

    Example:
    - TOOLS/TOOLSSKYBOX becomes sky_toujane.
    - TOOLS/TOOLSNODRAW becomes nodraw.
    - TOOLS/TOOLSPLAYERCLIP becomes clip_player.
    - TOOLS/TOOLSCLIP becomes clip.
    - TOOLS/TOOLSTRIGGER becomes trigger.
    - TOOLS/TOOLSSKIP becomes skip.
    - TOOLS/TOOLSHINT becomes hint.
    - TOOLS/TOOLSINVISIBLE becomes invisible. (doesn't exist)
    - TOOLS/TOOLSAREAPORTAL becomes portal_nodraw.
    - TOOLS/TOOLSBLOCKLIGHT becomes blocklight. (doesn't exist)
    etc.

    All unknown materials become caulk.

    Click image for larger version. 

Name:	result.png 
Views:	287 
Size:	880.2 KB 
ID:	81
    Attached Files Attached Files
    Last edited by Mitch; 20th November 2012 at 13:32.

  2. The Following 2 Users Say Thank You to Mitch For This Useful Post:

    ASAS1NS (20th November 2012),kung foo man (20th November 2012)

  3. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Wow, thats great

    Did you compared the textures, so they kinda look the same?

    The sourcecode with extension looks still really tidy.

    The only thing i dont like is the web-interface. The .VMF-files can be 20MB in size and i dont want to use a browser to upload+download the new map. Thats to much overhead.

    So i prefer PHP-CLI, just executing the vmf2map.php locally and it converts the .VMF in the same folder as the script. Like:

    Code:
    $map = convertVMF2Map("local.vmf");
    file_put_contents("new.map", $map);
    For people that want to see the original code: vmf.php

    Execute it using: http://windows.php.net/

    Just put the PHP-Folder into C:\ and add the folder to your enviroment-variable called PATH (Rightclick on Computer -> Settings).

    Then you can call the script with such a .bat-file:

    Code:
    php vmf2map.php
    pause
    If you dont want that PATH-variable, just write the full path of php:

    Code:
    C:\PHP\php.exe vmf2map.php
    pause
    Ok, now you may ask how to get a .vmf-File from a game like Counter Strike source, which just have .bsp-files? Use this java-decompiler: https://github.com/ata4/bspsrc/downloads

    The only annoying problem is, that the CoD2-Radiant only can handle around 3750 Brushes (if i remember correctly). Big Source-Engine-Maps got around 8000 Brushes... so the smaller maps are more interessting, till we found a way for more brushes in CoD2.
    timescale 0.01

  4. #3
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    I have extended and rewritten some Code (based on Mitch's Code, but removed the Web-Interface).

    Added:
    - Support for Triggers: they are now real Entities
    - Missing Textures generate a Warning (only printed once for each Texture)

    Want-List:
    - Add Spawnpoints
    - Auto-generated .gsc-File for Teleport/Push-Triggers

    Random-Idea:
    - If you want to add a matching Stock-Texture from CoD2 to the Convert-List, just open the decompiled .vmf-File in Hammer-Editor (start Source SDK in Steam). So you can also see, what a missing Default-Texture in Radiant was supposed to be.

    Download here: convert.php
    timescale 0.01

  5. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    The vmf2map-converter got awesome!

    Fullblown parsing now instead of explode'ing

    Exporting triggers, spawnpointsm, extended texture-name-converter. Have fun!

    Click image for larger version. 

Name:	vmf2map.png 
Views:	259 
Size:	368.2 KB 
ID:	87
    Attached Files Attached Files
    timescale 0.01

  6. #5
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Newest Converter:
    Attached Files Attached Files
    timescale 0.01

  7. #6
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Anybody ported some maps yet to CoD2?
    timescale 0.01

  8. #7
    ... connecting
    Join Date
    Jan 2014
    Posts
    7
    Thanks
    0
    Thanked 4 Times in 3 Posts
    Quote Originally Posted by kung foo man View Post
    Anybody ported some maps yet to CoD2?
    well i'm trying to port a map to codwaw instead of cod2. i'm porting the textures as well. so i'm wondering if it's possible not to replace the textures with cod2 ones and leave them as they are. i'm pretty experienced with php but i don't want to read the whole file just to make a small change. any ideas?

  9. #8
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    I don't really understand what you want/not want. Which file you don't want to read and why? When you are experienced in PHP, why don't you just fit the texture-conversion-table to WaW textures?
    timescale 0.01

  10. #9
    ... connecting
    Join Date
    Jan 2014
    Posts
    7
    Thanks
    0
    Thanked 4 Times in 3 Posts
    Quote Originally Posted by kung foo man View Post
    I don't really understand what you want/not want. Which file you don't want to read and why? When you are experienced in PHP, why don't you just fit the texture-conversion-table to WaW textures?
    i guess you're right. i should stop being lazy and find my way through it then. i have another question by the way. does it convert the patches as well?
    Last edited by johndoe; 8th February 2014 at 16:45.

  11. #10
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Yep, only brushes
    timescale 0.01

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •