Closed notexplosive closed 7 months ago
This is actually already possible. I made a demo script that can be found below or on https://github.com/Studio-Lovelies/GG-JointJustice-Unity/tree/feature/419-Support-inserting-effects-mid-text
&SCENE:TMPHLobby
&ACTOR:Dan
&SPEAK:Dan
This script tests mid sentence actions.
&AUTO_SKIP:true
Half-way through this sentence I will
&CONTINUE_DIALOGUE
&SHAKE_SCREEN:0.2,0.2,false
&PLAY_SFX:Thud3
&SET_POSE:Lean
COUGH
&CONTINUE_DIALOGUE
&SET_POSE:Normal
&AUTO_SKIP:false
and the screen will shake.
That's it.
It's kinda hacky so the question is: Is this good enough? Or is something simpler required.
@PhoebeMitchell Works for me! Tested the script on d62911e8938b8b37b1f75782ecf35e9c526dd282, it's readable and meets the acceptance criteria.
Description
Japes example:
“I’m al- >cough< …Alright- >cough< …ugh.”
on the>cough<
s, Jape wants to be able to support screenshake and/or a sound effect.Acceptance Criteria
This story will be finished when a Narrative Script can have effects that fire mid-text including screenshake and sound effects.
Implementation thoughts:
Moths pointed out that this could build on top of the functionality that changes text speed mid sentence. I think this makes a lot of sense. IIRC this system works by calling a
CONTINUE
command. So maybe the end result would look something like:&SPEAK: I'm al-
<-- We need a way to ensure this continues without an [A]-press (maybe we just requireAUTOSKIP:true
before this andAUTOSKIP:false
after we're done?)&SHAKE_SCREEN:1,0.5,false
&PLAYSFX:cough
&CONTINUE_DIALOGUE: ...Alright-
&SHAKE_SCREEN:1,0.5,false
&PLAYSFX:cough
&CONTINUE_DIALOGUE: ...ugh.