Moonstormmarker
Based on game build 714014 | Last updated: 2026-03-06
Overview
The moonstormmarker prefab creates a short-lived, rotating minimap icon used during moon storm events. It does not behave like a typical entity with persistent logic — instead, it exists solely to provide a visual cue on the minimap that updates periodically. It spawns a globalmapicon to ensure the marker is visible across clients in multiplayer. The prefab is non-simulating (persists = false), non-blocking (NOBLOCK tag), and is used exclusively on the master simulation.
Usage example
-- Typically created internally by the game during a moon storm event
-- Manual usage (e.g., for debugging) would look like:
local inst = SpawnPrefab("moonstormmarker_big")
inst:AddTag("NOBLOCK") -- already added by default
Dependencies & tags
Components used: Transform, MiniMapEntity, SoundEmitter, Network
Tags: Adds NOBLOCK
Prefabs referenced: globalmapicon
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
marker_index | number | 1 (master only) | Current frame index (0–7) for the rotating marker animation. Only used on the master. |
icon | entity reference | nil (set later) | Reference to the spawned globalmapicon used for multiplayer minimap visibility. |
Main functions
do_marker_minimap_swap(inst)
- Description: Rotates the minimap icon to the next frame (0–7) in the sequence to create an animation effect. Called periodically by
DoPeriodicTask. - Parameters:
inst(entity) — the marker instance. - Returns: Nothing.
- Error states: Resets
marker_indexto0ifnil; wraps to0after7via modulo operation.
show_minimap(inst)
- Description: Spawns a
globalmapiconto mirror this marker’s minimap appearance across clients and schedules periodic icon swaps. Called once on initialization. - Parameters:
inst(entity) — the marker instance. - Returns: Nothing.
- Error states:
inst.iconis set to the spawnedglobalmapiconentity.
Events & listeners
- Pushes: None identified.
- Listens to: None identified.
(Note: UsesDoPeriodicTaskandDoTaskInTimefor scheduling, not event listeners.)
Additional notes
- Two prefab variants are exported:
"moonstormmarker_big"(default) and"monstormmarker_debug"(likely typo for"moonstormmarker"in name). Both use the same constructorfn. - The
fnfunction returns early on clients (if not TheWorld.ismastersim) — no local logic is executed on non-master nodes. - The icon image files are loaded via
Asset("MINIMAP_IMAGE", "moonstormmarker{0-7}"), and the filename is built at runtime as"moonstormmarker" .. index .. ".png".