Log inGet started
Package

heatSignatures.package

README.md

Heat (module)

heatSignatures's temperature model: every thing in the world has a heat in degrees Celsius, for a thermal camera to draw and for gameplay to read. Game scripts call it to ask how hot something is (Heat.at, Heat.of), to give a thing heat (Heat.give), to leave a warm hand print (Heat.touch) and to set the weather heat sits in (Heat.setClimate). Thermal style blocks (sensorBlocks) and sensorGoggles' readout read it through HeatField.

local Heat = require("~heatSignatures.Heat")

Heat.setClimate("desertDay")                       -- every player
Heat.setClimate("temperateNight", { air = 2 })     -- with overrides

print(Heat.at(player.position))                    -- degrees C at a point
print(Heat.of(entity.find("Guard1")))              -- one thing's temperature

Heat.give(entity.find("Reactor"), "engine", { active = 140, working = true })
Heat.take(entity.find("Reactor"))
Heat.touch(door.position, { life = 45 })           -- a fading warm print, shared
Heat.addRule("reactor", "engine")                  -- your own name rule
Heat.setAuto(false)                                -- stop finding things by name

What it gives

CallWhat it does
Heat.at(pos)Temperature at a point: the climate's air with every heat shape and warm print reaching it, plus the radiant warmth of fires and lamps near it.
Heat.of(entity)Temperature of a thing heatSignatures knows (HeatSource, Heat.give, a name rule), or the air for anything else.
Heat.give(entity, class, opts)Script-made heat on this machine. opts: temp, active, working, size, offset.
Heat.take(entity)Takes a Heat.give off.
Heat.touch(pos, opts)A warm print that fades (temp 31, life 30 s, radius 0.12 m by default), sent to every player.
Heat.setClimate(id, overrides)Puts the scene in a climate for every player (makes the synced HeatClimate entity when there is none).
Heat.climate() / Heat.climates()The climate now, with every value filled in / every heatClimate asset installed.
Heat.addRule(pattern, class) / Heat.classForName(name)Name rules: a word in an entity's name gives it a class.
Heat.setAuto(on)Finding things by name on or off (on by default).
Heat.sources() / Heat.prints()Every heat shape held now / the warm prints still fading.
Heat.CLASSES / Heat.DEFAULT_RULESThe classes (person, animal, engine, vehicle, fire, lamp, electronics, metal, stone, water, ice, plant, warm, cold) and the default name rules.

How things get heat without tagging

  • Names: Campfire, Guard2, Generator, Fox, Crate3, Stream and dozens more words match a class. A match on a parent covers its children.
  • Players: every player's body is a warm person, whatever it is called.
  • Moving and working: people, animals and vehicles warm toward their active temperature while they move; anything working warms too. They warm over warmUp seconds and cool at half that speed.
  • The render side also reads surfaces: green reads as leaves near the air, glowing pixels read hot, metal has low emissivity so it mirrors the cold sky.

Known limits

  • Heat shapes are boxes or ellipsoids fitted to a thing's bounds when it is first seen; a thing that changes size keeps its first fit.
  • Heat.give is per machine: run it on every machine (or use a synced HeatSource) so every player agrees.
  • Warm prints sent before a player joined are not replayed to them.