Project Zomboid

Project Zomboid

Smokin' Joe's Rucksacks
Archer 13 Mar, 2023 @ 1:54pm
Fixing Canteen Attachments
Hey, I spent some time figuring out how to allow canteens from other mods to attach, and I figured I'd share how I did it in case anyone else wants to be able to. Oddly, the mod seems to have some code already in place, it just wasn't completed.

To start, head to the mod's folder. It'll be in Steam's workshop folder under 108600 and 270502657. Go to media/lua/client/Hotbar and open Rucksacks_ISHotbarAttachDefinition.lua with Notepad.

In the attachments sections of the local LeatherbagLeft and local LeatherbagRight entries, add the lines Canteen = "Leatherbag Left Canteen", and Canteen = "Leatherbag Right Canteen", respectively. Include those commas at the end.

Then go to the local LargeRuckRight and local LargeRuckLeft entries and add those same lines, but replace Leatherbag with LargeRuck, like Canteen = "LargeRuck Right Canteen",. Save the file.

Now, go to back to the media folder and open the scripts folder. Open Attachments_LargeRucksack.txt. Under both MaleBody and FemaleBody (or just one if you only use one gender), add the following lines, following the format of the other entries:

/*Canteen*/
attachment largeruck_right_canteen
{
offset = 0.0300 -0.100 -0.0700,
rotate = 90.0000 180.0000 0.000,
bone = Bip01_BackPack,
}
attachment largeruck_left_canteen
{
offset = 0.0300 0.130 -0.0700,
rotate = 90.0000 180.0000 0.000,
bone = Bip01_BackPack,
}

Save the file. Now open Attachments_LeatherRucksack.txt. Do the same, but with this code:

/*Canteen*/
attachment leatherbag_right_canteen
{
offset = 0.0300 -0.100 -0.0700,
rotate = 90.0000 180.0000 0.000,
bone = Bip01_BackPack,
}
attachment leatherbag_left_canteen
{
offset = 0.0300 0.130 -0.0700,
rotate = 90.0000 180.0000 0.000,
bone = Bip01_BackPack,
}

Save the file. If you did everything correctly, you can load the game up and attach canteens from most other mods. Enjoy!
< >
Showing 1-2 of 2 comments
Archer 13 Mar, 2023 @ 1:59pm 
If you see this SmokingJoe, definitely feel free to add this to the mod itself. I tweaked the rotation so the canteens would look good, so it's working on that front.
Lumm 30 Jan, 2024 @ 8:52pm 
For players who want to use this mod w/ Noir's attachments w/o any overlap, you can empty the entirety of the text files listed above to remove the pre-built attachment slots so you can add your own later through the upgrade system.

This also fixes the issue where the default pack roll slot places other mod's sleeping bags at a 90 degree angle horizontally, making packs connect oddly.

Currently testing this method in debug mode and I haven't had any issues so far.
Last edited by Lumm; 30 Jan, 2024 @ 8:53pm
< >
Showing 1-2 of 2 comments
Per page: 1530 50