Add a hat, an accessory or a pattern¶
A cosmetic is one Data Asset, plus one line in the catalogue. By the end of this page your piece has a tile in the Customization screen, a price in credits, and shows on the robot in the menu and on every player in a match.
If you have not read How cosmetics work, start there.
- The Data Assets:
Content/MPFriendslop/Blueprints/DataAssets/Cosmetic/Childs/ - The meshes:
Content/MPFriendslop/Meshes/Characters/Cosmetics/ - The icons:
Content/MPFriendslop/Textures/Widgets/Cosmetics/ - The catalogue:
Content/MPFriendslop/Blueprints/Misc/BP_FriendslopGameInstance
Step 1, the mesh¶
- Import your static mesh into
Meshes/Characters/Cosmetics/. - Remove its collision. No shipped cosmetic has any collision, so a hat never blocks its own player's traces.
- Set
Collision ComplexitytoUse Simple Collision As Complex. - If a part of it should take the player's colour, give that part a material slot named
M_Robot_Shelland useMI_Robot_Shellon it. The colour and the pattern are applied by slot name, not by slot index, so the slot can sit anywhere in the list.
Parts with a fixed colour keep their own material. The traffic cone does this with MI_Cosmetic_ConeOrange next to its shell slot.
Step 2, the Data Asset¶
- In
Blueprints/DataAssets/Cosmetic/Childs/, duplicateDA_Cosmetic_TopHatfor a hat orDA_Cosmetic_Backpackfor something on the back. - Name it
DA_Cosmetic_<Name>. - Fill in the fields below.
| Field | What it does | Shipped in DA_Cosmetic_TopHat |
|---|---|---|
Display Name |
The name on the tile | Top Hat |
Slot |
The tab it is listed in, and the slot it equips into. A player wears one item per slot | Hat |
Icon |
The tile picture. Draw it white on a transparent background | T_Icon_Cosmetic_TopHat |
Price |
The cost in credits. 0 means free |
350 |
Locked By Default |
Shows the tile faded, with no price. It cannot be bought | off |
Static Mesh |
The rigid piece attached to the character | SM_Cosmetic_TopHat |
Skeletal Mesh |
A piece that follows the body instead, driven by the character's own animation. None of the shipped cosmetics uses it | empty |
Attach Socket |
The socket on the character mesh the piece is attached to | HatSocket |
There is no offset field. The socket is the offset: to move the piece, move the socket or the mesh pivot. HatSocket (on the head bone) and BackSocket (on spine_04) are on the skeleton SKEL_Mannequin and on the mesh SKM_Robot_Courier.
Step 3, the catalogue¶
- Open
BP_FriendslopGameInstance. - In
Settings|Cosmetics, add an entry toCosmetic Catalog. - Pick your Data Asset in the new entry.
- Save.
Warning
Cosmetic Catalog is the only list. A cosmetic that is not in it has no tile, cannot be bought, and the server refuses to equip it. There is no error message.
A pattern¶
A pattern is a cosmetic with no mesh. It paints a motif over the player's body, on the M_Robot_Shell slot only. Six ship: Plain, Bands, Dots, Checker, Grid and Hazard, indices 0 to 5.
- Duplicate
DA_Cosmetic_PatternBands. - Set
SlottoPatternand leaveStatic MeshandAttach Socketempty. - Fill in the pattern fields.
- Add it to
Cosmetic Catalog, like any cosmetic.
| Field | What it does | Shipped in DA_Cosmetic_PatternBands |
|---|---|---|
Pattern Index |
Which of the drawn patterns: 0 Plain, 1 Bands, 2 Dots, 3 Checker, 4 Grid, 5 Hazard |
1 |
Pattern Color |
The colour of the motif | set per pattern |
Icon Material |
The tile picture as a material instead of a texture | MI_Widget_PatternBands |
The same index with another Pattern Color is a new pattern already: nothing else to do.
The tile icon is an instance of M_Widget_Pattern in Materials/Widgets/. For your own, duplicate one of the six MI_Widget_Pattern* and set its PatternIndex.
A seventh pattern, index 6, has to be drawn first. The body patterns come from M_Prop_Master, group Robot Pattern, and a new index needs a new branch in its pattern selection. M_Widget_Pattern draws the icon from the same PatternIndex, so it needs the same branch.
A new slot¶
The tabs of the Customization screen are built from E_CosmeticSlot, which ships with Hat, Accessory and Pattern.
- Open
Blueprints/Enumerations/E_CosmeticSlotand add an entry. Its display name is the tab label. - Add a socket for it on your character mesh.
- Make Data Assets with that
Slotand thatAttach Socket, and add them toCosmetic Catalog.
The new tab appears on its own, and a player can now wear one item in it next to the hat and the accessory.
What you get for free¶
Once the Data Asset is in Cosmetic Catalog:
- It has a tile in its tab, with its icon, its name and its price.
- Buying it takes credits and saves it in the player's profile.
- The robot in the main menu wears it while the player looks at it, before buying.
- It is attached to the player in a match, and hidden from the player's own first person view.
- Its
M_Robot_Shellslot takes the player's colour and pattern.
None of that needs a line of Blueprint.
To add a gesture or a face to the emote wheel, see Add an emote or a face.