Skip to content

Make the delusion trigger animation skippable#486

Open
egyzol wants to merge 5 commits into
CommitteeOfZero:masterfrom
egyzol:fix-chlcc-delusion-trigger
Open

Make the delusion trigger animation skippable#486
egyzol wants to merge 5 commits into
CommitteeOfZero:masterfrom
egyzol:fix-chlcc-delusion-trigger

Conversation

@egyzol

@egyzol egyzol commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Make the delusion trigger animation skippable in C;H LCC #484

On a side note I noticed that the triggers in impacto make it spin the opposite way compared to the PS3 and switch version is this deliberate?

@Enorovan Enorovan linked an issue Jun 15, 2026 that may be closed by this pull request
@Enorovan

Copy link
Copy Markdown
Member

Hello, thanks for the PR

Two things :

  • Please squash your commits
  • You're right about the startup portion being inversed, it'd be kind if you could fix it (it's probably just a sign error?

@Enorovan

Copy link
Copy Markdown
Member

Oh also, you correctly skipped the startup section, but the "locking in/zooming in" section should also be skipped (at the end of the trigger)

@egyzol

egyzol commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Happy to help where I can

I didn't mean just that the startup portion of the trigger is inverted I meant that on the ps3 and switch the pressing the right trigger makes it spin left and on impacto pressing the right trigger makes it spin right

@Enorovan

Copy link
Copy Markdown
Member

Happy to help where I can

I didn't mean just that the startup portion of the trigger is inverted I meant that on the ps3 and switch the pressing the right trigger makes it spin left and on impacto pressing the right trigger makes it spin right

Hmm I'm not remembering this but in any case, no there's no reasoning behind our implem being different so it should be fixed

@egyzol egyzol force-pushed the fix-chlcc-delusion-trigger branch from e942c8f to 1469ef5 Compare June 17, 2026 18:09
@Enorovan

Enorovan commented Jun 17, 2026

Copy link
Copy Markdown
Member

I think the startup section is also inversed, i should load up clockwise, then left-right-left, then continue clockwise

Right now it does counterclockwise, right-left-right, continues clockwise, so only step 5 is correct

@egyzol

egyzol commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

I found the fix for it but now I also found that it's still not quite alligned with the other versions so I am going to tinker with it a bit more
I'll commit it when it's fully done

@egyzol egyzol force-pushed the fix-chlcc-delusion-trigger branch from 2e60b9d to 17ffa7f Compare June 18, 2026 09:31
@egyzol

egyzol commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

It should be really close to the original now
Also added a small delay to the end of the dt when skipping

@Enorovan Enorovan requested a review from KKhanhH June 22, 2026 13:28

@PringlesGang PringlesGang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, looks great for the most part!

In addition to the other comment, the skip-exiting of the trigger also does not seem to be as smooth yet as it should be. There's a noticeable delay between the animation being skipped and the new dialogue actually showing up, and if you let go of force-skip halfway through that delay it does not automatically load the next line

If you could fix those remaining issues up, that would be great. Thanks again

Comment thread src/games/chlcc/delusiontrigger.cpp Outdated
State = Hidden;
Reset();
};
if (GetFlag(SF_MESSKIP)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this and the other one should be SF_MESALLSKIP, as you should not be able to skip the intro with the advance button

@egyzol

egyzol commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

I added the delay because it felt like it had some on the other platforms altough it could just be my eyes playing tricks on me.
I could remove the delay alltogether or make it shorter. Which one would you prefer?

@PringlesGang

Copy link
Copy Markdown
Member

I added the delay because it felt like it had some on the other platforms altough it could just be my eyes playing tricks on me. I could remove the delay alltogether or make it shorter. Which one would you prefer?

I did some digging for myself and I've figured out how the actual game does it. Bear with me, this may get a little technical

When hiding the delusion trigger, in the script (_system.scs) it enters a tight loop that keeps calling InstDelusionTriggetCHLCC type 7 until flag 2511, SF_DELUSION_UI_ANIM_WAIT, is reset to false:

46:
	Mwait 1, 0
	DelusionTrigger_07
	FlagOnJump 2511, 46  // Jumps back to label 46 if flag 2511 is true
	Jump 42

In the original game, DelusionTrigger_07 keeps track of a counter which is incremented on each invocation, and handles the hiding animation. In Impacto this is done in DelusionTrigger::UpdateHiding() instead. These functions are pretty one-to-one implementation-wise, so those should probably not be updated for this

The skipping is handled by the Mwait instruction, which in this case waits for a single frame, except if SF_MESALLSKIP is true, in which case it just keeps going. This means that if the game is skipping, it will rapidly call DelusionTrigger_07, near-instantly setting its counter to 100 which will have it trip the SF_DELUSION_UI_ANIM_WAIT flag, and thus exit the loop, skipping the animation

Because we handle the hiding animation in DelusionTrigger::UpdateHiding(), which is called through DelusionTrigger::Update() instead of InstDelusionTriggerCHLCC, the repeated calls to this instruction will not do anything, and thus Impacto does not skip

I think the cleanest solution would be to extract setHidden() into a public method on the CHLCC::DelusionTrigger class and adding

case 7:
  if (GetFlag(SF_MESALLSKIP) {
    inst.SetHidden();
  }
  break;

to InstDelusionTriggerCHLCC

Something similar would likely need to be done for skipping the showing animation and case 2

Let me know if anything's unclear, I understand this may be a lot

@egyzol

egyzol commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

It's fairly straight forward thank you for the explanation.
Now I have some other questions what's the difference between SF_MESALLSKIP and SF_MESSKIP I'm guessing that MESALLSKIP is skip mode and MESSKIP is the player pressing advance but then is there a way to differentiate between skip mode and force skip?

@PringlesGang

Copy link
Copy Markdown
Member

It's fairly straight forward thank you for the explanation. Now I have some other questions what's the difference between SF_MESALLSKIP and SF_MESSKIP I'm guessing that MESALLSKIP is skip mode and MESSKIP is the player pressing advance but then is there a way to differentiate between skip mode and force skip?

That's right, SF_MESALLSKIP is for force skip, skip all, and an active skip read (i.e., skip mode is on, the config is set to skip read, and the line is actually read).
SF_MESSKIP is for any reason the line would be skipped, whether that be through a skip like SF_MESALLSKIP or through the advance button.
This logic is all handled in ChkMesSkip if you wanna take a closer look

There isn't really a ScrFlag for differentiating skip mode from force skip, but neither does the engine ever make a difference through the script. Within the engine code that difference would be GetControlState(CT_SkipMode) vs. GetControlState(CT_ForceSkip)

@egyzol egyzol force-pushed the fix-chlcc-delusion-trigger branch from 8194643 to bfac7f6 Compare June 23, 2026 19:05
@egyzol

egyzol commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Is this how you imagined to work?

@PringlesGang PringlesGang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah you got the idea I was going for, but I've still got a small handful of pointers

Comment thread src/vm/inst_gamespecific.cpp
Comment thread src/games/chlcc/delusiontrigger.cpp Outdated
Comment thread src/games/chlcc/delusiontrigger.cpp Outdated
Comment thread src/games/chlcc/delusiontrigger.cpp Outdated
Comment on lines +591 to +599
void DelusionTrigger::SetHidden() {
SetFlag(SF_DELUSION_UI_ANIM_WAIT, 0);
Reset();
}

void DelusionTrigger::SetShown() {
SetFlag(SF_DELUSION_UI_ANIM_WAIT, 0);
Load();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at these now, I think you can safely move the SetFlags into Reset() and Load() and just use those everywhere instead, removing SetShown() and SetHidden() altogether

@egyzol egyzol force-pushed the fix-chlcc-delusion-trigger branch from d542843 to 55cd6e5 Compare June 25, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C;H LCC delusion trigger skipping logic

4 participants