Ради вашего удобства наш сайт использует cookies! Узнать больше! Мы используем cookies

Door Unlock From Inside

Door Unlock From Inside

Restores vanilla door behavior in B42 multiplayer: doors auto-unlock when you are inside the building.


Problem

In Build 42 multiplayer, doors sometimes stay locked even when the player is standing inside the house. The vanilla "open from inside" auto-unlock behavior fails due to client-server desync, effectively trapping players in their own houses.


Fix

Two-pronged approach:

  • Periodic scan + server unlock — Every 0.5s, scans 3-tile radius around player. If player is indoors (isOutside=false), requests server to unlock nearby doors.
  • ISOpenCloseDoor hook — Intercepts the door-open action just before it runs. If player is indoors, force-unlocks the door on the fly. This bypasses any server-side re-locking.

Features

  • Works even when getRoom() returns nil (map mod issues)
  • Uses isOutside() for reliable indoor detection
  • Only works when player is indoors — outdoor locked doors stay locked (preserves "break in" gameplay)
  • Handles both IsoDoor and IsoThumpable doors (player-built)
  • Server-authoritative unlock with broadcast to all clients
  • Lightweight: 0.5s scan interval, 5s request cooldown per coordinate

Update Log

v5

  • Added ISOpenCloseDoor:perform hook — force-unlocks door at the moment of interaction (bypasses server re-lock)
  • Server broadcasts unlock to all clients for local state sync
  • Both client-side polling and hook work together for reliability

v4

  • Moved to server-authoritative unlock via sendClientCommand
  • Removed hasLockedDoor check (client-server desync could hide locked state)
  • 5-second cooldown per door coordinate to prevent spam

v3

  • Added isOutside()-based indoor detection (fallback when getRoom/getBuilding return nil)
  • Boundary-door check (only unlock doors between indoor and outdoor squares)

v2

  • Switched from getRoom() to getBuilding()
  • Expanded scan to include doorway edge tiles

v1

  • Initial release
  • getRoom()-based indoor detection
  • Client-side setLocked(false) on nearby doors

Compatibility

  • Build 42.13+ (SP/MP)
  • Works with any map mod
  • Compatible with Authentic Z, True Music, EURY Multiplayer Bug Fixes
  • No mod dependencies

Developed by $J

Workshop ID: 3712058921
Mod ID: DoorUnlockFromInside

Рейтинг

Войдите, чтобы голосовать.
🏅 Нет оценок

Базовые теги:

Version:

Загрузить 8.3 KB