Definitely the best tutorial for a dialogue system. I had already managed to change the Portraits and Character Names but through a lot of If Statements. I LOVE this simple method. Thank you very much Trever. I hope your game is a success, I will be in line to buy it.
This remains the best series on how to use Ink effectively. I'm using a slightly different triggering method within a UI menu and you've enabled me to create a snazzy SMS UI for an in game message system. Thanks very much for taking the time to make these.
Dude, i followed the first tutorial for my main annual university project, and i was desperate a month ago because i didnt find exactly this feature. I think im not joking if i say that you saved my last 10 months work. This monday is the final deadline of the course, and im so excited because this may make me approve the year. Huge thanks and keep this kind of tutorials coming, extra clear and sharp!
This is a great tutorial. However tip for anyone who can't handle the fast pace- simply turn the playback speed a bit slower. Helped me a lot. (Also make sure you watch the "How it's going to work")!
damn this tutorial is so good! just finished up the first video on the dialogus system and this is so fitting for what im making! thank you so much! i cant wait to implement the rest of the tutorials on this and then expand on it!
Thank you, thank you, THANK YOU Trever! This tutorial made understanding everything a breeze, I hope you have a wonderful day mate you've literally solved all my problems with my dialogue system
@@ShapedByRainStudios One thing I wondering is how would you make it so NPCs can have different things to say after you've talked to them? I tried using the variables and logic in Ink, but I don't think they carry over once the dialogue ends and it just resets.
@Jeremy Ho This is a great question! I'm not sure if there's a clean way to save a variables state between stories solely on the Ink side. With that said, this is how I would go about it. I recommend storing the variables in your C# code and then _saving/loading_ them into/from your Ink story in the _Enter/Exit Dialogue Mode_ methods. This would allow you to more easily implement a save/load system with the variables down the road (since I don't believe Ink has that capability), and doesn't require too much extra code. Then you can use those variables, like you're trying to do right now, to add logic to your Ink dialogue that will carry over. Here's some example code that would store the state of one variable called _count_ . Of course, you would declare and use _count_ in your Ink file as normal. The main downside here is that you'll need to add some C# code whenever you want to store a different variable from your Ink dialogue. *1. Create a **_DialogueVariables.cs_** class* public class DialogueVariables { private Ink.Runtime.Object count; public void SaveVariablesFromStory(Story story) { this.count = story.variablesState.GetVariableWithName("count"); } public void LoadVariablesToStory(ref Story story) { if (count != null) { story.variablesState.SetGlobal("count", count); } } } *2. Create a variable and instantiate that class in your DialogueManager script* private DialogueVariables variables; private void Start() { ... variables = new DialogueVariables() .... } *3. Save/Load in your Enter/Exit Dialogue Mode methods* private void EnterDialogueMode(Story story) { ... variables.LoadVariablesToStory(ref story); ... } private IEnumerator ExitDialogueMode() { ... variables.SaveVariablesFromStory(currentStory); ... } I tested this out and seems to be working for me. I hope this helps! 🙂
@@ShapedByRainStudios Thank you so much! This works great! I really appreciate you going out of your way to spend the time to go through this and explain it well, and I don't take it for granted. Thanks again!
hey trevor. great work on these tutorials. they are super easy to follow and adapt for my own purposes...also you're one of the few people i've seen that is actually using the new Input system, so that's a big plus! i have a question about the color tags...the color tags only change the text after the text has typed out completely and not during typing. do you have any tips on where i can start for a solution to this issue? keep up the excellent work, and again thanks for the great tutorials! :D (EDIT: if this question is addressed in later videos just let me know and i'll find the solution as i go through the tutorials)
Hey there and glad to hear the videos have been helping! 🙂 Are you referring to the typing text tutorial (next one in this series I think)? The solution there should work with color tags. If you haven't seen that one yet - then that should give you a good idea on one way to go about it. Here's the video - ua-cam.com/video/2I92egFvC80/v-deo.html&t In addition to that tutorial, see this bug fixes/polish video for a more polished way to go about the typing text effect. The solution given there may also help with solving the issue you're having. Here's a direct link to the bug fixes video - ua-cam.com/video/HP1EYVwAhRg/v-deo.html&t Appreciate the kind words and best of luck!
Fantastic! Just one question: Tags I set in Ink always go after the text line, and therefore I can't set tags at the start of the dialogue. How can I fix this?
a good tutorial on handling a dialogue system specially with the strong potential that ink provides. I do think that the using the animator to change portraits is an interesting idea, but would use code on my own version in the end. although with this setup it will be interesting to setup like walk in and other things seen in visual novels. i would like to know how select choices not only with the controller but with the mouse as well. any ideas?
Hey there! As for things like a 'walk in' and other transitional stuff as seen in visual novels - I think the most straight forward way would be to use Ink tags with a specific key/value for the transition, and use an animator to go about the transition similar to how portraits work. Depending on how complex your transitions are though, it could be worth having a separate system in your game that manages those which the Dialogue System simply triggers. It all depends on how complicated of transitions you're going for. As for selecting choices not only with the controller, but also with mouse clicks, I know at least a few people that have gotten that working with this Dialogue System. The solution is different depending on which Input System you're using. If you're using Unity's old (default) input system, then the OnMouseDown() method is likely what you're looking for. - docs.unity3d.com/ScriptReference/MonoBehaviour.OnMouseDown.html If you're using Unity's new Input system, mouse clicking specific objects is a bit more complicated, but this thread has a couple different solutions throughout it that could be helpful. The raycasting one is likely what I would personally use (post #9) - forum.unity.com/threads/onmousedown-with-new-input-system.955053/ Best of luck and I hope that helps! 🙂
Been following along these tutorials on and off for a while and they've been SO helpful, thanks so much for making them! I'm curious, is there any way to activate tags in between lines of dialogue? I'm thinking something along the lines of: Character A speaks, Tag is resolved, Character B speaks. At the moment I can only get the tags to trigger when a line of dialogue is being played, but ideally I'd like a pause effect to resolve a tag before dialogue resumes. I'm sure there's a solution to this I can make myself but I'm curious if you're already aware of one!
Hey there! Really glad to hear the tutorials have been helping! 🙂 If I understand what you're trying to do, that should be possible using Ink tags with a couple small changes. First, you'll want to ensure tags are being handled before you display the line, so that when a tag comes in, you can handle it before Character B speaks. Second, you'll need to include some logic to wait until that specific tag has resolved before displaying the line for Character B. This can be done in a lot of ways and would be a really good learning exercise overall. Alternatively - you could use something called *Ink External Functions* instead of tags for this, which essentially can be used to call C# code directly from your Ink dialogue file. That said - you'll still need to handle pausing the dialogue line for Character B on the C# side, just like with Ink tags. I'm currently working on a video about Ink External Functions that'll hopefully be finished later this month, but in the meantime, you can scroll down to the 'External Functions' section of this documentation to see more about those. - github.com/inkle/ink/blob/master/Documentation/RunningYourInk.md Either way works though! I hope that helps a bit and best of luck to you!
@@ShapedByRainStudios That sounds like a good plan, thanks! I'll give my best shot and see if I can get something like that implemented in my project using the tags, and failing that, I'll look into the external functions as well. Looking forward to your video on that either way, sounds very useful!
Hello! this is a good tutorial! I use this to make my game project. but I have something to ask that I can use this method when player have 2 choice and choose one that wrong and make player HP -1 ?
I followed the Tutorial for the dialog system the first one, for setting it up, Im using both the old a new input system, and the Dialog wont work, the box will pop up but the dialog wont show up at all, am I doing some wrong?
Ok I have no idea if this is a problem or not but whenever I go into dialogue mode I get two messages in console saying Animator.GoToState: State could not be found and Invalid Layer Index '-1' I'm not sure exactly if I did something wrong or what since when I play the game everything seems to work just fine and I wanted to know if this could cause issues down the road and if so what should I do to try and fix it. Anyway besides this one hiccup this series has been really great and honestly i'd consider them some of the best tutorials out there!
Hey there! Thank you so much for the kind words! I'm really glad you've found the series to be helpful! 🙂 As for the warning you're getting, that's _usually_ an indicator that the animator doesn't contain a state name you're trying to transition to through code. In this tutorial, that's most likely the portrait (or layout) animator for the line - _portraitAnimator.Play(tagValue);_ (around 13:40 in this video for the portrait one). I would add a Debug.Log(tagValue) statement right before that to ensure that the tagValue is equal to an animation state in your animator. There's likely a mismatch going on there somehow. Keep in mind that the comparison is also case sensitive. I do recommend fixing it so those warnings go away, since otherwise you might end up with some unpredictable or broken portraits/layouts later down the line. It should hopefully be a pretty easy fix, but feel free to let me know if the above info leads to a dead end. Best of luck!
@@ShapedByRainStudios This is a few months down the line, but I'm getting the same issue. I've put a debug statement in each of the switch cases and they each print out what is correct. It also only happens right when I start the dialogue, I have a choice where you can loop through the dialogue endlessly and each time it's gets to the beginning the warning pops up. Any ideas? Small edit: I fixed something as it only happens once now, right when I start the dialogue. But after that, even if it loops the warnings don't get logged Edit #2: So I fixed it, after a bit more digging through my code it was exactly what you mentioned. I had a state called "Default" and was trying to call "default"
Hey there! In this kind of Dialogue System, dialogue related logic like you mentioned is usually best handled within the Ink file itself. If you haven't seen it yet, I have a video that showcases Ink's capabilities that can be found here which might help give you some ideas on how to handle your specific case - ua-cam.com/video/KSRpcftVyKg/v-deo.html Beyond what's shown in that video, Ink has many more capabilities. You can even do things like picking random choices, conditional choices, and more with the correct syntax. The Ink docs are really well written in my opinion and can be found here - github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md Best of luck! 🙂
Hi, Trever! First, thanks a lot for this brilliant tutorial. I’m a beginner on unity and c# and now I’m trying to jump to a new knot when the program reads a label on the ink JSON text. It change a variable on the script and it was working perfect. But when this variable is changed on an object, in the rest of objects change too. How could I do to make individual changes on each dialogue trigger without doing a new script for each item/object?
Hey there and thank you so much for the kind words! 🙂 There are a lot of ways you could go about that. I think the most straight forward way would be to add a configuration variable to your script (for example, [SerializeField] private bool jumpToKnot = true). Then, you can add an if/else block to handle things according to that configuration in the script. Of course, this means you'll need to adjust that configuration appropriately in the Unity inspector for each script. Hopefully that makes sense and best of luck to you!
@@ShapedByRainStudios Thanks for the quick answer! Finally I found a different way calling to a new inkjson file when the bool variable changes, but the private variable was the key as you tell me. :D
Hi Trever, first of all: Awsome tutorial series! You explained everything super clearly and make one understadn what he or she does. That makes it easy to keep on working with this Dialogue system and with Ink. I encountered a little Problem which I can't really solve though. Whenever I start a Dialogue, after talking to a NPC befor, all futur Dialogue in my dialoguePanel is shifted to th left (The SpeakerFrame is untouched by this problem). I'm pretty sure the problem is with the animations. Even though the off shift doesn't increase with each dialogue I start. Do you maybe have encountered something similar befor or have any idea what the Problem could be? Thats for helping!
I have just had the same problem. I made a temp fix by not changing the anchors of the UI. In my bug, it didn't seem like the animator could change them. U can try and see if that fixes ur problem. Good luck
This is a great series, thank you so much for making this! I did run into a little bit of a snag when handling tags, though. It seems like every tag is being handled on the line after they're written. ex. This is a line of dialogue #portrait: new_portrait This is the next line of dialogue. The portrait would change after the player advances to the second line rather than on the line the tag is written on. I'm using the dialogue manager created in this tutorial, except instead of using the input manager to call ContinueStory(), I assigned it to a UI button. I'm unsure if this is related though, as everything else works as intended, including the typing effect from the next tutorial in the series. Any idea what could be happening?
UPDATE: Okay, after being stuck on it for a few days, I fixed it by calling HandleTags() at the start of the display line coroutine instead of in ContinueStory()
I found a fix! So yeah, you are supposed to put it in not just the coroutine, but in the start of the "foreach letter in dialogue" inside the coroutine, before adding the letter. Hope this helps anyone with the issue!
Hey there! I'm not sure what you mean by 'correctly' - but I can guess that you mean the image stretches awkwardly? If that's the case, 9-sliced images might be a good solution depending on your needs. Here's a link for reference of the option in Unity that can get you started (you'd also have to slice it appropriately in the sprite editor) - docs.unity3d.com/540/Documentation/ScriptReference/UI.Image.Type.Sliced.html Best of luck and I hope that helps!
I see that this system only shows the portraits and names of the NPCs, however, would I be able to implement a portrait and name for the player itself with a bit of changing?
Unfortunately to my knowledge, Ink doesn't have any built-in support for localization. It does support non-ascii characters though. I think the easiest way right now is to have different Ink files for each language you'd need to support and then load them accordingly.
could you make the tags work with an integer instead of a string? for example, i want certain passages in my dialogue to affect the player's health bar, but i'm not sure how to do this
Definitely the best tutorial for a dialogue system.
I had already managed to change the Portraits and Character Names but through a lot of If Statements.
I LOVE this simple method. Thank you very much Trever. I hope your game is a success, I will be in line to buy it.
Thanks so much Rub! I really appreciate the support and I'm glad you've found these tutorials helpful! 🙂
This remains the best series on how to use Ink effectively. I'm using a slightly different triggering method within a UI menu and you've enabled me to create a snazzy SMS UI for an in game message system. Thanks very much for taking the time to make these.
Dude, i followed the first tutorial for my main annual university project, and i was desperate a month ago because i didnt find exactly this feature. I think im not joking if i say that you saved my last 10 months work. This monday is the final deadline of the course, and im so excited because this may make me approve the year.
Huge thanks and keep this kind of tutorials coming, extra clear and sharp!
Right on! I'm really glad to hear that these tutorials helped. Congratulations and I hope next Monday goes well for you! 🙂
This is a great tutorial. However tip for anyone who can't handle the fast pace- simply turn the playback speed a bit slower. Helped me a lot. (Also make sure you watch the "How it's going to work")!
Thank you for the kind words and great tip! 🙂
Dude... these dialogue tutorial vids you make are severely underrated. Best one by far that I have seen!
I have been WAITING for a tutorial as well explained as this one. Thank you!!!
You're welcome! I'm glad you found it to be helpful! 🙂
Thanks so much for the great tutorial, I've been going through a lot of tutorials online and this series is by far the best one
Thank you so much for the kind words! I'm really glad these tutorials helped! 🙂
Your code is so insanely clean and easy to understand.
Your channel is awesome! I've been following & re-following these ink tutorials all week, really great stuff!
Thanks so much, that means a lot! 🙂 I'm glad you've been finding them useful!
damn this tutorial is so good! just finished up the first video on the dialogus system and this is so fitting for what im making! thank you so much! i cant wait to implement the rest of the tutorials on this and then expand on it!
Really glad to hear that this has been helpful and thank you for the kind words! 🙂
This is exactly what I was looking for! Now I can be one step closer to building my dream rpg> < Thank you so much!!!!
your videos on inky and dialogue systems helped me SOOO much, thank you a lot!
I'm really glad to hear that! Thanks for the kind words! 🙂
thank you thank you for this whole playlist blessings be upon ye
Thank you, thank you, THANK YOU Trever! This tutorial made understanding everything a breeze, I hope you have a wonderful day mate you've literally solved all my problems with my dialogue system
Thank you so much for the kind words and hope you have a wonderful day as well! Really glad the videos helped! 🙂
Great video! I love learning more about Inky, it's very helpful when making dialogue systems
This is an awesome tutorial, definitely going to try to learn as much as I can from it.
Thanks so much for this series! This system is so easy to use, and your tutorials are so helpful. Thanks for the clear explanations.
You're welcome and thank you so much for the kind words! 🙂
So simple and yet its worth gold!
You are my hero, I cannot thank you enough for this.
Really really great stuff! This was extremely useful and you are excellent at teaching.
I really appreciate the kind words and I'm glad you found this useful! 🙂
@@ShapedByRainStudios One thing I wondering is how would you make it so NPCs can have different things to say after you've talked to them? I tried using the variables and logic in Ink, but I don't think they carry over once the dialogue ends and it just resets.
@Jeremy Ho This is a great question! I'm not sure if there's a clean way to save a variables state between stories solely on the Ink side. With that said, this is how I would go about it.
I recommend storing the variables in your C# code and then _saving/loading_ them into/from your Ink story in the _Enter/Exit Dialogue Mode_ methods. This would allow you to more easily implement a save/load system with the variables down the road (since I don't believe Ink has that capability), and doesn't require too much extra code.
Then you can use those variables, like you're trying to do right now, to add logic to your Ink dialogue that will carry over.
Here's some example code that would store the state of one variable called _count_ . Of course, you would declare and use _count_ in your Ink file as normal. The main downside here is that you'll need to add some C# code whenever you want to store a different variable from your Ink dialogue.
*1. Create a **_DialogueVariables.cs_** class*
public class DialogueVariables
{
private Ink.Runtime.Object count;
public void SaveVariablesFromStory(Story story)
{
this.count = story.variablesState.GetVariableWithName("count");
}
public void LoadVariablesToStory(ref Story story)
{
if (count != null)
{
story.variablesState.SetGlobal("count", count);
}
}
}
*2. Create a variable and instantiate that class in your DialogueManager script*
private DialogueVariables variables;
private void Start()
{
...
variables = new DialogueVariables()
....
}
*3. Save/Load in your Enter/Exit Dialogue Mode methods*
private void EnterDialogueMode(Story story)
{
...
variables.LoadVariablesToStory(ref story);
...
}
private IEnumerator ExitDialogueMode()
{
...
variables.SaveVariablesFromStory(currentStory);
...
}
I tested this out and seems to be working for me. I hope this helps! 🙂
@@ShapedByRainStudios Thank you so much! This works great! I really appreciate you going out of your way to spend the time to go through this and explain it well, and I don't take it for granted. Thanks again!
Anytime! 🙂
Amazing solution!
hey trevor. great work on these tutorials. they are super easy to follow and adapt for my own purposes...also you're one of the few people i've seen that is actually using the new Input system, so that's a big plus!
i have a question about the color tags...the color tags only change the text after the text has typed out completely and not during typing. do you have any tips on where i can start for a solution to this issue?
keep up the excellent work, and again thanks for the great tutorials! :D
(EDIT: if this question is addressed in later videos just let me know and i'll find the solution as i go through the tutorials)
Hey there and glad to hear the videos have been helping! 🙂 Are you referring to the typing text tutorial (next one in this series I think)? The solution there should work with color tags. If you haven't seen that one yet - then that should give you a good idea on one way to go about it. Here's the video - ua-cam.com/video/2I92egFvC80/v-deo.html&t
In addition to that tutorial, see this bug fixes/polish video for a more polished way to go about the typing text effect. The solution given there may also help with solving the issue you're having. Here's a direct link to the bug fixes video - ua-cam.com/video/HP1EYVwAhRg/v-deo.html&t
Appreciate the kind words and best of luck!
love this series. It is hard to understand why it is here for free, bcs in the udemy etc... i would be one of the "must have course".
Thank you so much for the kind words! That means a lot! 🙂
Fantastic! Just one question: Tags I set in Ink always go after the text line, and therefore I can't set tags at the start of the dialogue. How can I fix this?
a good tutorial on handling a dialogue system specially with the strong potential that ink provides. I do think that the using the animator to change portraits is an interesting idea, but would use code on my own version in the end. although with this setup it will be interesting to setup like walk in and other things seen in visual novels. i would like to know how select choices not only with the controller but with the mouse as well. any ideas?
Hey there!
As for things like a 'walk in' and other transitional stuff as seen in visual novels - I think the most straight forward way would be to use Ink tags with a specific key/value for the transition, and use an animator to go about the transition similar to how portraits work. Depending on how complex your transitions are though, it could be worth having a separate system in your game that manages those which the Dialogue System simply triggers. It all depends on how complicated of transitions you're going for.
As for selecting choices not only with the controller, but also with mouse clicks, I know at least a few people that have gotten that working with this Dialogue System. The solution is different depending on which Input System you're using.
If you're using Unity's old (default) input system, then the OnMouseDown() method is likely what you're looking for. - docs.unity3d.com/ScriptReference/MonoBehaviour.OnMouseDown.html
If you're using Unity's new Input system, mouse clicking specific objects is a bit more complicated, but this thread has a couple different solutions throughout it that could be helpful. The raycasting one is likely what I would personally use (post #9) - forum.unity.com/threads/onmousedown-with-new-input-system.955053/
Best of luck and I hope that helps! 🙂
Been following along these tutorials on and off for a while and they've been SO helpful, thanks so much for making them! I'm curious, is there any way to activate tags in between lines of dialogue? I'm thinking something along the lines of: Character A speaks, Tag is resolved, Character B speaks. At the moment I can only get the tags to trigger when a line of dialogue is being played, but ideally I'd like a pause effect to resolve a tag before dialogue resumes. I'm sure there's a solution to this I can make myself but I'm curious if you're already aware of one!
Hey there! Really glad to hear the tutorials have been helping! 🙂
If I understand what you're trying to do, that should be possible using Ink tags with a couple small changes.
First, you'll want to ensure tags are being handled before you display the line, so that when a tag comes in, you can handle it before Character B speaks.
Second, you'll need to include some logic to wait until that specific tag has resolved before displaying the line for Character B. This can be done in a lot of ways and would be a really good learning exercise overall.
Alternatively - you could use something called *Ink External Functions* instead of tags for this, which essentially can be used to call C# code directly from your Ink dialogue file. That said - you'll still need to handle pausing the dialogue line for Character B on the C# side, just like with Ink tags. I'm currently working on a video about Ink External Functions that'll hopefully be finished later this month, but in the meantime, you can scroll down to the 'External Functions' section of this documentation to see more about those. - github.com/inkle/ink/blob/master/Documentation/RunningYourInk.md
Either way works though! I hope that helps a bit and best of luck to you!
@@ShapedByRainStudios That sounds like a good plan, thanks! I'll give my best shot and see if I can get something like that implemented in my project using the tags, and failing that, I'll look into the external functions as well. Looking forward to your video on that either way, sounds very useful!
Hello! this is a good tutorial! I use this to make my game project.
but I have something to ask that I can use this method when player have 2 choice and choose one that wrong and make player HP -1 ?
I followed the Tutorial for the dialog system the first one, for setting it up, Im using both the old a new input system, and the Dialog wont work, the box will pop up but the dialog wont show up at all, am I doing some wrong?
Ok I have no idea if this is a problem or not but whenever I go into dialogue mode I get two messages in console saying
Animator.GoToState: State could not be found
and
Invalid Layer Index '-1'
I'm not sure exactly if I did something wrong or what since when I play the game everything seems to work just fine and I wanted to know if this could cause issues down the road and if so what should I do to try and fix it.
Anyway besides this one hiccup this series has been really great and honestly i'd consider them some of the best tutorials out there!
Hey there! Thank you so much for the kind words! I'm really glad you've found the series to be helpful! 🙂
As for the warning you're getting, that's _usually_ an indicator that the animator doesn't contain a state name you're trying to transition to through code. In this tutorial, that's most likely the portrait (or layout) animator for the line - _portraitAnimator.Play(tagValue);_ (around 13:40 in this video for the portrait one).
I would add a Debug.Log(tagValue) statement right before that to ensure that the tagValue is equal to an animation state in your animator. There's likely a mismatch going on there somehow. Keep in mind that the comparison is also case sensitive.
I do recommend fixing it so those warnings go away, since otherwise you might end up with some unpredictable or broken portraits/layouts later down the line. It should hopefully be a pretty easy fix, but feel free to let me know if the above info leads to a dead end.
Best of luck!
@@ShapedByRainStudios This is a few months down the line, but I'm getting the same issue. I've put a debug statement in each of the switch cases and they each print out what is correct. It also only happens right when I start the dialogue, I have a choice where you can loop through the dialogue endlessly and each time it's gets to the beginning the warning pops up. Any ideas?
Small edit: I fixed something as it only happens once now, right when I start the dialogue. But after that, even if it loops the warnings don't get logged
Edit #2: So I fixed it, after a bit more digging through my code it was exactly what you mentioned. I had a state called "Default" and was trying to call "default"
Ik its too much to ask but is it possible to do a video on tags and how to save a boolean in unity which is in ink (please and tq)
how do i make the npc ask multiple questions with different choices? should it be like an array of questions which the npc selects at random?
Hey there! In this kind of Dialogue System, dialogue related logic like you mentioned is usually best handled within the Ink file itself.
If you haven't seen it yet, I have a video that showcases Ink's capabilities that can be found here which might help give you some ideas on how to handle your specific case - ua-cam.com/video/KSRpcftVyKg/v-deo.html
Beyond what's shown in that video, Ink has many more capabilities. You can even do things like picking random choices, conditional choices, and more with the correct syntax. The Ink docs are really well written in my opinion and can be found here - github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md
Best of luck! 🙂
Hi, Trever! First, thanks a lot for this brilliant tutorial. I’m a beginner on unity and c# and now I’m trying to jump to a new knot when the program reads a label on the ink JSON text. It change a variable on the script and it was working perfect. But when this variable is changed on an object, in the rest of objects change too. How could I do to make individual changes on each dialogue trigger without doing a new script for each item/object?
Hey there and thank you so much for the kind words! 🙂 There are a lot of ways you could go about that. I think the most straight forward way would be to add a configuration variable to your script (for example, [SerializeField] private bool jumpToKnot = true).
Then, you can add an if/else block to handle things according to that configuration in the script. Of course, this means you'll need to adjust that configuration appropriately in the Unity inspector for each script.
Hopefully that makes sense and best of luck to you!
@@ShapedByRainStudios Thanks for the quick answer! Finally I found a different way calling to a new inkjson file when the bool variable changes, but the private variable was the key as you tell me. :D
When I go through after selecting "yes i have more questions" No matter what option I select It behaves as if I had selected "happy"
How do I play a sound effect when #portrait:dr_green_sad is used?
Hi Trever,
first of all: Awsome tutorial series! You explained everything super clearly and make one understadn what he or she does. That makes it easy to keep on working with this Dialogue system and with Ink.
I encountered a little Problem which I can't really solve though. Whenever I start a Dialogue, after talking to a NPC befor, all futur Dialogue in my dialoguePanel is shifted to th left (The SpeakerFrame is untouched by this problem). I'm pretty sure the problem is with the animations. Even though the off shift doesn't increase with each dialogue I start.
Do you maybe have encountered something similar befor or have any idea what the Problem could be?
Thats for helping!
I have just had the same problem. I made a temp fix by not changing the anchors of the UI. In my bug, it didn't seem like the animator could change them. U can try and see if that fixes ur problem.
Good luck
@@oscar2495 Thank you! Removing the achores from the animation work for me too.
This is a great series, thank you so much for making this! I did run into a little bit of a snag when handling tags, though.
It seems like every tag is being handled on the line after they're written.
ex. This is a line of dialogue #portrait: new_portrait
This is the next line of dialogue.
The portrait would change after the player advances to the second line rather than on the line the tag is written on. I'm using the dialogue manager created in this tutorial, except instead of using the input manager to call ContinueStory(), I assigned it to a UI button. I'm unsure if this is related though, as everything else works as intended, including the typing effect from the next tutorial in the series.
Any idea what could be happening?
UPDATE: Okay, after being stuck on it for a few days, I fixed it by calling HandleTags() at the start of the display line coroutine instead of in ContinueStory()
@@Aria-nx1xe I'm having the same issue and calling HandleTags in the start of the coroutine doesn't work. Do you have any other fixes?
I found a fix! So yeah, you are supposed to put it in not just the coroutine, but in the start of the "foreach letter in dialogue" inside the coroutine, before adding the letter. Hope this helps anyone with the issue!
does this work with 3D as well?
the portraits of the speakers don't scale correctly when the height of the whole thing changes
Hey there! I'm not sure what you mean by 'correctly' - but I can guess that you mean the image stretches awkwardly? If that's the case, 9-sliced images might be a good solution depending on your needs. Here's a link for reference of the option in Unity that can get you started (you'd also have to slice it appropriately in the sprite editor) - docs.unity3d.com/540/Documentation/ScriptReference/UI.Image.Type.Sliced.html
Best of luck and I hope that helps!
I see that this system only shows the portraits and names of the NPCs, however, would I be able to implement a portrait and name for the player itself with a bit of changing?
how about localization with ink?
Unfortunately to my knowledge, Ink doesn't have any built-in support for localization. It does support non-ascii characters though.
I think the easiest way right now is to have different Ink files for each language you'd need to support and then load them accordingly.
could you make the tags work with an integer instead of a string? for example, i want certain passages in my dialogue to affect the player's health bar, but i'm not sure how to do this