GameMaker Following this tutorial, It keeps giving me an error.

M

memes1

Guest
I am using the trial version, Soon going to buy a license.
i am following this tutorial to a T but i keep getting this error message:
_________________________________________ ############################################################################################ FATAL ERROR in action number 1 of Step Event0 for object obj_dialog_controller: Variable obj_dialog_controller.fetch(100005, -2147483648) not set before reading it. at gml_Script_Get_dialog (line 1) - if (fetch) { ############################################################################################ -------------------------------------------------------------------------------------------- stack frame is gml_Script_Get_dialog (line 1) called from - gml_Object_obj_dialog_controller_Step_0 (line 1) - Get_dialog()

I don't understand what im doing wrong, can anyone help? i dont even know if this is the right place for this.
 

samspade

Member
Hello and welcome. This is the right forum to ask the question.

The error message means the following. In obj_dialog_controller you are using a variable named fetch but you have not set that variable to anything before using it. It's possible someone here might have watched the video because most people won't watch a tutorial video to help answer a question, so in general you should post your code.

Still with just that message I would guess that there is two likely issues. Number one, you need to put the variable fetch in the create event of obj_dialog_controller and set it to whatever is relevant. Or two, it appears from the message that you're calling if (fetch) from a script which means maybe you mean to be using the variable fetch that is set in another object. If this is the case, let us know and post your code so we can give a more concrete answer for fixing it.
 
M

memes1

Guest
ok here you go

Get_dialog code:

if (fetch) {
dialog_output = "";
dialog_output_speed = 0;
var dialog_data = dialog_lines[dialog_line];


dialog_text = dialog_data [0];
dialog_continue = dialog_data [1];
dialog_avatar = dialog_data [2];
dialog_left_facing = dialog_data [3];

fetch = false;
} else {

dialog_output = string_copy (dialog_text, 1, dialog_output_speed);
dialog_output_speed = 0.8;
}
 
M

memes1

Guest
Hello and welcome. This is the right forum to ask the question.

The error message means the following. In obj_dialog_controller you are using a variable named fetch but you have not set that variable to anything before using it. It's possible someone here might have watched the video because most people won't watch a tutorial video to help answer a question, so in general you should post your code.

Still with just that message I would guess that there is two likely issues. Number one, you need to put the variable fetch in the create event of obj_dialog_controller and set it to whatever is relevant. Or two, it appears from the message that you're calling if (fetch) from a script which means maybe you mean to be using the variable fetch that is set in another object. If this is the case, let us know and post your code so we can give a more concrete answer for fixing it.
Hello and welcome. This is the right forum to ask the question.

The error message means the following. In obj_dialog_controller you are using a variable named fetch but you have not set that variable to anything before using it. It's possible someone here might have watched the video because most people won't watch a tutorial video to help answer a question, so in general you should post your code.

Still with just that message I would guess that there is two likely issues. Number one, you need to put the variable fetch in the create event of obj_dialog_controller and set it to whatever is relevant. Or two, it appears from the message that you're calling if (fetch) from a script which means maybe you mean to be using the variable fetch that is set in another object. If this is the case, let us know and post your code so we can give a more concrete answer for fixing it.
New
ok here you go

Get_dialog code:

if (fetch) {
dialog_output = "";
dialog_output_speed = 0;
var dialog_data = dialog_lines[dialog_line];


dialog_text = dialog_data [0];
dialog_continue = dialog_data [1];
dialog_avatar = dialog_data [2];
dialog_left_facing = dialog_data [3];

fetch = false;
} else {

dialog_output = string_copy (dialog_text, 1, dialog_output_speed);
dialog_output_speed = 0.8;
}
 

samspade

Member
That isn't enough to help, unfortunately, so what I did was watch the tutorial at 2x and skim through it through find where he sets the variable fetch. It happens at 20:40. It is a variable in obj_dialog_controller. However, it looks like he doesn't set it in the create event, but instead sets it when it is created using the dot accessor. If that doesn't make sense, then the following articles might be helpful:

Addressing Variables in an Object

What's the Difference: Objects and Instances

It seems like you probably changed something from the tutorial (not a bad thing) or missed something. You can probably solve it just by adding fetch = true (or false depending) in the appropriate place.

Since I didn't watch the video to understand what he is actually doing I also could have missed something. So if that doesn't work, I would re-watch the start of the video and make sure you understand why he is doing what he is doing.
 
M

memes1

Guest
That isn't enough to help, unfortunately, so what I did was watch the tutorial at 2x and skim through it through find where he sets the variable fetch. It happens at 20:40. It is a variable in obj_dialog_controller. However, it looks like he doesn't set it in the create event, but instead sets it when it is created using the dot accessor. If that doesn't make sense, then the following articles might be helpful:

Addressing Variables in an Object

What's the Difference: Objects and Instances

It seems like you probably changed something from the tutorial (not a bad thing) or missed something. You can probably solve it just by adding fetch = true (or false depending) in the appropriate place.

Since I didn't watch the video to understand what he is actually doing I also could have missed something. So if that doesn't work, I would re-watch the start of the video and make sure you understand why he is doing what he is doing.
Thanks, friend.
 
D

Dan B

Guest
So... think about it like this: "obj_dialog_controller.fetch" basically means: I'm accessing the object 'obj_dialog_controller' AND I'm accessing it's 'fetch' variable. Try something simple, check the 'obj_dialog_controller' create event, is there a 'fetch' variable?

Like: fetch = 0
within the 'obj_dialog_controller' object

You're simply not setting the variable to a 'tangent' existence before using it; whether it be a 'true false', or a '1, 0' Does that make sense?
 
Top