MaterialAnimation_LargeCanopy02
Module: materialanimation_largecanopy02.lua
Overview
The MaterialAnimation_LargeCanopy02 module is responsible for playing material animations on large canopy objects when they enter specific states, such as “CollapseFireState” or “CollapseState”. It triggers the animation by listening to state changes and then executing the appropriate animation sequence.
Inheritance
- Inherits from:
none — base/utility module - Imports:
none
Instance pattern
This is a stateless manager/utility module. It does not track any per-instance state; it operates based on global events and object states.
Functions
OnStateChange(uiGuid, uiNodeHashName, uiStateHashName)
Engine-invoked by naming convention (no Event.Create wiring for OnStateChange itself in this file). Unlike materialanimation_largecanopy01, this version does not check uiNodeHashName at all — it only checks uiStateHashName == String.GetHash("CollapseFireState") or uiStateHashName == String.GetHash("CollapseState"). If either matches, it registers an Event.ObjectIsReady listener to call _PlayMaterialAnims once the object is ready.
_PlayMaterialAnims(uiGuid)
Plays a material animation on the specified object using its GUID, one-shot (false loop flag). The animation name is "jungle_env_largecanopy01_material_anim" — literally the 01 name, even though this is the 02 module. This is what’s in the decompiled source; whether that’s an authoring copy-paste or intentional asset reuse can’t be determined from static reading alone.
Events
- Listens for
Event.ObjectIsReady(registered insideOnStateChange) to call_PlayMaterialAnimsonce the object is ready, after the object enters “CollapseFireState” or “CollapseState”. - Correction:
Event.ObjectStateChangedoes not appear anywhere in this file’s source — that event name was previously listed here in error.OnStateChangeis invoked directly by the engine via naming convention, not through anEvent.Create/Event.ObjectStateChangeregistration.
Module constants & tunables
- Trigger: state
"CollapseFireState"or"CollapseState"(hashed viaString.GetHash). No node check — unlike MaterialAnimation_LargeCanopy01, which also gates on the"Slice00"node. - Animation:
"jungle_env_largecanopy01_material_anim"— the01name, one-shot (false).
The animation string is literally the
largecanopy01name even though this is the02module. This is what the decompiled source contains; it may be intentional asset reuse or an authoring copy-paste — it can’t be determined from static reading alone. If you clone this file for a new canopy, double-check the animation name is the one you intend.
Notes for modders
- Change the two state strings and/or the animation name to retarget — that’s the whole knob set.
- Sibling drivers: MaterialAnimation_LargeCanopy01 (adds a
"Slice00"node check, fires only onCollapseFireState) and MaterialAnimation_TreePlaza02 (fires onFireDebrisState/FireDestroyedState; playsglobal_env_treeplaza02_anim).