After initiating a conversation, an invisible object spawns on the scene, which plays this conversation as its animation. To control the UI and the flow of the conversation, I wrote several state machine components:
Statement - displays what the NPC says.
![unity_2018221f1_personal_64bit_-_testroomunity_-_ante_portas_-_pc_mac__linux_standalone.png unity_2018221f1_personal_64bit_-_testroomunity_-_ante_portas_-_pc_mac__linux_standalone.png](https://m.gjcdn.net/content/750/23688292-c2nxkqya-v4.png)
Chose - shows dialogue options. The available options may depend on the player's attribute level (strength in this case) or the stage of the quest.
![unity_2018221f1_personal_64bit_-_testroomunity_-_ante_portas_-_pc_mac__linux_standalone.png unity_2018221f1_personal_64bit_-_testroomunity_-_ante_portas_-_pc_mac__linux_standalone.png](https://m.gjcdn.net/content/750/23688329-xbu48sjq-v4.png)
If Quest - controls the course of the conversation depending on the stage of the quest.
![unity_2018221f1_personal_64bit_-_testroomunity_-_ante_portas_-_pc_mac__linux_standalone.png unity_2018221f1_personal_64bit_-_testroomunity_-_ante_portas_-_pc_mac__linux_standalone.png](https://m.gjcdn.net/content/750/23688320-8qwcbhxm-v4.png)
Set Quest - changes the stage of a given quest.
![unity_2018221f1_personal_64bit_-_testroomunity_-_ante_portas_-_pc_mac__linux_standalone.png unity_2018221f1_personal_64bit_-_testroomunity_-_ante_portas_-_pc_mac__linux_standalone.png](https://m.gjcdn.net/content/750/23688311-tvimpsu3-v4.png)
There is also a randomizer component, but it is not used in this case.
![image.png image.png](https://m.gjcdn.net/content/750/23721010-6nzbzk2f-v4.webp)
0 comments