This article relates to the game "Half-Life: Alyx". Click here for more information.
This article relates to the workshop tools for "Half-Life: Alyx". Click here for more information.
This article's documentation is for Source 2. Click here for more information.

Map Extensions

From Valve Developer Community
Jump to navigation Jump to search
English (en)Русский (ru)中文 (zh)Translate (Translate)

A Map Extension lets you add map content to an existing compiled map. For example, add new geometry to a map that ships with the game.

Creating a Map Extension-128485245.png

Limitations

Map Extensions have the following limitations:

  • It cannot modify anything in the parent map (Particularly: they cannot remove entities or affect baked lighting.)
  • Static objects in the extension map won't cast shadows from static lights in the parent map.
  • It can reference entities in the parent map via I/O, but must use the "final" fixed-up name rather than the Hammer name of the entity (use ent_text to find it).

Construction

First, create a new map in Hammer with File → New.

To have a good frame of reference, add a prefab that references an existing shipping map (find them in content/hlvr/maps/release/*)

Creating a Map Extension-128485222.png Creating a Map Extension-128485225.png


IMPORTANT STEP: Select the prefab, expand the Transform group and check Editor Only and Transform Locked.

Editor Only
Allows you to see the parent map in Hammer without compiling it into your map. If compiling your map takes a long time, you may have forgotten this!
Icon-Bug.pngBug:Prefabs flagged as editor only are still pre-processed by the compiler before they are discarded. This adds time to some very fast compiles (entities only, etc).  [todo tested in?]
Transform Locked
Improves editor performance and prevents you from accidentally offsetting your guide (and the rest of your map) from the parent map.

ObjectProperties flags EditorOnly TransformLocked.png Creating a Map Extension-128485235.png

Save and compile your map.

Creating a Map Extension-128485234.png

Restart the Workshop Tools and goto "edit addon info..." on the addon selection screen.

Creating a Map Extension-128485237.png



Link your parent/extension maps together.

(Ignore the Playable Maps section. It is for new, full featured maps only.)
Creating a Map Extension-128485239.png

Re-run the game, and load the parent map using the 'addon_tools_map' command in the console:

addon_tools_map a2_pistol

You should see your extension map loaded and overlaid on top of the original map:

Creating a Map Extension-128485245.png