Good day everypony !
Today I’ll introduce you to the first bits of the Game Editor, along with the dialog system.
Our dialogs are composed of a dialog file in JSON and a script giving him life. It uses a very simple system using dialog nodes and hooks, behaving like this :
1. A init hook let the script define which node should be used to start the dialog.
2. The possible answers are gathered from the node. Each of them have a Available Hook that determines if the player can use them or not.
3. The player select an answer :
— if the answer has a HookExecute, the corresponding script function is executed and define the next node.
— else, if the answer has a DefaultAnswer, it is used to define the next node.
4. If a next node has been defined, back to step 2. Else, the dialog is over.
The script and nodes can be edited from the Game Editor, and this behaviour is already supported in the game itself. Have a few screenshots :
The script editor. On the left, scripts are sorted by types (dialogs, quests and AI). On the right, the editor allows you to edit the script, save it, close it. It supports every feature expected from an IDE (except for syntax check and auto-completion).
Last but not least, the in-game result of the dialog shown in the two previous screenshots. Just as specified, the two first answers appear, and the last one, who had a HookAvailable returning false, doesn’t.
Once internationalization support will be ready, the “key” values used here to point to nodes and answers will be replaced by a text in the language selected by the player.
That’s it for today !