2023-02-03
Research on tweaking .inkwidget and .inkanim
super useful quote from psiberx:
you're editing
packageData, so you have two options: 1 - move your changes topackage, and nukepackageDatafor future convenience 2 - use async widget spawning
note: async widget spawning ➡️ inkGameController.AsyncSpawnFromExternal() (see cyberdoc)
So all in all, what did I have to do ?
- take .inkwidget and .inkanim and understand how they relate.
- take the whole animation and determine its key positions, at least roughly.
- clone both .inkwidget, .inkanim, rename them, and point .inkwidget to cloned .inkanim (its
animationLibraryResRef). - creating a new
definitionwith customevents:markerNameandstartDelay. also creating its counterpart intargets(path = [0]). - handle animations played automatically, or container using multiple text widget for the same sentence:
- removing
inkHorizontalPanels in .inkwidget, nested deep down underCritical_Screen_Text_Canvas/inkVerticalPanelWidget7/inkHorizontalPanelWidget2. - swap them with mere
inkText(since on the summary values displayed like78 / 45use oneinkTextfor each part:78///48). - fix the animations pointing at deleted
inkHorizontalPanels children and point to the newinkTextinstead. - also as a side note the original widgets sometimes have their
logicControllerfield set, to play animation on them automatically, which is not what you want when you are going to set the text dynamically.
- removing
- fix a couple of inconsistencies, because every once in a while some siblings widgets would have the same
CName. makes you wonder why theinkTextat the correct path is eithernullor nothing gets updated on screen (e.g.Blood_HPanel). - play biomonitor sounds.
Honestly if I had a (couple of ?) week(s ?) to allocate to this, I'd probably rewrite the widget and its animations from scratch. I'd reuse all the assets from the original .inkwidget, simplify its widgets tree, then split the .inkanim into reusable chunks of animation. I'd probably store all the key positions of all the main frame and design the whole thing to be able to get played chained, separately or be able to jump from non-consecutive segments.