AMM: Custom Props
How to create custom props to use with AMM or sector editing
Summary
Published: April 2023 by @manavortex Last documented update: Sep 20 2024 by @manavortex
This guide will teach you how to create AMM props in two variants:
the old way by using a mesh entity with a .mesh file with only one appearance
customizable by chaining a
root entity
, an.app
, and a.mesh
file with multiple appearances
Its focus is on the file structure and the relations between the files.
For another guide regarding custom props, check AMM: Textured items and Cyberpunk Materials using Custom Props – it will focus on the possibilities you have with different materials, while this guide focuses on the process and the structure.
Wait, this isn't what I want!
If you want to play around with materials and an existing prop, check AMM: Textured items and Cyberpunk Materials using Custom Props
If you want to enable collisions, see Enable embedded collisions
If you want to make meshes out of 2d textures, see Your image as custom mesh
… or use the wiki's AI-assisted search function, or simply poke around
Where to find models
Many websites host free stuff; you can find the largest archives below. Browse this list for a more comprehensive collection, or use the following queries in your search engine of choice:
For game design or rendering, usually textured:
TurboSquid (there's a drop-down menu on the left-hand side where you can select to search for free models!)
For 3d printing, usually not textured:
Requirements:
Cyberpunk 2077 game version
WolvenKit >= 8.12 for 2.1, 8.8.1 for 1.6.1 (DLSS)
Appearance Menu Mod (>= version 2.1, anything earlier won't have customizable appearances)
Optional, but recommended if you want to create multiple props: Notepad++
Level of difficulty: You know how to read.
Setting up the project
This section will tell you how to get the files, then give you an explanation of what they do and finally show you a diagram on how they hang together.
Tutorial item
Tutorial item (customizable)
Download the AMM prop template from Nexus. Download the complete source folder, as it will have the files as depicted below.
Prepare your Wolvenkit project by you downloaded with the one from your project. By the end of it, you should have the following files:
If you want to move or rename anything, please do it as specified in Moving and renaming in existing projects. Doing anything else will break the mod.
Optional, but recommended: Start the game and spawn the props, as in the green hint box at the beginning of this section.
Optional, but very recommended: Read through the next section to understand what's going on here.
If you're the more hands-on kind of learner, skip to Using other meshes or Creating another prop to fuck around and find out.
The first part of the structure is up to you, although for the sake of the tutorial you might want to stick to it. There's a section later on how to change your paths.
The second part (under "resources") is where AMM will look for custom props. You can't change it other than creating subfolders under "Custom Props".
Explanation: what did you just download?
This section gives an explanation of the included files, explaining the difference in file structure between props with vs without variants.
If you don't want to know this, you can skip ahead to Using other meshes or Creating another prop to get crackin', or check the diagram to see how the files connect.
LUA file
This file registers your prop with AMM. File content looks like this:
Without a lua
file, AMM won't know about your props, and thus can't spawn them.
Here's what the lines do:
name
what you search for in AMM
category
what AMM sorty by (you can only reuse exisitng categories)
distanceFromGround
how far away from the ground should your prop be? (This moves the origin in Blender's 3d viewport)
appearances
If you're using a root entity, these are the appearance names to switch through and the entries in AMM's "appearance" dropdown / spawn tab
When you edit the .lua, it's usually enough to reload all mods
in CET.
Entity file
Defined in your LUA
file, this file holds the game entity that AMM spawns when you click the button. There are two ways of using entity files:
Mesh entity (the legacy version)
Fun fact: The cluttered prop browser annoyed manavortex so much that she helped Max implement the alternative workflow described below the picture, and wrote this guide!
It was that bad!
One entity file per variant. The props will not have appearances — AMM's prop browser has one entry per entity file (e.g. cube_black
, cube_white
, cube_glowing
).
Edit this kind of prop by opening the following file in Wolvenkit:
You add props by putting meshes directly into the components array:
One entity file per prop, one entry in AMM's prop browser (e.g. cube
). After spawning it, you can toggle its appearances (white
, black
, glowing
) the same way you do it with NPCs.
If you have added clothing items, then this will be familiar to you. If you haven't, please ignore the link and keep reading — this is the simpler version!
Edit this kind of prop by opening the following file in Wolvenkit:
Instead of adding items directly via the components array, we link appearances to an .app file. The only component we keep in the root entity is the targeting component for the CET cursor: this way, it will be added to each appearance in the .app file.
Appearance file
This file holds a list of appearances
. Inside each appearance
, you can define any number of things to be loaded (components) and specify or override their behaviour.
We will only use entPhysicalMeshComponent
s, and they must be named amm_prop_slot1
.. amm_prop_slot4
if you want to enable scaling.
If you have more than four mesh files assigned to your app's components, the prop will no longer be scaleable (as of AMM 2.1). You can get around this limitation by making meshes with more submeshes instead of having individual files.
template_textured.mesh
A pre-configured mesh for a textured material. Uses the following files in the subfolder textures
:
template_01_d.xbm
: A diffuse (albedo) map, colouring the meshtemplate_01_n.xbm
: A normal (bump) map, adding depth to the object.
If you stick to this naming convention and have your filenames end in _d
or _n
, Wolvenkit will recognize and identify the correct settings for image import.
You can learn more about textured materials here. This is not necessary for the purpose of this guide.
template_multilayered.mesh
A pre-configured mesh for a multilayered material. Uses the following files in the subfolder textures
:
6_layers.mlsetup
: A multilayer setup with colour properties6_layers.mlmask
: A multilayer mask, determining which parts of the mesh are affected by which layer of the mlsetup. In this case, it just contains six blank layers.template_01_n.xbm
: A normal (bump) map, adding depth to the object.
You can learn more about multilayered materials here. This is not necessary for the purpose of this guide.
If you have downloaded the example Wolvenkit project, you can now install it and launch the game, seeing everything in action.
Diagram
Okay, now that we've gone through the theory, let's have a quick overview how everything hangs together:
Without variants
With variants
Using other meshes
You can point the prop at a different mesh by changing the depot path of the component. If you have no idea how to do that, read on!
With variants
Open the
appearance
filetutorial\amm_props\template\template.app
Find the array
appearances
at the top of the fileFor each appearance, open the
components
arrayClick on the first component
amm_prop_slot1
. In the panel to the right of the tree, change the following properties:mesh -> DepotPath
. Put the relative path to your .mesh (right-click on the file)mesh -> meshAppearance
. Put something that actually exists in your file, otherwise the first appearance from the list will be used as default.
If you want to use more than one mesh, repeat the process for the other components. If you want to use more than 4, check Why only 4 components? below.
Repeat the process for the other appearances.
Save the file and start the game. If you've done everything right, you will now see your new mesh.
Without variants
Open the
mesh entity
tutorial\amm_props\template_no_variants\template_no_variants.ent
Find the
components
array and open itClick on the first component
amm_prop_slot1
. In the panel to the right of the tree, change the following properties:mesh -> DepotPath
. Put the relative path to your .mesh (right-click on the file)mesh -> meshAppearance
. Put something that actually exists in your file, otherwise the first appearance from the list will be used as default.
If you want to load more than one mesh, repeat the process for the other components. If you want to use more than four, read Why only 4 components?
If you don't want to load more than one mesh, select
amm_prop_slot2
and delete thedepotPath
. Otherwise, you'll see your prop and a floating cube.Finally, change the
defaultAppearance
to a valid appearance in your .mesh file. If no appearance with this name can be found, the prop will be invisible when it spawns.
Why only 4 components?
Currently (October 31 2023), AppearanceMenuMod can only scale objects by targeting their components by name. For that reason, yours have to be named as they are.
If you use more than 4 components or change their name, then your prop will no longer scale.
Creating another prop
This step is optional. If you just want to see how this works, you can pack your project with Wolvenkit and search AMM for "tutorial item". However, assuming that you actually want to make cool things, you will be doing this a lot.
If you want to create another prop, here's the fastest non-script way to go about it (tried and tested by manavortex).
In Windows Explorer, duplicate the
template
folderRename the new folder (
template - Copy
) to the name of your prop (e.g.baseball
).
It's important that you stick to a schema here, because otherwise, the search and replace below will not work and you have to change all the paths by hand.
Use the exact same value to replace template
in both the folder and the file names!
Good: folder: baseball, file: baseball.ent Bad: folder: baseball, file: my_baseball.ent
Rename all files inside of the folder: replace
template
with the name of your prop (e.g.baseball
). Not all files will have template in their names; just ignore the ones that don't.
Capitalization matters. If you use uppercase letters in folder names, the game will get confused, and Wolvenkit will secretly convert them back to lowercase before packing.
Good: baseball
Bad: Baseball
Switch to the
raw
tab in Wolvenkit and open your json files in Notepad++Via
Search and Replace in Files
(Ctrl+Shift+F), replacetemplate
with the name of your new prop and folder (e.g.baseball
). Replace it in all files, using Match case:Optional: If you have changed the folder structure (e.g. moved your folder from the subfolder
stuff
to the subfoldermisc
), run anotherSearch and Replace in Files
(Ctrl+Shift+F) to adjust your file paths.In the project browser's raw section, right-click on the folder and select
Convert from json
. This will have updated the relationships between the files to your renamed files.Delete the files / appearances that you don't need. Save and close the mesh file.
Import your meshes and textures over the ones from the template. For a guide on how to do that, check here.
To register the prop with AMM, add another entry to the props array in your
LUA
file:
Save the LUA file.
Install and launch the game
Spawn your new prop
Baseball (customizable)
with AMM.
If everything went well, you should see something like this now:
If not, it is time to hit up the troubleshooting.
The final touches
Before you can share your custom props, you have to change the folder structure and file paths. Otherwise, two people overwrite tutorial.lua
, and one of the mods stops working.
You can find a step-by-step guide on the process here.
Troubleshooting
This section will only cover troubleshooting steps for this guide. For anything related to mesh imports, see here. For general 3d model troubleshooting (including import errors), see here.
My prop doesn't even list in AMM!
The problem is in your .lua file. Use this tool to check the syntax and make sure that there are no errors - usually, it is missing/extra commas and/or missing/extra braces.
If the syntax is okay and your prop still doesn't show up, double-check your category and make sure that it is one of the existing ones.
My prop won't spawn!
... and I can't target it!
AMM can't find your .ent file. Make sure that your .lua points to the correct path in your archive (right-click -> copy relative path and paste it to your lua file.
Make sure that you don't delete any quotation marks or commas while you do that. If you're unsure, you can double-check this step.
... it all looks good, but there is no prop!
Toy around with the scaling. Sometimes, your prop doesn't show because it's the size of Johnny's ego and hovers somewhere above your city block – or the opposite, it's microscopically tiny. Don't be afraid to change it by the factor 10 or even 100 and see if that does anything.
If that's not it and if you have a customizable prop (with a root entity), try adding an appearance default
to the mesh. The game will fall back to that one if there are issues with your custom appearances.
My prop spawns, but something about it is weird!
In general, your answer is probably in the guide on AMM: Textured items and Cyberpunk Materials using Custom Props, section 2 (processing the mesh) – check that guide's troubleshooting section.
Last updated