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

SOLVED using a tutorial for level generation and its not working

trying a level generation for my new game using a tutorial and not sure what to do, am i stupid or is this tutorial outdated?
(tutuorial im using)
w.png
unknown.png
 
O

orangejous Games

Guest
Yo! I implemented this in my game about a week ago, and there are a few things to look out for with this tutorial (it is technically outdated as of the current gamemaker version, but will still work, there are just some formatting issues).

It looks like your syntax errors might be caused by not putting "_" with the variables (you can't use spaces, I'm assuming you didn't only because it shows up as yellowed text but just in case),

The other thing... make sure you put the semi-colons after writing your lines, that could cause issues with the system reading the code seeing as how semi-colons tell the system that the line has stopped.

Further, in the tutorial, you'll be making scripts, make sure to see how to format scripts now, (when he says to make a new script, name the script immediately whatever you want to name it, or else, you will need to change the "function ScriptX() {" to "function _______(name of your script)() {" and then write the script code within that function!
 

Slyddar

Member
The other thing... make sure you put the semi-colons after writing your lines, that could cause issues with the system reading the code seeing as how semi-colons tell the system that the line has stopped.
This is not required by Gamemaker, and will not produce any errors if you omit a semi colon, but it's good coding practise as other engines require it.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
This is not required by Gamemaker, and will not produce any errors if you omit a semi colon, but it's good coding practise as other engines require it.
Not quite true... It is required for some functions and expressions to be parsed correctly, and the YYC can be very finicky if they aren't included. In general I would 100% recommend always using the semi-colon, even if you can "get away" without using it. It also future-proofs the code, as GML is constantly evolving and I can see it being made mandatory in the future to bring GML more in line with other popular languages. :)
 

Slyddar

Member
It is required for some functions and expressions to be parsed correctly
Can you elaborate on what requires it? Of course I always use it, and know YYC is a bit tricky, but I'm curious what functions and expressions actually require it in VM.
 
I have seen local variable declarations fail in some cases when semicolons are omitted. I’m not sure about other cases (I never omit them so don’t run into problems) but I’m sure there’s more.

Really, I see no point in defending a lack of semicolons, in the same way as I don’t see the point in defending using = as a comparator. If you do either, you are neglecting to learn programming concepts and you are teaching yourself bad habits that can easily bite you later on.

Always end appropriate lines with semicolons and you will never run into problems.
 

TailBit

Member
Isn't it mostly:
GML:
var a=0;
But if you don't use it then console can end up showing the next line instead of the line with the error.. wasted some hours scratching my head on that.
 

Director_X

Member
";" means END of a command instruction statement. It is good practice to use ";" all the time to separate different commands. Keeping your code clean will save you pain in the long run.
 
Top