MaterialAnimation_LargeCanopy01
Module: materialanimation_largecanopy01.lua
Overview
The MaterialAnimation_LargeCanopy01 module is responsible for triggering a material animation on a large canopy object when it enters the “CollapseFireState” state. The animation plays once the object is ready.
Inheritance
- Inherits from: none — base/utility module
- Imports: none
Instance pattern
This is a stateless manager/utility module with no per-instance tables or fields.
Functions
OnStateChange(uiGuid, uiNodeHashName, uiStateHashName)
Engine-invoked by naming convention (there’s no Event.Create/Event.* wiring for it in this file — the engine calls it directly when an object’s animation-graph node changes state). Checks uiNodeHashName == String.GetHash("Slice00") and uiStateHashName == String.GetHash("CollapseFireState") — both must match. If so, registers an Event.ObjectIsReady listener to call _PlayMaterialAnims once the object is ready.
_PlayMaterialAnims(uiGuid)
Plays a material animation on the specified object using the Object.PlayMaterialAnimation function. The animation played is "jungle_env_largecanopy01_material_anim", with the loop flag set to false (one-shot, not looping).
Events
- Listens for
Event.ObjectIsReady(registered insideOnStateChange) to call_PlayMaterialAnimsonce the object is ready, after the “Slice00” node enters “CollapseFireState”. OnStateChangeitself is not registered viaEvent.Createin this file — it’s called directly by the engine using theOnStateChangename convention (same as the siblingmaterialanimation_*modules).
Module constants & tunables
- Trigger: node
"Slice00"and state"CollapseFireState"(both hashed viaString.GetHash). This is the only sibling driver that also gates on the node name. - Animation:
"jungle_env_largecanopy01_material_anim", played one-shot (loop flagfalse) viaObject.PlayMaterialAnimation.
Notes for modders
- To retarget this to a different collapse, change the
"Slice00"/"CollapseFireState"trigger and/or the animation name — those two strings are the entire knob set. - Sibling drivers (same shape, different trigger/animation): MaterialAnimation_LargeCanopy02 (no node check; fires on
CollapseFireState/CollapseState; reuses this file’s...largecanopy01...animation name) and MaterialAnimation_TreePlaza02 (fires onFireDebrisState/FireDestroyedState; playsglobal_env_treeplaza02_anim).