TUTORIAL - SETTING UP AN INLINE SPEECH SYSTEM
This tutorial assumes you have been through all the others so I’m not detailing everything in specifics. Step 1 – Select GUICamera and navigate to the Dialog Manager in the inspector. Change the DialogBox Style to ‘inLineResponse’.
Step 2 – In Answers set the gap to around 50 and the prefab to an inline prefab.
NOTE – An inline prefab should be checked by dragging it into the hierarchy, its position must be set to where the first one is to be used.
21
TUTORIAL – SETTING UP IN A GAME
This tutorial again assumes you have been through the rest and are starting to get a hang of things.
Here we will go through using this system in a more traditional game sense, such as an RPG. We will create some NPCs and attach some scripts to them. You would set up the dialog system as normal first but make sure the settings in the Dialog Manager are as follows:
Set up your Answer prefab as you would normally.
Step 1 – Open the InGameSampleBlank from the Scenes folder. Step 2 – Select the Player (The Green Ball).
Step 3 – From Scripts>Player attach both ‘BasicMovement’ and ‘Player’ as components to the Player.
22
Step 4 – Drag an NPC into the scene, a NPC can be found in Prefabs>NPC.
Step 5 – In the inspector the NPC will have a NPC script already attached. Here you need to assign a XML script and a character. For this example assign Alice(Resources>Character>Alice), as the Character and use the script for her from XMLScripts>NPC>Alice.
NOTES ON MAKING SCRIPTS FOR NPCS ? ? ?
Always make sure the Background is set to “None”.
Don’t worry too much about scene changes, try to remember paths.
It’s easier to make separate scripts for each NPC than try to interweave one complex script.
CODE NOTES ON NPCS ? ?
To call the NPCs script you have to use NPC.Speak().
Feel free to look at the “Player” and “NPC” scripts to get a feel for how they work, also feel free to use them in your own game.
23
CUSTOM DIALOGS IN THIS METHOD If you want a custom dialog box in this method, make sure that these settings are set in the DialogBox scripts settings.
ADDITIONAL NOTES
Some points worth considering about this product.
RESOURCES
Try to utilise the resources folder as much as possible. This will enable you to keep your hierarchy clean and organised.
It is worth noting that the resources in the resource folder when first using the system SHOULD NOT BE
REMOVED. This is because of a failsafe in code that ensures that your dialog will work even if the system can’t find your custom assets.
FORMATS
I made use of PNG and PSD for the majority of image times; it is recommended that you use these formats, with images that have a size that is of a power of 2. Set high antialiasing and true colour in an images setting for best results.
POSSIBLE EXTENSIONS
These are things that I haven’t implemented in this version that could perhaps make things a bit better. I may or may not add these in the future; these are just considerations for possible extensions.
KEYBOARD CONTROLS
24
I neglected to add keyboard controls just because I find the system adequate with a mouse. But I do think that the interface can be made more friendly and intuitive with keyboard controls. Especially when making use of this system in a game over a visual novel.
CONVERSATION HISTORY
A feature that is more of a trimming than a core feature, I was originally going to implement this using the mouse wheel and feel it is probably not too great a challenge to do. However this feature has been omitted from this version purely due to time constraints.
SCROLL BAR FOR INLINE CHOICES
This again probably wouldn’t be too difficult to implement. If you want more than a few responses on a question some sort of scroll system will need to be developed. I have included the DepthMask shader to create masking. I may revisit this in the future.
KNOWN BUGS
UNABLE TO FIND CHARACTER
For some reason sometimes Unity won’t load the characters from Resources. Fix – Drag the desired character into the Hierarchy.
SAVE SOMETIMES BREAKS
Not sure why this one happens but sometimes you can’t save over the file you are working on. Fix – Save with a new name, suppose it encourages backups.
SPECIAL THANKS
I would like to thank all the people on the Unity Forums for help, advice and support that I have had through the development of this project. I would also like to thank:
Melanie & Corey Powell Jones Mark Kendrick & Maureen Lawson Ilena Williams & Roger Williams
For everything you have done to help me finish this to the end and in life in general.
25