Legacy GM Easy Branching Dialogue System

K

KitKatKatu

Guest
Just wanted to update that my second problem (the text drawing centered on the y) was because in another room in my game I drew text at middle and never switched it back to top! I had a feeling it was a super easy fix. I'm still unable to solve the first problem though. Will continue trying to learn!
 
Last edited by a moderator:
Just wanted to update that my second problem (the text drawing centered on the y) was because in another room in my game I draw text at middle and never switched it back to top! I had a feeling it was super easy fix. I'm still unable to solve the first problem though. Will continue trying to learn!
Hello!
Sorry it's been a while

I've take a look into your first problem, and it is a tricky one. Without a lot of modification, you can replace this line:
Code:
var str=string_copy(str,1,dialogueTextOn);
With something like this:
Code:
var str2=string_copy(str,1,dialogueTextOn);

//Add blank characters to keep words whole
var s=string_delete(str,1,dialogueTextOn);
if string_pos(" ",s)!=0{
    //repeat(string_pos(" ",s)-1){str2+=chr(8192)}
    str2+=string_copy(s,1,string_pos(" ",s)-1)
}else{
    //repeat(string_length(s)){str2+=chr(8192)}
    str2+=s
}
str=str2
Unfortunately, I could not find a character that acts like white space. If you have a custom font, with font_add(), then you could manually add in a blank character and I think the above code will work
Otherwise, I have just made it so it draws words one by one instead of each character. It is more choppy, but it keeps the words whole



Hiya guys! I was wondering how to get the text to be left aligned in NoobsWeStand's most recent example file. I know this is a question that was answered and fixed in The-any-Key's example, but I'm very far into development in my game to make the switch now. Thank you for understanding!
This should be an easy fix! All you need to do is use
draw_text_bb_ext_black and draw_text_bb_ext instead of their _centered variants

Here are both of the updated scripts so they work with all the BBC code
https://pastebin.com/AF9yAFgC
https://pastebin.com/FMT2ySQA
 
Last edited:
K

KitKatKatu

Guest
Back! With new questions, but also answers.
(In the Easy Dialogue System program and not Game Maker this time)
Problem 1:
After a check, if I put a script before text it doesn't work. (as an example, depending on the check chosen, I want to change the npc's portrait to reflect their mood while talking)
what i'd love to work: switch - check - script - text
the only thing that works right now: switch - check - text - script - text
Problem 2:
When I use if statements with scripts, it can't read my arguments. When I don't ask for arguments it can read the script, and outside of if statements it can read arguments.
Code:
if scr_itemcheck(0,1){convo(0,1)}
It's unable to return true since it can't read the arguments. If I make scr_itemcheck only say: "return(1);" then it works. I made sure this script worked outside of dialogue as well.

I was able to solve the wrapping problem in my last post by taking another look at this tutorial:
http://michaelvandiest.tumblr.com/post/137357826705/advanced-dialogue-box-tutorial

In parDialogueNPC Draw GUI under the text variables (tx,ty,tw,th) I put:
Code:
    var charWidth = 7;//width of each character
    var lineEnd = floor(tw/charWidth);//max amount of characters we want per line
    var currentLine = 0;//current line we are on
    var space = 0;// “space” is like the character count. For example if the message is “Hello” then “H” is character 0, “e” is character 1, so on and so forth.
    var L = 1;//for looping

    //Draws regular text typewriter style
    while(L <= string_length(str) && L <= dialogueTextOn)
    {
        var wlength = 0;//stores the length of words before typing them
        while (string_char_at(str,L) != " " && L <= string_length(str))//while the character that the loop is on is not a space
        {
            L++;//loops through letters until it hits a space
            wlength++;//goes throught the characters and adds to word length until it hits a space
        }
        if space+wlength > lineEnd
        {
            space = 0;
            currentLine++;//goes to a new line and sets space back to the beginning of the new line
        }
        L -= wlength// put the loop back to the start of the word
 
Last edited by a moderator:
2

2AM Productions

Guest
I am having a random error, it can not read the scripts for some reason? I do not know why can you help me out here?
 
K

KitKatKatu

Guest
Problem 3: I finally caught the fatal error text from the easy dialogue program (I forgot to save it the first few times haha):
It does this sometimes when I save or save as whether it's a file name that exists or a new one. If I'm trying to save it as a file that exists, it'll delete the file and fail to save so I end up losing any work I did.
Code:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object objControl:

Unable to find any instance for object index '100110' name '<undefined>'
at gml_Script_scr_save
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_scr_save (line 0)
gml_Script_scr_saveAs
gml_Object_objControl_Draw_64
 
Last edited by a moderator:
I am having a random error, it can not read the scripts for some reason? I do not know why can you help me out here?
Could you possibly copy the error?

Problem 3: I finally caught the fatal error text from the easy dialogue program (I forgot to save it the first few times haha):
It does this sometimes when I save or save as whether it's a file name that exists or a new one. If I'm trying to save it as a file that exists, it'll delete the file and fail to save so I end up losing any work I did.
Code:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object objControl:

Unable to find any instance for object index '100110' name '<undefined>'
at gml_Script_scr_save
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_scr_save (line 0)
gml_Script_scr_saveAs
gml_Object_objControl_Draw_64
I am not quite sure what is wrong, but I have pushed a quick update that makes backups of the dialog every time you save so you should not lose all your work when this error happens

Downloads:
GMX(741kb): https://www.dropbox.com/s/drzxckpugx2lud8/Dialog1_265.gmz?dl=0
EXE(3mb): https://www.dropbox.com/s/ptvmdveftou2xya/Dialogv1.265.exe?dl=0
 
E

ElkkuTheBaws

Guest
I get this error when I'm trying to implement this to my game.
Code:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Create Event
for object objDialogueControl:

Unable to find any instance for object index '58' name 'obj_DD_Box'
 at gml_Script_scr_dialogue_settings (line 59) - Dialogue_box_x=obj_DD_Box.x/room_width;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_scr_dialogue_settings (line 59)
called from - gml_Object_objDialogueControl_CreateEvent_1 (line 3) - scr_dialogue_settings();
 
E

ElkkuTheBaws

Guest
I would like to navigate in the options menu with my arrow keys or with the keyboard in general. As a beginner, I don't know how I should do it. Pls. SEND HELP
 
D

DereChen

Guest
Is this still active? Because I would really like help on how to actually integrate this into my game. The manual does not really state, and I have a hard time reverse engineering from the gmz
 
I get this error when I'm trying to implement this to my game.
Code:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Create Event
for object objDialogueControl:

Unable to find any instance for object index '58' name 'obj_DD_Box'
 at gml_Script_scr_dialogue_settings (line 59) - Dialogue_box_x=obj_DD_Box.x/room_width;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_scr_dialogue_settings (line 59)
called from - gml_Object_objDialogueControl_CreateEvent_1 (line 3) - scr_dialogue_settings();
I am not sure how you got that error. I would have to look at the source code if you could PM it to me

I would like to navigate in the options menu with my arrow keys or with the keyboard in general. As a beginner, I don't know how I should do it. Pls. SEND HELP
If you are referring to navigating the menus in the editor: I would need to program that in. It is currently not available
If you are referring to the dialog interface with different options, here is an example of how to choose with the number keys:
Code:
//Check if the user selected the option with the keyboard
if keyboard_check_released(ord(string(i+1))){
   scr_dialouge_NPCCDialogOption(i)
       dialougeTextOn=0//reset the typewriter 1effect
       Dialogue_Line_Offset=0; // Reset line offset
   break;
}
Put this code in the parNPC draw GUI event after where it says:
Code:
//Loops through the ds_list and draws every option
This should enable you to use the 1,2,3,4,5... keys to select the options


Is this still active? Because I would really like help on how to actually integrate this into my game. The manual does not really state, and I have a hard time reverse engineering from the gmz
All you really need to do is use the example project, and import the parNPC,objControl, and objNPCBob(for an example NPC). Then just import all of the scripts, and make sure objControl is in the room / in your first room
If you need more help, PM me
 
D

DereChen

Guest
All you really need to do is use the example project, and import the parNPC,objControl, and objNPCBob(for an example NPC). Then just import all of the scripts, and make sure objControl is in the room / in your first room
If you need more help, PM me[/QUOTE]

Um...stupid question but how do you use the text file the engine makes as its finished product? I put it in the files section of gamemaker, now what?
 
E

ElkkuTheBaws

Guest
I am not sure how you got that error. I would have to look at the source code if you could PM it to me



If you are referring to navigating the menus in the editor: I would need to program that in. It is currently not available
If you are referring to the dialog interface with different options, here is an example of how to choose with the number keys:
Code:
//Check if the user selected the option with the keyboard
if keyboard_check_released(ord(string(i+1))){
   scr_dialouge_NPCCDialogOption(i)
       dialougeTextOn=0//reset the typewriter 1effect
       Dialogue_Line_Offset=0; // Reset line offset
   break;
}
Put this code in the parNPC draw GUI event after where it says:
Code:
//Loops through the ds_list and draws every option
This should enable you to use the 1,2,3,4,5... keys to select the options



All you really need to do is use the example project, and import the parNPC,objControl, and objNPCBob(for an example NPC). Then just import all of the scripts, and make sure objControl is in the room / in your first room
If you need more help, PM me
I figured out that error on my own. I think it was because I didn't have that obj_control in my room or something like that.
[CODE said:
//Check if the user selected the option with the keyboard
if keyboard_check_released(ord(string(i+1))){
scr_dialouge_NPCCDialogOption(i)
dialougeTextOn=0//reset the typewriter 1effect
Dialogue_Line_Offset=0; // Reset line offset
break;
}
And thanks a lot for that example it was just how I wanted so thanks a lot.

I am a bit unsure how this convo thing works. I would like to make quests and stuff and I am bit confused how it works. I know you can like call it and then it changes to that conversation but I don't know how. And also the scripts system is a bit unclear for me.
 
G

gold141

Guest
Thank you for that great dilogue system! I have some problems. If it is more then 19 convos pogram just dont whant to export more than 19. However it can export just Text in convo with № more than 19. It is often problems with export. It just says it is have some problems. Than you can see that some convos just disapiare. Than you fix it and click export again. And it is same problem with another convo. I dont know why it is, but think it is problem with export/import (save/load). Il try to make video how it is. but i think you know about this problem.
 
M

milch

Guest
hey guys,

i've been trying to make this work using only the keyboard or gamepad instead of mouse hovering, but i wasnt successful :/
it just keeps going back to the first option (it flickers briefly over to the second one), also it doesnt execute the script after the option was selected for some reason... here is the code i added:

if ds_exists(op0[on0,on1],ds_type_list) && ds_list_size(op0[on0,on1])>0{


if (alarm[3] <=0) {
if down_key {

audio_play_sound(sounds.menu_upanddown_sound, 1, 0);
if (option_index < (ds_list_size(op0[on0,on1]) )) {

option_index++;
}
else {
option_index = 0;
}
alarm[3] = room_speed/4;
}

if up_key {


audio_play_sound(sounds.menu_upanddown_sound, 1, 0);
if (option_index > 0 ) {

option_index--;
}
else {
option_index = ds_list_size(op0[on0,on1]);
}
alarm[3] = room_speed/4;
}
}

var _yy=yy+(string_height_ext(string_hash_to_newline(line[on0,on1]),25,ww-xx)-200);




obj_arrow.arrowsprite = false;

for(i=0;i < (ds_list_size(op0[on0,on1]) );i++){

draw_set_color (c_black);
if i = option_index {
//doesnt hover

draw_set_color (c_white);


}


draw_set_alpha (0.5);
draw_rectangle ( xx+(ww/2) - 20 ,_yy - 20, xx+(ww/2) +100 ,_yy + 40, 0)

draw_set_alpha (1);

draw_text_color(xx+(ww/2),_yy,
ds_list_find_value(op0[on0,on1],i) , c_white, c_white, c_white, c_white, 1)



if a_button and textwriting == false{

audio_play_sound(bass_descend2, 1, 0);
alarm[1] = 5;

}
if alarmsetter == true {


scrNPCCDialogOption(option_index)
dialougeTextOn=0
alarmsetter = false;

break;
}
_yy += 100
}

any help is really appreciated!!
 
G

gold141

Guest
I found problem. If in convo first going script, than it will not work properly. So you need to make text first and than anything else. Who knows how to fix it?
 
M

milch

Guest
hmm also i have a problem with passing arguments to the script... whenever i want to pass a variable or object, it doesnt work. executing the script outside the dialog system works just fine...
[text]
text[0,0]=yo ma maaaan
text[1,0]=get yoself a stick!|scr_get_item(obj_stick);|showChat|line(0,0)|
[config]
[vars]
vars=

code in the script:

with (obj_stats) {



inventory[global.inv_space] = argument0
global.inv_space ++

}

oh also, i was so busy complaining that i never said thank you for making this!! :D thanks so much, this will make writing dialogues so much easier
 
All you really need to do is use the example project, and import the parNPC,objControl, and objNPCBob(for an example NPC). Then just import all of the scripts, and make sure objControl is in the room / in your first room
If you need more help, PM me
Um...stupid question but how do you use the text file the engine makes as its finished product? I put it in the files section of gamemaker, now what?[/QUOTE]

That should be all you need to do! Just put them in the included files

Thank you for that great dilogue system! I have some problems. If it is more then 19 convos pogram just dont whant to export more than 19. However it can export just Text in convo with № more than 19. It is often problems with export. It just says it is have some problems. Than you can see that some convos just disapiare. Than you fix it and click export again. And it is same problem with another convo. I dont know why it is, but think it is problem with export/import (save/load). Il try to make video how it is. but i think you know about this problem.
I would need to look at your save file - if you could PM it to me, that would be great!


I found problem. If in convo first going script, than it will not work properly. So you need to make text first and than anything else. Who knows how to fix it?
Unfortunately that is a problem with the engine as of now - there are future plans to make it so that you can do that


hmm also i have a problem with passing arguments to the script... whenever i want to pass a variable or object, it doesnt work. executing the script outside the dialog system works just fine...
[text]
text[0,0]=yo ma maaaan
text[1,0]=get yoself a stick!|scr_get_item(obj_stick);|showChat|line(0,0)|
[config]
[vars]
vars=

code in the script:

with (obj_stats) {



inventory[global.inv_space] = argument0
global.inv_space ++

}

oh also, i was so busy complaining that i never said thank you for making this!! :D thanks so much, this will make writing dialogues so much easier
I have added, in the example project, so that you can switch between different styles and ways of controlling the dialog.
This should cover your request to use the up/down arrow keys to select options

As for the script, it takes every argument in as a string, so you will have to do something like this:
with (obj_stats) {

inventory[global.inv_space] = asset_get_index(argument0)
global.inv_space ++

}

Here is the new version of the Example:
https://www.dropbox.com/s/tzyqc7fngvnnbzf/Example1_26755.gmz?dl=0
 
M

milch

Guest
ahhh thanks so much, it works fine now!
thanks for putting in so much work, I have no idea why someone would do that for free :D you should put up a donation link, i'm sure there's many grateful people who'd want to support you with a dollar or two
 
K

KitKatKatu

Guest
As for the script, it takes every argument in as a string, so you will have to do something like this:
with (obj_stats) {

inventory[global.inv_space] = asset_get_index(argument0)
global.inv_space ++

}
Just wanted to send an update to say that this fixed the argument problem I told you about in a PM last month!! Thank you so much for your hard work <3 I'll be keeping an eye on this thread for sure~
 
M

milch

Guest
Somehow the labels dont work for me :/
When testing in the dialog tool it works fine, but when I drop it in it says
upload_2017-12-18_21-24-44.png

These are my nodes..

upload_2017-12-18_21-23-51.png

and the textfile

[text]
text[0,0]=This the MAX Bottle Machine 2004.
text[1,0]=(OPTION): Do you want to cash in your bottles?
op0[1,0]=cash in:cancel:
op1[1,0]=0,1|if scr_check_bottles(){goto(gotbottles)}|:1,1|:
text[0,1]=You don't have any bottles to turn in! Come back after you've freed nature of some plastic.
text[1,1]=Cancelling.|scr_dobject();|showChat|line(0,0)|
text[0,3]=Calculating....|label(gotbottles)|scr_bottlemachine()|
text[1,3]=You turned in [color=c_red] [var=obj_stats.bottles] bottles[/color] and received [color=c_red][var=obj_stats.cashed_in] shlotinki[/color].
text[2,3]=Thank you for using the MAX bottle machine and helping to preserve the environment.|scr_dobject();|showChat|line(0,0)|
[config]
[vars]
vars=

Did anybody else have the same problem or maybe sees what stupid mistake I made? :D
 
S

SatanLover666

Guest
I love the system because it is exactly what I need, but is there a way to get past text[0,50] to for example text[0,57]? if this is possible this would save my whole project!
 
I love the system because it is exactly what I need, but is there a way to get past text[0,50] to for example text[0,57]? if this is possible this would save my whole project!
For sure!
I did not count of people going this high, so I just set a cap at 50, but that can be easily changed!

In the create event of the parNPC, change this:
Code:
//Setup the variables to hold the NPC lines
on0=0
on1=0
for(i=0;i<255;i++){
    for(a=0;a<50;a++){
        line[i,a]=""//text
        op0[i,a]=-1//ds_list
        op1[i,a]=-1//ds_list
    }
}
To this:
Code:
//Setup the variables to hold the NPC lines
on0=0
on1=0
for(i=0;i<255;i++){
    for(a=0;a<100;a++){
        line[i,a]=""//text
        op0[i,a]=-1//ds_list
        op1[i,a]=-1//ds_list
    }
}
The new code has a cap of 100. To increase this, just increase the number in the inner for loop.
If you are still having problems, DM me!
 
K

KitKatKatu

Guest
I'll post this here just in case anyone else is encountering the same thing:
asset_get_index(argument0), I swear, had fixed the problem I had where scripts with more than 1 argument weren't reading. But recently that fix stopped working and now asset_get_index is returning -1. (I can tell because drop item is making the item increase by 1 and check item says the item is there when the inventory is empty and empty slots return -1) I don't know what happened u _ u
 
M

milch

Guest
I'll post this here just in case anyone else is encountering the same thing:
asset_get_index(argument0), I swear, had fixed the problem I had where scripts with more than 1 argument weren't reading. But recently that fix stopped working and now asset_get_index is returning -1. (I can tell because drop item is making the item increase by 1 and check item says the item is there when the inventory is empty and empty slots return -1) I don't know what happened u _ u
ah man i'm having the same problem... It's not only with more than 1 arguments, asset_get_index doesn't seem to work at all for some reason

Code:
with (obj_stats) {
   
    NPCinfo2 = asset_get_index(argument0)
    show_debug_message("npcinfo2 " + string(NPCinfo2))
   
}
scr_description(obj_stats.lisa_stats)

shows -1.. also tried to only put lisa_stats as an argument but that also doesnt work

edit: okay i'm just an idiot, of course i dont want to refer to an asset, but to a variable... xD
 
Last edited by a moderator:
K

KitKatKatu

Guest
ah man i'm having the same problem... It's not only with more than 1 arguments, asset_get_index doesn't seem to work at all for some reason

Code:
with (obj_stats) {
  
    NPCinfo2 = asset_get_index(argument0)
    show_debug_message("npcinfo2 " + string(NPCinfo2))
  
}
scr_description(obj_stats.lisa_stats)

shows -1.. also tried to only put lisa_stats as an argument but that also doesnt work

edit: okay i'm just an idiot, of course i dont want to refer to an asset, but to a variable... xD
yes, i had to ditch using enums and switch to reals XD (thanks noobswestand!)
but then it begs the question: how was asset_get_index ever working for me in the first place???
lol everything's up and running again!
 
M

milch

Guest
I keep getting the "out of memory" error a lot lately and lose all my progress :/ If I open my saved file and try to continue it always gives me the same error at the same time and closes.
all I can do is write the dialog all over and hope it doesn't happen again... how can I prevent this? and what memory is it talking about anyway
 
I keep getting the "out of memory" error a lot lately and lose all my progress :/ If I open my saved file and try to continue it always gives me the same error at the same time and closes.
all I can do is write the dialog all over and hope it doesn't happen again... how can I prevent this? and what memory is it talking about anyway
Try disabling fancy lines
Does it happen randomly, or when you save, or when you do something specific?
Other than that, if you PM me your dialog I could try a couple of things and see what is up. I have only really worked with projects that are under 50 lines of dialog with this
 
M

milch

Guest
Try disabling fancy lines
Does it happen randomly, or when you save, or when you do something specific?
Other than that, if you PM me your dialog I could try a couple of things and see what is up. I have only really worked with projects that are under 50 lines of dialog with this
It happens sometimes after I add a certain amount of nodes in the dialog. this specific one i'm talking about crashes at about 8kb. the weird thing is, that i had dialog files that are way bigger (22kb or so) and they were fine... unfortunately I already deleted it and made a new file that works fine now :/ I will send you one when it happens again! Thanks so much :D
 
Z

zkormany

Guest
Problem 1:
After a check, if I put a script before text it doesn't work. (as an example, depending on the check chosen, I want to change the npc's portrait to reflect their mood while talking)
what i'd love to work: switch - check - script - text
the only thing that works right now: switch - check - text - script - text
I'm struggling with the same thing...have you found a solution? I would like to execute a script directly after the check step...
 
Z

zkormany

Guest
Thank you NoobsWeStand for you quick response. You have built a really fantastic dialog engine!

What I wanted to achieve is something like this. I realized that without placing text nodes after the check nodes it won't work. That's not a big limitation I just have to change my dialogs slightly. :)
upload_2018-3-20_10-2-46.png
 
Thank you NoobsWeStand for you quick response. You have built a really fantastic dialog engine!

What I wanted to achieve is something like this. I realized that without placing text nodes after the check nodes it won't work. That's not a big limitation I just have to change my dialogs slightly. :)
Interesting! I will look into that - how the export files are setup, it should support that type of loop
 
I

innercitysumo

Guest
Did anyone ever figure out why this doesn't work in Android? I integrated it into my game without reading all of this thread (oops) - works great on Windows when testing it but doesn't play on Android.

I'm pretty sure it's to do with how Android handles (or doesn't handle) the included txt files that include the dialogue. If I remove them from the folder I get exactly the same behaviour when running it on Windows.

EDIT:

The code for loading the dialogue file is:
Code:
global.NPCdirectory="Dialogue\";
file=file_text_open_read(global.NPCdirectory+"\"+string(argument[0])+".txt")
I've tried several variants, including putting the file directly in the working directory, e.g.:
Code:
file=file_text_open_read(working_directory+"\"+string(argument[0])+".txt")
(and also with a / slash)

but nothing has worked for me so far.
 
Last edited by a moderator:
Did anyone ever figure out why this doesn't work in Android? I integrated it into my game without reading all of this thread (oops) - works great on Windows when testing it but doesn't play on Android.

I'm pretty sure it's to do with how Android handles (or doesn't handle) the included txt files that include the dialogue. If I remove them from the folder I get exactly the same behaviour when running it on Windows.

EDIT:

The code for loading the dialogue file is:
Code:
global.NPCdirectory="Dialogue\";
file=file_text_open_read(global.NPCdirectory+"\"+string(argument[0])+".txt")
I've tried several variants, including putting the file directly in the working directory, e.g.:
Code:
file=file_text_open_read(working_directory+"\"+string(argument[0])+".txt")
(and also with a / slash)

but nothing has worked for me so far.
I have just done the testing, and it seems to be an error on my part
It was with global.NPCdirectory
In the create event of objControl, just change it to:
global.NPCdirectory="Dialog"
 
Last edited:
I

innercitysumo

Guest
I have just done the testing, and it seems to be an error on my part
It was with global.NPCdirectory
In the create event of objControl, just change it to:
global.NPCdirectory=global.NPCdirectory="Dialog"
Thanks, that worked for me. Annoyingly I had noticed the extra slash in the global and thought I'd already tried this, but I guess not. Thanks for sharing your system - saved me a lot of headaches trying to come up with something from scratch. And there's no way I would've come up with half as good an editor.
 
It's been a while! I finally got back into making my game and have been working on this again
https://i.gyazo.com/59734f94ead4830da8f5736ac059313d.mp4

Download:
EXE: https://www.dropbox.com/s/pi519lsvd3m3amh/Dialogv1.27.exe?dl=0
Source: https://www.dropbox.com/s/6d6hybpnw78jeym/Dialog1_27.gmz?dl=0
Example source: https://www.dropbox.com/s/cis28repvqcek4i/Example1_27.gmz?dl=0


Many thanks to this tutorial and @Zack
https://forum.yoyogames.com/index.p...cking-250-000-english-dictionary-words.47936/


Here are some of the changes:
  • Added spell checking in text boxes
  • Fixed shakeY not working
  • Fixed text-wrapping in the Example and Dialog testing so that it does not cut off words
  • Optimized the editor so more Nodes can be shown at once without slowdown
 
Last edited:
F

Felipe Rybakovas

Guest
This still works on 1.4? Is an amazing system!!!! thanks for all that!
 
S

Shirsh

Guest
Hey, this system looks great, but I have troubles figuring proper cleanUp/onDestroy/GameEnd etc event for NPCs:
1st part is easy:
Code:
if ds_exists(defaultMap, ds_type_map) {
    ds_map_destroy(defaultMap);
}
if ds_exists(chatMap, ds_type_map) {
    ds_map_destroy(chatMap);
}
But after that there also numeral ds_lists op0[_on0,_on1] and op1[_on0,_on1] created in "while" loop with local vars _on0 and_on1.
What is good way of destroying them could be?
I thinking of storing their "names" in an extra ds (another list?) then going through it in a loop destroing every incuded list, then that extra list themself.
Have no idea if it's best way.

Could be nice to have cleanUp/onDestroy event included in Example.


upd: what do you say, next thing will work?
Code:
if ds_exists(optionsList, ds_type_list){
    if !ds_list_empty(optionsList){
        for (var i = 0; i < ds_list_size(optionsList); ++i) {
            var j = ds_list_find_value(optionsList, i);
            ds_list_destroy(j);
        }
    }
    ds_list_destroy(optionsList);
}
in load_npcChat list "optionsList" getting created if there was none, when meets "(OPTION): " string and later
ds_list_add(optionsList, op0[_on0,_on1]); and ds_list_add(optionsList, op1[_on0,_on1]); right after their respective creations.
 
Last edited by a moderator:
Hey, this system looks great, but I have troubles figuring proper cleanUp/onDestroy/GameEnd etc event for NPCs:
1st part is easy:
Code:
if ds_exists(defaultMap, ds_type_map) {
    ds_map_destroy(defaultMap);
}
if ds_exists(chatMap, ds_type_map) {
    ds_map_destroy(chatMap);
}
But after that there also numeral ds_lists op0[_on0,_on1] and op1[_on0,_on1] created in "while" loop with local vars _on0 and_on1.
What is good way of destroying them could be?
I thinking of storing their "names" in an extra ds (another list?) then going through it in a loop destroing every incuded list, then that extra list themself.
Have no idea if it's best way.

Could be nice to have cleanUp/onDestroy event included in Example.


upd: what do you say, next thing will work?
Code:
if ds_exists(optionsList, ds_type_list){
    if !ds_list_empty(optionsList){
        for (var i = 0; i < ds_list_size(optionsList); ++i) {
            var j = ds_list_find_value(optionsList, i);
            ds_list_destroy(j);
        }
    }
    ds_list_destroy(optionsList);
}
in load_npcChat list "optionsList" getting created if there was none, when meets "(OPTION): " string and later
ds_list_add(optionsList, op0[_on0,_on1]); and ds_list_add(optionsList, op1[_on0,_on1]); right after their respective creations.
Good point. I never actually thought to clean up my ds_lists and maps
I put in your code and it seems to work fine. I pushed out an update as well

1.275:
EXE: https://www.dropbox.com/s/ho5ba5b5w9x2b0p/Dialogv1.275.exe?dl=0
Source: https://www.dropbox.com/s/khne8ma72yiuibz/Dialog1_275.gmz?dl=0
Example: https://www.dropbox.com/s/q4sudhwyq2b1mr3/Example1_275.gmz?dl=0

Changes:
Added cleanup code to destroy ds_x stuff correctly
 
S

SheBork

Guest
Hello! I hope this is still active.. First off, awesome work!!! This is really cool and it takes a lot off my shoulders in trying to make a game solely based on dialogue.
I have a problem I hoped you might help me with, though... It boils down to, what is "showText2" for?
My game is kind of a dating sim style thing, so no characters moving around the screen, just the user pressing space to advance the conversations. So I tried modifying your code so instead of a collision event, the player only needed to press space. (there's no player object) - My problem is that when I do press space, the text box appears for a fraction of a second then disappears. (the NPC loading is a success) (I'm using gms 2 by the way)
All I can guess is that either the text box gets refreshed, so two events happen at the same time involving pressing space, or the variables showText and showText2 shouldn't be used like I used them. I am unsure what showText2 is for, though.
Here's the code, the way I changed it:
Code:
// The step event for collision in parNPC is now:
if showText2=true{
    if keyboard_check_released(vk_space){
        showText=true
    }else{
        showText=false
    }
}
else{
    showText=false
    if keyboard_check_released(vk_space)
    {
        showText2=true
    }
}
And the chatBox settings:
Code:
//Chatbox Settings
global.chatX=32
//global.chatY=global.gui_height-400
global.chatY=448
//global.chatW=350+32
global.chatW=720
global.chatH=150

global.chatKeyboard=false//Whether you can use the 1-9 keys to select an option
global.chatArrow=true//Wether you can use the up/down keys to select an option
global.chatArrowUp=vk_up;
global.chatArrowDown=vk_down;

global.chatContinueButton=vk_space;
Hopefully this is enough to tell where the problem is, I can't figure it out :( Thank you anyway for the great work!!!
 
R

rhyvynrxauope

Guest
Deat NoobsWeStand!
Thank you for amazing dialog system for gamemaker. It is actually fantastic and what is most important - free! I'm creating a game right now using your engine.
By I need your help. I created large dialog, but when I try to export it or even "test", it gives me an error and crashes:

Code:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object objControl:

Variable objControl.<unknown variable>(100059, -2147483648) not set before reading it.
at gml_Script_scr_saveNode
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_scr_saveNode (line 0)
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveNode
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveNode
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveNode
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_saveRec
gml_Script_scr_export_dialog
gml_Script_scr_test_dialog
gml_Object_objControl_Draw_64
I can send you the ".ini" file, if you want. It works as well.
I hope you can help me with my problem, because I'm absolutely lost and don't know, what to do.

P.S. I found that node, where it crashes, but even if I delete it and place there another node, it gives me the same error (check the video below to get what I mean).
P.S.S. I need only the result. If you can export the file for me it will be cool too.


Best regards,
Sergey
[email protected]
 
Last edited by a moderator:
Top