~Hakurei Shrine~ > Rika and Nitori's Garage Experiments
My script is ugly and made of fail
(1/3) > >>
Suikama:

--- Code: ---
script_enemy_main {
    let frame = 0;
    let BossImage = "script\img\ExRumia.png";
    let BossCutIn = "script\img\ExRumia.png";
    @Initialize {
        LoadGraphic(BossImage);
        SetLife(2000);
        SetDamageRate(100, 0);
        SetTimer(30);
        SetInvincibility(30);
        CutIn(KOUMA, "Spellcard Name", BossCutIn, 0, 0, 200, 600);
        SetScore(9001);
        SetEnemyMarker(true);
        SetDurableSpellCard;
        Concentration01(60);
        Concentration02(60);
        MagicCircle(false);
        SetEffectForZeroLife(0, 0, 0);
    }

    @MainLoop {
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 24);
        if(frame==60){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer, RED03, 20);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==68){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer, RED03, 17);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==75){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer, RED03, 15);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==83){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer, RED03, 12);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==90){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer, RED03, 9);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==97){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer, RED03, 7);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==101){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 20, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==103){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 40, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==105){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 60, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==107){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 80, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==109){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 100, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==111){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 120, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==113){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 140, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==115){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 160, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==117){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 180, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==119){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 200, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==121){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 220, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==123){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 240, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==125){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 260, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==127){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 280, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==129){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 300, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==131){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 320, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");
}
        if(frame==133){
            CreateShot01(GetX, GetY, 10, GetAngleToPlayer + 340, RED03, 10);
            PlaySE("script\BROFIST\se_tan00.wav");

            frame = -120;
        }
        frame++;
    }

    @DrawLoop {
        SetTexture(BossImage);
        DrawGraphic(GetX, GetY);
    }

    @Finalize {
    }
}

    @BackGround {
    }
}

--- End code ---
Trying to make scarlet meister. A couple of issues:

1. Rumia doesn't appear. She just shoots from nowhere land. Keep in mind I have no idea how drawing works and jsu copypastaed this stuff lol.
2. There should be a way to work a loop into there so it's not so ugly but I'm not familair with these kinds of loops (I've only used Python before)
3. How to I make the rest of the card? :V
Garlyle:
1. You forgot the SetGraphicRect(minx,miny,maxx,maxy) line.  You use it by specifying the pixel range in which the image is drawn, based on the picture.  Co-ords are the same as in Danmakufu, so it's from the top left.  So if you wanted to draw the section of the image where the upper left pixel is (10,20) and the bottom right is (40, 30)...

    @DrawLoop {
        SetTexture(BossImage);
        SetGraphicRect(10,20,40,30);
        DrawGraphic(GetX, GetY);
    }

I forget what the co-ords are on the Rumia default image but you should be able to grab the DrawLoop from elsewhere.

You ALSO forgot a movement, so the character is being spawned at CenterX, 0, and is staying there.  Use something like the following:

MovePosition01(GetCenterX,100,10);

in your @Initialize to make the character move to (centerX, 100) at a speed of 10 frames per second.




2. Try to learn to use things like...

if (frame == 83 || frame == 90 || frame == 97){} (The "||" means 'OR')

ascent(i in 0..x){} (x is equal to the number of times you want to run the contents of this loop)
Since you're using i, you can also use it to cause things to work differently each time.  For instance:
ascent(i in 0..5){(GetX,GetY,10,GetAngleToPlayer+(20*i),RED03,10+(2*i))}
Will shoot 5 shots, in a total delay from 10-18, at a total angle range from GetAngleToPlayer, to GetAngleToPlayer+80

loop(x){yield;} (Think of this like a 'wait' command.  X is the number of times to loop the command)

Also look into Tasks.  They might help too.



3. What "rest of the card" are you looking at specifically?
Suikama:
I meant the rest of Scarlet Meister, but I figure it's a bit too hard for me now so I tried something else.

Before that though, how do you view replays with danmakufu?
Garlyle:
When you have a saved replay of a script, after selecting the script you want to play, in addition to the "[moonrunes]Play" option that you normally select, any and all available replay files will appear beneath that which you can select.
Naut:
I've remade Scarlet Meister, using a task, if you'd like to see how it works. I could make a non-task Scarlet Meister if you would rather have a look at that instead.
Navigation
Message Index
Next page

Go to full version