Build ceilings at the z+1 level above your character! This mod integrates with Project Zomboid's new B42 building system to enable ceiling construction with support constraints.
- Ceiling Construction: Build ceilings one level above your current position
- Realistic Validation: Ceilings require proper structural support (walls or adjacent floors)
- Visual Feedback: Ghost preview shows where ceilings can be built along with ground ghost for reduced eyeball damage
- Extensible System: Easy for modders to add their own ceiling pieces
- Stands Alone: Comes out-of-the-box with a metal and a wooden ceiling entity
The mod uses a multi-hook approach to intercept and modify the building system:
- Detects ceiling entities by checking for
ceilingtag in recipes - Flags detected entities with
isCeilingBuild = true - Stores z-level information for other hooks
- Detected entities are run through custom rendering for building ghost + guide sprite
- Intercepts build commands for ceiling entities
- Redirects construction to z+1 level
- Ensures ceiling is built at correct elevation
- Validates ceiling placement with structural requirements
- Checks for proper support (walls or adjacent floors)
- Handles ceiling creation and integration
Working Features:
- Ceiling detection via recipe tags
- Building at z+1 level
- Correct validation logic with structural requirements
- Ghosts have mirrored validation state
Known Limitations:
- Ceilings built will sometimes not render correctly (appear/disappear) from the player perspective without leaving the area or re-loading the save.
Ceilings can be built when:
- Adjacent ceiling floor exists - in any direction at the same level
- Wall directly below - any wall (WallN or WallW) at ground level (z-1)
- West-facing wall support - WallW at x+1,z-1 reaches west to provide support
- North-facing wall support - WallN at y+1,z-1 reaches north to provide support
To make your building pieces work with the ceiling system, add these components to your entity scripts:
component CraftRecipe
{
tags = ceiling, // <- This tag enables ceiling detection
// ... rest of your recipe
}
component SpriteConfig
{
OnIsValid = BuildRecipeCode.ceiling.OnIsValid, // <- Ceiling validation
OnCreate = BuildRecipeCode.ceiling.OnCreate, // <- Ceiling creation
// ... rest of your sprite config
}
Here's a complete entity script for a custom ceiling:
module Base
{
entity MyCustomCeiling
{
component SpriteConfig
{
isThumpable = false,
OnIsValid = BuildRecipeCode.ceiling.OnIsValid,
OnCreate = BuildRecipeCode.ceiling.OnCreate,
face W
{
layer
{
row = your_sprite_here,
}
}
}
component CraftRecipe
{
tags = ceiling, // <- Essential for detection!
time = 150,
category = Ceilings,
SkillRequired = Woodwork:3,
xpAward = Woodwork:30,
inputs
{
// Your required materials
}
}
}
}
That's it! Your ceiling piece will automatically:
- Be detected by the mod
- Build at z+1 level
- Use proper validation rules
- Show correct ghost preview
The mod uses a careful hook sequence:
ISBuildPaneldetects ceiling entities firstISBuildActionhandles actual building when clicked- Server validation runs when needed
- Works with any entity using the ceiling tag system
- Doesn't interfere with vanilla building
- Compatible with other building mods
For issues or questions:
- Check console logs if ceiling detection isn't working
- Ensure your entities have the correct
tags = ceilingproperty - Post a new issue here
- v1.11: Updated for B42.13+ multiplayer compatibility
-- Changed
Is()API calls tohas()for property checking -- Removed empty client-side patch file causing require warnings -- Tested for multiplayer server deployment - v1.10: Fixed ghost sprite to mirror IsValid status of build sprite - thanks Alex for pointing me in the right direction
- v1.00: Initial release with working ceiling system -- Full z+1 building support -- Extensible tag-based detection
- Nothing ATM!