Trying to do a tutorial, keep getting errors even though I've done everything she said

So I have the free trial version of GMS 2 and I'm trying to do this tutorial:

But there's a problem: at 8:02 you can see she has NO compiling errors. I'm having them even though I did everything in the video (differing names aside)
The errors are on lines 12, 21, 22, 25, and 33.
GML:
switch(room){
    case room0:
    draw_text(20,20, "Score: "+string(score));
    draw_text(20,40, "Lives: "+string(lives));
    break;
   
    case GameStart:
    var c = c_yellow;
    draw_text_ext_transformed_color(
       room_width/2, 100, "SPACE ROCKS",
       3,3,0, c,c,c,c,c, 1
    );
    draw_text(
    room_width/2, 200
    @"Score 1,000 points to win!
     UP: Move
     LEFT/RIGHT: Move Left/Right
     SPACEBAR: Shoot
   
     >> PRESS ENTER TO START <<
    "
    );
    break;
   
    case WinScreen:
   
    break;
   
    case GameOver:
   
    break;

}
Line 12 is a compile error and says "wrong number of arguments for function draw_text_ext_transformed_color
It's even saying there's syntax errors on lines where I don't see the red line on.
Any idea what's going on?
 
c,c,c,c,c,
5 c's. There's only 4 colours you can input to the function.
200 @"Score 1,000 points to win!
No comma after the 200 (should be 200,)

If you are getting errors and the tutorial maker isn't, then you are making a mistake somewhere. Over time, you'll get better at spotting those sorts of errors (it took me like 5 seconds of looking over the code to spot them, lol), but you should always take the time to go through line by line and make exactly sure you have typed exactly the exact thing that they have if you are getting errors, even if you've looked for 20 minutes and not spotted any, you should still be assuming you've made a mistake.
 
I fixed both of those and despite removing one of the Cs, I’m still getting an error on line 12. Where it says in the syntax errors, “arguments expected 13, got 11”.
 
Last edited:

Catastrophe

Member
Hey, so she's using

draw_text_transformed_color

you're using:
draw_text_ext_transformed_color

change your function and you're good to go.

They are different functions with a different amount of arguments.

As a general rule, when you're starting out, you should look up every function you use in the manual to get an idea of how and why the function is used, it'll help in the long term a lot :) Help->open manual->index and type in the function name, and you'll get a lot of useful info :D This will show you not only how many arguments you should pass in, but what those arguments mean.
 

Toque

Member
I had the same problems starting out. It’s not forgiving. Miss a comma. Misspelled a variable.

check it five times...... you really have to check letter by letter.

but soon the errors will help you narrow it down.
 

TsukaYuriko

🌠
Forum Staff
Moderator
The best course of action in such situations is to comment out the offending line, move it off the screen and to write it once more. If it works that time, you can now compare the difference between the two and see what you did wrong. If you're still getting an error message and have with absolute certainty ensured that your code is identical to the source... try it once again anyway. (If it's still not correct, the tutorial you're using is likely not for your version of GM.)
 
I had the same problems starting out. It’s not forgiving. Miss a comma. Misspelled a variable.

check it five times...... you really have to check letter by letter.

but soon the errors will help you narrow it down.
This is where Frosty gets their "you need to spell internet posts properly to be able to code" rant from. In some ways, it's vital to coding to be able to organise your thoughts into cohesive statements and then precisely execute on those statements with the tips of your fingers. But then again, I've seen some pretty scatterbrained people produce some pretty crazy stuff so, who really knows.
 

Toque

Member
This is where Frosty gets their "you need to spell internet posts properly to be able to code" rant from. In some ways, it's vital to coding to be able to organise your thoughts into cohesive statements and then precisely execute on those statements with the tips of your fingers. But then again, I've seen some pretty scatterbrained people produce some pretty crazy stuff so, who really knows.
True. But you only know what you know. It’s a process. You start and stumble your way through it. Then you get smarter and can see the problems yourself.

Not every person has a coder brain. Coding is hard for a lot of people.

If you hang in there it gets easier. Your going to make lots of mistakes. You learn to go to the manual. Etc.

Hang in there.
 
Top