Sign in to follow this  
Nicholas Kong

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

Recommended Posts

Nicholas Kong    1535

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

Share this post


Link to post
Share on other sites
haegarr    7372

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this