• 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!

Expected Expression error

J

jimuthy

Guest
Hi all

I am quite new to GameMaker and I a following a tutorial for a beat em up. I have encountered expected expression errors at lines 4 and 12 and syntax errors at line s 17 and 44. I can' see a problem - please help!

Image attached of the problem - all help appreciated!
 

Attachments

FrostyCat

Redemption Seeker
The first three errors have to do with you single-quoting strings. Starting with GMS 2, strings need to be double-quoted.
GML:
if (keyboard_check(ord("A"))) {
The fourth error has to do with the extra closing brace on the said line that does not have a corresponding opening brace.

There is also extensive muddling of minus signs and equal signs throughout the code, all of which you should fix before proceeding. If you cannot see the difference between - and =, dial up the font size at File > Preferences > Text Editors > Code Editor > Colours > Default > Size until you can. It is not GMS 2's job to clean after inaccurate typography.

I strongly advise against continuing with the tutorial you are currently using, as the single-quoted strings suggest pre-GMS 2 content. There will likely be material later that needs significant rework due to changes in GMS 2.3, and asking for help on that is an avoidable waste of time.
 
J

jimuthy

Guest
Thanks to both - yes it is pre GMS 2.3; I was using it to see how things work. The inverted commas instead of apostrophe did indeed clear up one problem. I will move onto another tutorial, but thanks again for your help.
 
Top