Jump to content


Photo
* * * * * 8 votes

Dialog System - Messages, Questions And Input


  • Please log in to reply
113 replies to this topic

#1 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 05 August 2013 - 09:35 PM

  • Title: Example-Dialog
  • Description: A dialog system that supports multiple choice questions, text input and more
  • GM Version: GM:Studio / GM8(.1)
  • Registered: Yes
  • File Type: .gmz / .gmk
  • File Size: 3 MB
  • File Link: (Mediafire): GMZ | GMK
  • Required Extensions: None
  • Required DLLs: None
  • Tags: dialog, message, question, input, textbox, pause
Summary
A while ago I made a [url=http://gmc.yoyogames.com/index.php?showtopic=519406]simple dialog system, which seemed to be quite useful for many. I decided to improve upon it and created this.
Unfortunately it is not compatible with the old one so if you are switching over you'll have to rewrite a whole bunch of code... But it has a lot more features! These features include:
  • Basic messages, that just have text
  • Different coloured text within one message
  • Different sized text within one message
  • The speaker's name separated from the rest of the message
  • 2 spots for images of the character to appear behind the message. See image below
  • These images can slide in, and be animated
  • Automatic line wrapping, even splitting extremely long messages into multiple boxes
  • Text appearing letter by letter, with variable speed and skip to end
  • Beeping noise while text is appearing, and when messages close
  • Questions with multiple options (up to 15)
  • Text input for things like names
  • Confirmation for both forms of input
  • Stuff triggered by messages
  • Variables in messages
  • Support for importing dialog from an external .ini file. Good for multilingual games
  • Pause the rest of the game while dialog is visible, and darken the surroundings
Most features can be disabled with little difficulty, or even by simply ignoring them. Just follow the instructions found in some of the many comments. Small modifications for things like fading in the sprites (rather than sliding) or voice acting are not particularly difficult, but may not be explicitly described in said comments.

It works by storing messages in a ds_queue. The sprites, speaker, and coloured/resized text are encoded into the same string, so it only requires one value for each message. Questions and text input are all handled in the same place, and can trigger more dialog messages seemingly seamlessly.
It pauses the game by creating a sprite from the screen using sprite_create_from_screen(), then deactivating all instances except any controllers you might have. It then draws this sprite and the dialog in the Draw GUI event so that it never gets covered by anything else.

A note to users:
Implementing the system directly into your game is not particularly difficult, as it only relies on the fact that you have a Controller object. If you do not have a Controller object, you should, and can either make one or move the code from the example's Controller object to the DialogController.

A few things that you might easily miss
  • There are constants. Don't forget to import them to your game.
  • The Controller must be behind the DialogController, in terms of depth, to ensure drawing success
  • The Controller and DialogController objects are persistent and should be created in the first room
  • If you are wondering why you never see rSetup in the game, check the room's Creation Code on the Settings tab of the room editor
This system has been tested only on Windows, and should work on Mac/Ubuntu. Not sure about mobile devices with virtual keyboards though.

Here is an image of the engine in action:
Spoiler


Other things you could possibly learn from this engine are grid based movement, and how to pause the game.

Edits:
Spoiler

Edited by thegame, 30 June 2015 - 12:08 AM.

  • 6

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#2 RabbiRexTexas

RabbiRexTexas

    GMC Member

  • GMC Member
  • 144 posts
  • Version:GM:Studio

Posted 11 September 2013 - 11:21 PM

When I run your demo, I get the following compile error:
 

In script game_pause line 8 pos 26: Unknown function or script: sprite_create_from_screen

Using GM:Studio, 2.1, Steam Version, Windows 7.


  • 0

#3 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 11 September 2013 - 11:30 PM

Ah yes... They removed that function in the recent update... I'll post a fix for that sometime soon.
Thanks for telling me.
  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#4 RabbiRexTexas

RabbiRexTexas

    GMC Member

  • GMC Member
  • 144 posts
  • Version:GM:Studio

Posted 11 September 2013 - 11:46 PM

Ah yes... They removed that function in the recent update... I'll post a fix for that sometime soon.
Thanks for telling me.

 

I'll eagerly await that. I've been looking for a method of implementing one-character-at-a-time dialog crawls for months.

 

Another heads up: when I comment out the offending line of code, I get a bunch of other compile errors:
 

In Script dialog_question at line 22 : function "dialog_msg" expects 4 arguments, 2 provided
In Script dialog_input at line 12 : function "dialog_msg" expects 4 arguments, 2 provided
In Script dialog_from_array at line 18 : function "dialog_question" expects 1 arguments, 2 provided
In Object Controller, in Event Create event number 0 at line 6 : function "dialog_import" expects 2 arguments, 0 provided
In Object DialogController, in Event Create event number 0 at line 4 : function "dialog_import" expects 2 arguments, 0 provided
In Object DialogController, in Event Step event number 2 at line 31 : function "dialog_from_array" expects 2 arguments, 1 provided
In Object DialogController, in Event Step event number 2 at line 34 : function "dialog_from_array" expects 2 arguments, 1 provided
In Object DialogController, in Event Step event number 2 at line 37 : function "dialog_from_array" expects 2 arguments, 1 provided
In Object DialogController, in Event Step event number 2 at line 40 : function "dialog_from_array" expects 2 arguments, 1 provided
In Object DialogController, in Event Step event number 2 at line 43 : function "dialog_from_array" expects 2 arguments, 1 provided
In Object DialogController, in Event Step event number 2 at line 49 : function "dialog_from_array" expects 2 arguments, 1 provided
In Object DialogController, in Event Step event number 2 at line 77 : function "dialog_from_array" expects 2 arguments, 1 provided
In Object DialogController, in Event Step event number 2 at line 79 : function "dialog_from_array" expects 2 arguments, 1 provided
In Object DialogController, in Event Step event number 2 at line 84 : function "dialog_from_array" expects 2 arguments, 1 provided
In Object DialogController, in Event Step event number 2 at line 85 : function "dialog_from_array" expects 2 arguments, 1 provided
In Object DialogController, in Event Step event number 2 at line 89 : function "dialog_from_array" expects 2 arguments, 1 provided


Edited by RabbiRexTexas, 11 September 2013 - 11:49 PM.

  • 0

#5 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 12 September 2013 - 03:00 AM

Yes I know about those ones too. Again due to incompatibility with the new version. I'll fix that with the update.
Edit: I've finished and uploaded the new version. Enjoy!

Edited by thegame, 12 September 2013 - 03:12 AM.

  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#6 RabbiRexTexas

RabbiRexTexas

    GMC Member

  • GMC Member
  • 144 posts
  • Version:GM:Studio

Posted 13 September 2013 - 06:30 PM

Thank you!


  • 0

#7 alexandervrs

alexandervrs

    GMC Member

  • GMC Member
  • 745 posts
  • Version:GM:Studio

Posted 14 September 2013 - 11:23 AM

It's pretty solid. Not sure if it was in the demo though but does it support having variable speed *inside* the message? Like in order to create a stuttering voice? I saw "Text appearing letter by letter, with variable speed and skip to end" but not sure if it's what I am thinking.

 

Some ideas:

 

Parsing the # character as # and not as newline in the input field would be nice, perhaps also allowing only alphanumeric+space. Maybe you could even make functions for that like dialog_set_input_type() with argument[0] options as "all","digits","letters","lettersdigits","name" (letters,digits and space) as well as have a dialog_set_input_limit() to limit the number of characters that can be entered.

 

Having two keys, one to skip the message and one to confirm seems a bit redundant, most RPG games use one confirm/skip key for everything.

 

Also would be nice if this could skip the messages and navigate through choices with the gamepad buttons. :)


  • 0

#8 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 14 September 2013 - 03:06 PM

For the variable speed for stuttering, use the WAIT constant ("Hi uh..." +WAIT+ " Bob")for a brief pause. Add more ("Hi uh..." +WAIT+WAIT+WAIT+ " Bob") for a longer pause.

The input things are a good idea. I may add that at some point.

As for two keys, I'm not sure what you mean. I believe it is Enter that does skipping, confirming, and next message.

And adding gamepad functionality is something for the user to do if they want it. It is an example after all. You're welcome to change it and add as much as you want to it. The example's just there to show you how to start.
  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#9 Tranz3d

Tranz3d

    GMC Member

  • GMC Member
  • 504 posts
  • Version:GM:Studio

Posted 18 October 2013 - 02:52 PM

..


Edited by Tranz3d, 18 January 2016 - 09:56 PM.

  • 0

#10 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 18 October 2013 - 08:35 PM

Ah, I see. That is a good point. I'll change that next time I update this.
I never said you had to use those controls though, so please change them if you prefer it that way.
  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#11 Kian

Kian

    Unplugged

  • GMC Member
  • 303 posts
  • Version:GM:Studio

Posted 08 November 2013 - 07:27 PM

Implementing the system directly into your game is not particularly difficult, as it only relies on the fact that you have a Controller object. If you do not have a Controller object, you should, and can either make one or move the code from the example's Controller object to the DialogController.

The Controller must be behind the DialogController, in terms of depth, to ensure drawing success
The Controller and DialogController objects are persistent and should be created in the first room


I'm a bit confused on that bit.

 

I don't have a Controller object, but do I need both, or just the created DialogController with Controller code in?


  • 0
@infeckgames       | infeck.com           | bunnAI | CyberLight Rider | Zombie Clicker

27531.png Vp3VoKc.png

#12 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 09 November 2013 - 01:27 AM

... If you do not have a Controller object, you should, and can either make one or move the code from the example's Controller object to the DialogController...

You do not need both. You can move the Controller's code to it, as is described in the above sentence. I generally use both, as I try to keep the code for each thing separate, but it works with DialogController also doing Controller things.
  • 1

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#13 Kian

Kian

    Unplugged

  • GMC Member
  • 303 posts
  • Version:GM:Studio

Posted 10 November 2013 - 11:56 PM

Thanks thegame ^^


  • 0
@infeckgames       | infeck.com           | bunnAI | CyberLight Rider | Zombie Clicker

27531.png Vp3VoKc.png

#14 WeaN

WeaN

    GMC Member

  • New Member
  • 11 posts
  • Version:GM:Studio

Posted 27 January 2014 - 10:12 PM

I can't seem to import this gmx file ... I get the "Exception reading assets from GMXFile "Config :: Configs\Default" error :/

Any chance you would upload the project file the way you did it in your previous thread ? I'm dying to see and learn from this.


  • 0

#15 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 28 January 2014 - 12:19 AM

Aha. I had it that way originally, but I got rejected because it's not the correct way to do it apparently. They haven't gone back and checked the old one though, so I just left it.

I'll upload it and PM you the link. (Edit: DONE)

Edit: I also reuploaded the .GMZ with some bug fixes. Maybe there was another problem with backwards compatibility between versions causing your error. Hopefully it's fixed.

Edited by thegame, 28 January 2014 - 12:26 AM.

  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#16 ketchuphed

ketchuphed

    GMC Member

  • GMC Member
  • 14 posts
  • Version:GM:Studio

Posted 02 February 2014 - 06:58 AM

Great engine, although I have only a couple questions so far: I may be completely missing something, but is there a simple way to make the game execute a command at the end of a dialog? Such as advancing the room or opening or closing a door. My 2nd question is: How do i go about crediting you for using elements of your engines?


  • 0
Current WIP:   Untitled_RPG
Name:          -|--------
Graphics:      -|--------
Mechanics:     ---|------
World Design:  |---------
Total:         -----|----------------------------------

#17 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 02 February 2014 - 06:47 PM

There's no way of doing something at the end built in yet... That's something I didn't think of.
I think it would be something similar to how the questions work just without getting input. I'll try and get it working and post an update.
Edit: Done and uploaded. Small changes made to the End Step event of DialogController and the dialog_msg() script.

As for credits, don't worry about that too much. Mention me (thegame) in the credits somewhere if you like.

Edited by thegame, 02 February 2014 - 07:02 PM.

  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#18 ketchuphed

ketchuphed

    GMC Member

  • GMC Member
  • 14 posts
  • Version:GM:Studio

Posted 03 February 2014 - 07:13 AM

Also, I've found is that to have the dialog box appear correctly using views, i had to modify a couple things, but in my game so far i allow the user to adjust the size of the window, when I resize the window the coordinates of the dialog box are somewhere strange and off the screen. Another thing about using views with this script is that the draw sprite from screen script throws some things off kilter, shears some sprites into pieces, and so on. It also makes all my invisible sprites visible. such as wall controllers and my separate collision boxes. any tips on this?


  • 0
Current WIP:   Untitled_RPG
Name:          -|--------
Graphics:      -|--------
Mechanics:     ---|------
World Design:  |---------
Total:         -----|----------------------------------

#19 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 03 February 2014 - 12:32 PM

With the window being resized there are probably a number of things that need to be changed. I didn't put support for that since most games have fixed window size...
One thing that might help is that the surface used for drawing should probably be set to a fixed size of 2048x2048. That's bigger than any screen you will ever get and better supported as it's a power of 2.
I haven't done much with surfaces before though, so I'm not completely sure how to fix all the issues. It will take some work for sure.

For the visibility thing, just put a visibility check in the script:
with(all) {
    if(sprite_index >= 0) {
        if(visible) {
            draw_self();
        }
    }
}
Oh the things I overlooked... I'll clean this thing up and upload another one soon. Maybe not today though.
The next version of GM:S should make this all easier when they allow us access to the application_surface, so it will probably work better after that.
  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#20 ketchuphed

ketchuphed

    GMC Member

  • GMC Member
  • 14 posts
  • Version:GM:Studio

Posted 10 February 2014 - 06:15 AM

Thank you for all the help with using your engine. I'm most greatful that I actually found one that was recent and still being supported and updated. You definitely have a spot reserved in the credits of my game. It's still in the early dev stages, but I've been chipping away at it the past few weeks. Again, Thank you!
  • 0
Current WIP:   Untitled_RPG
Name:          -|--------
Graphics:      -|--------
Mechanics:     ---|------
World Design:  |---------
Total:         -----|----------------------------------

#21 psymist

psymist

    GMC Member

  • New Member
  • 3 posts
  • Version:GM:Studio

Posted 20 February 2014 - 03:44 AM

I was wondering if you could give me some guidance on how to use this dialogue system.  I'm new to Gamemaker, so I'm having a bit of trouble figuring out how this works.  Sorry if these are basic questions.

 

Is it possible to have NPC conversations with questions using the message function or do I have to use the same "Deal with questions" script and dialogue file as the opening dialogue?  I'm not exactly sure how to have the character pictures come up with the dialogue file as opposed to the messages, which is why I ask.

 

Also, would it be better to have every dialogue (about 8) in the same dialogue folder and start the reference at a later m (m49 instead of m0) or make a bunch of separate dialogue files?


Edited by psymist, 20 February 2014 - 09:40 AM.

  • 0

#22 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 20 February 2014 - 12:18 PM

It is possible for NPC conversations to use questions with the functions, but the responses for questions must be done in the "Deal with questions" block. Use the dialog_question function, rather than dialog_msg to ask a question.

To get the pictures to come up from in the file, use sa1, sa2, sa3, etc. for the left side sprite, and sb1, sb2, sb3 for the right side. I've updated the example with another few messages in the file if you want to see this.

I don't think it will work if you use multiple dialog files. You have to start it at m0, and they should all be in the same file. I suggest either using all coded messages using dialog_msg and other functions, or all from the dialog file, but not going back and forth as that can get messy and confusing.

Read the comments (and the code) in the scripts, as a few of your questions are answered there.
  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#23 psymist

psymist

    GMC Member

  • New Member
  • 3 posts
  • Version:GM:Studio

Posted 24 February 2014 - 08:08 AM

Thanks for your response!  The example you created helped a lot.  I think I'm going to work with the dialog file since I've typed everything in there and calling the pictures is so easy.


  • 0

#24 psymist

psymist

    GMC Member

  • New Member
  • 3 posts
  • Version:GM:Studio

Posted 28 February 2014 - 02:42 PM

I was wondering if you could give me a bit more help.  I think I understand how the player space command works.  firstMessage gets read and goes into the text file.  I added dialog_init() to the FromFile NPC create command to extend the dialogue beyond the first message.  However, I cannot make the "Deal with Questions" script (from the dialog controller) function in the End Step.  When the messages appear in the text box, it doesn't break the choices and following the branching pattern for the dialogue that I set up.  The choices look like the following: Wow, it's a cat. I Lol, it's a dog.  The stick replaces the OPTION tag as if the stuff isn't being read.  Sorry to bother you again.


  • 0

#25 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 28 February 2014 - 09:26 PM

Don't put dialog_init() in the FromFile NPC. It should only be run once by the DialogController at Game Start.

The FromFile NPC needs dialog_import() to get it's script from the ini file, and it should get all of them. To make it say more than one message at a time, change the messageCount variable found in it's Create event.

Then for questions, copy how the DialogController's intro dialog thing goes. Be sure that you set the t# value for the question to q and that it is being triggered by dialog_from_array() and not manually.

Truthfully, the way that I have got the Player to do the talking with <Space> Pressed in the example is not that great. There are certainly better ways to trigger the dialog, but this was simply the easiest to write in the example. firstMessage is not added to the text file though... it is just offset so that when you talk to the NPC again it starts with the next message - this allows for those characters that say different things every time you talk to them.

I hope this helps, though I am not sure I understand your issue...
  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#26 AdamUnavailable

AdamUnavailable

    GMC Member

  • New Member
  • 6 posts
  • Version:GM:Studio

Posted 16 March 2014 - 09:42 PM

I've found this example immensely useful for starting up an RPG.

 

The thing I'm stuck on right now is modifying how often a character is printed. I see there is a constant for dialog speed (DIASPD), but is it implemented? After searching through all the scripts, I can't find it referenced anywhere.

 

While the default frequency is fine at a room-speed of 30, it's inconvenient for a 60fps room to have to basically double all WAIT commands. I've started working on a solution but thought I should ask first in case I missed something.


  • 0

#27 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 17 March 2014 - 12:25 PM

Wow. You're right, I forgot to implement it.
Find the line that says
diaPos = min(diaPos + 1, msgLen);
and make it
diaPos = min(diaPos + DIASPD, msgLen);
and it should start working.

Sorry about that...
  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#28 AdamUnavailable

AdamUnavailable

    GMC Member

  • New Member
  • 6 posts
  • Version:GM:Studio

Posted 17 March 2014 - 03:11 PM

Thank you, the fix works perfectly.


  • 0

#29 TDSrock

TDSrock

    Aedifex Praecantatio

  • GMC Member
  • 915 posts
  • Version:GM:Studio

Posted 19 March 2014 - 10:08 AM

first off.
thanks for making this great looking engine. however i keep running into a bug with the lastMessage value.

i have been staring at what i did and what you did for two days now and still havent figured out my mistake.

error message below

Spoiler

 

at this stage i am just trying to get all the engines running on my game, so i copied over your Death sign aswell in this. but that shouldent be the issue...
als when i comment the part of code this refers to i dont get an error, however the lastMessage is never created before talking to someone. which shouldent be the case i beleive. also the startup talk doesent seem to work... i copied over what you did and changed the names acordingly.

 

thanks

-TDS


Edited by TDSrock, 19 March 2014 - 10:08 AM.

  • 1

yoyogamessigTDSrock_zpsb6af8f68.png


#30 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 19 March 2014 - 11:50 AM

From that, I can't really tell what the problem is... A few possibilities though:

Did you copy over the _NPC parent object of the sign? That may have some effect on it, though I'm not sure.
Try initializing lastMessage in dialog_init() by putting lastMessage = ""; at the end. It should be written there anyway, I just forgot...

If this doesn't work, I can look into it in more detail if you can send me your project. ([File -> Export Project] to make a .gmz, then upload it somewhere)
  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#31 TDSrock

TDSrock

    Aedifex Praecantatio

  • GMC Member
  • 915 posts
  • Version:GM:Studio

Posted 19 March 2014 - 04:20 PM

From that, I can't really tell what the problem is... A few possibilities though:

Did you copy over the _NPC parent object of the sign? That may have some effect on it, though I'm not sure.
Try initializing lastMessage in dialog_init() by putting lastMessage = ""; at the end. It should be written there anyway, I just forgot...

If this doesn't work, I can look into it in more detail if you can send me your project. ([File -> Export Project] to make a .gmz, then upload it somewhere)

i'll try these fixes, will edit this post later once i have (30-50 minuts)

EDIT:

thanks man, now it works 100%

i really like this engine. thanks a bunch for being pretty awesome and making this and then letting others use it.

 

-TDS


Edited by TDSrock, 19 March 2014 - 10:03 PM.

  • 0

yoyogamessigTDSrock_zpsb6af8f68.png


#32 TDSrock

TDSrock

    Aedifex Praecantatio

  • GMC Member
  • 915 posts
  • Version:GM:Studio

Posted 31 March 2014 - 03:35 PM

hey mate me again. i was wondering what if it is possible to have the system print out the player's name which is stored as Player.name (Player being the object)

i would prefer the dialog to be written in the external file.

i'd prefer to ask you first before fiddling with the code as it currently doesn't support this.

a good way to implement it i feel is making it so that if you do CONPlayer.nameCON it will use the constant inside the two CON's. or similar deals of course

 

i'll be trying to get this to work, if i figure it out i'll post how i did it here as i do imagine it is usefull for others

 

EDIT
i have bee struggling to get this to work as i imagined it would.

what i tried to do.
i tried to make another constant similar to SIZE called CON
gave it it's own switch statement and such and i think it works however i don't know how to actually get it to change the CONp into Player.name

 

if you could help me getting this to work i would be extremely happy as it is the only tidbit i want to work for the very first alpha version of my game. this game is a school project (but also a personal project) and i wish to have the first alpha done before Friday if possible.


Edited by TDSrock, 31 March 2014 - 07:39 PM.

  • 0

yoyogamessigTDSrock_zpsb6af8f68.png


#33 greyzebra

greyzebra

    GMC Member

  • GMC Member
  • 119 posts
  • Version:GM:Studio

Posted 31 March 2014 - 03:41 PM

Thanks for sharing, this is very nice.


  • 0

#34 Finaldream3

Finaldream3

    GMC Member

  • New Member
  • 4 posts
  • Version:Unknown

Posted 02 April 2014 - 01:41 AM

I was wondering if you could make a tutorial on how to use this 


  • 0

#35 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 02 April 2014 - 08:38 PM

@TDSrock - Working on it Done. Please tell me if you notice any errors and enjoy!
@greyzebra - Thank you for using it
@Finaldream3 - Unfortunately I cannot, as this is the tutorial. Read all the words (in the OP and in the code) and you should hopefully be able to figure it out.

Edited by thegame, 02 April 2014 - 09:33 PM.

  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#36 TDSrock

TDSrock

    Aedifex Praecantatio

  • GMC Member
  • 915 posts
  • Version:GM:Studio

Posted 02 April 2014 - 09:59 PM

@Finaldream3 - Unfortunately I cannot, as this is the tutorial. Read all the words (in the OP and in the code) and you should hopefully be able to figure it out.

i could get around to doing this for you at one point or another. i have the hard and soft-ware to do such a thing


  • 1

yoyogamessigTDSrock_zpsb6af8f68.png


#37 FamuFamu

FamuFamu

    GMC Member

  • GMC Member
  • 20 posts
  • Version:Unknown

Posted 22 April 2014 - 11:47 PM

Excuse me, I imported everything on your example (Scripts, constants, objects, rooms...) but this error shows up

 

___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Alarm Event for alarm 0
for object DialogController:

Push :: Execution Error - Variable Get -1.message(100012, 4)
 at gml_Script_dialog_from_array (line 16) -     if(message[i, 4] == "m") {
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_dialog_from_array (line 16)
called from - gml_Object_DialogController_ObjAlarm0_1 (line 7) -         dialog_from_array(0, 1);

 

 

Any idea what could be causing it? I can't seem to find the solution and it's most likely something I overlooked.


  • 0

#38 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 23 April 2014 - 01:42 AM

Did you also copy over the dialog.ini file?

If you did more than just import the example into another project make sure that DialogController calls dialog_import() in one of its Create, Game Start or Room Start events.
  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#39 FamuFamu

FamuFamu

    GMC Member

  • GMC Member
  • 20 posts
  • Version:Unknown

Posted 23 April 2014 - 02:27 AM

Alright! Yes, copying the ini file turned out to be the solution (Maybe you should clarify that bit on the OP in case someone else turn up with my same problem? Nevermind, I should've seen it)

 

Anyways, thanks for the quick reply!


Edited by FamuFamu, 23 April 2014 - 02:31 AM.

  • 0

#40 FamuFamu

FamuFamu

    GMC Member

  • GMC Member
  • 20 posts
  • Version:Unknown

Posted 23 April 2014 - 10:55 PM

Sorry for the double-posting. I'm trying to make the dialog appear as soon as the game starts by changing the case on the switch in the alarm event of DialogController to the name of the room where my game starts, but the same error I posted before shows up.

 

I'm trying to make a Visual Novel, therefore, there's no "Player object", does this affect things somehow? How can I make the dialog appear after the game starts?

 

Thanks in advance


  • 0

#41 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 24 April 2014 - 12:14 PM

Are you sure it was the same error? Make sure that DialogController is persistent, and that you don't make a second DialogController in the next room.
Check the contents of the dialog.ini file, make sure that the message is there if you modified it at all.
Also check where dialog_import is being called, as that might have an effect on it. If it's in Game Start and you aren't using a persistent object it won't remember the dialog in the second room.

Without a Player object it will be fine. The dialog engine only needs DialogController and optionally the regular Controller.
  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#42 Xaintrailles

Xaintrailles

    GMC Member

  • New Member
  • 2 posts
  • Version:GM:Studio

Posted 25 April 2014 - 02:37 AM

Thank you for this system, it seems it can be very useful for me. But I have a problem with some special characters like "é" or "ç", that are used very often in french. They don't appear, even if the selected font has it. Can I do something about that ?

 

I already changed the range of my font.

 

EDIT : It was a mistake on my side : I solved the problem by changing the font.


Edited by Xaintrailles, 25 April 2014 - 06:09 AM.

  • 0

#43 FamuFamu

FamuFamu

    GMC Member

  • GMC Member
  • 20 posts
  • Version:Unknown

Posted 08 May 2014 - 01:26 AM

Oh, sorry I didn't reply back earlier. It was something in the ini file (I accidentally moved something) but I fixed it by changing the line so it shows another message (In Game Maker, not in the ini file).


  • 0

#44 BGC88

BGC88

    GMC Member

  • New Member
  • 1 posts
  • Version:GM:Studio

Posted 21 July 2014 - 03:38 AM

Sorry for bumping this old thread, but I'm trying to implement this system and I had a quick question. Is there a way to not have any dialogue show up as soon as the room starts? So that you only speak with NPC's and there is no asking of your name etc, at the beginning. I've tried tweaking a bunch of different things and I feel like I'm missing something obvious. 

 

Also, whenever the dialogue box shows up, a small gray bar (same color as the default background of the room) shows up along the bottom of the screen. I tried fiddling with the draw scripts but I can't seem to find the issue.

 

Any help would be appreciated! 


  • 0

#45 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 21 July 2014 - 09:34 PM

To remove the dialogue from room start, look in the Alarm 0 event of the DialogController object. Take the code out of there and it should stop.

The gray bar I am not sure about... It may be something about the draw scripts, or maybe the one that makes sPause (sprite_from_screen or whatever it was called) as GM:S has since then updated its abilities to create sprites from the screen.
I've fixed it for my version and may have forgotten to upload, so I'll look into that.
Edit: I hadn't uploaded it, so now I have. Not sure if that will actually fix the problem though. Feel free to re-download and check it out. If it doesn't work I may need a screenshot and to look at the way your project is set up to help fix it, so play with it a bit and if you're really stuck upload it somewhere and I'll see what I can do.

Edited by thegame, 21 July 2014 - 09:44 PM.

  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#46 AdamUnavailable

AdamUnavailable

    GMC Member

  • New Member
  • 6 posts
  • Version:GM:Studio

Posted 25 July 2014 - 04:07 PM

Any plans on cleaning this up and putting it on the Marketplace? Seems like there are a lot of useful applications for it.


  • 0

#47 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 25 July 2014 - 09:14 PM

Hmm I did not think of that. Hadn't really paid any attention to the Marketplace since I figured I'd never buy stuff from it.
Putting things on though... That's a good idea. I'll look into it, though depending on uh... stuff... I may decide not to.
Thanks!
  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#48 Wiiboy4ever

Wiiboy4ever

    GMC Member

  • GMC Member
  • 127 posts

Posted 31 July 2014 - 08:30 PM

This looks fabulous!! Though too bad I don't have studio. Hate to ask, but any chance of an 8.0 release?


  • 0

#49 thegame

thegame

    OinkIguana

  • GMC Member
  • 1549 posts
  • Version:GM:Studio

Posted 31 July 2014 - 09:08 PM

I don't have a license to 8.0, though I used to have 8.1. After getting Studio I deleted 8.1 too, so I'm not sure if I'll be able to make an 8.0 release.

There's a link in my signature to my other text example, which has less features but works in 8.0/8.1. Take a look at that if you want.

There may be ways to port this to 8.0 but it would probably be a lot of work. If you want I can work on it and could probably get it to you in a week or two.
Alternatively I can give you the rundown of how it all works and send the scripts and you can piece it together again, rewriting any of the Studio specific stuff. Might be challenging depending on your experience with GM and my explanation skills.
  • 0

Examples: Inventory and Shop Example ||| Dialog System with messages, questions, input and more ||| Old dialog box example (May not work in new versions of GM:Studio)
Jam Games: 11: Abby and Elliot - 21st place ||| 12: Forks - 16th place ||| 13: White - 19th place
Completed games: White


#50 nacho_chicken

nacho_chicken

    Metal Slime

  • GMC Member
  • 357 posts
  • Version:GM:Studio

Posted 31 July 2014 - 09:33 PM

"A lot of work" means copy-pasting all the scripts/objects/etc from GM:S into the desired version of GM and making minor adjustments if you use some GM:S-specific commands. GM8.1 Free is available from YYG. If GM8 is unavailable, taking a .gm81 and converting to .gmk takes but 20 seconds of googling to find out how to do, and about 5 seconds to actually do it. All in all, it takes about 10-15 minutes to port to pre-GM:S.

 

As for why someone using an outdated version of Game Maker can't take the few minutes to backport using GM:S Standard, I don't know. Still, I would recommend putting out a .gmk just so you won't have to explain the process every time someone asks.


  • 0

YouTube: nacho1zero1

Twitter: @nacho_chicken

QlIK4q9.png