scene_add_global_timer
Define a global countdown or stopwatch timer for a player or stage in a Miliastra level, so graphs can start it, react when it ends, and show round or day length without counting ticks.
Instructions
Define a global timer (全局计时器) in a copy of a save and give it to the player template (holder "player", one per player) or to the stage entity (holder "stage", one for the level): a countdown of some seconds, or a stopwatch with countdown false. A graph starts it with f.startGlobalTimer(holder entity, name); when a countdown ends, a graph on the holder hears whenGlobalTimerIsTriggered. Use it for the length of a round or of a day, instead of counting ticks in a graph: it can also be shown on the screen with scene_add_timer_display. Writes a new .gil in the workspace; the official save is not touched. Verified in play on 2026-10-10: a timer held by the stage starts counting by itself when the level loads (several seconds before the graphs start), whenGlobalTimerIsTriggered fires when it reaches zero, and f.startGlobalTimer starts it again after that.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| holder | No | player | |
| mapPath | No | ||
| seconds | Yes | ||
| countdown | No | ||
| outputName | No |