-
Notifications
You must be signed in to change notification settings - Fork 0
MapCompiler
- User defined compile steps, with user defined custom working directories,
- Automatic game install paths from Steam, (for example locating Portal 2 on the hard drive),
- Automatic srctools_paths.vdf creation for postcompiler,
- Automatic search for maps based on the filename in user defined directories,
- Probably more lol.
The default configuration shipped in the release allows compiling maps from Portal 2's puzzlemaker onto P2CE and playing them on P2CE. Although sometimes this doesn't work perfectly (It's the way BEE2 handles it originaly which kind of makes it not 100% compatible with standard compile tools). Even with some issues, most puzzles should be working perfectly fine. It is especially useful when developing a mod with custom puzzle elements that use logic not available on base Portal 2.
For puzzlemaker map compile, download the zip and place the puzzlemaker folder into p2ce/custom, so it looks like: p2ce/custom/puzzlemaker. Hopefully everything should be set up and ready to compile the maps.
For a different usage, or different paths, here's the documentation:
This is a file that has a current configuration for the compile process. See the bundled file for reference too!
- This program uses the concept of
Path <var>sheavily. What are those? These are basically very simple variables that you can use when specifying a path, so for example instead of writingC:\Program Files\Steam\steamapps\common\Portal 2\somethingyou can write<Portal2>\something.- Also, both forward
/and backward\slashes work in all fields where you need to specify a path.- Some path vars are assigned automatically, but some you have to define yourself, check below for more information.
- You always need to have a slash after the ending bracket >, path vars don't include a bracket by default. Of course some path vars like
<mapfilename>are not bound by this rule most of times.- Special flags can also be specified that influence how the path vars are processed. Usage is
<pathvar>{flag}. This has to be right after the ending bracket >! Current list offlags:posix: Replaces all backward slashes with forward slashes. It also replaces double slashes with one.- There are also special path vars, currently:
<map>- This contains the whole path to the map file, excluding the filetype!<mapfilename>- This contains only the map filename, without the extension.
- Both
<map>and<mapfilename>are defined after the user specifies the map; you can only use them in the compile blocks (see below).
- Specify the name of the root folder that we are working in, most of time it will be the mod's name or
Portal 2 Community Edition <moddir>
- Specify a path to SteamPathProvider.exe.
- That program is also bundled with the release in s_cfg folder.
- This is an empty srctools_paths.vdf file, that the script uses to base on when generating the actual file.
- This is required as the filestructure may change, and due to a weird bug in the postcompiler, every comment in that file is always regenerated when called, potentially breaking things and overriding the data written by this program.
- This file is shipped in s_cfg folder.
- Where to write the srctools_paths.vdf file.
- Includes the filename and the extension.
- This entry is a list of blocks that contain configuration sent to SteamPathProvider.exe, and later then based on this various things happen.
{
"Reference": "Portal2",
"InPathsVDF": "portal2",
"AppID": 620
}Example block shown above.
-
Reference
- This sets a path var to be used later.
- The path var's name is exactly the argument passed to
Reference - Optional
-
InPathsVDF
- Srctools_paths.vdf file syntax looks like:
"name" "path", this is the name in that syntax. - Optional, if omitted the program will not write this path to the srctools_paths
- Srctools_paths.vdf file syntax looks like:
-
AppID
- Specifies the AppID (from Steam). This is used to get the installation path of that AppID
- Required
- Optional
- Tells the program to automatically search for maps in the specified directory and with specified filetype.
"PromptMap": {
"SearchIn": "<Portal2>/sdk_content/maps",
"Filetype": ".vmf"
}-
SearchIn
- Specifies the location where the maps should be searched.
-
Filetype
- Self explanatory, what filetype to use when searching.
-
The path syntax with PromptMap is
<SearchIn>/<user_defined_map>.<Filetype>- These are not real path vars, only shown here for demonstration!
-
user_defined_mapis the map filename inputed by the user when the program is running.
- This is a list where the actual compiler settings are, like programs called, arguments, etc.
- Sets a specific name referenced throughout this program. This doesn't affect the called executable or passed arguments in any way, it's entirely internal to this program only.
- Required
- Path field, sets the current working directory.
- Also sets
<cwd>path var that can be used in this block (but limited only to this block!) - CWD is not a global, meaning that you have to set it every compile block (does not apply to CopyFile, check below)
- CWD is required, but only if you are actually calling a program. If
CopyFileis specified in Call (explained below) it is not required.
- Path to the program that will be called.
- Required always.
- Can also be
CopyFile, this basically copies the file from one location to another. Special arguments apply.
- Source: Path field, specifies the location of the file to copy from.
- Destination: Path field, also self-explanatory, specify the destination of the file. You can also change it's name here.
- This is a list of strings, every string should be a separate argument, every argument parameter should also be separate, not in the same string.
- Every string in this list is processed by ResolvePathVar, meaning that you can use path vars here!
- Specifies the end location of the map file after this process finishes; basically
<map>will be set to this upon completion. <mapfilename>is especially useful here!- Should be used without the file extension.
- A boolean value, if set to true the program will not print the program's output to the console.
- Useful for running the game.
- Doesn't do anything with CopyFile.