J
Jmarlin3
Guest
I've been following the tutorial from Shaun Spaulding regarding Basic Artificial Intelligence
He constantly uses state_text in this form
He uses a different word to identify which script it's using. The problem is everytime I use it, I get this error:
"unexpected unary operator ="
These are the instances I use it in:
scr_enemy_attack:
scr_enemy_idle:
scr_enemy_attack:
Finally, in my enemy object, I have a drawing event with this:
That doesn't have any error warning, but everything else shows the same error.
Please help as much as possible.
He constantly uses state_text in this form
Code:
state_text = ' ' ;
"unexpected unary operator ="
These are the instances I use it in:
scr_enemy_attack:
Code:
state_text = 'attack';
var dis = point_distance(x,y, o_player.x, o_player.y);
if (dis > attack_range) {
// Chase
state = scr_enemy_chase
} else {
// Attack
if (alarm[0] == -1) {
o_player.hp -= 1;
alarm[0] = 30;
}
}
Code:
state_text = 'idle';
var dis = point_distance(x,y,o_player.x,o_player.y);
if (dis <= sight_range) {
state = scr_enemy_chase;
}
Code:
state_text = 'attack';
var dis = point_distance(x,y, o_player.x, o_player.y);
if (dis > attack_range) {
// Chase
state = scr_enemy_chase
} else {
// Attack
if (alarm[0] == -1) {
o_player.hp -= 1;
alarm[0] = 30;
}
}
Code:
draw_text(x,y,state_text);
Please help as much as possible.