Project Zomboid

Project Zomboid

ra's Body Mod
 This topic has been pinned, so it's probably important
razab  [developer] 4 Jun, 2024 @ 6:26am
[GUIDE FOR MODDERS] Adding compatibility for clothing mods
When ra's Body Mod is active, some modded clothing items from other mods may cause clipping issues when worn by male characters. Specifically, the male "extra 3d object" may clip through clothes.

In case you are the creator of a clothing mod for which those problems occur and you would like to make your mod compatible with mine, here is a guide for you:



For your modded clothing items which cause clipping, we have to manually tell the game that the respective items should hide the male 3d object. To achieve this, simply add the following lines of lua code to your mod's shared folder:

local modInfo = getModInfoByID("rasBodyMod") if modInfo and isModActive(modInfo) then -- check if ra's Body Mod is enabled local rasSharedData = require("RasBodyModSharedData") -- import data if rasSharedData and rasSharedData.ExceptionalClothes then if not rasSharedData.ExceptionalClothes["BodyLocation"] then rasSharedData.ExceptionalClothes["BodyLocation"] = {} end rasSharedData.ExceptionalClothes["BodyLocation"]["Base.MyItem"] = { hideWhileStanding = true, hideWhileSitting = true } rasSharedData.ExceptionalClothes["BodyLocation"]["Base.MyItem2"] = { hideWhileStanding = true, hideWhileSitting = true } -- and so on... -- this can be done for several body locations: if not rasSharedData.ExceptionalClothes["AnotherLocation"] then rasSharedData.ExceptionalClothes["AnotherLocation"] = {} end rasSharedData.ExceptionalClothes["AnotherLocation"]["Base.MyItem3"] = { hideWhileStanding = true, hideWhileSitting = true } -- and so on... end end

"BodyLocation" is the body location your clothing items belong to (example: "Jacket"). "Base.MyItem" and "Base.MyItem2" are the IDs for the items. Same for "AnotherLocation" and "Base.MyItem3".

The parameter "hideWhileSitting" tells the game whether the male 3d object should be hidden when the male character is in the sitting animation. For example, for the vanilla mini skirt, we would like to have

rasSharedData.ExceptionalClothes["Skirt"]["Base.Skirt_Mini"] = { hideWhileStanding = true, hideWhileSitting = false }

Result: When male characters wear a mini skirt and no underpants, the 3d object will be hidden when standing/walking/running but will be visible when sitting.



Note that it is probably not necessary to apply the above procedure to all modded clothing items. My mod is configured in a way so that clothing items from the following body locations will automatically hide the male 3d object:

UnderwearBottom, Underwear, Torso1Legs1, Legs1, Pants, FullSuit, FullSuitHead, BathRobe, Boilersuit, Jacket_Down

All modded clothing items assigned to those locations will never cause any clipping issues and you don't have to do anything special for them. Clothing items which do not graphically cover the groin area also do not require any treatment.



In case there are any questions or if you think something doesn't work properly, feel free to ask.

Thanks for reading! :D
Last edited by razab; 6 Jun, 2024 @ 9:50am
< >
Showing 1-4 of 4 comments
Mazkai 6 Oct, 2024 @ 6:21pm 
Is there a way you could release this as a patch
razab  [developer] 8 Oct, 2024 @ 10:10am 
@Mazkai, in general, I try to keep my mod compatible with all vanilla clothes. I also added support for clothes from some other mods (Clothes Box Redux and Brita's Armor). However, adding support for ALL clothing mods would be a huge workload and it is not possible to make a single and easy patch which addresses all clothing mods out there. (At least, there is no reliable way to do this I am aware of.)

I therefore decided to make this guide. So, if people like to add support for another clothing mod they like, it should be relatively simple.
Mazkai 8 Oct, 2024 @ 2:51pm 
If only most game developers cared as much as you honestly 😢
razab  [developer] 9 Oct, 2024 @ 7:26am 
@Mazkai, Do you have a specific clothing mod in mind you'd like to see get a compatibility patch with my mod?
< >
Showing 1-4 of 4 comments
Per page: 1530 50