Cooldown
True if a configured number of minutes have passed since the given node was most recently played, or if the node has never been played.
Category: Play history
Returns: bool
Signature
Cooldown(nodeOrTag, minutes)
The first argument is either a node ID (node_event) or a tag ID (tag_music). The second argument is the cooldown duration in minutes. The function reads elapsed time from the project’s time-of-day clock. In a project without Time enabled, using Cooldown is an authoring error: the validator flags it when the project loads, and at runtime the expression fails with the error “This expression uses time-of-day which is disabled for this project. Enable it in Project → Time.”
Examples
Cooldown(node_event, 5) // true if 5+ minutes have passed since
// node_event last played
Cooldown(tag_music, 10) // true if any tag_music node was last played
// 10+ minutes ago
Cooldown(node_hint, 1) // show a hint only if the player waited
// at least 1 minute since the last hint
Notes
Cooldown measures elapsed time against the project’s time-of-day clock. The project must have Time enabled: the validator flags a Cooldown call in a clockless project when the project loads, and if one somehow reaches the runtime anyway, the expression fails with the error “This expression uses time-of-day which is disabled for this project. Enable it in Project → Time.”
For arguments: use the ID, not the UUID; see Expressions.