Archived

This topic is now archived and is closed to further replies.

rogerdv

structure to store dialogs fon an RPG game

Recommended Posts

Im trying to figure out how to store dialogs for my game, but I cant find any useful way. I need to keep a quite complex dialog structure that not only have words, but also lua scripts, something like: Possible answers: 1 2 if player.intelligence<10 then Any suggestion?

Share this post


Link to post
Share on other sites
I''d store it in a graph structure, when player gets to a vertex the scrtipt would be executed to check which answers are available for the player and then shown.


darkone
Registered Linux User #317188

Share this post


Link to post
Share on other sites
Assign each state of the game, quests, etc, a number.
Save all the stuff you want in a database, and update the database as events happen.
When you meet an npc, check the variables you need for that npc in the database, and act accordingly to the value you have there.
Lua has some tools to acess sql db''s.

Share this post


Link to post
Share on other sites