• Create Account

## How to handle Dialogue Text for NPC and Quest [Java]

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1warnexus  Prime Members

1535
Like
0Likes
Like

Posted 09 January 2014 - 11:41 AM

Code is in Java. The project is a small scale single player role playing game for PC.

How to handle Dialogue Text for NPC and Quest? Are dialogue for NPC and Quest handled differently?

At the moment, this is how it is currently handled. Text is passed through as a parameter during the creation of NPC and Soldier object.

For map screen 0 of the game (0 being the first map of the game)

public Screen0(double x, double y) {
super(x, y);
// TODO Auto-generated constructor stub
anim = new Animation(animations);
String text = "My cat is in danger! Please I need your help!";
soldier = new NPC(new Soldier(getWidth() - (getWidth() * .66)  , (getHeight() - (getHeight() * 1.2))  ),text);
}

Screen 1(1 is the second map of the game)

public Screen1(double x, double y) {
super(x, y);
// TODO Auto-generated constructor stub
anim = new Animation(animations);
String text = "I'm in need of limber. ";
soldier = new NPC(new Soldier(getWidth() - (getWidth() * 1.5)  , (getHeight() - (getHeight() * 1.2))  ), text);
}


Edited by warnexus, 09 January 2014 - 11:44 AM.

### #2haegarr  Members

7186
Like
0Likes
Like

Posted 09 January 2014 - 12:12 PM

Dialogues and quests are not the same. Although quests are often given in the course of a conversation, but they may also come from reading bulletins in a town, or materialize as sub-quest when executing a main quest, or … whatever. As such, a quest is a job to be done, has a current state, has conditions which denotes its success (goal of the quest), perhaps also conditions denoting its final fail, defines a reward, and perhaps other things that doesn't came to my mind at the moment. On the other hand a dialogue is a piece of conversation, may transport just facts which must be known by the player, or is simply garnishment for the game, perhaps some needless gossip. Conversation needs to be tracked, too, and hence also has a kind of state.

Thinking that dialog and/or quests are just text is wrong. Text is an auxiliary form of expression for both, nothing less but also nothing more.

BTW: Maps should be data, perhaps each one owned by an instance of Map, but not own derived classes! The same is true for dialogue and quests and anything else that counts to the assets of the game.

### #3warnexus  Prime Members

1535
Like
0Likes
Like

Posted 10 January 2014 - 02:07 PM