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 nukepackageData
for 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
definition
with customevents
:markerName
andstartDelay
. also creating its counterpart intargets
(path = [0]
). - handle animations played automatically, or container using multiple text widget for the same sentence:
- removing
inkHorizontalPanel
s in .inkwidget, nested deep down underCritical_Screen_Text_Canvas/inkVerticalPanelWidget7/inkHorizontalPanelWidget2
. - swap them with mere
inkText
(since on the summary values displayed like78 / 45
use oneinkText
for each part:78
//
/48
). - fix the animations pointing at deleted
inkHorizontalPanel
s children and point to the newinkText
instead. - also as a side note the original widgets sometimes have their
logicController
field 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 theinkText
at the correct path is eithernull
or 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.