T
ththobo
Guest
Hey ladies and gents of the GameMaker Community. Here's my isssue.
I'm following the RPG maker tutorial by youtuber Heartbeast and everything was fine until I got to his 22nd part where I add dialogue.
At some point, the color in my code editor disappeared and now everything is the normal white color. I am also receiving a "Malformed If statement" error on 2 lines of code in a script that I did not touch during the time I was working through this new video. I have a feeling whatever caused the issue with my colour in the code editor may have also caused the errors.
The errors come up as following:
In Script scr_enemy_wander_state at line 2 : malformed if statement
In Script scr_enemy_wander_state at line 6 : malformed if statement
Here is my code:
///scr_enemy_wander_state()
scr_check_for_player();
if (point_distance(x, y, targetx, targety) > spd); {
var dir = point_direction(x, y, targetx, targety);
var hspd = lengthdir_x(spd, dir);
var vspd = lengthdir_y(spd, dir);
if (hspd != 0); {
image_xscale = sign(hspd);
}
phy_position_x += hspd;
phy_position_y += vspd;
}
I've tried undoing everything I did in the video but that has not worked and I cannot find anything on Google or the documentation about fixing this issue. I am fairly new to this program. Everything was working fine before I started the video but now this error comes up even when I have not made any changes to the script.
I am using Gamemaker: Studio version 1.4.1760. Here is a picture of Heartbeast's code of the same script where I get the error: http://i.imgur.com/xqUTtyo.jpg
Any help is greatly appreciated as I am very frustrated and can't go any further from here.
I'm following the RPG maker tutorial by youtuber Heartbeast and everything was fine until I got to his 22nd part where I add dialogue.
At some point, the color in my code editor disappeared and now everything is the normal white color. I am also receiving a "Malformed If statement" error on 2 lines of code in a script that I did not touch during the time I was working through this new video. I have a feeling whatever caused the issue with my colour in the code editor may have also caused the errors.
The errors come up as following:
In Script scr_enemy_wander_state at line 2 : malformed if statement
In Script scr_enemy_wander_state at line 6 : malformed if statement
Here is my code:
///scr_enemy_wander_state()
scr_check_for_player();
if (point_distance(x, y, targetx, targety) > spd); {
var dir = point_direction(x, y, targetx, targety);
var hspd = lengthdir_x(spd, dir);
var vspd = lengthdir_y(spd, dir);
if (hspd != 0); {
image_xscale = sign(hspd);
}
phy_position_x += hspd;
phy_position_y += vspd;
}
I've tried undoing everything I did in the video but that has not worked and I cannot find anything on Google or the documentation about fixing this issue. I am fairly new to this program. Everything was working fine before I started the video but now this error comes up even when I have not made any changes to the script.
I am using Gamemaker: Studio version 1.4.1760. Here is a picture of Heartbeast's code of the same script where I get the error: http://i.imgur.com/xqUTtyo.jpg
Any help is greatly appreciated as I am very frustrated and can't go any further from here.