• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Legacy GM [SOLVED] Code editor has no color and new "malformed if statement" error

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.
 
J

jackhigh24

Guest
all your code text colour looks ok to me in the screen shot, your code on the other hand is two malformed if statements you left a semicolon after the if statement

Code:
///scr_enemy_wander_state()
scr_check_for_player();                              
if (point_distance(x, y, targetx, targety) > spd); {
                                                 ^<<<<<<<<<here
var dir = point_direction(x, y, targetx, targety);
var hspd = lengthdir_x(spd, dir);
var vspd = lengthdir_y(spd, dir);
if (hspd != 0); {
              ^<<<<<<<<<<here
image_xscale = sign(hspd);
}
phy_position_x += hspd;
phy_position_y += vspd;
}
 
T

ththobo

Guest
Sorry the screenshot is from the video. Thats Heartbeasts code and what it looks like from the video. And thanks for pointing the error out to me, but is there a reason why it would work fine before but suddenly stop working?
 
J

jackhigh24

Guest
well the code should not of worked if you had it set like that, it should of come up when you ran it, so no idea why that happened, as for your colours, then if they are all gone white, that is strange and could be a bug that you just found, would have to wait and see if anyone else has that happen, but you can go to preferences, click on the scripts and code tab, then you will see on the right you can set all your colours back up again, but would be interesting to see a screen shot of that tab before you reset them

EDIT
i said on the left in the text i wrote above, just changed it to on the right LOL, just incase you saw it before i changed it.
 
T

ththobo

Guest
I uninstalled and reinstalled right before you posted that comment and since I was so worried about not being able to continue, I did not think of screenshotting the issue. If it comes up again, I will definitely screencap it and post it here.
Thanks for the help!
 
S

swurvy

Guest
I found this post googling the same issue with my code text all of a sudden turning white when my fingers got sloppy on the keyboard -- it turned out I hit F10 which toggles the colors for the code. The setting is also accessible in the menu, File --> Preferences --> Scripts and Code --> Use color coding as jackhigh24 mentions above.
 
F

flaame1979

Guest
I've had a similar thing happen to my editor, and I'll look in the preferences, scripts, code tab mentioned above by jackhigh24 when I get home, but I'm not sure it'll make a difference for me because I have two monitors set up right now, and when I drag the code editor window from my main screen that doesn't show the color difference to my second monitor, the colors are very visibly different..
Does anyone have any idea what might be done about this?
I have a 38" widescreen vizio tv for my main monitor using one of the hdmi inputs via a dvi-to-hdmi cable, and my second monitor has dvi input, so it's a normal cable. Could this be the issue and is there a setting I change somewhere in my monitor? I have tried all the settings I can think of...
 

rIKmAN

Member
I've had a similar thing happen to my editor, and I'll look in the preferences, scripts, code tab mentioned above by jackhigh24 when I get home, but I'm not sure it'll make a difference for me because I have two monitors set up right now, and when I drag the code editor window from my main screen that doesn't show the color difference to my second monitor, the colors are very visibly different..
Does anyone have any idea what might be done about this?
I have a 38" widescreen vizio tv for my main monitor using one of the hdmi inputs via a dvi-to-hdmi cable, and my second monitor has dvi input, so it's a normal cable. Could this be the issue and is there a setting I change somewhere in my monitor? I have tried all the settings I can think of...
Do other windows show colour normally on both when dragging them between screens?

Sounds like you may need to adjust / calibrate the main screens contrast / colour etc
 
Top