v1.0.1
GoldSrc Map2Prop is a tool for converting .map, .rmf and .jmf files, as well as .obj files exported from J.A.C.K, to GoldSrc .smd file that can then be compiled into a GoldSrc format studio model without the hassle of using an 3D editor.
It can also be seamlessly integrated with the map compilation process, essentially running as its own compilation tool that'll convert, compile, and replace the brushwork with model props automatically.
Windows Defender False Positive
Unfortunately Windows Defender (and potentially other antiviruses) might flag Map2Prop.exe as a trojan. This is a consequence of using the PyInstaller to package the application.
I am trying out self-signing the application to see if it makes a difference, but it might take a while before I become a trusted source. You can help out in the meantime by reporting it as a false positive.
You may add an exception for Map2Prop.exe in your antivirus, or if you still don't trust it you're welcome to clone the project, check the files, and
building it yourself.
Requirements
To use the auto-compile feature one must add a valid reference to a
Sven Co-op studiomdl.exe either in
config.ini
(recommended) or using the commandline option (
-m
,
--studiomdl
).
Why is the Sven Co-op studiomdl.exe required for compilation?
The reason for requiring the Sven Co-op studiomdl.exe for compiling these models is because of how map textures work, i.e. they may tile or otherwise extend beyond the UV bounds. Legacy studiomdl.exe compilers will clamp UV coordinates which is no good for this. Additionally, legacy compilers cannot handle CHROME textures that aren't 64x64. Don't worry, the compiled model will still work perfectly fine in vanilla Half-Life.
How To Use
Simply download the archive and extract it to a directory of your choosing (or
build it).
After that open
config.ini and ensure the paths to the Steam installation and studiomdl.exe are set up correctly.
Textures
Map2Prop needs the texture files that are used in the prop to create the models. It will look for the raw BMP textures in both the input file's directory and the output directory, as well as in WAD archives in these directories and the configured game config's mod folder and automatically extract these.<br />
Additionally one can feed a text file containing paths to WAD archives (one per line) to the commandline argument (
-w
,
--wad_list
) or fill out a
wad list
in
config.ini.
In other words, set the
steam directory
and the relevant
game
and
mod
in
config.ini and Map2Prop will take care of extracting the textures for you.
Drag & Drop
A simple way to use Map2Prop is to place the prop(s) to be converted in their own map and drag that map onto the executable.
All brushes will be merged with the worldspawn model unless part of a
func_map2prop entity with the
own_model
key set to
1
, which will be placed in their own models.
Map Compile
By adding the
map2prop.fgd
to the map editor's game configuration one can tie brushes to the
func_map2prop entity and add the Map2Prop executable to the compilation process (for example Hammer/J.A.C.K's Run Map Expert mode) before/above the CSG compiler and in arguments put
"$path/$file" --mapcompile
.
Important: Ensure
Use Process Window or
Wait for Termination (or similar) is checked to make sure Map2Prop finishes before the rest of the process continues.
Commandline Interface
For advanced usage one might run Map2Prop through a shell or command prompt.
To get started with the CLI one can either run Map2Prop with no arguments or call it with
--help
to get a list of available arguments.
config.ini
The config file
config.ini
allows one to adjust various defaults and set up paths to the model compiler and game directories. Each separate game configuration section (preceeded by the section's name in square brackets, e.g. `[halflife]`) will override the default settings when that configuration is active. The active game configuration can either be set in the default's
game config
key, or by using the commandline option (
-g
,
--game_config
).
For example, when using the map compile feature one can add the
--game_config my_mod
to ensure the models end up in
/Half-Life/my_mod/models/
Bug Reports and Feature Suggestions
Take a look at the
Issues page for the repository and make sure the bug/feature hasn't been already been posted.
If the bug/feature is new, feel free to open a new issue, or comment it here or send me a private message. Be as detailed and specific as you can be.
If it's a bug report, please include the steps for reproducing the issue. Any log files (from /logs) or input map files will be very helpful in investigating the bug.
Special Thanks
Thanks to Captain P for all the help and advice, as well as showing me the .rmf/.jmf parsing code from MESS (and of course many thanks to MESS for being an excellent resource).
Thanks to Penguinboy for the tips and being very helpful with any questions I've had.
Thanks to Kimilil for help with testing the release candidate and providing excellent feedback and ideas.
Alpha Testers
Many thanks goes out to the kind people who helped me test this program and provide useful feedback and suggestions during its alpha stage:
- SV BOY
- TheMadCarrot
- Descen
- Kimilil
I haven't had a chance to try the tool out yet, but I am endlessly grateful that you're working on it!
I am very likely to have a chance to experience it soon, thank you very much for your work and love. Love comes from China.
I hope it's useful to those that don't want to learn to use a 3D editor but still want to make model props for their maps. ^^
The program can't start because api-ms-win-core-path-l1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem.
That's on Windows 7. Why is the executable so massive?
The size is mostly due to a library I used for a lot of the math functions, and I agree it's unnecessarily large. Been working on refactoring out that bloated library since last week and should have a new version ready pretty soon. 🙂
Also found and fixed a bug related to reading .obj files with ORIGIN brushes.
The models look indistinguishable from their brush counterparts.
Amazing job with the program <3
This program is a step forward to make goldsrc propmaking workflow better, for sure. For one, it eliminates the need to use Blender+plugin for the obj to smd conversion.
I really hope you explore the possibility of extracting compiled .bsp models as .objs, which you can feed into the toolchain, as the lightmaps can then be baked into the textures of the props, suitable for larger props e.g. 3d skyboxes.
What this would make possible is a single compile workflow: csg, bsp, vis, rad, bsp2prop.
Again, this tool being at the end means it has rad's lighting information to work with.
I know unrealkaraulov's newbspguy fork has this exact feature, but it's not accessible in the CLI (in fact his fork's CLI is completely broken) and he's been on radio silence as of late.
Crafty can export .bsp as .objs as well but only the whole .bsp. Again, UK's newbspguy comes in a clutch with its ability to export individual brush model as a standalone .bsp, which you feed into Crafty. But again, the problem with these programs are that they have no command line interfaces.
Months ago I had the desire to create a script/tool that would allow me to do that, but I abandoned it. It's good that you made it possible.
The idea i had in mind was basically converting the brush in an entity called "brush_model" with some keyvalues. Then during the compiling process (before zhlt tools process) the script/tool would convert the "brush_model" entity to mdl (using external tools) and then automatically inserting it into the map as a cycler_sprite. I never got around to implementing it, i just coded a few lines to parse the .map file in a basic way.
Here concept map of the idea:
@cindor That sounds similar to the concept Kimilil was talking about.
Someone in the Discord came up with the idea to use custom entities that would be turned into models and put back in the map. I guess one could call a program at the start of the compile process that'd extract these entities from the .map file and run Map2Prop on those (once I finish the .map format support) and then replace these entities with cycler_sprite or whatnot (possibly give it a CLI argument) before overwriting the .map and let the rest of the compile process go as usual. It wouldn't have Kimilil's baked lightmaps, but could been an alternative way of doing this.
I'm thinking instead of using a custom point entity (info_bone) that can hold a
name
andparent
, and have it skinned to the vertices of any brushes grouped with it (or even radius around the entity, could use a keyvalue for that as well). Might look into it after the full release.@SirYodaJedi I think it'll work fine, unless you use any Quake III curved surfaces. Just looked at the code now and realised it doesn't handle the curved surface array in each solid, which will corrupt all other solids after the first one. Already fixing that now 🙂
That's fine. It's a bridge between two worlds.
Finally we have the goldsrc equivalent to source's Propper!