Author Topic: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)  (Read 140426 times)

J.O.B

  • YOU CAN'T MAKE ME CHANGE
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #210 on: June 08, 2011, 10:53:05 AM »
you better fix that :V
Danmakufu actually raised an error and then I put that in and the error went to the one I posted before.

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #211 on: June 08, 2011, 10:58:10 AM »
the error message danmakufu's giving you is because it's not recognizing any task named "Bullet1" which happens when you accidentally close the text file before it encounters the declaration (aka you have an extra closing bracket / '}')

also, I just noticed now, you declared your object bullet in the task as '1', you can't use numbers as the start of your variables' names... you can use obj1, obj_2 or whatever, but don't start with numbers like 1obj or 2_obj... and don't make it only a number...
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

J.O.B

  • YOU CAN'T MAKE ME CHANGE
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #212 on: June 08, 2011, 11:06:38 AM »
Yay it's finally working now:D
Thanks for the help.
And btw, I did have my Bullet1 variable as object originally but I changed it since I thought it might make a difference.

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #213 on: June 08, 2011, 06:50:16 PM »
Quick CompSci question after reading through the 'Useful Misc. Code' thread. When, if ever, is it necessary to declare variables in the declaration of the function or task. Along with that, what, if any, difference does it make? I've found that variables showing up in the function declaration line work fine even if never explicitly declared at a higher level or within the function before being used.

In short, what is the difference between:

function derp (let herp, let dedurp) {
do stuff;
}

function derp (herp, dedurp) {
do stuff;
}

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #214 on: June 08, 2011, 06:56:54 PM »
Style difference. I don't think it changes anything. In most languages, you need to specify the type of variable (int counter = 0, string name = "Reimu", etc), even in function declarations. In Danmakufu, it assigns types automatically, and all you need is "let" - so the designers let you use standard programming syntax for functions by allowing you to declare the "type" of a variable in the declaration. But since it's always the same, they also let you skip it if you want.

TAKE IT CACODEMON!!

  • OKAY THEN I'M A LEGAL AIDE
  • AND ERIN BROCKOVICH IS MY NAAAME
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #215 on: June 08, 2011, 08:17:19 PM »
If the language is set then the error message won't display in garbage text. Please screencap or copy it, we aren't magic.

Wording that better: It still crashes instantaneously when I launch it via AppLocale. The error message is just the usual "program has stopped working" (thanks Windows vagueness!)
Sonata of Scarlet Sunflowers, a Flandre x Yuuka story. | Laziness of Daemonic Wastrels, wherein The Dude, Frylock, HW Guy, and David Wong get their asses kicked in Gensokyo.  | T.O.U.H.O.U.: Land of Shadows, a S.T.A.L.K.E.R./Touhou crossover. | Abomination, a monster story.

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #216 on: June 08, 2011, 08:32:38 PM »
I got another question...
When i create a bullet pattern that circles like laserB, what would the shot be named? I cant tell by the vagueness of the touhou wiki's descriptions of the shots.  :derp:
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #217 on: June 08, 2011, 10:38:55 PM »
I assume you're looking for something like CreateLaserB that let's you control a bullet based on the position of the boss except as a bullet instead of a laser? If so, there's no such thing. You'll have to use ObjShots and trigonometry. If you're confident in your Danmakufu abilities, go take a look at the shot object tutorial. If you understand how to use shot objects and get good with trigonometry, you pretty much have Danmakufu bullet pattern creation mastered.
<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.

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #218 on: June 08, 2011, 11:46:40 PM »
Ok! i got a basic pattern to work for obj bullets...but i cant get them to go in a circular pattern (like shotA).

http://pastebin.com/EqUmtSJu

Did i put the superbullet name in wrong? Or did i just misplace something?
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Drake

  • *

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

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #220 on: June 09, 2011, 12:16:41 AM »
Ok im gonna fix that! In the meantime, yet another one of my things is wrong. Its telling me the wait function is wrong, but i have it defined...

http://pastebin.com/TNPEGYTe
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #221 on: June 09, 2011, 12:23:06 AM »
It isn't your yield that's wrong, it's that your brackets aren't matched up. When you open your loop(8) you're using a ( instead of { .

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

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #222 on: June 09, 2011, 12:28:20 AM »
Ok im gonna fix that! In the meantime, yet another one of my things is wrong. Its telling me the wait function is wrong, but i have it defined...

http://pastebin.com/TNPEGYTe

Line 99:
loop(8){CreateLaser01(Obj_GetX(obj),Obj_GetY(obj),2,dir,100,10,RED04,0); dir+=360/8;}

It can't find the wait function because it think it's being defined in a weird place because of that missing bracket.
<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.

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #223 on: June 09, 2011, 12:29:17 AM »
0_0' oh...umm...i knew that!
...yeah, as you can see, i dont have a good eye....kinda watching the video you posted, and trying to follow along.
Thanks! ...But its been bugging me for the longest time that when i usually get an error, it goes back up to the wait function...kinda strange. :/ Oh well. Thanks again!

(Dont be suprised if you see me more often. xD)
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #224 on: June 09, 2011, 12:35:51 AM »
Computers are notorious for being bad at figuring out your intentions. They do exactly what you tell them to do and that's it. When it doesn't understand what you're trying to do, it tries its best to tell you why it can't understand you, but quite often, especially with syntax errors, it'll fail to point you to the real problem. Syntax errors are best solved through good habits so that they don't even appear. Syntax highlighters are also helpful. I suggest that you download Notepad++ which will highlight your opening and closing brackets more clearly even without a custom syntax highlighter. Of course, you can also try installing the Danmakufu syntax highlighter for Notepad++ which might help you identify errors more easily.
<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.

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #225 on: June 09, 2011, 01:25:17 AM »
Thanks for the thing Blargel! One last thing before i go on to experimenting with obj.shots.

http://pastebin.com/CvHW1rjT

THIS error is funny cause its all japanese except for a bracket...
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #226 on: June 09, 2011, 01:47:25 AM »
http://www.shrinemaiden.org/forum/index.php/topic,4155.0.html

You don't read stickies, don't you?

You're a bad, bad boy.

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #227 on: June 09, 2011, 01:49:48 AM »
dir+=180/8

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

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #228 on: June 09, 2011, 03:49:52 PM »
Ok so im getting use to using obj.shots and such. My latest one includes the bouncing of MANY bullets and such. I thank DoubleVla from youtube, and Drake for showing me! (How many times can i thank you guys in one week?)

So recently, my newest try is being....strange. Its an arc shot where the bullets follow you after like...a second. There being strange and not even shooting, They just spawn and move a centimeter! Why is that?

http://pastebin.com/fAqgMEi6
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #229 on: June 09, 2011, 03:57:09 PM »
Quote
while(!Obj_BeDeleted(obj)){
 
                        Obj_SetSpeed(obj,0);
                        wait(30);
                        Obj_SetAngle(obj,atan2(GetPlayerY - Obj_GetY(obj), GetPlayerX - Obj_GetX(obj)));
                        ObjShot_SetGraphic(obj,RED04);
                        Obj_SetSpeed(obj,4);                   
       
                        yield;
                }
there's your problem... every time the loop runs, you're setting its speed to 0, then telling it to wait for 30 frames... after that you set the speed to 4, but remember that it's a while loop so after that last yield, it goes back to the start of the loop and resets the speed of the bullet to 0... basically you're getting a teeny-tiny movement every 31 frames :V
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #230 on: June 09, 2011, 04:14:54 PM »
OMG YOU SEE? IM BAD AT THIS! lol thanks! your awesome! Im not good at spoting errors......mainly cause i have eye problems so...thanks again!  :V :V :V
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

Serina

  • Evening Star
  • I like Danmakufu
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #231 on: June 09, 2011, 05:03:23 PM »
I don't know if I can ask this here, it's a pretty weird question: I can't handle tasks very well, but MainLoop scripting works great for me. Is there anything that only tasks can do? Things that you can't do using the MainLoop? Thanks!

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #232 on: June 09, 2011, 05:13:15 PM »
Everything is possible using either method. Some things become much easier using one or the other, but nothing is impossible. For example, something tasks are commonly used for is to make object shots with custom movement patterns - this can be done in MainLoop scripting by having an array that holds the object IDs, and ascenting through it each frame to apply the movement (with another array or two if the shots have other variables).

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #233 on: June 09, 2011, 05:51:45 PM »
I'm trying to make the final spellcard for an extra boss, and i got stuck with this:

Code: [Select]
     task SpellPhases{
     loop{
     if(GetEnemyLife==750){
     Phase2=true;}
     if(GetEnemyLife==500){
     Phase3=true;}
     if(GetEnemyLife==250 || GetTimer==30){
     Phase4=true;}
     yield;
     }
     }
The GetTimer part works for changing phase, but the GetEnemyLife parts does nothing.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #234 on: June 09, 2011, 05:57:15 PM »
I don't know if I can ask this here, it's a pretty weird question: I can't handle tasks very well, but MainLoop scripting works great for me. Is there anything that only tasks can do? Things that you can't do using the MainLoop? Thanks!
Learn to use tasks too and broaden your knowledge.  ;)
It's good to know both methods, but Azure is right, either method works for anything, though it is my opinion that more things are easier with tasks than with MainLoop.

I'm trying to make the final spellcard for an extra boss, and i got stuck with this:

Code: [Select]
     task SpellPhases{
     loop{
     if(GetEnemyLife==750){
     Phase2=true;}
     if(GetEnemyLife==500){
     Phase3=true;}
     if(GetEnemyLife==250 || GetTimer==30){
     Phase4=true;}
     yield;
     }
     }
The GetTimer part works for changing phase, but the GetEnemyLife parts does nothing.

The life may not be exactly 250, 500, or 750 because the player doesn't necessarily deal 1 damage per frame. I would code it like this:
Code: [Select]
task SpellPhases {
    while(GetEnemyLife>750 && GetTimer>30){ yield; }
    phase2=true;
    while(GetEnemyLife>500 && GetTimer>30){ yield; }
    phase3=true;
    while(GetEnemyLife>250 && GetTimer>30){ yield;}
    phase4=true;
}
}
<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: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #235 on: June 09, 2011, 05:59:39 PM »
I'm trying to make the final spellcard for an extra boss, and i got stuck with this:

Code: [Select]
     task SpellPhases{
     loop{
     if(GetEnemyLife==750){
     Phase2=true;}
     if(GetEnemyLife==500){
     Phase3=true;}
     if(GetEnemyLife==250 || GetTimer==30){
     Phase4=true;}
     yield;
     }
     }
The GetTimer part works for changing phase, but the GetEnemyLife parts does nothing.


Alternate solution:
Y'see, this line of code only calls if the boss's life is EXACTLY 250, 500, or 750. Otherwise it doesn't work at all.
To counter this just replace == with <= which means less than or equal to (the boss's life goes below 750, etc).

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #236 on: June 09, 2011, 06:23:49 PM »
That won't work. If the HP drops under 500 it will trigger Phase 2 and Phase 3 both. You need to add dual statements.

Code: [Select]
If  > 500 && <= 750 { phase }
if > 250 && <= 500 { phase2 }

etc

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #237 on: June 09, 2011, 06:29:02 PM »
It might be he only has while loops in other tasks. This one might only check for the life so the attack tasks can stop waiting and start spawning bullets.

Is that the case?

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #238 on: June 09, 2011, 06:33:03 PM »
It might be he only has while loops in other tasks. This one might only check for the life so the attack tasks can stop waiting and start spawning bullets.

Is that the case?
Hardly doubt it. Look at the code. It has a loop { } in there, it seems to loop forever as a checker. Thus, he needs dual statements

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #239 on: June 09, 2011, 06:36:42 PM »
I followed Blargels example and it worked just fine. But thanks a lot for all the helpful replies ;)!