Log inGet started
World

Loadout: Guns, Bows, Blades and Spells Kit

README.md

marks

Surface marks that shots leave behind: bullet holes, scorches, blade slashes, smash craters, frost, energy burns, spell sigils, paint splats and water splashes. They are stamped as oriented box decals with the engine's decal renderer. Each mark is a local entity, so every peer draws its own. Sending a hit to the other players is up to the caller.

local Marks = require("weaponsKit.marks")
Marks.place("bulletHole", hit.position, hit.normal)              -- default size, random spin, 30 s life
Marks.place("scorch", p, n, { size = 2, life = 10 })
Marks.place("paintSplat", p, n, { tint = { 0.2, 0.6, 1, 1 } })  -- recoloured variant
Marks.define("goo", { material = myGooMaterialRef, size = 0.6 })
API
Marks.kinds()Sorted kind names.
Marks.place(kind, point, normal, opts?) -> booleanStamps the mark flat on the surface at point, facing out along normal. point and normal are each a vector or {x,y,z}. opts takes size (metres), spin (radians), life (seconds) and tint ({r,g,b,a}). Returns false and warns once on an unknown kind or bad input; it never raises.
Marks.clear() / Marks.count()Removes every mark / how many are alive.
Marks.setLimit(n)Pool size (default 64). Past it, the oldest mark is recycled.
Marks.define(kind, { material, size })Adds or replaces a kind. material is a material ref, an identity, or a function returning a ref.

Default sizes (m): bulletHole 0.12, energyBurn 0.25, paintSplat 0.35, slash 0.5, crack 0.7, waterSplash 0.7, frost 0.8, magicSigil 0.9, scorch 1.2.

Marks fade over their last 1.5 s. One frame driver runs while any mark is alive. Each frame it compares one number until a mark reaches its fade, and then it updates only the marks that are fading.

Materials and textures live in marks/. Each texture is a 512² UASTC image whose alpha holds the shape, and the background is keyed to alpha 0. The decal pass blends texture alpha × base_color alpha × opacity. Glowing kinds (energyBurn, frost, magicSigil) also bind the texture as emissive_texture.