PEAK
You are viewing a potentially older version of this package. View Latest Version
Install with App

Details

Date Uploaded
Downloads
128
Size
59KB

Campfire Haven

Unlit campfires become real safe havens, and the Scoutmaster learns to keep its distance.

Host-side mod. Only the host needs it. Every player in the lobby is affected and clients install nothing.

Do not install this on clients as well as the host. The host already pushes protection to every remote player; a client that runs the mod too will apply warmth a second time and drain cold at double rate.

What it does

1. Unlit campfires work like lit ones

In vanilla PEAK a campfire only protects you while it burns. Campfire.Update() keeps the whole protection block behind if (Lit), and the warmth emitter sits under a child object that UpdateLit() switches off together with the flames. The moment the fire goes out, both protections vanish.

Campfire Haven restores them while the campfire is unlit:

  • Hunger is blocked with the same NoHunger buff the lit campfire uses
  • Cold is drained at the same rate and radius the lit campfire uses, read from the real emitter on the prefab instead of being hardcoded

Lit campfires are left completely untouched. Burning or not, the protection is identical.

2. Campfires banish the Scoutmaster

When the Scoutmaster enters a campfire's protection radius, the host removes it from the world. This applies to lit and unlit campfires alike. If it is holding a player, the grab is released first so nobody is left stuck.

Configuration

Config file: BepInEx/config/campfirehaven.host.cfg

Radii are in meters as shown by the in-game distance prompt (the game displays world units multiplied by 1.6).

Setting Default Meaning
General.Enabled true Master switch
General.DebugLog false Verbose diagnostics
Campfire.ProtectFromHunger true Unlit campfires block hunger
Campfire.ProtectFromCold true Unlit campfires remove cold
Campfire.ProtectionRadius 19.2 Hunger protection radius. 19.2 m equals the vanilla 12 world units
Campfire.WarmthRadius 6.4 Warmth radius. 6.4 m equals the vanilla 4 world units
Scoutmaster.Enabled true Remove the Scoutmaster inside campfire range
Scoutmaster.EvictionRadius 19.2 Eviction radius. 19.2 m equals the vanilla 12 world units

Set any radius to 0 to fall back to that campfire's own value.

With DebugLog on, the plugin prints one summary line every 30 seconds containing the numbers it actually decided on: hunger, cold, seconds since last frostbite, whether hunger is blocked, and the distance to the nearest unlit campfire. Entering and leaving an aura, starting and stopping warmth, and every Scoutmaster removal are logged as they happen.

How it works

Hunger and cold are both computed on the client that owns the character, so a host-only mod has to push the result over the network. The plugin uses the game's own master-authoritative channel, CharacterAfflictions.RPC_ApplyStatusesFromFloatArray, which validates info.Sender.IsMasterClient.

  • The host's own character receives the real NoHunger affliction, the exact code path a lit campfire uses
  • Remote players have their hunger pinned to the value they had when they entered the radius, and cold pushed down at the emitter's rate
  • The Scoutmaster is a room object owned by the master, so only the host can remove it

The plugin polls every 0.5 seconds, the same cadence the vanilla warmth emitter uses. It installs no Harmony patches, so other mods cannot conflict with it at the IL level. Other mods that patch the campfire methods still run first, and this plugin simply reacts to the resulting state.

Notes

  • Remote players do not get the little campfire icon on the stamina bar, because there is no trustworthy way to hand them the affliction. Their hunger still does not grow.
  • Burnt-out (Spent) campfires count as unlit and keep protecting you.
  • The campfire's gloom safe zone (gloom immunity, ghost orb repulsion, fog visuals) keeps its vanilla behaviour and is not extended to unlit fires.
  • Reviving or falling into the void clears all afflictions, so hunger briefly resumes until the next tick reapplies the buff.
  • Cold is usually zero on the beach during the day. To test warmth, use the AddCold console command or stand in fog first.

Installation

Install with a mod manager, or drop plugins/CampfireHaven.dll into BepInEx/plugins/.

Requires BepInEx 5.4.23.3 or newer.

AI disclosure

This mod was written with AI assistance: the source code, documentation and icon were produced by an AI coding agent working against the game's decompiled assemblies, then reviewed in several rounds against the actual game code. It has been tested in single-player and it works there, but it has not been tested in a full multiplayer lobby. Treat it as an AI-assisted mod and report anything that misbehaves.

Source

The full source, the reverse-engineering notes this was built from, and the audit reports are kept alongside the project.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.