Jump to content

Recommended Posts

Posted (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:

image.thumb.png.6df124f6b3540206e1c4a8873a284dca.png

 

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:

image.png.46f5ea52ecb077f9b40eb9e5ed78a4e3.png

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 by Charleston
Fix formatting
Posted (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

 

image.png.c4e720ad53d043e373ec9144a3ddbd9c.png



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.

 

image.png.88daa4d0300545cfc913b51c25449f90.png

Edited by Charleston
Posted
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"  }
			}
		 ]
	 }
]

 

Posted

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!

Posted (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 by Brady_The
Posted
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!

  • Like 1
Posted (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!

image.png.a776861c39288a36002105b2a39611f8.png

 

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.

image.png.2bbd5cac0325f7c0d4230b71d2086f2c.png

 

 

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 by Charleston
  • Like 2
  • Charleston changed the title to Help a Beginner? (Adding Player Model Features)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.