Author Topic: Danmaku Pattern Ideas  (Read 37708 times)

Danmaku Pattern Ideas
« on: April 29, 2009, 03:22:15 AM »
So I've taken a look at a bunch of the functions and such of danmakufu, and it seems for the most part that if you can think of a pattern, then with a bit of math, hard work, and tenacity, you can make it.

So then the problem arises, what patterns should be made?

It reminds me of that 4koma involving ZUN smashing his beer bottles to get ideas for danmaku. But for those of us who aren't masters of the drunken programming art, well, it's going to take a bit of creativity.

So the purpose of this thread is for us as a community to pool our ideas for danmaku patterns. Not just to show off or to give other people ideas, but so that we can compare and improve and ultimately create patterns that are both good to look at and fun yet challenging to dodge.

shinyjam

  • Permabanned by TheStupidOne
  • I am a complete asshat!
Re: Danmaku Pattern Ideas
« Reply #1 on: April 29, 2009, 03:57:46 AM »
I believe we should create a character first, create a background story for her, then create Danmaku pattern based on her...or vice verse.

Drake

  • *
Re: Danmaku Pattern Ideas
« Reply #2 on: April 29, 2009, 03:58:54 AM »
Six points appear around the boss. Lasers join the points, making a 3D cube. The cube rotates, and the boss fires shots in uh insert pattern here. Shots hit the lasers and do something.

I've been wanting to make a boss based entirely on square patterns. I was supposed to do some today but ended up babysitting a friend's kid.

Or I could implement the square patterns into luckluck girl. That might work.

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

Re: Danmaku Pattern Ideas
« Reply #3 on: April 29, 2009, 04:07:58 AM »
I get inspiration in many ways, some of which are the following...

I usually think of "what would I like to dodge?" Then I try to create something similar, but not exactly replicate, that. Works most of the time.
As I'm scripting, I'll often try to loosely calculate math on absurd patterns. I'll just input whatever pops into my head, which can sometimes yield interesting results.
Occasionally I make a massive string of SetShotDataA's and mess with angular velocity. I don't even bother calculating when to properly change angles with respect to a frame count, just input anything.
Other times I see somebody else's pattern and think "this would look cool if..." and then try and make that from scratch. I never succeed, but something good usually comes out of it.
Failing all that, I just wait until random inspiration hits. Rare is the occasion I actually replicate what I first thought of with 100% accuracy, anyway.


Personally, I like what Nuclear Cheese did in his Celia Stage script: messing with SetAlpha to create transparent and sometimes invisible danmaku. I think that has quite a bit of untapped power.

Drake's idea sounds neat, but man I wouldn't want to try and code it...

I dunno... What else. It's hard to think of things like this on the spot...

MCXD

  • Test
  • Light Sign "Heaven Engine"
Re: Danmaku Pattern Ideas
« Reply #4 on: April 29, 2009, 07:22:19 AM »
This would be the exact reason why I stopped my previous Danmakufu project(s).

As such, I have nothing to contribute, I'd just like to say that I have extremely chronic originality problems.

Re: Danmaku Pattern Ideas
« Reply #5 on: April 29, 2009, 01:16:33 PM »
My suggestion is think of a theme, and try and create patterns based on that.

A weird one I thought of this week was one based on microbiology. The boss shoots out large bullets. These large bullets split into medium bullets, and those split into small bullets.

Stuffman

  • *
  • We're having a ball!
Re: Danmaku Pattern Ideas
« Reply #6 on: April 29, 2009, 11:30:48 PM »
Yeah Colossal has it the way I do it. The catch is you have to be careful to not get too gimmicky in representing the theme.

Drake

  • *
Re: Danmaku Pattern Ideas
« Reply #7 on: April 30, 2009, 06:17:56 AM »
wtf why are square patterns so difficult to make

I'm overcomplicating it but it should work either way ffff

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

KomeijiKoishi

Re: Danmaku Pattern Ideas
« Reply #8 on: April 30, 2009, 03:31:23 PM »
http://www.youtube.com/watch?v=Jf6k_AHYa50&fmt=18

Did somebody ask for square patterns?
7:00 is the part you should look at.

Re: Danmaku Pattern Ideas
« Reply #9 on: April 30, 2009, 06:43:08 PM »
I wonder how rediculous it would be to have Scarlet Meister firing Utsuho's Suns and Unzan's fists...

Also maybe this thread will get more publicity and ideas if it were in the general discussion board...
« Last Edit: April 30, 2009, 07:21:46 PM by Suikama »

Re: Danmaku Pattern Ideas
« Reply #10 on: April 30, 2009, 11:54:46 PM »
Also maybe this thread will get more publicity and ideas if it were in the general discussion board...

We could ask the other members of MotK for ideas on what they would like to play. Would the thread go in "Help Me, Eirin!" or "Akyu's Arcade"? Danmakufu is directly based on touhou (the characters are Reimu, Marisa and Rumia, blah blah), but it's not really a touhou game, so I wouldn't know where to start a thread.

shinyjam

  • Permabanned by TheStupidOne
  • I am a complete asshat!
Re: Danmaku Pattern Ideas
« Reply #11 on: May 01, 2009, 04:31:49 AM »
Maybe ASCII Art?
          ____
        /      \
       / ─    ─ \
     /  (●)  (●)  \  
     |    (__人__)     |
      \    ` ⌒?    /ヽ
      (ヽ、      / ̄)  |
       | ``ー――‐''|  ヽ、.|
       ゝ ノ      ヽ  ノ |

        ____
        /     \     
     /   ⌒  ⌒ \
   /   ( ●)  (●) \
    |   、" ゙)(__人__)" .)|    ___________
   \      。` ||||==(⌒)ー、| |             |
__/         ||||    \  〉| |              |
| | /    ,  | ̄ ̄ ̄ ̄ ̄| ̄ ̄ .| |              |
| | /   /   ヽ回回回回レ    | |                 |
| | | ⌒ ーnnn.ヽ___/     |_|___________|
 ̄ \__、("二) └─┘ ̄l二二l二二  _|_|__|_

Drake

  • *
Re: Danmaku Pattern Ideas
« Reply #12 on: May 01, 2009, 04:33:10 AM »
Don't bother. I tried a while ago, and it's fucking tedious for what you get out of it. You pretty much have to position every little bullet by hand, indicate a direction and hope to god it doesn't screw up.

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

shinyjam

  • Permabanned by TheStupidOne
  • I am a complete asshat!
Re: Danmaku Pattern Ideas
« Reply #13 on: May 01, 2009, 04:36:06 AM »
Lol that's why I prefer making it in flash...but for the programming pro, a pac-man eating around would be awesome ;D

Drake

  • *
Re: Danmaku Pattern Ideas
« Reply #14 on: May 01, 2009, 07:02:08 AM »
I made Red Light, Green Light. I'll up it in the morning.

OH WAIT I STAYED UP UNTIL 2 IN THE MORNING WORKING ON IT DERPDERPDERP

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

Drake

  • *
Re: Danmaku Pattern Ideas
« Reply #15 on: May 01, 2009, 02:00:05 PM »
Code: [Select]
#TouhouDanmakufu
#Title[Red Light, Green Light]
#Text[game]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {

let frame = -100;

let wall;
let speed = 15;
let firing = true;
let rando;
let current = GetCurrentScriptDirectory();

    @Initialize {
        SetLife(10000);
        SetTimer(40);
        SetMovePosition02(GetCenterX, GetClipMinY + 40, 50);
        SetDamageRate(0,0);
        ForbidBomb(true);
        ForbidShot(true);
        Expert;
        wall = GetPlayerY - 30;
        rando = rand(175,250);
    }

    @MainLoop {

        if (GetPlayerY() < wall){SetPlayerY(wall+1);}

        if (OnPlayerMissed() == true){wall+=0.8;}

        CreateShot01(GetClipMinX, 150, 0, 0, YELLOW05, 3);
        CreateShot01(GetClipMaxX, 150, 0, 0, YELLOW05, 3);

        if (firing == true){
            wall -=0.1;

            if (frame%speed == 0){
                line(rand(GetClipMinX+10, GetClipMaxX-10), 90+rand(-8,8));
            }

        }

        if (frame > rando){
            speed-=1;
            firing = false;
            redlight;
            rando = rand(175,250);
            frame = 0;
            }

        if(GetTimer==1){
            if(GetPlayerY < 150){
                SetLife(0);
            }else{
                ExtendPlayer(-4);
                ShootDownPlayer;
            }
        }

        frame++;
        yield;
}
///////
task line(x,r){   

ascent(i in 1..12){ 
       CreateShot01(x, GetClipMinY+(i*8)-20, 4, r, GREEN01, i);
}

}
///////
task redlight(){

ascent(i in -10..10){
       CreateShot01(GetPlayerX+(i*3), GetPlayerY-5, 0, 0, RED01, (speed*1.5)+10);
}
loop(60){yield;}
            firing = true;
}
///////
}

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

Tenbatsu! Myon Rabbie

  • I cannot and will not learn.
  • Letty is sick of my shit.
Re: Danmaku Pattern Ideas
« Reply #16 on: May 01, 2009, 02:07:21 PM »
Why do you die at the end of that script? ;__;
Nice spell tho

Re: Danmaku Pattern Ideas
« Reply #17 on: May 01, 2009, 02:36:32 PM »
If you're not above the yellow dots on the sides of the screen by the end of the game, you die a horrible, infuriatingly annoying death.

Re: Danmaku Pattern Ideas
« Reply #18 on: May 01, 2009, 02:48:07 PM »
Code: [Select]
#TouhouDanmakufu
#Title[EX Danmaku Paranoia]
#Text[This card requires streaming like none other]
#Image[script\BROFIST\Th06sc50.jpg]
#BackGround[User(script\BROFIST\SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.png, 0, 50)]
#BGM[.\Unzan lol.mp3]
#PlayLevel[ULTRA RAPE]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
    let frame = 0;
    @Initialize {
SetLife(1);
        SetTimer(100);
        SetEffectForZeroLife(0, 0, 0);
    }

    @MainLoop {     
        if(frame==20){
    loop(1){
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer, RED02, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-5, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+5, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+90, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-90, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+95, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-95, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+10, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+20, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+30, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+40, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+50, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+60, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+70, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+80, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-10, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-20, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-30, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-40, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-50, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-60, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-70, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-80, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+15, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+25, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+35, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+45, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+55, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+65, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+75, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer+85, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-15, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-25, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-35, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-45, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-55, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-65, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-75, RED03, 0);
                CreateShot01(GetX, GetY, 1, GetAngleToPlayer-85, RED03, 0);
            }
    frame = 0;
}
        frame++;
    }

    @DrawLoop {
    }

    @Finalize {
    }

    @BackGround {
    }
}

Drake

  • *
Re: Danmaku Pattern Ideas
« Reply #19 on: May 01, 2009, 02:51:04 PM »
If you're not above the yellow dots on the sides of the screen by the end of the game, you die a horrible, infuriatingly annoying death.
Pretty much. You go up as the timer runs. If you get hit, the wall goes back down like the game. If you're not up by 1 second, loldeath.

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

Drake

  • *
Re: Danmaku Pattern Ideas
« Reply #20 on: May 01, 2009, 11:22:21 PM »
Code: [Select]
#TouhouDanmakufu
#Title[EX Danmaku Paranoia]
#Text[This card requires streaming like none other]
#Image[.\Th06sc50.jpg]
#BackGround[User(.\SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.png, 0, 50)]
#BGM[.\Unzan lol.mp3]
#PlayLevel[ULTRA RAPE]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {

    let frame = 0;

    @Initialize {
        SetLife(1);
        SetTimer(100);
        SetDurableSpellCard();
    }

    @MainLoop {     
        if(frame%20==0){
               CreateShot01(GetX, GetY, 1, GetAngleToPlayer, RED02, 0);
               ascent(i in -9..9){
                       CreateShot01(GetX, GetY, 1, GetAngleToPlayer+(i*10)+5, RED03, 0);
                       CreateShot01(GetX, GetY, 1, GetAngleToPlayer+(i*10)+10, RED03, 0);
               }
        }
        frame++;
    }
}
made your code not messy

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

Re: Danmaku Pattern Ideas
« Reply #21 on: May 01, 2009, 11:50:21 PM »
Code: [Select]
#TouhouDanmakufu
#Title[EX Danmaku Paranoia]
#Text[This card requires streaming like none other]
#Image[.\Th06sc50.jpg]
#BackGround[User(.\SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.png, 0, 50)]
#BGM[.\Unzan lol.mp3]
#PlayLevel[ULTRA RAPE]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {

    let frame = 0;

    @Initialize {
        SetLife(1);
        SetTimer(100);
        SetDurableSpellCard();
    }

    @MainLoop {     
        if(frame%20==0){
               CreateShot01(GetX, GetY, 1, GetAngleToPlayer, RED02, 0);
               ascent(i in -9..9){
                       CreateShot01(GetX, GetY, 1, GetAngleToPlayer+(i*10)+5, RED03, 0);
                       CreateShot01(GetX, GetY, 1, GetAngleToPlayer+(i*10)+10, RED03, 0);
               }
        }
        frame++;
    }
}
made your code not messy
Ah so that's how you do it. Thanks!

Re: Danmaku Pattern Ideas
« Reply #22 on: May 05, 2009, 02:31:12 AM »
Maybe ASCII Art?
          ____
        /      \
       / ─    ─ \
     /  (●)  (●)  \  
     |    (__人__)     |
      \    ` ⌒?    /ヽ
      (ヽ、      / ̄)  |
       | ``ー――‐''|  ヽ、.|
       ゝ ノ      ヽ  ノ |

        ____
        /     \     
     /   ⌒  ⌒ \
   /   ( ●)  (●) \
    |   、" ゙)(__人__)" .)|    ___________
   \      。` ||||==(⌒)ー、| |             |
__/         ||||    \  〉| |              |
| | /    ,  | ̄ ̄ ̄ ̄ ̄| ̄ ̄ .| |              |
| | /   /   ヽ回回回回レ    | |                 |
| | | ⌒ ーnnn.ヽ___/     |_|___________|
 ̄ \__、("二) └─┘ ̄l二二l二二  _|_|__|_

Take a look at this:

http://www.youtube.com/watch?v=Z1xt1Mstpig

Somebody has WAY too much time on their hands.

Drake

  • *
Re: Danmaku Pattern Ideas
« Reply #23 on: May 05, 2009, 02:40:31 AM »
HOLY SHIIIIIIIT

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

Infy♫

  • Demonic★Moe
  • *
Re: Danmaku Pattern Ideas
« Reply #24 on: May 05, 2009, 10:46:40 AM »
i wonder if you guys have any ideas on how to even figure a concept for a survival spellcard that isn't directly based on those of touhou... when i try to figure something it always turns out to have stuff from an EX boss that exists already...

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmaku Pattern Ideas
« Reply #25 on: May 05, 2009, 12:58:54 PM »
I was working on this, actually. Did some more or less interesting concepts, but I am unable to work on them right now due to RL business. I'll continue on it some time later, though.

As of now, the better one would be this:
Code: [Select]
#TouhouDanmakufu
#Title[Stuff 36 - claws]
#Text[moep]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
    let BossImage = "script\img\ExRumia.png";
    let BossCutIn = "script\img\ExRumia.png";
    let frame=-120; //the attack timer
    let move=-60; // the move timer
    let color = [WHITE31, WHITE31, AQUA31, GREEN31, ORANGE31];
    let flyangle=0;
    let hard=0;


    @Initialize {
        LoadGraphic(BossImage);
        SetLife(3000);
        SetDamageRate(60, 0);
        SetTimer(60);
        SetInvincibility(120);
        CutIn(YOUMU, "stuff "\""stuff"\", BossCutIn, 0, 0, 200, 600);
        SetScore(500000);
        SetEnemyMarker(true);
        SetMovePosition02(GetCenterX,GetCenterY,60);
        Concentration01(60);


    }

    @MainLoop {
        yield;

        if(frame==150){
            TMangle(GetPlayerX, GetPlayerY, rand(0, 360), 10, 15);
            if(hard<90){hard+=5;}
            frame=hard;
        }

        if(move==300){
            SetMovePositionRandom01(64, 32, 2.5, 64, 32, 360, 192);
            move=0;
        }

        frame++;
 
    }

    @DrawLoop {
SetRenderState(ALPHA);
        if(frame<0&&frame>-60){ SetAlpha(-4*frame); }
if(GetSpeedX()==0){ SetGraphicRect(64,1,127,64); }
else if(GetSpeedX()>0){ SetGraphicRect(192,1,255,64); }
else if(GetSpeedX()<0){ SetGraphicRect(128,1,191,64); }
        SetTexture(BossCutIn);
        DrawGraphic(GetX, GetY);
       
    }

    @Finalize {
    }
    task TMangle(x, y, ang, n, delay) {

//three parallel slashes with a delay, spouting a fountain of n*2 blood drops.

        let count=0;
        TClaw(x+10*cos(ang+90), y+10*sin(ang+90), ang, 90, delay);
        TClaw(x, y, ang, 90, delay);
        TClaw(x+10*cos(ang-90), y+10*sin(ang-90), ang, 90, delay);

        loop(30+delay){yield;}

        loop(n){
           CreateShot12(x, y, rand(-2, 2), rand(-1, -3), 0, 0.03, 2, 3, RED01, 10);
           CreateShot12(x, y, rand(-2, 2), rand(-1, -3), 0, 0.03, 2, 2, RED01, 10);
        }
    }

    task TClaw(px, py, ang, dis, delay) {

//creates a slash that cuts through the center of a circle with a radius of "dis" around (px py) at an angle of "ang"

       let obj=Obj_Create(OBJ_LASER);
       let timer=30+delay;

       Obj_SetPosition(obj, px+dis*cos(ang), py+dis*sin(ang));
       ObjLaser_SetLength(obj, 1);
       ObjLaser_SetWidth(obj, 6);
       Obj_SetAngle(obj, ang);
       Obj_SetSpeed(obj, 0);
       ObjShot_SetGraphic(obj, RED11);

       while(Obj_BeDeleted(obj)==false){
          timer-=1;
          yield;

          if(timer<31&&timer>-30){
              Obj_SetPosition(obj, Obj_GetX(obj)-cos(ang)*dis/30, Obj_GetY(obj)-sin(ang)*dis/30); //moves the slash
              ObjLaser_SetLength(obj, ObjLaser_GetLength(obj)+dis/30); //lengthens the slash
              }
          if(timer<-29){
              ObjLaser_SetLength(obj, ObjLaser_GetLength(obj)-dis/30); //shortens the slash
          }
          if(timer==-90){
              Obj_Delete(obj);
          }
       }
    }
}

Note: I have not read up how to use sounds in danmakufu and wanted to keep my scripts text based without need for additional pictures and stuff until they have gained a certain level of quality, so you don't need anything but the text.
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: Danmaku Pattern Ideas
« Reply #26 on: May 05, 2009, 02:48:48 PM »
Take a look at this:

http://www.youtube.com/watch?v=Z1xt1Mstpig

Somebody has WAY too much time on their hands.
what

WHAT

HOLY SHIT ಥ_ಥ

KomeijiKoishi

Re: Danmaku Pattern Ideas
« Reply #27 on: May 05, 2009, 04:27:00 PM »
what

WHAT

HOLY SHIT ಥ_ಥ

I love it. The music AND the danmaku.
If somebody asks...
The anime?s called "Sayonara Zetsubou Sensei".

Re: Danmaku Pattern Ideas
« Reply #28 on: May 05, 2009, 04:31:59 PM »
Iryan, my th_dnh.exe keeps randomly crashing during your script. However, it looks pretty badass, for what it's worth.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmaku Pattern Ideas
« Reply #29 on: May 05, 2009, 05:09:23 PM »
Now that you mention it, I got them too...

Mh, I think it happens when the lasers spawn outside the filed an thus don't cease to exist. Then, the task proceeds to tell danmakufu to do someting with an object that doesn't exist anymore.

That should be fixable by inserting if(Obj_BeDeleted(obj)==false) around the tags.
Then again, that would mean that by staying close to the border of the playing field, you can make some of the claws nonexistent...

Then I have to insert a command to do run the task for a random direction again in an else bracket.
Let's see...


Edit: I've done adjustments to prevent the script from crashing. Of course, they'll only help if the reason for the crashs is the one I believe it to be. I didn't test it because I have to restart the PC with japanese setting to get danmakufu to run, so I may have brought in a new error by mistyping something. I'll maybe test in sometimes later...

Code: [Select]
#TouhouDanmakufu
#Title[Stuff 36 - claws]
#Text[moep]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
    let BossImage = "script\img\ExRumia.png";
    let BossCutIn = "script\img\ExRumia.png";
    let frame=-120; //the attack timer
    let move=-60; // the move timer
    let flyangle=0;
    let hard=0;


    @Initialize {
        LoadGraphic(BossImage);
        SetLife(3000);
        SetDamageRate(60, 0);
        SetTimer(60);
        SetInvincibility(120);
        CutIn(YOUMU, "stuff "\""stuff"\", BossCutIn, 0, 0, 200, 600);
        SetScore(500000);
        SetEnemyMarker(true);
        SetMovePosition02(GetCenterX,GetCenterY,60);
        Concentration01(60);


    }

    @MainLoop {
        yield;

        if(frame==150){
            TMangle(GetPlayerX, GetPlayerY, rand(0, 360), 10, 15);
            if(hard<90){hard+=5;}
            frame=hard;
        }

        if(move==300){
            SetMovePositionRandom01(64, 32, 2.5, 64, 32, 360, 192);
            move=0;
        }

        frame++;
 
    }

    @DrawLoop {
SetRenderState(ALPHA);
        if(frame<0&&frame>-60){ SetAlpha(-4*frame); }
if(GetSpeedX()==0){ SetGraphicRect(64,1,127,64); }
else if(GetSpeedX()>0){ SetGraphicRect(192,1,255,64); }
else if(GetSpeedX()<0){ SetGraphicRect(128,1,191,64); }
        SetTexture(BossCutIn);
        DrawGraphic(GetX, GetY);
       
    }

    @Finalize {
    }
    task TMangle(x, y, ang, n, delay) {

//three parallel slashes with a delay, spouting a fountain of n*2 blood drops.

   //here is an if clause to prevent the game from crashing for spawning objects outside of the existing field

    if(((x+100*cos(ang))>0) && ((x+100*cos(ang))<448) && ((y+100*sin(ang))>0) && ((y+100*sin(ang))<480))){

        let count=0;
        TClaw(x+10*cos(ang+90), y+10*sin(ang+90), ang, 90, delay);
        TClaw(x, y, ang, 90, delay);
        TClaw(x+10*cos(ang-90), y+10*sin(ang-90), ang, 90, delay);

        loop(30+delay){yield;}

        loop(n){
           CreateShot12(x, y, rand(-2, 2), rand(-1, -3), 0, 0.03, 2, 3, RED01, 10);
           CreateShot12(x, y, rand(-2, 2), rand(-1, -3), 0, 0.03, 2, 2, RED01, 10);
        }

    } else{ TMangle(x, y, ang+rand(90, 270), n, delay);}
    yield;
    }

    task TClaw(px, py, ang, dis, delay) {

//creates a slash that cuts through the center of a circle with a radius of "dis" around (px py) at an angle of "ang"

       let obj=Obj_Create(OBJ_LASER);
       let timer=30+delay;

       Obj_SetPosition(obj, px+dis*cos(ang), py+dis*sin(ang));
       ObjLaser_SetLength(obj, 1);
       ObjLaser_SetWidth(obj, 6);
       Obj_SetAngle(obj, ang);
       Obj_SetSpeed(obj, 0);
       ObjShot_SetGraphic(obj, RED11);

       while(Obj_BeDeleted(obj)==false){
          timer-=1;
          yield;

          if(timer<31&&timer>-30){
              Obj_SetPosition(obj, Obj_GetX(obj)-cos(ang)*dis/30, Obj_GetY(obj)-sin(ang)*dis/30); //moves the slash
              ObjLaser_SetLength(obj, ObjLaser_GetLength(obj)+dis/30); //lengthens the slash
              }
          if(timer<-29){
              ObjLaser_SetLength(obj, ObjLaser_GetLength(obj)-dis/30); //shortens the slash
          }
          if(timer==-90){
              Obj_Delete(obj);
          }
       }
    }
}
« Last Edit: May 05, 2009, 06:49:58 PM by Iryan »
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."