Charleston Posted August 9, 2025 Report Posted August 9, 2025 (edited) Hey guys, I am very much new to modding VS. I've been wanting to make a pack that adds several new hairs / beards / mustaches to the game. As a test I created this: Looks nice right? Anyway... I've added this to my assets folder for the mod, with a similar tree as the base game location: \assets\expandedhairs\shapes\entity\humanoid\seraphskinparts\hair-face Then I created a patch .json to ADDMERGE the one mustache into the player.json like so: I'm currently trying to figure out how to add the shape location into this. If I leave that shape line in (probably completely wrong) then I get an error when loading the world. If I remove the shape line the game loads and when I click my "mst-typical01-skinny" the game crashes to desktop (probably because it has no idea where the shape file is for that). Anybody more experienced wanna help me out? I'd greatly appreciate it. I'd love to learn how to properly mod this game and figured this would be a decent start. Edited August 10, 2025 by Charleston Fix formatting
Charleston Posted August 9, 2025 Author Report Posted August 9, 2025 (edited) Updated the json a bit after reading some of other people's things. Still crashes but doesn't actually throw an error while loading, just once fully loaded when I click on the option in .charsel EDIT: Edited again removing the square bracket and extra bracket in place of a single bracket, game now throws this error and doesn't load the patch. Edited August 9, 2025 by Charleston
Brady_The Posted August 9, 2025 Report Posted August 9, 2025 5 hours ago, Charleston said: removing the square bracket and extra bracket in place of a single bracket, game now throws this error and doesn't load the patch. This happens because you are trying to add your moustache to an array (square brackets) with the wrong value contents (curly braces). I've not dabbled in hair, but I did help somebody a bit a while ago. I adapted their solution to your parameters. See if [ { "file": "game:entities/humanoid/player.json", "path": "/attributes/skinnableParts/8/variants", "op": "addmerge", "value": [ { "type": "shape", "code": "mst-typical01-skinny", "shape": { "base": "expandedhairs:shapes/entity/humanoid/seraphskinparts/hair-face" } } ], "side": "server" } ] does the trick. Spoiler Original (in case you are interested in adding more than one style): [ { "file": "game:entities/humanoid/player.json", "path": "/attributes/skinnableParts/6/variants/-", "op": "addeach", "value": [ { "type": "shape", "code": "olmrya", "shape": { "base": "vintytimestuff:entity/humanoid/seraphskinparts/hair-extra/olmrya" } }, { "type": "shape", "code": "bunny", "shape": { "base": "vintytimestuff:entity/humanoid/seraphskinparts/hair-extra/bunny" } }, { "type": "shape", "code": "grief", "shape": { "base": "vintytimestuff:entity/humanoid/seraphskinparts/hair-extra/grief" } } ] } ]
Charleston Posted August 9, 2025 Author Report Posted August 9, 2025 Game will launch and show the feature in the menu again, but crashes when clicked on. Running on 64 bit Windows 10.0.19045.0 with 15724 MB RAM Game Version: v1.20.12 (Stable) 8/9/2025 11:38:58 AM: Critical error occurred Loaded Mods: expandedhairs@0.0.1, game@1.20.12, scrollcharactercreation@1.0.3, creative@1.20.12, survival@1.20.12 System.NullReferenceException: Object reference not set to an instance of an object. Is it because I'm still missing some things required here? I don't have an en.json patch made yet because I figured I could go without it to start with. Really appreciate the help btw!
Brady_The Posted August 10, 2025 Report Posted August 10, 2025 (edited) 17 hours ago, Charleston said: Is it because I'm still missing some things required here? I am sorry, I can't really help you there. That error is very generic, it could be anything. Maybe the crash is caused by the missing language strings. I personally would have a look at some other mod doing something similar and see if those work. If so, compare yours to theirs and see what is different. For example, check out https://mods.vintagestory.at/show/mod/17519#tab-files version 2.2.0. Edited August 10, 2025 by Brady_The
Charleston Posted August 10, 2025 Author Report Posted August 10, 2025 7 hours ago, Brady_The said: I am sorry, I can't really help you there. That error is very generic, it could be anything. Maybe the crash is caused by the missing language strings. I personally would have a look at some other mod doing something similar and see if those work. If so, compare yours to theirs and see what is different. For example, check out https://mods.vintagestory.at/show/mod/17519#tab-files version 2.2.0. Actually was comparing to exactly that, an older version before they swapped to player model lib. I'll respond to this post if I figure it out. I feel like there's just enough documentation for certain things (making items and blocks) but a severe lack of how certain things function past extreme beginner level. I'm also a newbie to this so not like I have any right to say that lol. Thanks again! 1
Charleston Posted August 10, 2025 Author Report Posted August 10, 2025 (edited) Hey for anyone following this! I managed to get things working. Using player model lib now even though it's not technically a dependency (just using for the scrolling feature, swapped off of old scrolling) Managed to get this! For anybody ever interested, I ended up just replacing the entirety of the section as seen below. This means all of the OLD mustaches (and in the future hair, beards, hair extras) are just contained within the mod folder now. Trying to addmerge a shape into an existing path without being able to have the game search in two different locations seems to just not function. Best option is to either create a whole new section (I compared my work to the goblin ears mod https://mods.vintagestory.at/goblinears Thanks @Aillun!) or to replace the entire section with a new folder. The "Object reference not set to an instance of an object." crash was due to the game being unable to pull the shape file, I'm assuming, which is what I set out to fix. Now to figure out how to get textures to overlay.... EDIT: Textures weren't mapped correctly. Was using the seraph-hair.png, should have been using lightgray.png... for some reason. Edited August 11, 2025 by Charleston 2
Recommended Posts