MaterialAnimation_TreePlaza02
Module: materialanimation_treeplaza02.lua
Overview
The MaterialAnimation_TreePlaza02 module is responsible for triggering material animations on a specific object in the game world. It listens for state changes related to fire debris and destruction, and plays a material animation when these states are detected.
Inheritance
- Inherits from:
none — base/utility module - Imports:
none
Instance pattern
This is a stateless manager/utility module with no per-instance pattern. It does not track any specific object state.
Functions
OnStateChange(uiGuid, uiNodeHashName, uiStateHashName)
Engine-invoked by naming convention (no Event.Create wiring for OnStateChange itself in this file — same pattern as the materialanimation_largecanopy01/02 sibling modules). Does not check uiNodeHashName. Checks uiStateHashName == String.GetHash("FireDebrisState") or uiStateHashName == String.GetHash("FireDestroyedState"). If either matches, 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, one-shot (false loop flag). The animation played is named "global_env_treeplaza02_anim".
Events
- Listens for
Event.ObjectIsReady(registered insideOnStateChange) to call_PlayMaterialAnimsonce the object is ready, after it enters “FireDebrisState” or “FireDestroyedState”. - Correction:
Event.ObjectStateChangedoes not appear anywhere in this file’s source — that event name (and the claim thatOnStateChange“listens for” it) 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
"FireDebrisState"or"FireDestroyedState"(hashed viaString.GetHash). No node check. - Animation:
"global_env_treeplaza02_anim", one-shot (loop flagfalse) viaObject.PlayMaterialAnimation.
Notes for modders
- Change the two fire-state strings and/or the animation name to retarget this driver — those three strings are the entire knob set.
- Sibling drivers (same one-shot
OnStateChange→Event.ObjectIsReady→_PlayMaterialAnimsshape): MaterialAnimation_LargeCanopy01 (checks"Slice00"node +CollapseFireState) and MaterialAnimation_LargeCanopy02 (CollapseFireState/CollapseState, no node check).