Skip to main content

Sgcritter Glomling

Based on game build 714014 | Last updated: 2026-03-08

Overview

SGcritter_glomling is a state graph for the Glomling entity, encapsulating its behavioral states and associated animation/sound triggers. It builds on shared critter state utilities (SGcritter_common.lua) and common game states (commonstates.lua) to provide flying-specific logic (e.g., flapping sounds, flying state transitions) and creature-specific interactions (eating, nuzzling, combat, play). This graph defines how the Glomling animates and reacts across key states using time-based events.

Usage example

local inst = CreateEntity()
-- Assume inst is a Glomling prefab instance
inst.sg = StateGraphInstance("SGcritter_glomling", inst, inst:GetStateGraph())
inst.sg:GoToState("idle")
inst.sg:Start()

Dependencies & tags

Components used: soundemitter (via inst.SoundEmitter)
Tags: None identified.

Properties

No public properties.

Main functions

This file does not define any standalone public functions beyond helper closures and callbacks. It constructs and returns a StateGraph instance.

Events & listeners

  • Listens to:
    SGCritterEvents.OnEat()
    SGCritterEvents.OnAvoidCombat()
    SGCritterEvents.OnTraitChanged()
    CommonHandlers.OnSleepEx()
    CommonHandlers.OnWakeEx()
    CommonHandlers.OnLocomote(false, true)
    (All events imported via SGCritterEvents and CommonHandlers helpers)

  • Pushes: None identified.