PuzzleMaker to P2CE compiler script #1242
Closed
TheEnderek0
started this conversation in
Resources
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Download
Download here
Download the source code in .zip or tar.gz
Overview
This script means to automate compiling maps exported from puzzlemaker to P2CE and run them. It's not meant for publishing the puzzles! It's meant for mods to more easily design puzzles, using P2CE specific entities, code etc.
For example let's say you would like to use Adhesion Gel in the puzzlemaker, now you can do that!
Caveats
As I mentioned before this script is not meant for puzzles that are going to be published on workshop.
Why is that? Well, this script doesn't exactly replicate how BEE2 packs stuff into the maps. While the logic-side should work perfectly fine, you can end up with visual bugs like this, due to missing textures, sounds etc:
While I made sure most of the stuff gets packed, postcompiler won't detect sounds playing purely via vscript for example. One way to get rid of these bugs is to mount BEE2 for the sake of playing the maps. (I suggest doing so by mounts.kv by adding this):
But this won't solve the issue that some of stuff can be not-packed properly, you'll have to use external tools to pack the remaining assets.
Installation
The .zip file you downloaded contains four files:
You will need to configure three of those, but this isn't difficult to do. Firstly let's discuss the file structure.
There are no real rules on the filestructure except for one:
gameinfo.txt
,srctools.vdf
,srctools_paths.vdf
must be all in the same directory as the map directory (map_path in the .bat file, check below)You can place the .bat file wherever you'd like, is it Desktop or somewhere in your mod file system it doesn't matter much* (explained later on).
The default config is to have all of these files placed in
<mod>/maps/puzzlemaker/
, so for examplep2ce/maps/puzzlemaker/
.Path setup
srctools_paths.vdf
Now, after you placed all of these files appropriately, you will need to change some config in the files so they run properly, I will guide you through everything so don't worry about this!
First of all, and by far the easiest, is to open

srctools_paths.vdf
. You will see an entry like this:You will need to change this path, so it points to the main game folder of Portal 2. You can do this easily by going into Steam > Selecting Portal 2 > Right click > Properties > Local files > Browse. Then copy that path from the explorer. After you've done this, close the file.
PuzzlemakerCompile.bat
Now it's a bit more tricky. Open up the .bat file you've downloaded (right click > edit). The lines that you may need to change are lines 3, 4, 5 and 6.
You never modify anything before the
=
sign!Here's what is what:
p2path
is the path of the main Portal 2, so the same thing you've put in the file before.maps/puzzlemaker/
directory (the recommended installation place).<mod>/maps/
) of where the maps are located.Here's an example config for:
Mod is just base p2ce (the .bat file can be placed anywhere now because it's an absolute path!).
Maps are placed in the
p2ce\maps\
directory.gameinfo.txt
(For mod developers)To ensure that your mods content is available for the compiling tools (for example to properly calculate lighting on normal maps) you need to add a new entry to searchpaths, referencing your mod.
That's all about the installation.
Usage
Usage of this script is very, very simple. When opened, it will prompt you with two things:
Do a full compile:
Y
and then press enter, you will make the script do a final compliation. What it means, is that the script cannot encounter any errors on the way. If it does (for example a leak) it will stop the process and not proceed further. It also means VRAD will run in -final which may be slow! This was intended for puzzles meant to be put on the workshop, before I encountered the issues in the Caveats chapter, so it's mostly a leftover.Map name
puzzlemaker_export
command. When you are in the puzzlemaker, save the puzzle, open up the console and typepuzzlemaker_export
and then type the name of the mapfile (it can be anything, but without extensions). After that go over to the script and type the same name. The compiling process will begin. Keep in mind you will need to do this everytime you make changes! If you don't want to do this or leave the field empty the script will default to thepreview.vmf
, which is the latest played puzzle. To use this method instead, just launch the puzzle in Portal 2, then stop the launching process (so the puzzlemaker generates thepreview.vmf
with the newest changes).That's basically all you'll have to do to use this script. For more information (how the script works for example) check out the readme on my repository.
If any problems occur, please report them over to me on discord, or make an issue on the repository.
Beta Was this translation helpful? Give feedback.
All reactions