Jump to content

Mscr:Assets.Asset

From Ironworks Games Wiki
Revision as of 07:06, 27 August 2026 by Nlondon (talk | contribs) (Created page with "{{note|todo|TO BE COMPLETED}} = Static Initialization = Static initialization of Assets is an important topic to understand. Due to the fact that {{code|Assets.GetAsset}} can be called during static initialization, Assets loaded from disk are loaded '''before''' the general script static initialization. For that reason, it's important to not rely on any script-defined statics to be available during static initialization and construction of any Asset-derived classes, as...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
todo: TO BE COMPLETED

Static Initialization

Static initialization of Assets is an important topic to understand. Due to the fact that Assets.GetAsset can be called during static initialization, Assets loaded from disk are loaded before the general script static initialization. For that reason, it's important to not rely on any script-defined statics to be available during static initialization and construction of any Asset-derived classes, as all static values will be zero.

todo: Defer all actual Asset data loads until after creation, and call Asset.Init() before loading in the data.