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

Can someone help me Plz?

Amon

Member
The error tells you that you are trying to use yaxis before declaring it. In your objects Create Event declare yaxis before you assign a value to it.
 
A

arirish

Guest
Code:
yaxis=0; //or whatever value you need it to be
You need to declare variables before you can use them. It can be as simple as assigning them a value in your object's Create event.
 

rIKmAN

Member
I'd advise you to follow some beginner tutorials, look at the "My First Game" projects on the marketplace and look have a read through the manual, you are struggling with very basic beginner concepts here and "variables" are one of many things explained in depth in the manual that will help you get going.

Without learning and understanding what you are doing, why these errors are occurring and what you need to do to fix them you will just have another question as soon as you are helped with the first one.

I don't meant to sound harsh, but put some time into learning the basic building blocks: variables, loops, conditionals etc and you will start to find that things start to make much more sense and become much less confusing.
 
A

arirish

Guest
At this point you should be spotting the pattern. You fix one undeclared variable error, you get another. Looks like none of your variables have been declared. Time for a bit of intuition on this one, no?
 

Toque

Member
GML isn’t easy. But it’s not really hard either. It will take some basic learning of programming and GML syntax and logic to get it done.

Try some tutorials or udemy course or something to get started.

Happy learning.
 
R

RedDragon64

Guest
At this point you should be spotting the pattern. You fix one undeclared variable error, you get another. Looks like none of your variables have been declared. Time for a bit of intuition on this one, no?
Yeah I am really Like 5 days new I should hit the books I did get the code from a tutorial right here
https://www.youtube.com/playlist?list=PLwG2Q399ulV3TyEWodJYrje3KsxvIxBv1
I have Only reached ep1 and I am stumped at the end
It's sad to see people try to teach when there is no interest in learning. :(
First of all RUDE Secondly I HAVE NEVER TOUCHED A GAME MAKER EVER I don't know java I don't know C# AND I DON'T KNOW GML I AM TRYING TO LEARN THAT IS WHY I AM HERE
T O L E A R N A B O U T G A M E M A K E R

GML isn’t easy. But it’s not really hard either. It will take some basic learning of programming and GML syntax and logic to get it done.

Try some tutorials or udemy course or something to get started.

Happy learning.
Yeah I don't know if game deving is my thing...... but I will try....

Learning new stuff is really hard but I will try to have fun
 

Lazzeking

Member
Yeah I am really Like 5 days new I should hit the books I did get the code from a tutorial right here
https://www.youtube.com/playlist?list=PLwG2Q399ulV3TyEWodJYrje3KsxvIxBv1
I have Only reached ep1 and I am stumped at the end

First of all RUDE Secondly I HAVE NEVER TOUCHED A GAME MAKER EVER I don't know java I don't know C# AND I DON'T KNOW GML I AM TRYING TO LEARN THAT IS WHY I AM HERE
T O L E A R N A B O U T G A M E M A K E R



Yeah I don't know if game deving is my thing...... but I will try....

Learning new stuff is really hard but I will try to have fun
Well, if you still have the last problem maybe you should check that the rKey and lKey are actually declared variables before using them.
Also, as said from other people before me, you should try to learn a little bit at a time and maybe get first a general concept of how let's say programming works, cause that's all it takes: A General concept of programming and a bit of time to learn the events and gml part, but still, learning gml isnt that difficult as it is (like most languages) really similiar to other languages.
 
First of all RUDE Secondly I HAVE NEVER TOUCHED A GAME MAKER EVER I don't know java I don't know C# AND I DON'T KNOW GML I AM TRYING TO LEARN THAT IS WHY I AM HERE
T O L E A R N A B O U T G A M E M A K E R
I really do hope you like to learn GM, game dev is a wonderful hobby. But it's quite hard to believe when you don't read the errors before posting them. If you would have red them have you should have noticed that the errors were nerly identical and that you already got the answer to solve it the second time.

I know that it can be frustrating when things don't work and you don't even know were to begin but the answer is not to ask for help every time. You are never going to grasp how a game work that way. The best way imo (and as stated before here) is to follow a simple tutorial to learn the basics. Then maybe experiment with the finished product or start a new project and base it on what you learned from the tutorial.

A classic problem is that you start with a project that contains to much concepts that you're not familiar with. It's only going to be frustrating and painful to work with and mostly lead to quiting. I can appreciate that you started with a tutorial tho. Some people come straight to the forums and ask how to make a 3D MMORPG like it's made with 10 lines of code.


The point here is not to be mean, I (we) really do like to help but I just don't think giving you the answer to your questions is the best way for you here.
 

FrostyCat

Redemption Seeker
There is no reason for those error messages to come up if your code is identical to the tutorial's instructions at 8:55.

Here are the lines that correspond to keyboard movement in get_input:
Code:
rKey = max(keyboard_check(vk_right), keyboard_check(ord("D")), 0);
lKey = max(keyboard_check(vk_left), keyboard_check(ord("A")), 0);
dKey = max(keyboard_check(vk_down), keyboard_check(ord("S")), 0);
uKey = max(keyboard_check(vk_up), keyboard_check(ord("W")), 0);

xaxis = (rKey - lKey);
yaxis = (dKey - uKey);
Make sure that your code matches every non-space character above, including the case. As I have already said before, GML is case-sensitive. In particular, if you mess up the casing of the variable names, you end up working with an entirely different variable. That is one of several common causes of errors in that "Variable not set before reading it" form.

In addition, you need to stop posting code in screenshot form, and to start using code boxes as per community convention. Read the section on "things to keep in mind when sharing information" in the Programming Forum Guidelines. And as a side note, read the item that says "show some initiative". Thus far you haven't demonstrated much of that, and responders around here are picking on you because of that.

At this point, I don't want to hear a single more question from you that stems from careless typography. All forms of programming require attention to minute detail. If this is not a skill that you intend to refine, then I encourage you to uninstall GMS and get a new hobby that doesn't require it.
 
R

RedDragon64

Guest
Well, if you still have the last problem maybe you should check that the rKey and lKey are actually declared variables before using them.
Also, as said from other people before me, you should try to learn a little bit at a time and maybe get first a general concept of how let's say programming works, cause that's all it takes: A General concept of programming and a bit of time to learn the events and gml part, but still, learning gml isnt that difficult as it is (like most languages) really similar to other languages.
Yeah I probably will abandon this project and start anew I will probably make a SIMPLE Zelda or Mario like games before Games like Earthbound, FF, and Chrono Trigger
(PS I HAVE STILL NOT PLAYED CHRONO TRIGGER IS IT ANY GOOD?) Thanks for the support and help (AND I WILL PROBABLY NEED MORE KNOWING ME)
Thank you guys....and gals
 
Top