Game text conversation design

  • posterboy
  • Born
  • Born
  • posterboy
  • Posts: 2

Post 3+ Months Ago

Hello,

Have you ever played games such as Final Fantasy or Deus Ex? When you interact with the characters in those games you are given a choice of topics of what to say. Depending on your choices a different conversation will unfold. Thus allows multiple conversations to unfold depending on your actions. I'm looking to do this in flash.

What is the best way to go about doing this?

I can program in Java so hopefully this shouldn't be too difficult.

Thanks in advance.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • stev_ro
  • Beginner
  • Beginner
  • User avatar
  • Posts: 61
  • Loc: ro

Post 3+ Months Ago

Well....try placing each conversation in a separate keyframe...so when you make your choice you go to a certain keyframe...
Or you could load different external mc's...so when you take the choice nr.1 you load the mc nr.1...and so on...
  • krismeister
  • Graduate
  • Graduate
  • krismeister
  • Posts: 202

Post 3+ Months Ago

Being a Java programmer you'll probably find it easier with a MVC system. Below is an example of how to build one in Flash.

Your model consists of a Questions class which contains many objects of type Question. You might build your Question object like:
Code: [ Select ]
class com.mysite.question.GenericQuestion{

 private var id:String //this questions ID
 private var text:String; //the question
 private var answers:Array=new Array(); //a list of answers
 private var sendLocations:Array = new Array(); //a list of which question id the corresponding answer sends you to

 public function GenericQuestion(node:XMLNode)
 /*
  we're passing in an XML node because Flash handles XML well, and it sounds like your requirements can be met by it. Assign values of the node to this objects variables.
  */
 }
 
 public function getQuestion():String{
  return question;
 }

 //make more getters

}
  1. class com.mysite.question.GenericQuestion{
  2.  private var id:String //this questions ID
  3.  private var text:String; //the question
  4.  private var answers:Array=new Array(); //a list of answers
  5.  private var sendLocations:Array = new Array(); //a list of which question id the corresponding answer sends you to
  6.  public function GenericQuestion(node:XMLNode)
  7.  /*
  8.   we're passing in an XML node because Flash handles XML well, and it sounds like your requirements can be met by it. Assign values of the node to this objects variables.
  9.   */
  10.  }
  11.  
  12.  public function getQuestion():String{
  13.   return question;
  14.  }
  15.  //make more getters
  16. }

The GenericQuestion and any other types of question classes can be held inside of a Questions class. The Questions class needs among other things a method where given a question id, it returns that question.

Then your xml might look like
Code: [ Select ]
<xml>
<questions>
<question id="start">
 <text>What should I do now?</text>
 <answers>
  <answer sendLocation="He Ran">Run</answer>
  <answer sendLocation="He Hid">Hide</answer>
  <answer sendLocation="He Walked">Walk</answer>
 </answers>
</question>

<question id="He Hid">
 <text>Your hiding failed, you were found. What should you do now?</text>
 <answers>
  <answer sendLocation="He Ran">Run</answer>
  <answer sendLocation="He Flew">Fly</answer>
  <answer sendLocation="He Walked">Walk</answer>
 </answers>
</question>
...
</questions>

  1. <xml>
  2. <questions>
  3. <question id="start">
  4.  <text>What should I do now?</text>
  5.  <answers>
  6.   <answer sendLocation="He Ran">Run</answer>
  7.   <answer sendLocation="He Hid">Hide</answer>
  8.   <answer sendLocation="He Walked">Walk</answer>
  9.  </answers>
  10. </question>
  11. <question id="He Hid">
  12.  <text>Your hiding failed, you were found. What should you do now?</text>
  13.  <answers>
  14.   <answer sendLocation="He Ran">Run</answer>
  15.   <answer sendLocation="He Flew">Fly</answer>
  16.   <answer sendLocation="He Walked">Walk</answer>
  17.  </answers>
  18. </question>
  19. ...
  20. </questions>


You can see how that XML can build your model.

You will have to draw a GUI which is the view. Then build a controller which handles user interaction and draws model data onto the view.

That is one good way to do it.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 13 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.