Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/OdintheDoggo/GodotNWS/llms.txt

Use this file to discover all available pages before exploring further.

The NWS issues alerts to communicate imminent hazards — watches, warnings, advisories, and statements — for a specific county. fetch_alerts() retrieves all currently active alerts for the county associated with your configured location and returns them as structured Alert resources. Requires location_setup_complete to have fired before calling.

Method

fetch_alerts()

Fetches active NWS alerts for the configured location’s county zone and emits alerts_fetched. Takes no parameters.

Signal

alerts_fetched(alerts: Array[Alert])

Emitted when the active alert list has been fetched and parsed.
The signal emits an empty array when no alerts are currently active for the area. Always check alerts.is_empty() before iterating.
alerts
Array[Alert]
An array of Alert resources representing each currently active alert. Each resource exposes the following fields:

Code Example

extends Node

func _ready() -> void:
    Nws.location_setup_complete.connect(_on_ready)
    Nws.setup(39.7456, -97.0892)

func _on_ready() -> void:
    Nws.alerts_fetched.connect(_on_alerts)
    Nws.fetch_alerts()

func _on_alerts(alerts: Array[Alert]) -> void:
    if alerts.is_empty():
        print("No active alerts.")
        return

    for alert in alerts:
        print("--- %s ---" % alert.event)
        print("Severity: %s | Urgency: %s | Certainty: %s" % [
            alert.severity,
            alert.urgency,
            alert.certainty
        ])
        print("Issued by: %s" % alert.senderName)
        print(alert.headline)

        if not alert.instruction.is_empty():
            print("What to do: %s" % alert.instruction)

        print("Expires: %d/%d/%d %02d:%02d UTC" % [
            alert.expires["month"],
            alert.expires["day"],
            alert.expires["year"],
            alert.expires["hour"],
            alert.expires["minute"]
        ])

Build docs developers (and LLMs) love