Author Topic: Danmakufu Error Message Troubleshooting  (Read 40123 times)

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Danmakufu Error Message Troubleshooting
« on: December 02, 2009, 08:43:00 AM »
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
« Last Edit: August 05, 2011, 09:24:51 PM by Blargel »
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danamkufu Error Message Troubleshooting
« Reply #1 on: December 02, 2009, 11:50:57 AM »
Add the 'script_enemy_main'  error , it is like one of the most common and the cause is missplaced }'s or forgotten ones. Imo this should be also turned into a chart. Do I have your permission to put it in a chart with MS Visio?

Drake

  • *
Re: Danamkufu Error Message Troubleshooting
« Reply #2 on: December 02, 2009, 02:28:36 PM »
The language barrier is certainly annoying... If someone finds another error I'll try to translate it to be put up.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danamkufu Error Message Troubleshooting
« Reply #3 on: December 05, 2009, 05:52:08 PM »
Flowchart based on Blargel's paint flowchar and his post. Credit to Blargel for the idea and permission :3

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danamkufu Error Message Troubleshooting
« Reply #4 on: December 05, 2009, 06:14:15 PM »
Here's the totally non-serious MSPaint flowchart if anyone is wondering.
lolflowchart
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danamkufu Error Message Troubleshooting
« Reply #5 on: December 05, 2009, 06:39:28 PM »
Bad Apple Allocation!! Where does it go?
« Last Edit: December 27, 2009, 05:45:52 AM by Always お⑨烏 »

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danamkufu Error Message Troubleshooting
« Reply #6 on: December 05, 2009, 06:53:34 PM »
Bad allocation is a bizarre error. Thanks for reminding me. From my experience, if restarting Danmakufu doesn't fix it, then there's actually a scripting error in there somewhere. I rarely ever see it though and there's not enough data to give any reliable reasons for its random appearances.

I guess I should put something about it in the first post.

EDIT: Btw, I believe "bad allocation" actually refers to a bad allocation of memory which means that Danmakufu is somehow handling memory incorrectly. Someone more experienced about this should look into this is it really becomes a problem.
« Last Edit: December 05, 2009, 06:55:07 PM by Blargel »
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Re: Danamkufu Error Message Troubleshooting
« Reply #7 on: December 05, 2009, 10:10:55 PM »
"Bad allocation" means you fucked up hard. Read through your script, check for any common errors. On the way through you might spot something out of the ordinary. Chances are you're trying to do something batshit, so check over your logic first. All else fails, burn your script or post it in the Q&A thread. The answer to your problem will almost invariably be "you're doing something batshit, stop", so be careful.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danamkufu Error Message Troubleshooting
« Reply #8 on: December 05, 2009, 10:15:53 PM »
"Bad allocation" means you fucked up hard. Read through your script, check for any common errors. On the way through you might spot something out of the ordinary. Chances are you're trying to do something batshit, so check over your logic first. All else fails, burn your script or post it in the Q&A thread. The answer to your problem will almost invariably be "you're doing something batshit, stop", so be careful.

I tried using #Player[REIMU_A, MARISA_B]
and I get Bad allocation.

Re: Danamkufu Error Message Troubleshooting
« Reply #9 on: December 05, 2009, 10:17:34 PM »
I tried using #Player[REIMU_A, MARISA_B]
and I get Bad allocation.
I don't think you can choose the types for the default characters. Only REIMU and MARISA.

Re: Danamkufu Error Message Troubleshooting
« Reply #10 on: December 05, 2009, 10:20:41 PM »
I tried using #Player[REIMU_A, MARISA_B]
and I get Bad allocation.

REIMU_A and MARISA_A don't exist. Get rid of the underscores.

#Player[REIMUA, MARISAB]

Lawence Codye

  • The Nine Tails of Subconscious...
  • Come & your desires shall all become reality...
Re: Danamkufu Error Message Troubleshooting
« Reply #11 on: December 07, 2009, 04:54:19 PM »
okay...what does this mean?
« Last Edit: December 07, 2009, 05:05:21 PM by Lawence Codye »
I am the Nine Tails of Subconscious...

Come & your greatest desires will be reality...

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danamkufu Error Message Troubleshooting
« Reply #12 on: December 07, 2009, 05:21:10 PM »
It says "sub", which I believe means that the error is related to a subroutine or function.

Possibilities:

If Season is a sub or function that is supposed to return you a number, and you want to check whether or not this number equals to 2, it may be that either you messed up something with Season so that it doesn't return you a number. Maybe it returns a string instead, maybe an object id or even nothing, I don't know. Alternatively, if it is a function, the error may be that you didn't give it any input for its variables to work with.
Also it may even be that you cannot use subs or funtions inside the if() check, so you would need Season to pass the respective value to a variable which then in the next step you can compare to two.

If these aren't the case, look whether or not something is awry in the line directly above that, especially if you forgot to put a bracket or a semicolon somewhere.
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

Re: Danamkufu Error Message Troubleshooting
« Reply #13 on: December 07, 2009, 05:55:06 PM »
if(Season==2){position="BLUE1";}

I don't actually know what the error message reads, but it might have something to do with the line before it as well.

Lawence Codye

  • The Nine Tails of Subconscious...
  • Come & your desires shall all become reality...
Re: Danamkufu Error Message Troubleshooting
« Reply #14 on: December 07, 2009, 05:59:13 PM »
ah, I see I messed up on epic levels...thanks all who helped & I'm just gonna try something way different...& easier...
I am the Nine Tails of Subconscious...

Come & your greatest desires will be reality...

Re: Danamkufu Error Message Troubleshooting
« Reply #15 on: December 14, 2009, 01:33:37 AM »
How's it goin'.


Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danamkufu Error Message Troubleshooting
« Reply #16 on: December 14, 2009, 02:04:42 AM »
How's it goin'.


takes random guess and says no such script
« Last Edit: December 14, 2009, 02:27:20 AM by Always お⑨烏 »

Re: Danamkufu Error Message Troubleshooting
« Reply #17 on: December 14, 2009, 02:38:50 AM »
It means I've defined something that has already been defined.

Like:

Code: [Select]
let shit = 0;

task shit{}

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danamkufu Error Message Troubleshooting
« Reply #18 on: December 14, 2009, 02:40:24 AM »
It means I've defined something that has already been defined.

Like:

Code: [Select]
let shit = 0;

task shit{}
:/

Gc

  • youtu.be/pRZpjlrKM8A
Re: Danamkufu Error Message Troubleshooting
« Reply #19 on: December 23, 2009, 03:19:56 AM »

What the fuck does it mean, I can't read moonrunes.

After getting this error, the script continues running normally, only without bullets.
« Last Edit: December 23, 2009, 03:21:33 AM by Gamecubic »

Drake

  • *
Re: Danamkufu Error Message Troubleshooting
« Reply #20 on: December 23, 2009, 03:45:06 AM »
Bullet declaration file error. Post your shot.txt in the Q&A thread~

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Snowpaw

Re: Danamkufu Error Message Troubleshooting
« Reply #21 on: December 24, 2009, 03:22:22 PM »
I have a problem specifically with Concealed the Conclusion...It SHOULD work right out of the box. You have to pay for it after all, right? (this is my friend's copy I'm borrowing, so I don't know)

My issue is that if I click the only exe that gives me a touhou like interface(th_dnh.exe), it crashes as soon as I select anything besides Directory and Quit...one of those famous Windows "This program has encountered an error and needs to close" things. I dunno what I'm doing wrong. I can't read anything in config or the other exe (thC_ptf.exe) because it's all in ?? instead of Japanese -.-" Help...I wanna play this before I have to give it back when school starts up again.
« Last Edit: December 24, 2009, 03:24:30 PM by Snowpaw »

KomeijiKoishi

Re: Danamkufu Error Message Troubleshooting
« Reply #22 on: December 24, 2009, 03:48:22 PM »
I have a problem specifically with Concealed the Conclusion...It SHOULD work right out of the box. You have to pay for it after all, right? (this is my friend's copy I'm borrowing, so I don't know)

My issue is that if I click the only exe that gives me a touhou like interface(th_dnh.exe), it crashes as soon as I select anything besides Directory and Quit...one of those famous Windows "This program has encountered an error and needs to close" things. I dunno what I'm doing wrong. I can't read anything in config or the other exe (thC_ptf.exe) because it's all in ?? instead of Japanese -.-" Help...I wanna play this before I have to give it back when school starts up again.

Get AppLocale and open the .exe file with it.

Re: Danamkufu Error Message Troubleshooting
« Reply #23 on: December 27, 2009, 04:00:28 AM »
I swear to God if this is telling me I'm missing a semi-colon




EDIT: Of course it is.

Post fucking Script: The issue wasn't the G.D. semi-colon.
« Last Edit: December 27, 2009, 04:15:20 AM by Naut »

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danamkufu Error Message Troubleshooting
« Reply #24 on: December 27, 2009, 11:22:17 AM »
Just so you guys know, pressing Ctrl+C on an message box like Danmakufu's scripting error messages actually copies the whole message. This is how I made the first post with Japanese in it (I don't have Japanese input after all). So if from now on you can paste the messages in instead of posting a screenshot, I can actually update the first post with the Japanese and the translations.

Also, what WAS the cause for that error message, Naut? Looks like it was telling you that you're missing semicolons but that wasn't the case?
« Last Edit: December 27, 2009, 11:23:49 AM by Blargel »
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Re: Danamkufu Error Message Troubleshooting
« Reply #25 on: December 27, 2009, 08:52:22 PM »
---------------------------
ScriptError「C:\Users\Owner\Desktop\Danmakufu\script\Creative exchange\chenspell.txt」
---------------------------
script_eventは未定義の識別子です(3行目)

   script_event name{



  let reimu = GetCurrentScriptDirectory ~ "img\cutins\reimu.png";

  let chen = GetCurrentScriptDirecto
~~~
---------------------------
OK   
---------------------------


I've never used event scripts before halp ;_;


Edit: fixed but now I get

---------------------------
ScriptError「C:\Users\Owner\Desktop\Danmakufu\script\Creative exchange\chenspell.txt」
---------------------------
"}"が必要です(15行目)

 SetChar(RIGHT, chen2);                      //Set the boss' picture on the right side of the screen.

 SetGraphicRect(RIGHT, 0, 0
~~~
---------------------------
OK   
---------------------------
« Last Edit: December 27, 2009, 08:56:46 PM by Kinoko Nasuma »

Re: Danamkufu Error Message Troubleshooting
« Reply #26 on: December 27, 2009, 09:08:09 PM »
The line right before it is missing a semi-colon, most likely. It says you're missing a bracket though.


So if from now on you can paste the messages in instead of posting a screenshot, I can actually update the first post with the Japanese and the translations.

Alrighty.

Also, what WAS the cause for that error message, Naut? Looks like it was telling you that you're missing semicolons but that wasn't the case?

Oh this is good.

Broken version:

Code: [Select]
script_enemy_main {

    let cut = "script\img\face\face.png"; // fill me

    #include_function "script\script_library\function_cutin.txt"
    #include_function "script\script_library\function_aura.txt"
    #include_function "script\script_library\library01.txt"

    @Initialize {
SetLife(350);
SetDamageRate(1,1);
SetTimer(70);
//...

Fixed version:

Code: [Select]
script_enemy_main {

    let cut = "script\img\face\face.png"; // fill me

    #include_function "script\script_library\library01.txt"
    #include_function "script\script_library\function_cutin.txt"
    #include_function "script\script_library\function_aura.txt"

    @Initialize {
SetLife(350);
SetDamageRate(1,1);
SetTimer(70);
//...

I shit you not. Nothing else was changed. I don't even.

Drake

  • *
Re: Danamkufu Error Message Troubleshooting
« Reply #27 on: December 27, 2009, 09:11:23 PM »
oh god lol

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Re: Danamkufu Error Message Troubleshooting
« Reply #28 on: December 27, 2009, 09:12:53 PM »
welp

Nuclear Cheese

  • Relax and enjoy the danmaku.
    • My homepage
Re: Danamkufu Error Message Troubleshooting
« Reply #29 on: December 27, 2009, 10:31:10 PM »
Broken version:

<snip>

Fixed version:

<snip>

I shit you not. Nothing else was changed. I don't even.


If something in function_cutin.txt or function_aura.txt relies on something in library01.txt, I think you need to include the library first.

My understanding of the #include in Danmakufu is that it just straight-up copy/pastes the script from the second file into the first file where the #include is, so if one file has something another needs, putting them in the wrong order might leave it going "lol where's this I dunno lol" and exploding.

Of course, this is assuming I'm remembering my experiences with #include correctly ...
to quote Naut:
"I can see the background, there are too many safespots."
:V