Note: This tutorial should be considered outdated since its spiritual successor and far better system called VAMStory has been released by @hazmhox https://hub.virtamate.com/resources/vamstory.28256/
This is a tutorial for my Branched Dialogue system I made for Space Force which you can check out here: https://www.reddit.com/r/VAMscenes/comments/gsh5zv/space_force_episode_1/
It supports 3 way conversations and unlimited branched storylines.
This system opened up a whole new world of possibilities for me so I wanted to share it with the community and do a proper tutorial. It is fully customisable so I encourage people to tinker and improve on what I’ve done.
In this tutorial we will cover:
Start by downloading the Branched Dialogue Template attached to this post.
You can build your scene straight from my template but I expect most people will want to add this to an existing scene so here’s how to do it. I will assume your scene has at least 2 people in it.
Unzip the Branched Dialogue template and put it somewhere in your VAM Scenes directory you can find easily.
Open your existing scene in Edit mode and in the Scene Audio menu add the 2 sound files from the template Sound directory. For this step it needs to be specifically these files in this location, you can change them for what you want after.
Make a note of the exact names of your characters in your scene, or if you have 3 then the two who are the non-player characters that you want to have replies. Their name is in the top of their Control menu in VAM.
Save your scene and load the Branched Dialogue template scene. Rename Actor#1 and Actor#2 to the names you noted in your existing scene, just click the name and type the new one over it. Select Merge Load Scene in the VAM main menu and select your scene.
That’s it! Branched Dialogue should now be ready to use on your first scene.
Important note: Before you do anything else save your scene and make a copy of it to keep aside. I’ll explain why later.
If you have other scenes in a series already built you need to add the 2 audio files to them first too, you can add them in VAM or you can copy and paste the sounds from your first scene .json using a text editor. Always keep a backup in case you mess something up doing this.
Adding dialogue to a scene
First we start with clearing any existing open dialogue buttons. Click the Select button (arrow) on the VAM main menu.
Select the “CloseAllButtonsDebugButton” atom, click it’s Control tab and tick On.
You should see a new button appear to the right of any existing open dialogue buttons. Press the button and they will all close. This will become a very handy button as you build scenes so don’t forget it is there!
Now we’re ready to add some dialogue. Press the select (arrow) button again on the VAM menu and select dialogueUIButton1. Press it's “Button” tab and here you can put your first line of dialogue.
Test it out by turning the button On in it’s Control tab. If the text is too big to fit then back in the Button tab increase the Canvas Y size so it all fits.
Good stuff, we have a line done!
Now to add a response press the Button Trigger tab and press Settings by “Actor#1 dialogue text” and you can put your text in and press OK. If you want the other person to be speaking untick Actor#1 dialogue text and tick Actor#2 dialogue text and do the same thing.
By default lines spoken by characters will stay open for 5 seconds which is usually fine, but if it is a longer line you can increase the number of seconds it is open in “Actor#1 (or #2) dialogue lifetime”.
Now we can test our scene!
Select “CloseAllButtonsDebugButton” again, turn it on and press it. All the dialogue buttons will close and now save your scene. When you save the first line will trigger automatically and you will be able to press it and see the response.
Repeat these steps for each dialogueUIButton2 - 10 in sequence until you want a scene transition. There is a dialogueUIButtonFinal which doesn’t have a response if you need an extra last line in the scene.
Moving the dialogue system around
To place the buttons in your scene select the DialogueGrabPoint which is a green hand icon below the buttons and you can move the whole system where you want and it will keep it all neat and level for you.
Merge Loading general principals
Once you have filled in dialogue for your first scene we now want to merge load to the next one.
Merge loading is an incredibly powerful feature of VAM that I think everyone should be using so I’ll go into a bit of detail of how to use it properly.
The idea is that you have your starting scene load with everything your future scenes will use. This means that VAM only needs to load it all once, and after that scene transitions will be very fast.
If you have an item that you will use in later scenes but not in your opening scene, put it in your opening scene but untick it's On button in it’s Control menu. VAM will load it but not use it
Similarly if you have an item that appears in your early scenes but not in later ones just untick it’s On button (don’t delete it!) and VAM will pretend it isn’t there in all subsequent scenes.
Many atoms like Animation Patterns and CycleForces can be repurposed for different things across different scenes.
Merge loading also works with attached objects. For example if you have a hat asset you want a person to wear, you can attach it to the person using “Select Link To From Scene” and attach it to the “Head” node and place it how you want it. When you merge load the hat will be placed correctly on their head in all other existing scenes no matter how they are posed.
If the hat was already in a scene you merge loaded to it will stay where it was. If you want it on the person’s head, delete it from that scene and merge load back into it from a scene where it is on their head and it will be placed properly.
Merge Loading dialogue scenes
Now we need that copy of the scene you saved earlier before you started adding dialogue text, we’ll call this your “clean” scene.
When building scenes you want to always keep a “clean” copy in each area that has no dialogue in it to make it easier to keep track of where you are in the sequence when adding dialogue. I learned this lesson the hard way, it gets very confusing when you are overwriting existing dialogue with new dialogue.
Merge Load your “clean” scene and you can start building your next scene from it. Make sure of course to save it to a new file and not overwrite the original. When you’re done Merge Load back to your starting scene so we can set up the transition.
Select the last dialogue button that you have written text in and in it's Button Trigger tab Untick everything (you can ignore Actor#1 and Actor#2 dialogue lifetimes if you want) and tick Merge Load. Press it's settings button and choose your next scene. Now use “CloseAllButtonsDebugButton” and save your opening scene.
Congratulations, your scene should now play through and transition to the next one at the correct point!
Branching Dialogue
To branch dialogue it is much the same as a normal dialogue except untick “Enable next with animation pattern” and tick “Dialogue Branch”.
When played through this will trigger 2 new buttons “dialogueUIButtonBranch1” and “dialogueUIButtonBranch2” which will each merge load to a new scene, it can be the same scene if you want.
Select these buttons and as with normal dialogue buttons add your text for each one in it's Button tab and in the Button Trigger tab press settings on “Merge load branch scene” and choose your scene to branch to.
Now use “CloseAllButtonsDebugButton” again and save your scene and you should be able to play through and branch the storyline!
Setting who speaks the first line
By default the player always speaks first but you can change this by selecting the DialogueFirstLine atom.
In it's Animation Triggers tab select the Actions button next to “Dialogue text and lifetime”
Now tick Actor#1 or #2 dialogue text (or both if you want) and “Play Sound 2”. You can press settings next to the dialogue text of the actor you want to speak and put the line in there.
Dialogue timing and advanced techniques
Branched Dialogue is very versatile and I encourage people to refine and improve on what I’ve done. One thing that was particularly hard to gauge was timing the lines. I settled on 2 seconds as a default from when a character replies to when the player’s response appears but you can change this. In the Select menu tick “Show Hidden” and you will see all the Animation Patterns behind the scenes. DialogueFirstLine is an Animation Pattern too but is not hidden, the same principles apply to this too.
When you press a dialogue button it triggers one of these Animation Patterns, so Dialogue Button 5 for example will trigger Dialogue5AnimationPattern. Ignore the ones that end in “Step1” and choose the one corresponding to the button you want to change.
In here the Animation Speed slider sets the timing for the next button, it is a 1 second pattern and at default it is at 0.5 speed making it 2 seconds. Increase this to make the button appear faster or decrease it to make it appear slower.
If you are feeling really fancy you can click the Animation Triggers button and add different things to trigger during the transition. I used this in Space Force to trigger orgasms which I think worked quite well.
General tips and tricks
Write your dialogue in your favourite word processing package so you have spell checking and you can refer back to it as you go. Once you get into the swing of things it is surprisingly quick to copy and paste lines across into VAM.
Try to keep your lines short and snappy, big walls of text can be very off putting.
You will notice 3 deactivated colour template buttons to the left of the dialogue buttons. I put these here so you can choose a colour scheme and quickly copy and paste out the colours to indicate playing a different character or the button performing some other function than speaking a line. I haven’t used them much yet but I thought they might be useful.
I think that’s about enough for one tutorial, I hope this helps some of the budding VAM writers out there!
Thanks for reading!
This is a tutorial for my Branched Dialogue system I made for Space Force which you can check out here: https://www.reddit.com/r/VAMscenes/comments/gsh5zv/space_force_episode_1/
It supports 3 way conversations and unlimited branched storylines.
This system opened up a whole new world of possibilities for me so I wanted to share it with the community and do a proper tutorial. It is fully customisable so I encourage people to tinker and improve on what I’ve done.
In this tutorial we will cover:
- Setting up Branched Dialogue in your existing scene
- Adding dialogue to a scene
- Moving the dialogue system around
- Merge Loading general principals
- Merge Loading dialogue scenes
- Branching dialogue
- Setting who speaks the first line
- Dialogue timing and advanced techniques
- General tips and tricks
Start by downloading the Branched Dialogue Template attached to this post.
You can build your scene straight from my template but I expect most people will want to add this to an existing scene so here’s how to do it. I will assume your scene has at least 2 people in it.
Unzip the Branched Dialogue template and put it somewhere in your VAM Scenes directory you can find easily.
Open your existing scene in Edit mode and in the Scene Audio menu add the 2 sound files from the template Sound directory. For this step it needs to be specifically these files in this location, you can change them for what you want after.
Make a note of the exact names of your characters in your scene, or if you have 3 then the two who are the non-player characters that you want to have replies. Their name is in the top of their Control menu in VAM.
Save your scene and load the Branched Dialogue template scene. Rename Actor#1 and Actor#2 to the names you noted in your existing scene, just click the name and type the new one over it. Select Merge Load Scene in the VAM main menu and select your scene.
That’s it! Branched Dialogue should now be ready to use on your first scene.
Important note: Before you do anything else save your scene and make a copy of it to keep aside. I’ll explain why later.
If you have other scenes in a series already built you need to add the 2 audio files to them first too, you can add them in VAM or you can copy and paste the sounds from your first scene .json using a text editor. Always keep a backup in case you mess something up doing this.
Adding dialogue to a scene
First we start with clearing any existing open dialogue buttons. Click the Select button (arrow) on the VAM main menu.
Select the “CloseAllButtonsDebugButton” atom, click it’s Control tab and tick On.
You should see a new button appear to the right of any existing open dialogue buttons. Press the button and they will all close. This will become a very handy button as you build scenes so don’t forget it is there!
Now we’re ready to add some dialogue. Press the select (arrow) button again on the VAM menu and select dialogueUIButton1. Press it's “Button” tab and here you can put your first line of dialogue.
Test it out by turning the button On in it’s Control tab. If the text is too big to fit then back in the Button tab increase the Canvas Y size so it all fits.
Good stuff, we have a line done!
Now to add a response press the Button Trigger tab and press Settings by “Actor#1 dialogue text” and you can put your text in and press OK. If you want the other person to be speaking untick Actor#1 dialogue text and tick Actor#2 dialogue text and do the same thing.
By default lines spoken by characters will stay open for 5 seconds which is usually fine, but if it is a longer line you can increase the number of seconds it is open in “Actor#1 (or #2) dialogue lifetime”.
Now we can test our scene!
Select “CloseAllButtonsDebugButton” again, turn it on and press it. All the dialogue buttons will close and now save your scene. When you save the first line will trigger automatically and you will be able to press it and see the response.
Repeat these steps for each dialogueUIButton2 - 10 in sequence until you want a scene transition. There is a dialogueUIButtonFinal which doesn’t have a response if you need an extra last line in the scene.
Moving the dialogue system around
To place the buttons in your scene select the DialogueGrabPoint which is a green hand icon below the buttons and you can move the whole system where you want and it will keep it all neat and level for you.
Merge Loading general principals
Once you have filled in dialogue for your first scene we now want to merge load to the next one.
Merge loading is an incredibly powerful feature of VAM that I think everyone should be using so I’ll go into a bit of detail of how to use it properly.
The idea is that you have your starting scene load with everything your future scenes will use. This means that VAM only needs to load it all once, and after that scene transitions will be very fast.
If you have an item that you will use in later scenes but not in your opening scene, put it in your opening scene but untick it's On button in it’s Control menu. VAM will load it but not use it
Similarly if you have an item that appears in your early scenes but not in later ones just untick it’s On button (don’t delete it!) and VAM will pretend it isn’t there in all subsequent scenes.
Many atoms like Animation Patterns and CycleForces can be repurposed for different things across different scenes.
Merge loading also works with attached objects. For example if you have a hat asset you want a person to wear, you can attach it to the person using “Select Link To From Scene” and attach it to the “Head” node and place it how you want it. When you merge load the hat will be placed correctly on their head in all other existing scenes no matter how they are posed.
If the hat was already in a scene you merge loaded to it will stay where it was. If you want it on the person’s head, delete it from that scene and merge load back into it from a scene where it is on their head and it will be placed properly.
Merge Loading dialogue scenes
Now we need that copy of the scene you saved earlier before you started adding dialogue text, we’ll call this your “clean” scene.
When building scenes you want to always keep a “clean” copy in each area that has no dialogue in it to make it easier to keep track of where you are in the sequence when adding dialogue. I learned this lesson the hard way, it gets very confusing when you are overwriting existing dialogue with new dialogue.
Merge Load your “clean” scene and you can start building your next scene from it. Make sure of course to save it to a new file and not overwrite the original. When you’re done Merge Load back to your starting scene so we can set up the transition.
Select the last dialogue button that you have written text in and in it's Button Trigger tab Untick everything (you can ignore Actor#1 and Actor#2 dialogue lifetimes if you want) and tick Merge Load. Press it's settings button and choose your next scene. Now use “CloseAllButtonsDebugButton” and save your opening scene.
Congratulations, your scene should now play through and transition to the next one at the correct point!
Branching Dialogue
To branch dialogue it is much the same as a normal dialogue except untick “Enable next with animation pattern” and tick “Dialogue Branch”.
When played through this will trigger 2 new buttons “dialogueUIButtonBranch1” and “dialogueUIButtonBranch2” which will each merge load to a new scene, it can be the same scene if you want.
Select these buttons and as with normal dialogue buttons add your text for each one in it's Button tab and in the Button Trigger tab press settings on “Merge load branch scene” and choose your scene to branch to.
Now use “CloseAllButtonsDebugButton” again and save your scene and you should be able to play through and branch the storyline!
Setting who speaks the first line
By default the player always speaks first but you can change this by selecting the DialogueFirstLine atom.
In it's Animation Triggers tab select the Actions button next to “Dialogue text and lifetime”
Now tick Actor#1 or #2 dialogue text (or both if you want) and “Play Sound 2”. You can press settings next to the dialogue text of the actor you want to speak and put the line in there.
Dialogue timing and advanced techniques
Branched Dialogue is very versatile and I encourage people to refine and improve on what I’ve done. One thing that was particularly hard to gauge was timing the lines. I settled on 2 seconds as a default from when a character replies to when the player’s response appears but you can change this. In the Select menu tick “Show Hidden” and you will see all the Animation Patterns behind the scenes. DialogueFirstLine is an Animation Pattern too but is not hidden, the same principles apply to this too.
When you press a dialogue button it triggers one of these Animation Patterns, so Dialogue Button 5 for example will trigger Dialogue5AnimationPattern. Ignore the ones that end in “Step1” and choose the one corresponding to the button you want to change.
In here the Animation Speed slider sets the timing for the next button, it is a 1 second pattern and at default it is at 0.5 speed making it 2 seconds. Increase this to make the button appear faster or decrease it to make it appear slower.
If you are feeling really fancy you can click the Animation Triggers button and add different things to trigger during the transition. I used this in Space Force to trigger orgasms which I think worked quite well.
General tips and tricks
Write your dialogue in your favourite word processing package so you have spell checking and you can refer back to it as you go. Once you get into the swing of things it is surprisingly quick to copy and paste lines across into VAM.
Try to keep your lines short and snappy, big walls of text can be very off putting.
You will notice 3 deactivated colour template buttons to the left of the dialogue buttons. I put these here so you can choose a colour scheme and quickly copy and paste out the colours to indicate playing a different character or the button performing some other function than speaking a line. I haven’t used them much yet but I thought they might be useful.
I think that’s about enough for one tutorial, I hope this helps some of the budding VAM writers out there!
Thanks for reading!