Porting maps from one mod to another (Source)

From Valve Developer Community
Jump to: navigation, search
Under construction icon-blue.png
This is a draft page. It is a work in progress open to editing by anyone.
Remember to check for any notes left by the tagger at this article's talk page.

Using MapEdit

These files can be used to set console variables for specific levels and change the level's entity data without modifying the BSP file. These files are to be placed into the "maps" directory under Synergy, with the ".edt" extension. File Format

Note.pngNote:the following MapEdit file is not entirely valid. You must supply valid values for each key in your own file.

"" should be replaced with the actual name of the map this file is for.

""
{
	"console"
	{
		"sk_plr_dmg_crowbar" "500"
	}

	"entity"
	{
		"create" // this entry will create a new entity
		{
			"classname" "entityClassName"
			"origin" "0 0 0"

			"values"
			{
				"keyName" "keyValue"
			}
		}

		"delete" // this entry will Delete an existing entity
		{
			"classname" "entityClassName"
			"origin" "0 0 0"

			"targetname" "entityTargetName"
		}

		"edit" // This entry will Edit an existing entity
		{
			"classname" "entityClassName" 
			"origin" "0 0 0"

			"targetname" "entityTargetName"

			"values"
			{
				"keyName" "keyValue"
			}
		}
	}
}

Creating a mapEdit Config File

The "console" key group is used to set console variables that will affect the specific level only. Variables set in this manner, will be reset upon level change. You may put as many as you wish in here, however there should typically be no more than 10.

The "entity" key group is used to modify the entity data for the level. Each key within the "entity" group can either be "create", "delete" or "edit" - other names are not valid.

The "create" key will add a new entity to the level. You may insert a "values" key group within the "create" key to add additional keys. (For example, "target" "elevator_floor_1_call_button".)

The "delete" key will remove the entity you specify. This key type does not support the "values" key group.

The "edit" key will only modify existing keys for the specified entity. You can not add new keys with this method. You must use the "values" key group with the "edit" key to specify which entity data key to modify and the value.

To select entities to remove or edit, you may:

use "classname" alone
    to select ALL entities in the level with specified class.
use "classname" with "origin"
    to select entity of class at specified origin.
use "targetname" alone
    to select ALL entities with the specified name.
use "targetname" with "origin"
    to select entity with specified name at origin

NOTE: maximum number of keys you may put into the "values" key group is 64.

NOTE: these files are automatically downloaded to clients when they connect to a server running the map that uses this file. Enhanced EDT (EEDT) Beta

Enhanced EDT is a new fast and painless method of creating EDT files. Switching from hand editing text files, to using Source's level editor Hammer itself to perform the changes. How it works

EEDT works by comparing the difference between two map (.vmf) files and creating an EDT based on the difference between them.

EDT Map (mapname_edt.vmf): The modified vmf file that contains the changes you made to the map. Comparison Map (mapname.vmf): The unmodified vmf file that will be used to compare vs the EDT Map. Setting Up

First you need to have (or generate) the .vmf file of the map you wish to modify. We recommend the open source decompiler BSPSource.

After getting the original vmf file (or decompiling it from the mapname.bsp) you will now have your Comparison Map. We strongly recommend to make this file Read Only to avoid accidental changes to it. Now make a copy of that file and add _edt after the mapname so your copied map file will be mapname_edt.vmf.

NOTE: If you are using a decompiled map, the mapname will have a _d appended, this is fine and does not need to be changed. As long as the EDT Map ends in _edt

Now you should have two maps, one called mapname_d.vmf (Read Only) and mapname_d_edt.vmf (Your Changes). How To Use

Open up Hammer (../steamapps/Synergy/synergy/bin/hammer.exe) and open up your EDT Map (mapname_edt.vmf) file. At this point you may now make all of the modifications to the EDT Map (mapname_edt.vmf) you wish.

When you are ready to generate the EDT file, press F9 in Hammer to bring up the Run Map dialog. Click the EXPERT button and add -edt to the commandline so it looks like this: -edt -game $gamedir $path\$file Uncheck everything except for bsp_exe. (Do not run VVIS or VRAD). Now press Go! to begin the EDT creation process. Compling the EDT File

The compile log will show every entity that has been created, modified, and deleted. EDTs will be saved both next to the map file (.vmf) and in Synergy/synergy/maps. Other Features

You can now create rectangular prism shaped trigger_* entities as you normally would in hammer; no more dealing with finding model numbers.

Comments: Entering text in the comment box of a new entity you added in hammer will show above the entity in the EDT file. For editing an existing entity, a comment will show after each keyvalue you change displaying the previous value.

External links