Open nezbo opened 13 years ago
Yeah. This is what I'm gonna spend most of my time on the upcoming days / week. Im quite interested in figuring out a streamlined way to implement actions in the game (i.e. getting a menu when clicking on the empty house lot, etc.)
I have a pretty clear idea of how to implement dialogs. We have a giant repository of all nodes in all conversations, A NPC then has a field that points to a start-node of a conversation. A node has some text, that is the thing they are actually saying, and a number of answers the player can choose from. These answers then points to new nodes, that the node class then will load and return to the game class..
Hope it makes sense.
Yeah. I think I know where you're getting at. For now I have implemented a way to load imageEntities (entities that can't move nor participate in combat) through a CSV file, with their name, tileset, image, and position:
NAME="" TILESET="tileset1" IMAGE="35" POSX=1 POSY=7 NAME="Door" TILESET="tileset1" IMAGE="36" POSX=2 POSY=7 NAME="" TILESET="tileset1" IMAGE="37" POSX=3 POSY=7
Adding something like: ACTION_NODES=["Examine", "Open"] which would then point to a generalized version of that dialogue option. But it seems to me it'll become a bit clumsy and... huge, somehow?
How do we implement dialogue trees in the game?
It should obviously be started on the activate() method of the NPC class. Try to search for solutions to this problem on the web and in literature, it should be a quite common problem.