Skip Typewriter Effect for Player
Skip Typewriter Effect for Player
Hi Pixel Crushers!
Right now, I have Dialogue Manager set up to show both the NPC and PLAYER dialogue.
When the player chooses a response, it types out the response after being clicked. (Some players find this redundant, and just want their chosen line to instantly appear.) How would I do this?
I know I could prepend/append all my player lines with the typewriter markup />something/< , but I'm sure there is a better way to skip the typewriter effect for player dialogue!
Right now, I have Dialogue Manager set up to show both the NPC and PLAYER dialogue.
When the player chooses a response, it types out the response after being clicked. (Some players find this redundant, and just want their chosen line to instantly appear.) How would I do this?
I know I could prepend/append all my player lines with the typewriter markup />something/< , but I'm sure there is a better way to skip the typewriter effect for player dialogue!
Re: Skip Typewriter Effect for Player
Hi,
Here are two suggestions:
1. Assuming the player uses a different subtitle panel than NPCs, remove the typewriter effect from the player's subtitle panel. For example, the Basic Standard Dialogue UI has an NPC Subtitle Panel and a PC Subtitle Panel. Inspect the PC Subtitle Panel's Subtitle Text and remove the UnityUITypewriterEffect component.
2. Inspect the Dialogue Manager. Tick Subtitle Settings > Skip PC Subtitle After Response Menu.
Here are two suggestions:
1. Assuming the player uses a different subtitle panel than NPCs, remove the typewriter effect from the player's subtitle panel. For example, the Basic Standard Dialogue UI has an NPC Subtitle Panel and a PC Subtitle Panel. Inspect the PC Subtitle Panel's Subtitle Text and remove the UnityUITypewriterEffect component.
2. Inspect the Dialogue Manager. Tick Subtitle Settings > Skip PC Subtitle After Response Menu.
Re: Skip Typewriter Effect for Player
Hi Tony!
The player and the NPC share the same subtitle panel. I believe what I have is based on WRPG template.
If I skip the PC subtitle, there is no record of what the player has said.
Is there a script that modifies only player lines of dialogue? Or the "responses"? (So that I do not have to manually enter \>line\< for each player line of dialogue?
Thanks!
Remy
The player and the NPC share the same subtitle panel. I believe what I have is based on WRPG template.
If I skip the PC subtitle, there is no record of what the player has said.
Is there a script that modifies only player lines of dialogue? Or the "responses"? (So that I do not have to manually enter \>line\< for each player line of dialogue?
Thanks!
Remy
Re: Skip Typewriter Effect for Player
Hi Remy,
You can add a script like this to the Dialogue Manager:
SkipTypewriterForPlayer.cs
You can add a script like this to the Dialogue Manager:
SkipTypewriterForPlayer.cs
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class SkipTypewriterForPlayer : MonoBehaviour
{
void OnConversationLine(Subtitle subtitle)
{
if (subtitle.speakerInfo.isPlayer)
{
subtitle.formattedText.text = @"\^" + subtitle.formattedText.text;
}
}
}
Re: Skip Typewriter Effect for Player
Hi Tony,
This works great!
I have the character names turned on, so the name always appears before the dialogue.
///
Example:
PLAYER: Hello, how are you?
NPC: I am fine.
///
Right now, the dialogue text appears instantly, but the Player name still gets typed out. Is there a way to also include the player name in this instant text script?
Thanks!
This works great!
I have the character names turned on, so the name always appears before the dialogue.
///
Example:
PLAYER: Hello, how are you?
NPC: I am fine.
///
Right now, the dialogue text appears instantly, but the Player name still gets typed out. Is there a way to also include the player name in this instant text script?
Thanks!
Re: Skip Typewriter Effect for Player
Hi,
The character name gets added to the front of the text after OnConversationLine() runs, as you've seen.
Try changing the script to this instead, which will enable and disable the typewriter effect instead of injecting a code to fast-forward it:
The character name gets added to the front of the text after OnConversationLine() runs, as you've seen.
Try changing the script to this instead, which will enable and disable the typewriter effect instead of injecting a code to fast-forward it:
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class SkipTypewriterForPlayer : MonoBehaviour
{
void OnConversationLine(Subtitle subtitle)
{
var dialogueUI = DialogueManager.dialogueUI as StandardDialogueUI;
if (subtitle.speakerInfo.isPlayer)
{
dialogueUI.conversationUIElements.defaultPCSubtitlePanel.GetTypewriter().enabled = false;
}
else
{
dialogueUI.conversationUIElements.defaultNPCSubtitlePanel.GetTypewriter().enabled = true;
}
}
}
Re: Skip Typewriter Effect for Player
Hi Tony,
I have a bit of a different problem now.
I want to NPC's name to be instant, but I want what the NPC says to be typewriter.
When I do this by using:
The responsemenu lags quite a bit before showing up. I think it has to do with what you said about this happening AFTER OnConversationLine?
Do you have any advice how to make the NPC's name be instant without this lag?
Thanks!
I have a bit of a different problem now.
I want to NPC's name to be instant, but I want what the NPC says to be typewriter.
When I do this by using:
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
subtitle.speakerInfo.Name = "\\>" + subtitle.speakerInfo.Name + "\\<";
}
Do you have any advice how to make the NPC's name be instant without this lag?
Thanks!
Re: Skip Typewriter Effect for Player
Hi,
Presumably it's lagging because the node's Sequence -- or the Dialogue Manager's Default Sequence if the node's Sequence is blank -- is set to something like:
The value of {{end}} is based on the length of the text, including the name. It doesn't take RPG Maker codes into account.
Try changing the sequence to:
This will make the node continue the conversation (i.e., to the response menu) as soon as the typewriter has finished typing.
Presumably it's lagging because the node's Sequence -- or the Dialogue Manager's Default Sequence if the node's Sequence is blank -- is set to something like:
Code: Select all
Delay({{end}})
Try changing the sequence to:
Code: Select all
Continue()@Message(Typed)
Re: Skip Typewriter Effect for Player
Code: Select all
Continue()@Message(Typed)
Is there any way to delay smartly according to typewriter, but still shows subtitle as usual?
Re: Skip Typewriter Effect for Player
Hi,
Are there any errors or warnings in the Console window when this happens?
Are there any errors or warnings in the Console window when this happens?