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 to package, and nuke packageData 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 custom events: markerName and startDelay. also creating its counterpart in targets (path = [0]).
  • handle animations played automatically, or container using multiple text widget for the same sentence:
    • removing inkHorizontalPanels in .inkwidget, nested deep down under Critical_Screen_Text_Canvas/inkVerticalPanelWidget7/inkHorizontalPanelWidget2.
    • swap them with mere inkText (since on the summary values displayed like 78 / 45 use one inkText for each part: 78 / / / 48).
    • fix the animations pointing at deleted inkHorizontalPanels children and point to the new inkText 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.
  • fix a couple of inconsistencies, because every once in a while some siblings widgets would have the same CName. makes you wonder why the inkText at the correct path is either null 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.