Author Topic: My script is ugly and made of fail  (Read 15638 times)

My script is ugly and made of fail
« on: May 01, 2009, 01:21:25 AM »
Code: [Select]

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 {
    }
}
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

  • I can't brain today
  • I have the dumb
    • Tormod Plays Games
Re: My script is ugly and made of fail
« Reply #1 on: May 01, 2009, 03:28:02 AM »
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?
« Last Edit: May 01, 2009, 03:30:03 AM by Garlyle »

Re: My script is ugly and made of fail
« Reply #2 on: May 01, 2009, 03:37:34 AM »
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

  • I can't brain today
  • I have the dumb
    • Tormod Plays Games
Re: My script is ugly and made of fail
« Reply #3 on: May 01, 2009, 03:40:24 AM »
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.

Re: My script is ugly and made of fail
« Reply #4 on: May 01, 2009, 04:19:49 AM »
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.

Re: My script is ugly and made of fail
« Reply #5 on: May 01, 2009, 05:06:38 AM »
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.
Alright thanks

Re: My script is ugly and made of fail
« Reply #6 on: May 01, 2009, 05:40:48 AM »
Happy to help tonight <3

Infy♫

  • Demonic★Moe
  • *
Re: My script is ugly and made of fail
« Reply #7 on: May 03, 2009, 02:42:09 PM »
My script is pretty and made of win :D
i remade SM. with a task. i hope this one gets close to the real spellcard.
EDIT: put in the more "efficient" version. More danmaku, more fun. Also, I noticed the cutin doesn't say this spellcard's name, but something like -1.IND00. why could it be?
Code: [Select]
#TouhouDanmakufu
#Title[Evil Scarlet Sign "Scarlet Shoot"]
#Text[A clone of "Scarlet Shoot", made by CAsercan3]
#Image[]
#BackGround[IceMountain]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
let frame = 100;
let deg = 0;
let rotvar = 0;
let frame2 = 0;
let frame3 = 0;
let frame4 = 0;
let BossImage = GetCurrentScriptDirectory ~ "huhu.gif";
let BossCutIn = GetCurrentScriptDirectory ~ "ss.jpg";
let Back = GetCurrentScriptDirectory ~ "Wormhole.jpg";
LoadSE(GetCurrentScriptDirectory ~ "tan01.wav");
    @Initialize {
        LoadGraphic(BossCutIn);
        LoadGraphic(BossImage);
        LoadGraphic(Back);
        SetLife(1500);
        SetDamageRate(10, 10);
        SetTimer(120);
        SetInvincibility(30);
        CutIn(YOUMU, "Scarlet Sign "\""Scarlet Meister"\", BossCutIn, 0, 0, 200, 600);
        SetScore(5000000);
        SetEnemyMarker(true);
        SetDurableSpellCard;
        Concentration01(120);
        Concentration02(60);
        MagicCircle(true);
        SetEffectForZeroLife(30, 100, 1);
        SetX(GetCenterX() +100);
        SetY(80);
    }

    @MainLoop {
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 24);
frame++;
yield;
//MotionBlur(SHOT,2,0);
if(frame == 450){
frame = 0;
ScarletShoot(1);
}
if(frame == 300){
ScarletShoot(0);
}
}
    @DrawLoop {
SetTexture(BossImage);
        DrawGraphic(GetX, GetY);

    }

    @Finalize {
DeleteGraphic(BossImage);
DeleteGraphic(BossCutIn);
DeleteGraphic(Back);
    }

    @BackGround {
rotvar += 1;
SetGraphicAngle (0,0,rotvar);
SetTexture (Back);
SetGraphicRect (0,0,1024,768);
DrawGraphic (GetCenterX(), GetCenterY());
    }
task ScarletShoot(d){
let frame = 0;
let frame2 = 0;
let frame3 = 0;
SetMovePosition03(rand_int(GetCenterX -50,GetClipMaxX -50),rand_int(50,GetCenterY -100),25,2);
let deg = GetAngleToPlayer;
while(frame < 68 && frame > -1){
yield;
frame++;
CreateShot01(GetX,GetY,rand(7,1),deg + rand(-60,60),RED01,1);
CreateShot01(GetX,GetY,rand(7,1),deg + rand(-60,60),RED01,0);
CreateShot01(GetX,GetY,rand(6,1),deg + rand(-60,60),RED01,0);
CreateShot01(GetX,GetY,rand(6,1),deg + rand(-60,60),RED01,0);
CreateShot01(GetX,GetY,rand(7.5,1),deg + rand(-60,60),RED01,0);
if(rand_int(1,3) == 3){
CreateShot01(GetX,GetY,rand(8,2),deg + rand(-40,40),RED02,0);
}
if(frame3 > 8){
CreateShot01(GetX,GetY,rand(6,2),deg + rand(-60,60),RED01,0);
CreateShot01(GetX,GetY,rand(7,3),deg + rand(-50,50),RED01,0);
CreateShot01(GetX,GetY,rand(7.5,3),deg + rand(-50,50),RED01,0);
//CreateShot01(GetX,GetY,rand(5,3),deg + rand(-50,50),RED01,0);
CreateShot01(GetX,GetY,rand(7,1),deg + rand(-60,60),RED01,0);
}
frame2++;
if(frame2 == 4){
frame3++;
PlaySE(GetCurrentScriptDirectory ~ "tan01.wav");
frame2 = 0;
CreateShot01(GetX,GetY,8,deg,RED03,0);
if(frame3 < 5){
deg = GetAngleToPlayer;
}
if(frame3 > 4){
if(d == 1){
deg += 360/12;
}
if(d == 0){
deg -= 360/12;
}
}
}
}
}
}
}
« Last Edit: May 04, 2009, 02:18:13 PM by CAsercan3 »

Re: My script is ugly and made of fail
« Reply #8 on: May 03, 2009, 05:26:22 PM »
Because we don't have "shots.txt", your script doesn't load any bullets, so all we see is white delay clouds being tossed around. If you use your own shot data, be sure to .rar or .zip your whole file directory, including the shot data properly referenced in the script (plus, if you're doing this, you can include sounds effects and images as well). I can't see why your script name would be displayed incorrectly at the moment, but if you batch your script files togather I'll have a first-hand look at it.

Infy♫

  • Demonic★Moe
  • *
Re: My script is ugly and made of fail
« Reply #9 on: May 04, 2009, 02:20:19 PM »
ah well, i didnt intend this to be a separate spell card, anyway. It will be part of a survival spell. that's why that shots thing was in there... it's not required. the sprites and background are just unneccesary, it's all about the danmaku.  it requires no files.

Re: My script is ugly and made of fail
« Reply #10 on: May 04, 2009, 10:33:45 PM »
Looks good. Somewhat easy, only because I don't think you're spawning enough little red shots, but the speed seems fine.

Infy♫

  • Demonic★Moe
  • *
Re: My script is ugly and made of fail
« Reply #11 on: May 05, 2009, 10:37:51 AM »
I wonder how you could create the special effect ZUN put on all of Remilia's spell cards in EoSD... The motion blur and the reddish brightness increment. Before you say it, MotionBlur is fail and does not give bullets a trail like it should.

Drake

  • *
Re: My script is ugly and made of fail
« Reply #12 on: May 05, 2009, 01:42:22 PM »
It is a blur, but not the same kind of blur. I'm not quite sure what it is, I would need to examine them a bit.

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