Emotion Bubble Fix and Other Cutscene-Related Fixes

If you liked this item, please rate it up on Steam Workshop page.

Author: Billyman

Last revision: 10 Feb, 2023 at 16:06 UTC

File size: 1.15 MB

On Steam Workshop

Description:

This mod contains various patches to fix up a couple of bugs that affect how cutscenes are shown, both story cutscenes and cutscenes that happen within the span of a battle (so after the prep screen, but before the results screen), which would be referred to as a battle cutscene from here on. The bugs, the reason why the bug existed at all, and how I made the fixes are as labeled below:

-Bug: After the first transition of a cutscene, emotion bubbles do not spawn for the duration of the cutscene.
-Reason: Emotion bubbles rely on an integer variable kept by the story manager, known as "targetIdx," which typically increments by 1 every time the cutscene proceeds, to be equal to the current position of the cutscene in order to be spawned. But when a transition is occurring, it neglects to increment the integer, probably in an attempt to prevent it from going higher. But in turn, it causes the integer to be misaligned with the current position of the cutscene, and so it would fail the condition to spawn the emotion for the rest of the cutscene.
-Fix: I used a transpiler to completely remove the condition to spawn the emotion bubbles, and now they can spawn even after a transition occurs.

-Bug: After viewing either a story or battle cutscene first, when you view another type of cutscene (battle cutscene after viewing a story cutscene, and vice versa), the filters appear to not function whatsoever, with the log stating that it can’t be done because of a camera being inactive.
-Reason: It all has to do with how the game calls the filter component, which was done not with a specific variable within it’s story manager that points towards the component for that type of cutscene, but instead with SingletonBehaviour, which finds the first active instance of a component, and locks onto that instance until the game is closed, or the component gets whacked. However, because SingletonBehaviour is now locked onto that specific filter component, if a different type of cutscene tries to activate a filter, it would again call SingletonBehaviour, which would return the wrong, and inactive filter component.
-Fix: I used harmony patches to prefix two publicly accessible methods of the filter component to redirect whatever goes through them to the other filter component if it turns out that not only is the component inactive, but the other filter component is active.

-Bug: While in a battle cutscene, not only does transitions seemingly not appear, but emotions also don’t appear as well.
Reason: This was more of a layering issue, if you happen to turn off the background, you could actually see the transition occur. This was probably a side-effect of having everything on one "layer", as battle cutscenes can’t be given the same breathing room as story cutscenes, due to having to overlay against the battle scene at all times. Emotions were also affected by layering, but it was more of a case of the game neglecting to change the layer of the spawned bubble to the appropriate one.
Fix: By changing the Camera that the object which handles the transitions focuses on, as well as increasing it’s "sorting order", I was able to almost resurface the transition, with one noticeable issue being that it gets affected by the filters, a flaw of having to focus on the same camera as the one which includes filters. I apologize if this is still an inconvenience. As for the emotion bubbles, I used another transpiler to change the layer of the spawned bubble to that of it’s parent’s layer after it’s instantiation, which means not only are emotion bubbles spawned in story cutscenes unaffected by this, but those spawned in battle cutscenes finally thrive to the surface.

I’m hoping this would relieve any headache which was induced by working on cutscenes, and having all this stuff happen (I know it did for me). If anyone has another issue relating to cutscenes or any of the fixes I applied above, or a way to improve any of the methods used above to fix the bugs, please feel free to comment here, and lemme know, I can see to implementing it whenever possible!