Author Topic: Danmakufu Q&A/Problem Thread II  (Read 219035 times)

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #240 on: November 07, 2009, 02:26:47 AM »
no and no

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

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #241 on: November 07, 2009, 02:45:50 AM »
Oh. Anyway to make it easier?

Delpolo

Re: Danmakufu Q&A/Problem Thread II
« Reply #242 on: November 07, 2009, 03:11:46 AM »
After stopping for months, I decided to go back and start writing some more scripts, starting by fixing an old one. Problem is, it keeps on freezing and I can't figure out why (though I know it's because of the task). Here's my whole script:

Code: [Select]
#TouhouDanmakufu
#Title[Help needed]
#Text[The task seems to freeze it. Why?]
#Image[]
#BackGround[IceMountain]
#BGM[.\bgm.mp3]
#PlayLevel[Fix]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
    let BossImage = ".\script\Arthur\Images\Boss.png";
    let BossCutIn = ".\script\Arthur\Images\BossCutIn.png";
    let cx=GetCenterX();
    let cy=GetCenterY();
    let frame=0;
    let a=0; // Angle.
let time=0;
let bullet=0; // To test for 'add' (which is to check if we count up the time or not).

task eye (a) {
let add=0;
if(bullet==0) {
bullet++;
add++;
}
let obj=Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj, cx+60*cos(a), 170+15*sin(a));
Obj_SetAngle(obj, atan2(sin(a), 4*cos(a)));
Obj_SetSpeed(obj, 0.75);
ObjShot_SetGraphic(obj, WHITE05);
ObjShot_SetDelay  (obj, 0);
ObjShot_SetBombResist (obj, true);
      while(Obj_BeDeleted(obj)==false) {
if(add==1) {time++;}
if(time==120) {Obj_SetSpeed(obj, 0);}
yield;
}
}

    @Initialize {
        LoadGraphic(BossImage);
        SetMovePosition02(cx+0, 170, 50);
        SetLife(2500);
        SetDamageRate(10, 10);
        SetTimer(300);
        SetInvincibility(100);
        CutIn(KOUMA, "Default", BossCutIn, 0, 0, 34, 48);
        SetScore(1000000);
        SetEnemyMarker(true);
        SetDurableSpellCard;
        Concentration01(50);
        MagicCircle(false);
        SetEffectForZeroLife(60, 100, 0);
    }

 @MainLoop {
SetCollisionA(GetX, GetY, 9);
SetCollisionB(GetX, GetY, 15);
if(frame>=60) {
if(frame==60) {
CreateShotA(0, cx, 170, 0);
SetShotDataA(0, 0, 0, 0, 0, 0, 0, AQUA01);
FireShot(0);
ascent (a in 1..361) {
if(a%2==0) {
eye (a); // The eyeball shape.
}
CreateShotA(a, cx+5*cos(a+90), 170+5*sin(a+90), 0); // Starting from here...
SetShotDataA(a, 0, 0.225, a+90, 0, 0, 0.25, AQUA01);
SetShotDataA(a, 120, 0, a+90, 0, 0, 0.25, AQUA01);
FireShot(a);
CreateShotA(a, cx+5*cos(a+90), 170+5*sin(a+90), 0);
SetShotDataA(a, 0, 0.0975, a+90, 0, 0, 0.25, AQUA01);
SetShotDataA(a, 120, 0, a+90, 0, 0, 0.25, AQUA01);
FireShot(a); // To here, it'd all for the iris...
}
}
yield;
}
frame++
    }

    @DrawLoop
    {
SetColor(255,255,255);
SetTexture(BossImage);
if(GetSpeedX()>0){
SetGraphicRect(65, 1, 95, 61);
} else if(GetSpeedX()<0){
SetGraphicRect(1, 1, 31, 61);
} else {
SetGraphicRect(33, 1, 63, 61);
} // Draw him moving correctly.
DrawGraphic(GetX(), GetY());
    }

    @Finalize
{
DeleteGraphic(BossImage);
}

}

(Can I just say "task eye", or is the "(a)" needed?)

Yes, I realise I called the task 180 times, but I don't know how to control 180 bullets in one task (don't know how to use arrays yet), though I doubt it's because of that; before trying to remake it, the old script called it 360 times and it didn't freeze. I know it's the task which is the problem because commenting out the task (and all references to it) makes the script work.

The task is basically calling 180 bullets, then stopping them in place after 2 seconds (after their creation) to form an eye shape. I use a task because I'd need to control every bullet individually near the end (by "closing" the eye), so I'd need to use "Obj_GetY" and move it depending on where it is, which I don't think I can do easily with "CreateShotA" (or some other "CreateShot_").

I really hate to make people go through all this just for me, but I'd like to at least finish this.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #243 on: November 07, 2009, 03:29:41 AM »
The ascent function creates it's variable automatically, you shouldn't need to initialize the variable.

You're also CREATING 180 OBJECTS AND FIRING 360 SHOTS IN ONE FRAME JESUS CHRIST

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

Re: Danmakufu Q&A/Problem Thread II
« Reply #244 on: November 07, 2009, 04:03:10 AM »
Rename the variable "add" to anything other than, uh, add. "Ad", for example. Kind of an odd thing to crash on though.

Code: [Select]
#TouhouDanmakufu
#Title[Help needed]
#Text[The task seems to freeze it. Why?]
#Image[]
#BackGround[IceMountain]
#BGM[.\bgm.mp3]
#PlayLevel[Fix]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
    let BossImage = ".\script\Arthur\Images\Boss.png";
    let BossCutIn = ".\script\Arthur\Images\BossCutIn.png";
    let cx=GetCenterX();
    let cy=GetCenterY();
    let frame=0;
    let a=0; // Angle.
let time=0;
let bullet=0; // To test for 'add' (which is to check if we count up the time or not).

task eye (a) {
let ad=0;
if(bullet==0) {
bullet++;
ad++;
}
let obj=Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj, cx+60*cos(a), 170+15*sin(a));
Obj_SetAngle(obj, atan2(sin(a), 4*cos(a)));
Obj_SetSpeed(obj, 0.75);
ObjShot_SetGraphic(obj, WHITE05);
ObjShot_SetDelay  (obj, 0);
ObjShot_SetBombResist (obj, true);
      while(Obj_BeDeleted(obj)==false) {
if(ad==1) {time++;}
if(time==120) {Obj_SetSpeed(obj, 0);}
yield;
}
}

    @Initialize {
        LoadGraphic(BossImage);
        SetMovePosition02(cx+0, 170, 50);
        SetLife(2500);
        SetDamageRate(10, 10);
        SetTimer(300);
        SetInvincibility(100);
        CutIn(KOUMA, "Default", BossCutIn, 0, 0, 34, 48);
        SetScore(1000000);
        SetEnemyMarker(true);
        SetDurableSpellCard;
        Concentration01(50);
        MagicCircle(false);
        SetEffectForZeroLife(60, 100, 0);
    }

 @MainLoop {
SetCollisionA(GetX, GetY, 9);
SetCollisionB(GetX, GetY, 15);
if(frame>=60) {
if(frame==60) {
CreateShotA(0, cx, 170, 0);
SetShotDataA(0, 0, 0, 0, 0, 0, 0, AQUA01);
FireShot(0);
ascent (a in 1..361) {
if(a%2==0) {
eye (a); // The eyeball shape.
}
CreateShotA(a, cx+5*cos(a+90), 170+5*sin(a+90), 0); // Starting from here...
SetShotDataA(a, 0, 0.225, a+90, 0, 0, 0.25, AQUA01);
SetShotDataA(a, 120, 0, a+90, 0, 0, 0.25, AQUA01);
FireShot(a);
CreateShotA(a, cx+5*cos(a+90), 170+5*sin(a+90), 0);
SetShotDataA(a, 0, 0.0975, a+90, 0, 0, 0.25, AQUA01);
SetShotDataA(a, 120, 0, a+90, 0, 0, 0.25, AQUA01);
FireShot(a); // To here, it'd all for the iris...
}
}
yield;
}
frame++
    }

    @DrawLoop
    {
SetColor(255,255,255);
SetTexture(BossImage);
if(GetSpeedX()>0){
SetGraphicRect(65, 1, 95, 61);
} else if(GetSpeedX()<0){
SetGraphicRect(1, 1, 31, 61);
} else {
SetGraphicRect(33, 1, 63, 61);
} // Draw him moving correctly.
DrawGraphic(GetX(), GetY());
    }

    @Finalize
{
DeleteGraphic(BossImage);
}

}

Delpolo

Re: Danmakufu Q&A/Problem Thread II
« Reply #245 on: November 07, 2009, 04:38:50 AM »
...That's it? Seriously?

Okay, having changed "add" to "check", another problem arises: there's only one white bullet that appears. (See here, with part of script if needed.)

Trying to find the error, changing the "181" to "361" in the "ascent" (obviously) doesn't change anything, nor does commenting out the "if(check==1) {time++;}", so I assume it's something else. (The task is still the same, save for the add-check swap.)

Also, is there a function for "CreateShotA" bullets that makes bombs unable to absorb them?

Re: Danmakufu Q&A/Problem Thread II
« Reply #246 on: November 07, 2009, 04:43:38 AM »
??

Code: [Select]
#TouhouDanmakufu
#Title[Help needed]
#Text[The task seems to freeze it. Why?]
#Image[]
#BackGround[IceMountain]
#BGM[.\bgm.mp3]
#PlayLevel[Fix]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
    let BossImage = ".\script\Arthur\Images\Boss.png";
    let BossCutIn = ".\script\Arthur\Images\BossCutIn.png";
    let cx=GetCenterX();
    let cy=GetCenterY();
    let frame=0;
    let a=0;      // Angle.
   let time=0;
   let bullet=0;   // To test for 'add' (which is to check if we count up the time or not).

   task eye (a) {
      let ad=0;
      if(bullet==0) {
         bullet++;
         ad++;
      }
      let obj=Obj_Create(OBJ_SHOT);
      Obj_SetPosition(obj, cx+60*cos(a), 170+15*sin(a));
      Obj_SetAngle(obj, atan2(sin(a), 4*cos(a)));
      Obj_SetSpeed(obj, 0.75);
      ObjShot_SetGraphic(obj, WHITE05);
      ObjShot_SetDelay  (obj, 0);
      ObjShot_SetBombResist (obj, true);
            while(Obj_BeDeleted(obj)==false) {
         if(ad==1) {time++;}
         if(time==120) {Obj_SetSpeed(obj, 0);}
         yield;
      }
   }

    @Initialize {
        LoadGraphic(BossImage);
        SetMovePosition02(cx+0, 170, 50);
        SetLife(2500);
        SetDamageRate(10, 10);
        SetTimer(300);
        SetInvincibility(100);
        CutIn(KOUMA, "Default", BossCutIn, 0, 0, 34, 48);
        SetScore(1000000);
        SetEnemyMarker(true);
        SetDurableSpellCard;
        Concentration01(50);
        MagicCircle(false);
        SetEffectForZeroLife(60, 100, 0);
    }

 @MainLoop {
   SetCollisionA(GetX, GetY, 9);
   SetCollisionB(GetX, GetY, 15);
   if(frame>=60) {
      if(frame==60) {
         CreateShotA(0, cx, 170, 0);
         SetShotDataA(0, 0, 0, 0, 0, 0, 0, AQUA01);
         FireShot(0);
         ascent (a in 1..361) {
            if(a%2==0) {
               eye (a);                  // The eyeball shape.
            }
            CreateShotA(a, cx+5*cos(a+90), 170+5*sin(a+90), 0);      // Starting from here...
            SetShotDataA(a, 0, 0.225, a+90, 0, 0, 0.25, AQUA01);
            SetShotDataA(a, 120, 0, a+90, 0, 0, 0.25, AQUA01);
            FireShot(a);
            CreateShotA(a, cx+5*cos(a+90), 170+5*sin(a+90), 0);
            SetShotDataA(a, 0, 0.0975, a+90, 0, 0, 0.25, AQUA01);
            SetShotDataA(a, 120, 0, a+90, 0, 0, 0.25, AQUA01);
            FireShot(a);                  // To here, it'd all for the iris...
         }
      }
      yield;
   }
   frame++
    }

    @DrawLoop
    {
   SetColor(255,255,255);
   SetTexture(BossImage);
   if(GetSpeedX()>0){
      SetGraphicRect(65, 1, 95, 61);
   } else if(GetSpeedX()<0){
      SetGraphicRect(1, 1, 31, 61);
   } else {
      SetGraphicRect(33, 1, 63, 61);
   }                // Draw him moving correctly.
   DrawGraphic(GetX(), GetY());
    }

    @Finalize
   {
      DeleteGraphic(BossImage);
   }

}

??



??

By the way, you're not incrementing the angle for your eye task, which is why all the bullets are being spawned at the same angle, and thus look like one bullet.

Delpolo

Re: Danmakufu Q&A/Problem Thread II
« Reply #247 on: November 07, 2009, 04:50:21 AM »
Nevermind, I'm an idiot who removed the "(a)" in "eye (a)" after I thought it was useless.

No problems anymore, thanks Naut!
(No, I didn't say "Thanks... not!")

Re: Danmakufu Q&A/Problem Thread II
« Reply #248 on: November 07, 2009, 06:13:53 AM »
Ok, so I want to make two rings of bullets (angles opposite to each other), and now I'm ending up with spinning bullets in the corners. I actually find that quite cool, but how can I include the second ring of bullets? And can you have two while loops?

Code: [Select]
#TouhouDanmakufu
#Title[Test 4: ?J???@?u???z???v]
#Text[Can you escape this illusionary gate?]
#Player[FREE]
#Image[.\img\lulzsmiley.png]
#BGM[.\bgm\necroremix.mp3]


#ScriptVersion[2]

script_enemy_main{



let CSD = GetCurrentScriptDirectory;
let imgBoss = CSD ~ "img\yukarisprite.png";
let cut = CSD ~ "img\yukaricutin.png";
let bg = CSD ~ "img\eyebg.png";
let timer = 157;


@Initialize{
SetLife(5000);
SetTimer(60);
SetScore(103600);
//SetDurableSpellCard;

SetMovePosition01(GetCenterX,100,5);

LoadGraphic(imgBoss);
LoadGraphic(cut);
LoadGraphic(bg);

CutIn(YOUMU,"?J?? ?u???z???v",cut,0,0,600,553);
SetEnemyMarker(true);
Concentration01(120);
MagicCircle(true);
mainTask;
}

@MainLoop{
SetCollisionA(GetX,GetY,28);
SetCollisionB(GetX,GetY,20);
yield;
}

@DrawLoop{
SetTexture(imgBoss);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,128,128);
SetGraphicScale(0.6,0.6);
SetGraphicAngle(0,0,0);
DrawGraphic(GetX,GetY);


}

@Background{
SetTexture(bg);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,300,300);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
DrawGraphic(GetCenterX,GetCenterY);


}

@Finalize{
DeleteGraphic(imgBoss);
DeleteGraphic(cut);
DeleteGraphic(bg);

}

task mainTask{
wait(90);
fire;
yield;
}



task fire{
let x = 0;
let dir = 0;
loop{
CreateShotA(1,GetX,GetY,30);
SetShotDataA(1,0,5,GetAngleToPlayer,0.05,-0.07,3,PURPLE01);
SetShotDataA(1,60,5,GetAngleToPlayer,0.1,-0.07,3,PURPLE01);
FireShot(1);

CreateShotA(2,GetX,GetY,30);
SetShotDataA(2,0,6,GetAngleToPlayer,0.001,0.001,9,PURPLE01);
FireShot(2);

CreateShotA(6,GetX,GetY,30);
SetShotDataA(6,0,5,GetAngleToPlayer,-0.05,-0.07,3,PURPLE01);
SetShotDataA(6,60,5,GetAngleToPlayer,-0.1,-0.07,3,PURPLE01);
FireShot(6);

while(x<36){
CreateShotA(4,GetX+60*cos(dir),GetY+80*sin(dir),30);
SetShotDataA(4,0,5,dir,0,0,0,PURPLE11);
SetShotDataA(4,60,5,dir,60,0.1,2,PURPLE11);
FireShot(4);
dir+=360/60;
x++;
}
//while(x<36){
//CreateShotA(5,GetX+60*cos(dir),GetY+80*sin(dir),30);
//SetShotDataA(5,0,5,dir,0,0,0,PURPLE11);
//SetShotDataA(5,60,5,dir,-1.9,0,2,PURPLE11);
//FireShot(5);
//dir+=360/60;
//x++;
//}
x=0;
dir=0;

CreateLaserA(0,GetX,GetY,400,20,PURPLE03,0);
SetLaserDataA(0,0,0,1,-1,2,180);
SetShotKillTime(0,180);
FireShot(0);

CreateLaserA(3,GetX,GetY,400,20,PURPLE03,0);
SetLaserDataA(3,0,180,-1,-1,-2,180);
SetShotKillTime(3,180);
FireShot(3);

wait(60);
}
}


function wait(w){
loop(w){yield;}
}

}
[/color]

Re: Danmakufu Q&A/Problem Thread II
« Reply #249 on: November 07, 2009, 06:35:20 AM »
Instead of trying to have two while loops run similtaneously, why not just spawn both rings in one loop?

Code: [Select]
#TouhouDanmakufu
#Title[Test 4: ?J???@?u???z???v]
#Text[Can you escape this illusionary gate?]
#Player[FREE]
#Image[.\img\lulzsmiley.png]
#BGM[.\bgm\necroremix.mp3]


#ScriptVersion[2]

script_enemy_main{



let CSD = GetCurrentScriptDirectory;
let imgBoss = CSD ~ "img\yukarisprite.png";
let cut = CSD ~ "img\yukaricutin.png";
let bg = CSD ~ "img\eyebg.png";
let timer = 157;


@Initialize{
SetLife(5000);
SetTimer(60);
SetScore(103600);
//SetDurableSpellCard;

SetMovePosition01(GetCenterX,100,5);

LoadGraphic(imgBoss);
LoadGraphic(cut);
LoadGraphic(bg);

CutIn(YOUMU,"?J?? ?u???z???v",cut,0,0,600,553);
SetEnemyMarker(true);
Concentration01(120);
MagicCircle(true);
mainTask;
}

@MainLoop{
SetCollisionA(GetX,GetY,28);
SetCollisionB(GetX,GetY,20);
yield;
}

@DrawLoop{
SetTexture(imgBoss);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,128,128);
SetGraphicScale(0.6,0.6);
SetGraphicAngle(0,0,0);
DrawGraphic(GetX,GetY);


}

@Background{
SetTexture(bg);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,300,300);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
DrawGraphic(GetCenterX,GetCenterY);


}

@Finalize{
DeleteGraphic(imgBoss);
DeleteGraphic(cut);
DeleteGraphic(bg);

}

task mainTask{
wait(90);
fire;
yield;
}



task fire{
let x = 0;
let dir = 0;
loop{
CreateShotA(1,GetX,GetY,30);
SetShotDataA(1,0,5,GetAngleToPlayer,0.05,-0.07,3,PURPLE01);
SetShotDataA(1,60,5,GetAngleToPlayer,0.1,-0.07,3,PURPLE01);
FireShot(1);

CreateShotA(2,GetX,GetY,30);
SetShotDataA(2,0,6,GetAngleToPlayer,0.001,0.001,9,PURPLE01);
FireShot(2);

CreateShotA(6,GetX,GetY,30);
SetShotDataA(6,0,5,GetAngleToPlayer,-0.05,-0.07,3,PURPLE01);
SetShotDataA(6,60,5,GetAngleToPlayer,-0.1,-0.07,3,PURPLE01);
FireShot(6);

while(x<36){
CreateShotA(4,GetX+60*cos(dir),GetY+80*sin(dir),30);
SetShotDataA(4,0,5,dir,0,0,0,PURPLE11);
SetShotDataA(4,60,5,dir,60,0.1,2,PURPLE11);
FireShot(4);
CreateShotA(5,GetX+60*cos(dir),GetY+80*sin(dir),30);
SetShotDataA(5,0,5,dir,0,0,0,PURPLE11);
SetShotDataA(5,60,5,dir,-1.9,0,2,PURPLE11);
FireShot(5);
dir+=360/60;
x++;
}
x=0;
dir=0;

CreateLaserA(0,GetX,GetY,400,20,PURPLE03,0);
SetLaserDataA(0,0,0,1,-1,2,180);
SetShotKillTime(0,180);
FireShot(0);

CreateLaserA(3,GetX,GetY,400,20,PURPLE03,0);
SetLaserDataA(3,0,180,-1,-1,-2,180);
SetShotKillTime(3,180);
FireShot(3);

wait(60);
}
}


function wait(w){
loop(w){yield;}
}

}

Re: Danmakufu Q&A/Problem Thread II
« Reply #250 on: November 07, 2009, 06:40:35 AM »
Instead of trying to have two while loops run similtaneously, why not just spawn both rings in one loop?

Code: [Select]
#TouhouDanmakufu
#Title[Test 4: ?J???@?u???z???v]
#Text[Can you escape this illusionary gate?]
#Player[FREE]
#Image[.\img\lulzsmiley.png]
#BGM[.\bgm\necroremix.mp3]


#ScriptVersion[2]

script_enemy_main{



let CSD = GetCurrentScriptDirectory;
let imgBoss = CSD ~ "img\yukarisprite.png";
let cut = CSD ~ "img\yukaricutin.png";
let bg = CSD ~ "img\eyebg.png";
let timer = 157;


@Initialize{
SetLife(5000);
SetTimer(60);
SetScore(103600);
//SetDurableSpellCard;

SetMovePosition01(GetCenterX,100,5);

LoadGraphic(imgBoss);
LoadGraphic(cut);
LoadGraphic(bg);

CutIn(YOUMU,"?J?? ?u???z???v",cut,0,0,600,553);
SetEnemyMarker(true);
Concentration01(120);
MagicCircle(true);
mainTask;
}

@MainLoop{
SetCollisionA(GetX,GetY,28);
SetCollisionB(GetX,GetY,20);
yield;
}

@DrawLoop{
SetTexture(imgBoss);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,128,128);
SetGraphicScale(0.6,0.6);
SetGraphicAngle(0,0,0);
DrawGraphic(GetX,GetY);


}

@Background{
SetTexture(bg);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,300,300);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
DrawGraphic(GetCenterX,GetCenterY);


}

@Finalize{
DeleteGraphic(imgBoss);
DeleteGraphic(cut);
DeleteGraphic(bg);

}

task mainTask{
wait(90);
fire;
yield;
}



task fire{
let x = 0;
let dir = 0;
loop{
CreateShotA(1,GetX,GetY,30);
SetShotDataA(1,0,5,GetAngleToPlayer,0.05,-0.07,3,PURPLE01);
SetShotDataA(1,60,5,GetAngleToPlayer,0.1,-0.07,3,PURPLE01);
FireShot(1);

CreateShotA(2,GetX,GetY,30);
SetShotDataA(2,0,6,GetAngleToPlayer,0.001,0.001,9,PURPLE01);
FireShot(2);

CreateShotA(6,GetX,GetY,30);
SetShotDataA(6,0,5,GetAngleToPlayer,-0.05,-0.07,3,PURPLE01);
SetShotDataA(6,60,5,GetAngleToPlayer,-0.1,-0.07,3,PURPLE01);
FireShot(6);

while(x<36){
CreateShotA(4,GetX+60*cos(dir),GetY+80*sin(dir),30);
SetShotDataA(4,0,5,dir,0,0,0,PURPLE11);
SetShotDataA(4,60,5,dir,60,0.1,2,PURPLE11);
FireShot(4);
CreateShotA(5,GetX+60*cos(dir),GetY+80*sin(dir),30);
SetShotDataA(5,0,5,dir,0,0,0,PURPLE11);
SetShotDataA(5,60,5,dir,-1.9,0,2,PURPLE11);
FireShot(5);
dir+=360/60;
x++;
}
x=0;
dir=0;

CreateLaserA(0,GetX,GetY,400,20,PURPLE03,0);
SetLaserDataA(0,0,0,1,-1,2,180);
SetShotKillTime(0,180);
FireShot(0);

CreateLaserA(3,GetX,GetY,400,20,PURPLE03,0);
SetLaserDataA(3,0,180,-1,-1,-2,180);
SetShotKillTime(3,180);
FireShot(3);

wait(60);
}
}


function wait(w){
loop(w){yield;}
}

}
Tried that and it doesn't work. Even after I changed it to yours, it still spawns just the one.

Lawence Codye

  • The Nine Tails of Subconscious...
  • Come & your desires shall all become reality...
Re: Danmakufu Q&A/Problem Thread II
« Reply #251 on: November 08, 2009, 12:42:38 AM »
umm...okay, another question I have.  What function(s) should I use to change shot types for a character I want to have multiple shot types...
like...the VIVIT player for example(looking at the script in no way helped me what so ever...)?
I am the Nine Tails of Subconscious...

Come & your greatest desires will be reality...

Re: Danmakufu Q&A/Problem Thread II
« Reply #252 on: November 08, 2009, 12:58:00 AM »
Tried that and it doesn't work. Even after I changed it to yours, it still spawns just the one.

??



??

Code: [Select]
#TouhouDanmakufu
#Title[Test 4: èJòäü@üuîÂæzûÕüv]
#Text[Can you escape this illusionary gate?]
#Player[FREE]
#Image[.\img\lulzsmiley.png]
#BGM[.\bgm\necroremix.mp3]


#ScriptVersion[2]

script_enemy_main{



let CSD = GetCurrentScriptDirectory;
let imgBoss = CSD ~ "img\yukarisprite.png";
let cut = CSD ~ "img\yukaricutin.png";
let bg = CSD ~ "img\eyebg.png";
let timer = 157;


@Initialize{
SetLife(5000);
SetTimer(60);
SetScore(103600);
//SetDurableSpellCard;

SetMovePosition01(GetCenterX,100,5);

LoadGraphic(imgBoss);
LoadGraphic(cut);
LoadGraphic(bg);

CutIn(YOUMU,"èJòä üuîÂæzûÕüv",cut,0,0,600,553);
SetEnemyMarker(true);
Concentration01(120);
MagicCircle(true);
mainTask;
}

@MainLoop{
SetCollisionA(GetX,GetY,28);
SetCollisionB(GetX,GetY,20);
yield;
}

@DrawLoop{
SetTexture(imgBoss);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,128,128);
SetGraphicScale(0.6,0.6);
SetGraphicAngle(0,0,0);
DrawGraphic(GetX,GetY);


}

@Background{
SetTexture(bg);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,300,300);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
DrawGraphic(GetCenterX,GetCenterY);


}

@Finalize{
DeleteGraphic(imgBoss);
DeleteGraphic(cut);
DeleteGraphic(bg);

}

task mainTask{
wait(90);
fire;
yield;
}



task fire{
let x = 0;
let dir = 0;
loop{
CreateShotA(1,GetX,GetY,30);
SetShotDataA(1,0,5,GetAngleToPlayer,0.05,-0.07,3,PURPLE01);
SetShotDataA(1,60,5,GetAngleToPlayer,0.1,-0.07,3,PURPLE01);
FireShot(1);

CreateShotA(2,GetX,GetY,30);
SetShotDataA(2,0,6,GetAngleToPlayer,0.001,0.001,9,PURPLE01);
FireShot(2);

CreateShotA(6,GetX,GetY,30);
SetShotDataA(6,0,5,GetAngleToPlayer,-0.05,-0.07,3,PURPLE01);
SetShotDataA(6,60,5,GetAngleToPlayer,-0.1,-0.07,3,PURPLE01);
FireShot(6);

while(x<36){
CreateShotA(4,GetX+60*cos(dir),GetY+80*sin(dir),30);
SetShotDataA(4,0,5,dir,0,0,0,PURPLE11);
SetShotDataA(4,60,5,dir,60,0.1,2,PURPLE11);
FireShot(4);
CreateShotA(5,GetX+60*cos(dir),GetY+80*sin(dir),30);
SetShotDataA(5,0,5,dir,0,0,0,PURPLE11);
SetShotDataA(5,60,5,dir,-1.9,0,2,PURPLE11);
FireShot(5);
dir+=360/60;
x++;
}
x=0;
dir=0;

CreateLaserA(0,GetX,GetY,400,20,PURPLE03,0);
SetLaserDataA(0,0,0,1,-1,2,180);
SetShotKillTime(0,180);
FireShot(0);

CreateLaserA(3,GetX,GetY,400,20,PURPLE03,0);
SetLaserDataA(3,0,180,-1,-1,-2,180);
SetShotKillTime(3,180);
FireShot(3);

wait(60);
}
}


function wait(w){
loop(w){yield;}
}

}

??


@UltimaRepman:
Have so that when you press "c" (VK_USER), a new variable is initialized your shot pattern, and all your shots are now based off the new variable (used to be count, is now count2, or something). When you hit "c" again, all the variables can revert back so that you resume your first shot pattern.
« Last Edit: November 08, 2009, 01:00:13 AM by Naut »


Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #254 on: November 08, 2009, 01:20:34 AM »

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


Re: Danmakufu Q&A/Problem Thread II
« Reply #256 on: November 08, 2009, 01:31:48 AM »

Re: Danmakufu Q&A/Problem Thread II
« Reply #257 on: November 08, 2009, 01:39:20 AM »

Re: Danmakufu Q&A/Problem Thread II
« Reply #258 on: November 08, 2009, 06:45:27 AM »
Grr..i have been into every page in Rika's Garage and I can not find the Shot Replace script that I accidentaly changed...and I have tried the Wiki and I still can not find it...know where I can find it?
« Last Edit: November 08, 2009, 07:01:04 AM by Demonbman »

Johnny Walker

  • Perdition Crisis~
Re: Danmakufu Q&A/Problem Thread II
« Reply #259 on: November 08, 2009, 07:10:49 AM »
Grr..i have been into every page in Rika's Garage and I can not find the Shot Replace script that I accidentaly changed...and I have tried the Wiki and I still can not find it...know where I can find it?

Search here:
http://www.shrinemaiden.org/forum/index.php?topic=18.0
« Last Edit: November 08, 2009, 07:38:08 AM by Johnny Walker »

Re: Danmakufu Q&A/Problem Thread II
« Reply #260 on: November 08, 2009, 07:20:02 AM »
Search here:
http://www.shrinemaiden.org/forum/index.php?topic=18.0

.....I am offically a 9 now....

Edit: It wont let me download the file, I get some an error saying this:
Your Hosting Account is Suspended
Your account has been suspended by x10Hosting's administration.
« Last Edit: November 08, 2009, 07:28:53 AM by Demonbman »

Johnny Walker

  • Perdition Crisis~
Re: Danmakufu Q&A/Problem Thread II
« Reply #261 on: November 08, 2009, 07:34:59 AM »
.....I am offically a 9 now....

Edit: It wont let me download the file, I get some an error saying this:
Your Hosting Account is Suspended
Your account has been suspended by x10Hosting's administration.
uploaded:

http://www.mediafire.com/download.php?ddjmdue1jm0


Nimble

  • Broken English Fox
  • Rushing toward the bullet!
    • Viewmix
Re: Danmakufu Q&A/Problem Thread II
« Reply #263 on: November 08, 2009, 10:04:08 AM »
I get some graphic problem with my enemy. I take enemy script from Blargel ExPatchouli stage, after learn how it working. I try to make one.


When enemy are spining. White edge appear from nowhere around enemy sprite. (top area)
When I make them stop spining. Everything seem fine. (bottom area - but the leaf is still spining)

Any advice for this problem?
Code: [Select]
script_enemy_main{

    let enemyframe = 0;
    let enemyframe2 = 0;
    let imgAngle=0;
    let imgEnemy=GetCurrentScriptDirectory~"..\..\img\enemy\devicered.png";

//--------------------------------------------------------------------------------------------------------------

    @Initialize{
        SetLife(50);
        LoadGraphic(imgEnemy);
        SetTexture(imgEnemy);
        SetGraphicRect(0,0,32,32);
        SetGraphicScale(1, 1);
        SetMovePosition02(GetX, GetY, 0);
    }

//--------------------------------------------------------------------------------------------------------------

    @MainLoop
{
SetCollisionA(GetX(),GetY(),24);
SetCollisionB(GetX(),GetY(),24);


if (enemyframe2 == 30)
{

PlaySE(GetCurrentScriptDirectory~"..\..\sfx\Shot1.wav");

CreateShot01(GetX, GetY, 3, 60, GREEN01, 0);
CreateShot01(GetX, GetY, 3, 90, GREEN01, 0);
CreateShot01(GetX, GetY, 3, 120, GREEN01, 0);

SetMovePosition02(GetX-100, GetY+25, 30);
}

if (enemyframe2 == 60)
{

PlaySE(GetCurrentScriptDirectory~"..\..\sfx\Shot1.wav");

CreateShot01(GetX, GetY, 3, 60, GREEN01, 0);
CreateShot01(GetX, GetY, 3, 90, GREEN01, 0);
CreateShot01(GetX, GetY, 3, 120, GREEN01, 0);

SetMovePosition02(GetX+100, GetY+25, 30);
enemyframe2 = 0;
}

if (enemyframe == 600)
{
VanishEnemy;
}

enemyframe++;
enemyframe2++;
}



//--------------------------------------------------------------------------------------------------------------

    @Finalize{
        if(BeVanished==false){
            loop(3){
                CreateItem(ITEM_SCORE,GetX+rand(-25,25),GetY+rand(-25,25));
            }
        }
    }

//--------------------------------------------------------------------------------------------------------------

    @DrawLoop{
        SetTexture(imgEnemy);
        SetColor(255,255,255);
        SetRenderState(ALPHA);
        SetGraphicAngle(0,0,imgAngle);
        DrawGraphic(GetX(),GetY());

        SetRenderState(ADD);
        SetGraphicAngle(0,0,imgAngle);
        DrawGraphic(GetX(),GetY());

        imgAngle-=4;
        if(imgAngle<-360){imgAngle=0;}
    }
}

« Last Edit: November 08, 2009, 10:08:03 AM by Nimble »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #264 on: November 08, 2009, 10:15:12 AM »
Welcome to the drawing engine of Danmakufu, that likes to put graphics off center when spinning. ( Probably this is the problem )

Try to increase the boundaries for the image, like the graphicrect. So if a image is 32x32 try to set the boundaries to 34x34 and retry again. I generally would advice this to anybody who is spinning graphics.

Remember that the boundary setting becomes annoying when you have images very close to eachother ( like I have with my shotscript )

Nimble

  • Broken English Fox
  • Rushing toward the bullet!
    • Viewmix
Re: Danmakufu Q&A/Problem Thread II
« Reply #265 on: November 08, 2009, 11:21:17 AM »
I try on change graphicreact from your advice to 0,0,32,32 0,0,34,34 1,1,32,32 1,1,34,34... up to 36 (start overlap) and less.
But white edge still appear every try.

Or I have to change something in my enemy image?

I make it transpalency by default (and already try with complete black (000000) background, but no different :'()

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread II
« Reply #266 on: November 08, 2009, 03:24:17 PM »
Haha he meant the size of the image itself.

If you want to alter the size of the graphicrect you should be making it one pixel smaller.

Although, I'm not sure that's the problem. It looks like the transparent pixels on the inside and rim are mapping as nontransparent when rotated, and changing the box size would be done to address garbage appearing on the edges.

I dunno what to do about it, though.

Oh, just so you know, your rects should be something like 1,1,30,30. 0~32 is technically 33 pixels since 0 counts.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #267 on: November 08, 2009, 04:54:28 PM »
Also, is there a function for "CreateShotA" bullets that makes bombs unable to absorb them?
You need object bullets for taht.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #268 on: November 08, 2009, 10:55:44 PM »
But white edge still appear every try.


Try putting the actual image on a 512 by 512 png file with transparency if you use ALPHA rendering, or put it in with a black background if you use ADD.  You'll get a clearer image, and it should solve your white edge problem.  Danmakufu is very picky when it comes to input, so try to keep up to its standards.


Oh, and my question... I want to change some of Danmakufu's default sounds... what can I do?  Anybody know?
« Last Edit: November 08, 2009, 11:49:52 PM by Fujiwara no Mokou »

Nimble

  • Broken English Fox
  • Rushing toward the bullet!
    • Viewmix
Re: Danmakufu Q&A/Problem Thread II
« Reply #269 on: November 08, 2009, 11:55:27 PM »

Try putting the actual image on a 512 by 512 png file with transparency if you use ALPHA rendering, or put it in with a black background if you use ADD.  You'll get a clearer image, and it should solve your white edge problem.  Danmakufu is very picky when it comes to input, so try to keep up to its standards.


Oh, and my question... I want to change some of Danmakufu's default sounds... what can I do?  Anybody know?
Thank you very much, when remove SetRenderState(ADD); problem solve.

From Unraveling the mysteries of th_dnh.dat

You need se folder in danmakufu root directory and insert what sfx you need to change in this folder like
Touhou_Danmakufu\se\sePlayerCollision.wav
If you want to change the sfx when player die.