The Daily Click ::. Forums ::. Klik Coding Help ::. Need help with a Dialogue System
 

Post Reply  Post Oekaki 
 

Posted By Message

Lonesome Drifter



Registered
  28/05/2012 18:24:24
Points
  14
28th May, 2012 at 28/05/2012 18:36:45 -

Hi. I'm new here and have been using MMF2 on and off for a few years. I just recently felt inspired to create my first complete game on this program.

The problem I am having right now is that I can't figure out how to incorporate an RPG style dialogue system.

I tried the dialogue tutorial on clickteam's site but it is very basic and does not state how to start a dialogue while interacting with an object.


Any help/suggestions would be very much appreciated.

 
n/a

tetsuya_shino



Registered
  12/08/2004
Points
  491
29th May, 2012 at 29/05/2012 03:03:33 -

Well, there are a lot of different RPGs out there, and there are more then a few ways to display text. Maybe you can post an image from a professional game with a dialogue system you'd like to emulate. I don't have MMF2 myself, but I think you're more likely to get help from others with a visual aid.

 
n/a

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
29th May, 2012 at 29/05/2012 20:16:11 -

Dialogue systems can be as complex or as basic as you need. you can have something as simple as a String object displaying the "Alt text" of an object that you are facing to a intensely in depth conversation tree developed using a dialogue builder and text blitter.

I am currently developing a game with a dialogue system, i dont know about anyone else but i have found it to be one of the more complex things i have attempted to build.

If you are an avid MMF'er then you should be able to come up with some sort of system, if you cant then i suggest you go for the more basic option i outlined above. I thought that the dialogue would be an easier part of my game to add but it has proven to be the most difficult.

Good luck with it.

 
n/a

Lonesome Drifter



Registered
  28/05/2012 18:24:24
Points
  14
29th May, 2012 at 29/05/2012 22:57:06 -


Originally Posted by Windybeard Games
Dialogue systems can be as complex or as basic as you need. you can have something as simple as a String object displaying the "Alt text" of an object that you are facing to a intensely in depth conversation tree developed using a dialogue builder and text blitter.

I am currently developing a game with a dialogue system, i dont know about anyone else but i have found it to be one of the more complex things i have attempted to build.

If you are an avid MMF'er then you should be able to come up with some sort of system, if you cant then i suggest you go for the more basic option i outlined above. I thought that the dialogue would be an easier part of my game to add but it has proven to be the most difficult.

Good luck with it.



Thanks. I will needs lots of it. Along with lots of patience as well. As for a visual aid, this flash game from Kazerad: http://www.prequeladventure.com/this/Katia_Enter.html

It has an example of what kind of dialogue system I want to incorporate, which is having the character interact with an object and have a text/dialogue box to show up.

 
n/a

The_Antisony

At least I'm not Circy

Registered
  01/07/2002
Points
  1341

VIP MemberStarSnow
5th June, 2012 at 05/06/2012 23:18:17 -

That example you've posted seems to be using the Text Blitter object, but you've got a few options. I prefer the Character Image object as I find it a little easier to work with, but whichever you decide to use, the first step would be creating a bitmap font for either extension. Working with Text Blitter, it's easier to keep each character in the bitmap font fixed width. The Character Image object is more of an ass to set up as it treats each separate character like an active object, but it allows each character to be a different width or height.

You'll need to figure out how to store all your game text and how to recall it easily. I can't tell you how because there are so many different methods ranging from simple (external text file) to complicated (encrypted binary string array). However, it might be a good idea to create a bit of a script interpreter so your game script can also include commands to change avatar pics or animation, trigger sounds, music, or control/interact with cutscenes.

I usually like to stick with text files and the Get Line object. I don't really mind if the people playing my game can mod the game dialog, and it's easier making correlations between script event triggers and script entry points since you can literally read though the text file to find correct reference points. It also keeps script interpretation dead simple.

In my games, I create a text file and number each of the dialog lines.

0001 Hey, this is a game script.
0002 Nothing special otherwise.
0003 Just an example of how I normally store my game dialog.
0004 Both the Character Object and Text Blitter allow for text wrap, so lines can be long.
0005 The only thing you would want to avoid is making a line so long it overflows the display area.
0006 <img>bin/imgs/avatar001.png
0007 Welcome to my RPG! This will become the first line of character dialog.
0008 My name is Action Jackson. I'm a wandering minstrel.
0009 I'ma shark! Suck-a-d***! I'm a SHARK!
0010 <break>
0011 Line 10 breaks the dialog. It ends the message and hides the subapp.
0012 When I create dialogs in my games, I don't like determining both a start and end line.
0013 I only determine the start line so I can make changes to each entry and move the <break> elements around.
0014 Either option works, but I find the latter works better if you decide to edit your script later.
0015 <break>
0016 Do you like ice cream?
0017 <option>Heck yes!|Not a huge fan
0018 The 'script interpreter' can be set up to delimit characters like '|' to allow for options in the dialog.

Your interpreter should always ignore the first five characters in each line. You wouldn't want your line numbers appearing in the dialog. They're just a way to keep the script and game organized.
Right$(CurLine$( "Get Line" ), Len(CurLine$( "Get Line" ))-5)

Basically, that counts how many characters there are in any given line, then removes the first five characters. The event can be used any time you want to pull a line from your dialog and display it.

You'll want to test for script events AFTER you remove the first five characters. You can do that in one of two ways. I'd suggest loading each line of script into a Static Text or Edit Box object, test for event triggers, then pass the object content to your Text Blitter or Character Image object. You could also mod out that code I've provided. For now, I'll stick with using an intermediary object.

The number of characters will change depending on what script command you're testing. For instance, testing for Image requires 7 characters. You can mod the event script I've already provided, but have it test your intermediary object. Use "compare two general values" to pull it off.

Your first event should test for NO script commands.
--------------------------------------------------
Text$("Static Text") <> "<break>"
Left$(Text$("Static Text"),5) <> "<img>"
Left$(Text$("Static Text"),5) <> "<snd>"
Left$(Text$("Static Text"),7) <> "<music>"
Left$(Text$("Static Text"), <> "<option>"
Upon pressing (Dialog Advance Key)
--------------------------------------------------
GetLine Object: Next Line;
Character Image Object: Set Text: Right$(CurLine$( "Get Line" ), Len(CurLine$( "Get Line" ))-5);
--------------------------------------------------

The <break> command isn't going to have any following attributes, so that's why we don't need to test for the first seven characters. If no script commands are found, GetLine advances to the next line of text in the text file and the contents from Static Text are moved to the Character Image object.

To create script commands, use the "compare two general values" again.
--------------------------------------------------
Left$(Text$("Static Text"),5) = "<img>"
--------------------------------------------------
Picture Object: New Picture: Apppath$ (Right$(Text$("Static Text"),Len(Text$("Static Text"))-5);
GetLine: Next Line;
Character Image Object: Set Text: Right$(CurLine$( "Get Line" ), Len(CurLine$( "Get Line" ))-5);
--------------------------------------------------
So... that event tests for Image on the very next line. Not awesome, but I'm sure it can be modded a little to allow for each line in the script file to be parsed for script events. My only intention is providing you an idea.

The <break> event can simply trigger the dialog screen, CharacterImage/TextBlitter, and StaticText to hide. If you're using subapps, make sure your subapp shares global values and strings, then you can have the <break> event change a global value from 1 to 0. When said global value changes, hide the subapp. I like to keep all of my dialog events in a disabled event group and enable it so I can simplify game controls... ie; have the same key trigger dialog events as in-game events, but that's up to you. It also keeps dialog events from parsing while the dialog objects are hidden or disabled.

When you want to trigger dialog, you could do something like this:
"Player" is overlapping "dialog event trigger".A
Character Image Object is Hidden.
Player presses "Space Bar" on keyboard.
--------------------------------------------------
Set Global Value "Dialog_StartLine" to 6.
GetLine: Go to line "Dialog_StartLine".
Character Image Object: Make visible.
Static Text: Make visible.
Image Object: Make visible.
Activate group: Dialog.
--------------------------------------------------

All the other script commands can be made the same way. The only difference is going to be the number of characters you're testing for, removing, and what you plan to do with the rest of the data. For options, you can use any kind of string tokenizer object to separate values by '|' and test for option choice.

I've left a lot out. A lot. There are hundreds of little ways to do something like this, and hundreds of different things you can do with it. I'd be going on for pages and pages fleshing this out and suggesting all the little ways you can mod the engine or trigger it differently.

Edited by The_Antisony

 
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?

CakeSpear



Registered
  28/01/2004
Points
  112
5th June, 2012 at 05/06/2012 23:46:33 -

I will admiti that i didnt read all the replys here.
Still ill try to give my advice.

For a basic dialogue system,
- why dont you use 1 String for each Character conversation, and split the Conversations up in String paragraphs wich display after eachother.
- Create 1 String for ALL Item monologs ( or whatever its called ). Make each paragraph the monolog to different Items
( make sure to make theese Strings invissible since they are only there for the System of it )

Then create a String Object wich acts as the players Visual Dialog Text.
Simply refer to the correct String and paragraph from the Event Editor ( when interacting with Items or Characters ), and make MMF2 read 1 letter at a time and paste that letter onto the Visual String Objects ( to get that typewriter effect ).

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
6th June, 2012 at 06/06/2012 16:27:56 -

As GrimFusion said, definitely load your text from an external file. Editing your dialog from within the event editor or inside the paragraphs of a String object will be a total nightmare. I recommend the Array object and creating your own array editor.

As far as text blitting goes, both extension objects are horribly outdated. The Text Blitter object does not support Flash or IOS and the Character Image object, when used in HWA, will "bug out" and slow your framerate down well below 20fps.

I've written an example, demonstrating how to text blit simply with active objects. It supports multiple tilesets, wordwrapping and total control over the blitting speed.

http://www.whenthereisnoroominhellthedeadwalktheearth.com/MMF/chrisburrowstextblitmethod.mfa

 
n/a

Lonesome Drifter



Registered
  28/05/2012 18:24:24
Points
  14
6th August, 2012 at 06/08/2012 04:54:18 -

Okay I just tried a dialogue system example from Adam "mrman" Gledhill. With some tweaking I managed to make a working dialogue system. However, the example makes it so that the program chooses a sentence at random instead of in order. I'm not sure how to code it so that it chooses the sentences in an ordered sequence (as in from line 1 to line 2 instead of line 1 to line 3).


Any help would be appreciated.

Edited by Lonesome Drifter

 
n/a
   

Post Reply



 



Advertisement

Worth A Click