Due to the increasing number of people who seem to be interested in learning Danmakufu, there has been an increase in the number of repetitive questions about error messages. Truthfully, it's started to annoy me a little, but instead of complain about it and do nothing, I thought I'd complain about it and write something that will hopefully help out. :V
Feel free to point out mistakes, ask your own questions here (about error messages of course), or contribute. If there's any missing information, I'll gladly answer and update this first post so future readers are more likely to find their problem answered here.
First off, if you're getting a bad allocation error, we currently do not have enough information about it to give an explicit reason why it occurs. The first thing you should do is reload Danmakufu and try your script again. If the bad allocation occurs at the exact same time as before, then there is may be a scripting error. Unfortunately for you, since it pops up with "bad allocation" rather than a scripting error, you won't get a specific message and troubleshooting will be rather difficult. If you looked through it and can't find any errors, go ahead and skip all these steps and post your code.
Step 1: Do you even get a scripting error?
Yes: Go to the next step.
No, it just freezes: You likely have an infinite loop somewhere in your script. Check all your while and loop statements to see if they ever exit correctly. If it's supposed to be an infinitely looping task, make sure you're yielding the task too.
No, it just crashes: There are a lot of things that can cause this. Common causes are attempts to create effect objects in @Initialize, naming things with names that Danmakufu is already using but didn't tell you (index, for example, should never be used as a variable/function name), or sound files that somehow aren't compatible with Danmakufu. This seems to vary from person to person and if none of the above reasons seem to be the case, go ahead and ask for help.
Step 2: Does the error give you a line number? It's usually in parentheses.
Yes: Check the line AND a few lines above and below it for common mistakes such as typos, capitalization errors, missing semi-colons, parentheses or other punctuation, or missing/extra parameters in functions. If you can't find the problem, go to the next step for more specific instructions.
No: Check to see if all your braces ('{' and '}') match up. Good spacing and tabbing habits help tremendously for this. A good way to check if these things match is to use your editor's find function (Ctrl+F for most programs) to look for { and then counting how many there are and then doing the same for }. This method also may find them in strange places you don't remember putting them into. If everything seems fine, skip to step 4.
Step 3: Does the error give a function or variable name?
Yes, and it's a function: Make sure that it is spelled correctly. If it's a subroutine, function, or task that you wrote yourself, make sure that both where you're calling it and where you defined it is spelled and capitalized correctly. Lastly, make sure the correct amount of parameters are in the parentheses. You may also have forgotten a comma or typoed it as a period instead so check for that too. A common mistake that I make is writing stuff like Obj_SetAngle(obj, 180-Obj_GetAngle(obj); As you can see, there's a parentheses missing.
Yes, and it's a variable: Make sure that the variable is spelled correctly. Make sure that the variable is also defined beforehand and within the scope of where you are trying to call it. Remember, a variable defined inside an if, while, loop, etc. statement cannot be used outside of that statement. Lastly, if your variable is storing one type of value (string, number, boolean, etc), it cannot be changed or compared to another type of value. For example, if you say let ThisThing = "five";, you cannot later put ThisThing = 5;. Similarly, ThisThing += 8 and if(ThisThing==5) will also raise errors.
No: Tough luck. Keep reading.
Step 4: Specific Error Messages
The following is de-engrishified machine translations. If there's someone who can translate them better, please do and I'll edit this.
[script name]内で「{...}」が対応していません - In [script name], "{...}" is not supported(?)
Okay this translation is way off, but I've seen this message so many times. You almost definitely have mismatched braces ('{' and '}').
[something]わ未定義の識別子 - [something] is not defined.
Check your spelling on the variable/function and make sure it was defined somewhere. Just so you know, functions also have scope similar to how variables do. If you define a function in a task, only that task can use that function.
型が違う値同士お比較しようとしました - Variables of different types are being compared.
As I just mentioned, you can't compare a string to a number. Even if it makes sense in your head, computers are very picky.
代入によって型が変えられようとしました - A variable was changing it's value type.
You're trying to change a variable's type (for example from a boolean to a string) which isn't allowed.
[punctuation]が必要です - [punctuation] is required.
You're missing the indicated punctuation on the indicated line. Usually a parentheses. Unfortunately, it will likely never catch a missing semi-colon.
配列のサイズお超えています - Size of the array was exceeded.
Remember, an array with 8 values is numbered from 0 to 7, not 1 to 8.
同じスコープで同名のルーチンが複数宣言されています - Functions and variables of the same name are declared in the same scope
You have a variable/sub/function/task named the same as another variable/sub/function/task.
解釈できないものがあります(「;」を忘れていませんか) - Unable to be interpreted (Don't forget ";"s)
You wrote something so weird, Danmakufu has no idea what you're trying to accomplish and gave up trying to give you a matching error message.
配列以外にconcatenateを使いました - No translation.
You're trying to add a value to an array that doesn't store that type of array. For example, trying to add "omg" to an array that only stores numbers. This error also appears if you try to add numbers to strings like "One plus one is" ~ 2. In that case, you'd need to use the function ToString to change the number to a string before using ~. Like this: "One plus one is " ~ ToString(2).
If there's an error message you got that doesn't match these, go ahead and post it up and we'll get it translated.
Step 5: It's STILL not working! You're useless Blargel!
Thanks. :V
Before you go ahead and post your problem, go through your code one more time using your editor's search function to find all the {'s and all the }'s. Count them. Make sure they are in appropriate spots and match up correctly. The most random error messages can pop up because these things aren't in the right places. It's all good? I'm still useless? Okay, go ahead and post your problem.
Just keep in mind that if your issue turns out to be something that I already addressed in here, you're gonna look rather silly. :V