Jump to content


Photo

Gm Manual Expansion- Error Messages


  • Please log in to reply
25 replies to this topic

#1 correojon

correojon

    custom title

  • New Member
  • 461 posts

Posted 27 March 2006 - 09:44 AM

I´m one of the admins at a spanish GM community and we made a translation of the GM manual. We have added some sections to help non-english speakers with some terms and we had a very nice idea: an Error messages section.

Recently, I talked to Mark to ask him if he could send us a complete list of all the error messages GM throws when you run a game. However, he replied that he hasn´t got this complete list written down anywhere and that making it would be too time-comsuming.

We are going to make this section anyway for our version of the manual, including in it all the error messages we can find. But I´ve thought that it would be a great thing to add to the official manual (the english one). So I´ve thought that maybe we could use this topic to create a list of all the error messages with a short description and a way to solve them. Maybe, if we do it well enough, Mark will consider adding it to the ofiicial manual as a 'common errors' appendix.

Before submitting any error messages to this topic, please take into account the rules Smarty added, your reply can be deleted if it ignores them:

If a decent list of error messages needs to be built, the following information is needed:

·The exact error message. Not some approximation of what you seem to remember from earlier. Use log writing of errors for easier copying
·Specify the script or events that you need to cause the error. This helps in suggesting a solution as well as verifying the error message is real.
·Optionally specify how you think it should be solved

You are of course allowed to correct shortcomings in reports or suggestions of others, but I will remove any information that I consider to be either incorrect or incomplete.


So, here´s the current list we have thought of:

CRITICAL ERROR MESSAGES
These error messages can appear both during compilation or runtime. For example, you can get a "Division by 0" compilation error message if you write something like "variable=1/0". But you can also get this error message if you write something like "variable=1/my_variable". If "my_variable" equals to 0 in any moment during your game, the error message will pop-up in runtime.

·Array index>=32000: This message tells you that you are trying to use an array index bigger than or equal to 32000. In Game Maker, the maximum size an array can have is 32000. That means the array will have 32000 elements at maximum, so the index of the last element will be 31999.

·Cannot find the file This happens when your Game Maker file is replaced, moved or deleted. Solution: Find the Game Maker file by yourself.

·Division by zero This message will pop up whenever you try to divide one number by 0. A way to abort this error is by making a check before making the division:
if a!=0{
 my_variable=1/a;
}

·Error Creating Stand-Alone: Cannot find the required dlls This happens when dxdata file is corrupt or deleted. Solution: Reinstal Game Maker.

·No action libraries have been found This happens when action libraries are replaced or deleted. The action libs included with Game Maker: 02_main1, 03_main2, 07_draw, 06_extra, 05_score, 04_control, 01_move. Solution: Place them in the map Lib or reinstall Game Maker.

·Error Creating Stand-Alone: Cannot find valid runner data This happens when the rundata file is corrupt or deleted. Solution: Reinstal Game Maker.

·Negative array index: This means that you are trying to use a negative index in an array. The first element in an array is always the element with index 0. There is nothing before it so by using a negative index you would be trying to access a non-existing element.

COMPILATION ERROR MESSAGES
These error messages appear before the game starts to run or when you push the Check the script for syntax errors button in a script. These messages will always pop-up if something is wrong.

·Assignment operator expected Happens when you use a variable name without an assignment operator:
my_variable;//ERROR
This statement doesn´t have any meaning and that´s why you get the error message. Another way to get this error message is to forget to put the brackets after a function:
instance_create;
To solve it, just put the brackets after the function along eith any arguments the function may need:
instance_create(x,y,my_object);

·Failed to compile scripts Occurs if there is an error in one of your scripts and you have "Display error messages" unchecked in the Global Game Settings. To solve it, go into Global Game Settings, check it and run the game so you can see the real error message.

·Failed to compile the actions in the objects.(compilation/runtime error) Occurs if there is an error in your game and you have "Display error messages" unchecked in the Global Game Settings. To solve it, go into Global Game Settings,check it and run the game so you can see the real error message.

·Game has no rooms: Rooms are where all the games takes place, so without rooms the game can´t run. Instances can´t be created anywhere but inside a room. So without rooms, the game can´t run any scripts or actions.

·Program ends before end of code This happens if there is code when your script is already ended with a bracket. Example:
{
   show_message('hello world');
}
show_message('code which caused the error');
To solve it, make a recheck at your brackets, most likely there is one closing bracket that is ending the script too early.

·Symbol <symbol> Expected In this case, you forgot to include the closing symbol to a statement, e.g. "Symbol } expected" or "Symbol ) expected".
for (i=0; i<10; i+=1
 show_message('Ouch');
Or
{
show_message('This gives an error too');
Appear frequently in nested blocks, where you usually forget to put a closing parenthesis at the correct place.

·Unexpected error occurred when running the game: This tells you that there has been an error outside Game Maker. Not having enough graphic memory or not having installed DirectX8.0 or later are the most common errors. With this error, the game can run in some computers and fail in others as it depends exclusively on each computers characteristics. An usual way to get this error message during runtime is to create infinite loops or to use too much memory.

·Wrong number of arguments to function or script This happens when in some script or code you forgot to add part of what is required for it to run. Some functions and scripts need arguments to work with and they must be specified when you call the function/script:
function_name(argument_0, argument_1, argument_2)
Check the manual to see the correct use of the specific function.

RUNTIME ERROR MESSAGES
These error messages appear in a determined moment when you are running your game. Depending on how you coded your game, some of them won´t show if the code or actions necessary to trigger them don´t take place. Also, some of these error are dependant of the computer the game runs in, for example, all the error messages relative to video memory issues.

·Cannot compare arguments Happens when you try to compare a string to a real number. Use the fuctions real() or string() to convert one of the arguments to the correct format.

·Creating istance for non-existing object The most common source for this error is to use the instance_create(x,y,object) function and provide it with an object name that has been mispelled. Check that you spelled right the object name when calling the function.

·File is not opened for reading: This error appears when you try to read or write data to a file that hasn´t be properly accessed. To open a file for reading, you must use the function file_text_open_read("path_to_the_file/name_of_the_file.extension"). The most common error is giving a wrong name to the path of the file, or using absolute paths. Absolute paths, such as "C:\\My_directory\\Myfile.txt" will work in your computer, but will fail in other people´s computers if they do´t have the exact file and directory distribution you have. So instead of using absolute paths, use paths relative to your game directory.

INI files must be located in the same directory as the program This happens when you try to use an INI file in your game but you have placed it elsewhere than the game directory. Move the INI file you are trying to open into the game's directory, or use a different file type (like TXT).

·Unknown funtion or script 'name of function' Happens when you misspell a funtion´s name or a script´s name or when you call a script that doesn´t exist. Check the spelling.

·Unknown variable 'variable_name': This error message appears when you try to use a variable that hasn´t been initialized. Before using a variable in any event, you must initialize it by giving it a value. You can also check the option "Treat uninitialized variables as 0" in the Game Options menu so that Game Maker will automatically initialize all variables to 0 when used the first time.

·Variable name expected Commonly occurs when you try to create a variable with the same name as one of your resources(sound, sprite, object, font, etc.) or when the variable name starts with a digit instead of a letter. Best way to solve is to prefix your resource names with what they are. e.g.
objmyobject
sprmysprite
fntmyfont

·Wrong type of arguments to + What happens when you try to add a real value on the end of a string, or the other way round. Example:
value=1;
show_message("1"+value);
To fix it, you must convert the real value into a string using the string() function:
value=1;
show_message("1"+string(value));


If you know of any error that hasn´t been listed here please feel free to contribute. Also, I´m not a native english speaker so there may be mistakes in the descriptions I wrote above. If you find any or if you can write things down in a clearer way, please let me know.

I´m sure this new section will help a lot of people. Even if it isn´t finally added to the manual this topic alone can become a very good reference. Now it´s your chance to contribute to Game Maker!

CONTRIBUTORS
A very big THANK YOU to all the people helping to make this come true!

ad134
akafinland
grimdaze
Magicman657
Melee-Master
paul23
scorpius
Smarty
Tuntis
Weird Dragon

ONLINE MANUALS
This new section has been converted to html (so it will be easier to add it to a chm project, hope Mark reads this :D) and uploaded to:
http://www.comunidad...or_messages.htm

VERSION EN ESPAÑOL:
Link al manual completo ONLINE de GM6.1 con la sección de Mensajes de Error añadida:
http://www.comunidad...al_GM/Index.htm

I also want to encourage speakers of other languages to translate this section and provide me with the link (via MP, preferred) so I can put it here. GML is really hard to learn if you don´t speak english :D
Recheck this message often as I will be updating it with the most recent news.

UPDATES
20/04/2006:
-ONLINE spanish version of the manual added

18/04/2006:
-Added 3 new error messages: "Assignment operator expected", "Creating instance for non-existing object" and "Unknown function or script"

02/04/2006:
-Added the Weird Dragon's observation on the "Variable name expected error".
-Added error message "INI files must be located in the same directory as the program" contributed by Melee-Master.

Edited by correojon, 20 April 2006 - 09:19 AM.

  • 0

#2 Alex

Alex

    3lite Member

  • New Member
  • 3098 posts

Posted 27 March 2006 - 09:55 AM

You could always use a Spanish to English translator if any unknown errors pop up.
  • 0

#3 correojon

correojon

    custom title

  • New Member
  • 461 posts

Posted 27 March 2006 - 10:08 AM

Thanks, that´s a great contribution... :D

However, GM starters don´t understand these error messages even if they come in their own language. As you can see if you read my entire post, the error message are explained and solutions are proposed for each of them. That´s what we are trying to achieve, a small, nice guide to help people solve this common errors in just a blink :D

No translator can do that.

Edited by correojon, 27 March 2006 - 10:08 AM.

  • 0

#4 Alex

Alex

    3lite Member

  • New Member
  • 3098 posts

Posted 27 March 2006 - 10:13 AM

Well i think the errors you've got are enough. I can't think of any.

How about the Unable to initialise renderer? or GM file is corrupt (most popular)
  • 0

#5 Smarty

Smarty

    GMC Member

  • Retired Staff
  • 7465 posts
  • Version:GM:Studio

Posted 27 March 2006 - 10:22 AM

This is actually a community thread I consider worthwhile, for a change. To give it a little bit more consistency I'm going to make a few house rules.

If a decent list of error messages needs to be built, the following information is needed:
  • The exact error message. Not some approximation of what you seem to remember from earlier. Use log writing of errors for easier copying
  • Specify the script or events that you need to cause the error. This helps in suggesting a solution as well as verifying the error message is real.
  • Optionally specify how you think it should be solved
You are of course allowed to correct shortcomings in reports or suggestions of others, but I will remove any information that I consider to be either incorrect or incomplete.

Correojon, can you update the first post of this topic with the new finds?
  • 0

#6 correojon

correojon

    custom title

  • New Member
  • 461 posts

Posted 27 March 2006 - 10:23 AM

Can you give me a small description on them? I have never found them when working with GM...I think that the first one must deal with video memory issues and the second one with a wrongly downloaded file or a file that was being saved when the computer crashed, but I preffer if I could get the opinion of someone who directly suffered them.

Thanks and excuse me if I was a bit rude in my last post :D

Edited:
Smarty, updating the first post right now. Thanks for your support :D

Edited by correojon, 27 March 2006 - 10:25 AM.

  • 0

#7 Smarty

Smarty

    GMC Member

  • Retired Staff
  • 7465 posts
  • Version:GM:Studio

Posted 27 March 2006 - 10:33 AM

No problem. :D

you might want to split the errors into two sections: the ones encountered during compilation (which Game Maker does before it actually runs the game), and the run-time errors.

Division by zero: May occur both in compilation (speciying e.g. 1/0 in a script) or runtime (1/a while a equals zero).
  • 0

#8 Finland Games

Finland Games

    Finland Games

  • New Member
  • 1034 posts

Posted 27 March 2006 - 11:00 AM

"wrong number of arguments to funtion or script"

this happens when in some script or code you forgot to add part of what is required.
an example of this is when you mean to do:

instance_create(x,y,object)

but instead put:

instance_create(x,object)

(you forgot to put in the "Y" variable)
  • 0

#9 Magicman657

Magicman657

    The Dark Paladin

  • New Member
  • 516 posts

Posted 27 March 2006 - 11:25 AM

Don't forget to add this one:
Cannot compare arguments.

You get this error when you try to compare a string to a real number. Happens more often than you would like it to sometimes :D
  • 0

#10 tuntis

tuntis

    GMC Member

  • New Member
  • 1839 posts

Posted 27 March 2006 - 12:06 PM

http://www.gamemaker.../List_of_errors

This is a good list.
  • 0

#11 Smarty

Smarty

    GMC Member

  • Retired Staff
  • 7465 posts
  • Version:GM:Studio

Posted 27 March 2006 - 12:07 PM

Again: let's make a distiction between compilation errors (script errors that can usually be caught by pushing the script check button) and runtime errors. The one akafinland posted is a compilation error, for example.

Here is another compilation error:

Symbol <symbol> Expected, e.g. Symbol } expected or Symbol ) expected.

In this case, you forgot to include the closing symbol to a statement, e.g.

for (i=0; i<10; i+=1
  show_message('Ouch');

Or

{
show_message('This gives an error too');

Appear frequently in nested blocks, where you usually forget to put a closing parenthesis at the correct place.
  • 0

#12 grimdayz

grimdayz

    a.t.t.i.c.

  • GMC Member
  • 1012 posts
  • Version:GM:Studio

Posted 27 March 2006 - 12:28 PM

Before using a variable in any event, you must initialize it in a Create event or in a room creation code by giving it a value.


That isn't true. You just have to give it a value(initialize) before running a check on it.
For example,

if (some_var == some_val)

As long as some_var is given a value(it does not matter where) before that if runs, it will work just fine.
------------------------------------------------------------------------------------------------------
Variable name expected.(compilation error(cannot be caught with the script check button but is caught before the game runs))
Commonly occurs when you try to create a variable with the same name as one of your resources(sound, sprite, object, font, etc.)

Best way to solve:
Prefix your resource names with what they are. e.g.
objmyobject
sprmysprite
fntmyfont

Edited by grimdaze, 27 March 2006 - 12:51 PM.

  • 0

#13 correojon

correojon

    custom title

  • New Member
  • 461 posts

Posted 27 March 2006 - 01:13 PM

OK, I´ve just updated the first post with some new error messages, divided them into error types as Smarty suggested (I added a "critical error" section for errors that can happen in runtime and compilation), sorted them alphabetically and added a contributor's list to encourage people :whistle:

Thanks to everyone for your your contributions :)

And now, it´s quoting time!

http://www.gamemaker.../List_of_errors

This is a good list.

Very good contribution! Thanks, I´ll check it :)

Before using a variable in any event, you must initialize it in a Create event or in a room creation code by giving it a value.



That isn't true. You just have to give it a value(initialize) before running a check on it.
For example,

if (some_var == some_val)

As long as some_var is given a value(it does not matter where) before that if runs, it will work just fine.

Didn´t know it, I´ll edit the description right now. Thanks!
  • 0

#14 grimdayz

grimdayz

    a.t.t.i.c.

  • GMC Member
  • 1012 posts
  • Version:GM:Studio

Posted 27 March 2006 - 01:15 PM

Failed to compile the actions in the objects.(compilation error)
Occurs if there is an error in your game and you have "Display error messages" unchecked in the Global Game Settings.

Solution: Go into Global Game Settings and check it so you can see the real error message.

Edited by grimdaze, 27 March 2006 - 01:24 PM.

  • 0

#15 paul23

paul23

    GMC Member

  • Global Moderators
  • 3802 posts
  • Version:GM:Studio

Posted 27 March 2006 - 01:29 PM

program ends before end of code (compilation error)

this happens if there are other code when your script is already ended with a bracket ie:
{
    show_message('hello world');
}
show_message('code which caused the error');

solution: make a recheck at your brackets, most likely there is one "close" bracket too much.

and in addition to the previous:
failed to compile scripts
Occurs if there is an error in one of your scripts and you have "Display error messages" unchecked in the Global Game Settings.
Solution: Go into Global Game Settings and check it so you can see the real error message.

Edited by paul23, 27 March 2006 - 01:33 PM.

  • 0

#16 scorpius

scorpius

    GMC Member

  • New Member
  • 116 posts

Posted 27 March 2006 - 01:36 PM

1:
Cannot find the file.

This happens when your GM file is replaced or delete.


Solution: Find the GM File by your self

2:
Error Creating Stand-Alone: Cannot find valid runner data.

This happens when the rundata file is corrupt or delete

Solution: Reinstal Game Maker

3:
Error Creating Stand-Alone: Cannot find the required dlls.

This happens when dxdata file is corrupt or delete

Solution: Reinstal Game Maker

4:
No action libraries have been found.

This happens when action libraries are replaced or delete.

The action libs included with GM: 02_main1, 03_main2, 07_draw, 06_extra, 05_score, 04_control, 01_move

Solution: Place them in the map Lib or reinstal GM

Edited by scorpius, 27 March 2006 - 01:49 PM.

  • 0

#17 ad134

ad134

    The Ad man

  • New Member
  • 413 posts
  • Version:Unknown

Posted 27 March 2006 - 03:00 PM

Wrong type of arguments to +

What happens when you try to add a real value on the end of a string, or the other way round. Example:
value=1
show_message("1"+value)

Fix:
value=1
show_message("1"+string(value))

Edited by ad134, 27 March 2006 - 03:01 PM.

  • 0

#18 Mothflavour2

Mothflavour2

    Expert Pixel Artist

  • New Member
  • 535 posts

Posted 31 March 2006 - 03:03 PM

·Cannot find the file This happens when your Game Maker file is replaced or deleted. Solution: Find the Game Maker file by yourself.


This actually happens when the file is moved, too. You should include that as well.
  • 0

#19 scorpius

scorpius

    GMC Member

  • New Member
  • 116 posts

Posted 31 March 2006 - 04:54 PM

Because there are some errors in the game it self I made a small tutorial to dissolve the problem by your self, I am not so good in gramma so you need to recheck it :).

When you are testing your game and a error pop-up, there are some programming or D&D error. This tutorial will let you know how to work with this error.

Example:

ERROR in
action number 1
of Create Event
for object object0:

Error in code at line 1:
  varriable+=2

at position 1: Unknown variable varriable


Here you can see a error, you got 2 options Abort/Iqnore. It is recommend that you Abort the game and solve the problem. It can't do any harm to ignore it, if you don't use expert functions.

Lets solve the problem. As you can see in the first line you can see where the error is. First you got the action number 1 this is the first action in the action section. When you got action number 2 it is the second action in the action section ect.. Then you got the event. In this case it is the Create event. As you can see the next is the object.

[GML] On the second line we got a snip code that has the error, also in what line the error is. The third line is the position of the letters where the error is, and then you can see what the error is.

[D&D] On the second line we got the position this is always 1 (correct if I am wrong) then you would see what the problem is.

You can see if you use it, I didn't put so much effort in it so its up to you if you want to use it. A little credits would be nice :whistle:
  • 0

#20 Melee-Master

Melee-Master

    Metalhead

  • New Member
  • 1170 posts

Posted 01 April 2006 - 01:38 AM

Error Message:
INI files must be located in the same directory as the program.

Solution:
Move the INI file you are trying to open into the game's directory, or use a different file type (like TXT).

Fatal error? No.

Screenshot:
Posted Image
  • 0

#21 Weird Dragon

Weird Dragon

    GMC Member

  • Global Moderators
  • 1934 posts
  • Version:GM:Studio

Posted 01 April 2006 - 11:24 AM

·Variable name expected Commonly occurs when you try to create a variable with the same name as one of your resources(sound, sprite, object, font, etc.). Best way to solve is to prefix your resource names with what they are. e.g.
objmyobject
sprmysprite
fntmyfont

<{POST_SNAPBACK}>

That error message can also be generated in case you initialize a variable name that starts with a digit instead of starting the name with a letter.

There is a site where a list of error messages is being created.
Here is a link and a quote from the list:
http://www.gamemaker.../List_of_errors

Variable Name Expected

This one typically appears when you have given a variable the same name as something else. Could be an object name, thus if it is an object name it can not also be a variable name, so a variable name is missing but expected and therefore the error message is generated. This error can also be generated in case you initialize a variable name that starts with a digit instead of starting the name with a letter.


And here is an article:
http://www.gamemaker...rors,_some_tips

Edited by Weird Dragon, 01 April 2006 - 11:29 AM.

  • 0

#22 correojon

correojon

    custom title

  • New Member
  • 461 posts

Posted 01 April 2006 - 12:09 PM

You can see if you use it, I didn't put so much effort in it so its up to you if you want to use it. A little credits would be nice

Just great! I just created an online version of this section and I added a small introduction using your little tutorial :)
You are already in the contributors list

Melee Master:
Just saw your message, I will update both the main message and the online section ASAP. Thanks!

Weird Dragon:
Thanks for pointing that out and many thanks for that interesting links, Ill be checking them :)

This is going pretty good, dont you guys think?
  • 0

#23 scorpius

scorpius

    GMC Member

  • New Member
  • 116 posts

Posted 01 April 2006 - 02:45 PM

Soon a Spanish version will also be available. I always want to encourage speakers of other languages to translate this section and provide me with the link (via MP, preferred) so I can put it here. GML is really hard to learn if you dont speak english :)
Recheck this message often as I will be updating it with the most recent news.

<{POST_SNAPBACK}>


I would like to make the dutch version :) I will start when the english version is ready.
  • 0

#24 correojon

correojon

    custom title

  • New Member
  • 461 posts

Posted 18 April 2006 - 10:50 AM

New update, check the first message of the topic.

Remember that the latest version can be found online at:
http://www.comunidad...or_messages.htm
  • 0

#25 ejackson

ejackson

    Topic Bumper

  • New Member
  • 416 posts

Posted 20 April 2006 - 03:58 AM

Mods, why don't you put this in Correjon's spanish GMC?

Edited by ejackson, 20 April 2006 - 03:59 AM.

  • 0

#26 correojon

correojon

    custom title

  • New Member
  • 461 posts

Posted 20 April 2006 - 09:26 AM

Another update, this time the spanish version has been completed, check it at:
http://www.comunidad...al_GM/Index.htm

Mods, why don't you put this in Correjon's spanish GMC?

What do you mean with "put this in Correjon's spanish GMC"? I don´t understand what you are saying ^_^
BTW, it´s correojon, not Correojon :)

[Spanish]
Añadida la versión en español del manual:
http://www.comunidad...al_GM/Index.htm
La sección de Mensajes de error se encuentra dentro de los Apéndices (abajo del todo en el índice general).
[/Spanish]

Edited by correojon, 20 April 2006 - 09:27 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users