Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

This has been working very well for me except when it comes to choices/branching dialogue. I get the following error after making a choice (selecting Red, Blue or Green) and I can't figure out why:

___________________________________________
############################################################################################
ERROR in
action number 1
of Alarm Event for alarm 2
for object obj_textbox: trying to index a variable which is not an array
 at gml_Object_obj_textbox_Alarm_2 (line 20) -               case -1: instance_destroy();       exit;
############################################################################################
gml_Object_obj_textbox_Alarm_2 (line 20)

Any help would be appreciated! This is what I have in the User Event0 of my custom speaker object.

reset_dialogue_defaults();
// Line 0
myText[0] = "Hey, what's your favourite colour?";
myTypes[0] = 0;
myEmote[0] = 1;
mySpeaker = -1;  // Line 1
myText[1] = ["Red", "Blue", "Green"];
myTypes[1] = 1;
mySpeaker = -1; 
myNextline[1] = [2, 3, 4]; // Line 2
myText[2] = "Red's pretty hot.";
myTypes[2] = 0;
mySpeaker = -1;  // Line 3
myText[3] = "Blue's pretty cool.";
myTypes[3] = 0;
mySpeaker = -1;  // Line 4
myText[4] = "Green, like the grass.";
myTypes[4] = 0;
mySpeaker = -1;