recently I made a dialog system in my game, I never made anything like that before. My method was I saved all dialogues in array editor, like first dialogue in 0, second in 1, third in 2 and so on then I fetch that into array using ajax, then simply applied dialogues by indexing.