Skip to content

Installation

Radik edited this page Jan 14, 2025 · 12 revisions

Move the addons/godotvmf folder into the same folder of your project and activate it in your project settings.

Important

Possibly you'll have errors once you installed the plugin. Just restart the project.

GodotVMF - Material Sync - is a plugin that automatically converts all godot materials in target_folder into VMT/VTF. Don't turn it on if you don't need this feature. See more

Hammer configuration

  1. Download Source SDK Base 2013 Singleplayer

  2. Download Hammer++ and put all files into SteamFolder/steamapps/common/Source SDK Base 2013 Singleplayer/hl2/bin

  3. Download the blank mod folder and put everything inside your project

  4. Launch Hammer++ and configure it (Tools -> Options):

  • Game Executable Directory - path_to_your_project
  • Game Directory - path_to_your_project
  • Hammer VMF Directory - path_to_your_project/mapsrc - usually some Source Engine developers create mapsrc folder where sources of maps are placed
  • Prefab Directory - path_to_your_project/mapsrc/prefabs
  1. You're all set!

Config file

Before work with the plugin you can create in the root of the project a file vmf.config.json (it's not necessary actually).

Default config:

{
	"gameinfo_path": "res://",

	"import": {
		"scale": 0.02,
		"generate_collision": true,
		"generate_lightmap_uv2": true,
		"lightmap_texel_size": 0.4,
		"instances_folder": "res://instances",
		"entities_folder": "res://entities",
		"geometry_folder": "res://geometry",
		"use_navigation_mesh": true,
		"navigation_mesh_preset": "res://presets/navigation_mesh.tres",
		"entity_aliases": {
			"npc_ghost": "res://objects/npc_ghost/npc_ghost.tscn"
		}
	},

	"models": {
		"import": true,
		"lightmap_texel_size": 0.4,
		"target_folder": "res://"
	},

	"materials": {
		"import_mode": 1,
		"ignore": [
			"TOOLS/TOOLSNODRAW",
			"TOOLS/TOOLSSKYBOX",
			"TOOLS/TOOLSINVISIBLE"
		],
		"fallback_material": null,
		"default_texture_size": 512,
		"target_folder": "res://materials"
	}
}
  • gameinfo_path - The source mod path where resources placed to work with hammer.

  • import

    • scale - In case you need to convert Valve's metrics to yours.
    • generate_collision - If true then generates CollisionShape3D for imported geometry (except brush entities) by using trimesh shape.
    • generate_lightmap_uv2 - If true then generates UV2 to enable light baking.
    • lightmap_texel_size - Size of each texel in the lightmap for more precise light baking (use with caution, very low values can cause crash).
    • instances_folder - Path inside the project where imported instances be placed.
    • entities_folder - Path inside the project where importer will grab entities during import.
    • geometry_folder - Path where the importer will store any mesh or collision resource that is generated.
    • use_navigation_mesh - If true, then generates navigation mesh for the generated geometry
    • navigation_mesh_preset - Path to the NavigationMesh resource that will be used for generated navigation mesh instead of default settings
    • entity_aliases - In case you don't want to place some entities inside the entities folder you can use aliases
  • models

    • import - If true then importer will try to import models from the mod's folder.
    • lightmap_texel_size - If true then generates UV2 for static props for light baking (global default value, can be overridden by eponymous keyvalue in prop_static entity, which can be manually added using Add button in object properties).
    • target_folder - Path inside the project where imported models be placed. In default config it's root because all model paths in prop_static already have models folder specified
  • material

    • import_mode - The mode of importing materials
      • 0 - Use existing
      • 1 - Import directly from mod folder. Already imported materials will be ignored.
    • ignore - List of materials that should be ignored during import.
    • fallback_material - Path to the material *.tres that will be used as a fallback for ignored materials.
    • default_texture_size - The size of the texture that will be used in case of missing texture.
    • target_folder - Path inside the project where imported materials be placed.