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

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #150 on: June 02, 2011, 11:48:49 PM »
http://dreamnovels.webs.com/apps/photos/photo?photoid=127757187
Go here, and go to Photos. Theres a section called Error messages. Thats where you'll find it!
"Think you got what it takes to beat me? Ive blown up universes before, so what makes you think you got a chance?" -Rogus

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 #151 on: June 02, 2011, 11:57:38 PM »
You didn't define the "wait" function. It's not built-in to Danmakufu; scripters just define it basically as a shortcut. wait(x) just yields x times, so it looks like this:

Code: [Select]
function wait(frames){
loop(frames){yield;}
}

Put that anywhere in your script - probably right above MainTask.

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #152 on: June 03, 2011, 12:12:25 AM »
But it worked for the other ones...im confused. :(
"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 #153 on: June 03, 2011, 12:24:17 AM »
The best thing for you to do is start by reading some actual tutorials and scripting basic patterns yourself, not just copying other people. If you don't understand how danmakufu works at all, you won't be able to script. Period.

Blargel's Beginner Tutorial (start here): http://www.shrinemaiden.org/forum/index.php/topic,30.0.html
Helepolis' video Tutorials (here after you understand the concepts in the first link): http://www.shrinemaiden.org/forum/index.php/topic,2852.0.html

Then after you learn everything solidly from the beginner tutorials (and only after)...
Nuclear Cheese's DrawLoop tutorial: http://dmf.shrinemaiden.org/wiki/index.php?title=Nuclear_Cheese%27s_Drawing_Tutorial
Naut/Iryan's Intermediate Tutorial: http://www.shrinemaiden.org/forum/index.php/topic,865.0.html

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

Yuyuko Yakumo

  • Carry me~ow
  • Rawr I eat your face with maaaaaagicalness
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #154 on: June 03, 2011, 05:07:51 AM »
In @Initialize, does danmakufu wait to finish loading something before continuing in a script? Say I had:

LoadMusic(bgm);
SetMovePosition01(blah,blah);
PlayMusic(bgm);

Would it load the music before moving?
I know, I know. I'll get a real avatar and signature soon. -_-

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #155 on: June 03, 2011, 05:11:46 AM »
It's all within the same frame, so it wouldn't really matter if you put one before the other.

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

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #156 on: June 03, 2011, 05:32:58 AM »
It's all within the same frame, so it wouldn't really matter if you put one before the other.

Problem:
Say you wanna destroy every bullet in a certain area then spawn a few bullets there - you'd have to delete the bullets then spawn the new ones:
DeleteEnemyShotImmediatelyInCircle(stuff) then CreateShotawejfp(jaeofjwsio)

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #157 on: June 03, 2011, 05:39:15 AM »
Bullet delay? Wait one/a few frame/s?

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

Yuyuko Yakumo

  • Carry me~ow
  • Rawr I eat your face with maaaaaagicalness
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #158 on: June 04, 2011, 12:15:11 AM »
The following stage script goes straight to clear without playing the boss...

Code: [Select]
@Initialize {
LoadGraphic (GCSD~"LoadingScreen.png");
LoadMusic (GetCurrentScriptDirectory~"Cirno's Perfect Math Class.mp3");
Wait(150);
CreateEnemyBossFromFile(GetCurrentScriptDirectory~"cpmcmain.txt", 0, 0, 0, 0, 0);
WaitForZeroEnemy;
Wait(30);
Clear;
}
I know, I know. I'll get a real avatar and signature soon. -_-

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #159 on: June 04, 2011, 01:23:34 AM »
You don't yield during @Initialize. Ever.

1. Create a random task and put the lines from Wait(150); to Clear; into it.
2. Put a yield; in @MainLoop for the task to link to.
3. Start the task in @Initialize.

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 #160 on: June 04, 2011, 01:45:07 AM »
The following stage script goes straight to clear without playing the boss...

Code: [Select]
@Initialize {
LoadGraphic (GCSD~"LoadingScreen.png");
LoadMusic (GetCurrentScriptDirectory~"Cirno's Perfect Math Class.mp3");
Wait(150);
CreateEnemyBossFromFile(GetCurrentScriptDirectory~"cpmcmain.txt", 0, 0, 0, 0, 0);
WaitForZeroEnemy;
Wait(30);
Clear;
}

There's a difference between using yield in a task and using yield in the rest of the script. If you yield in a task, it will pause that task until yield is called in the main part of the script. By main part of the script I mean stuff like @Initialize, @MainLoop and @Finalize -- though normally it would only be found in @MainLoop. The Wait function that most people use is just a loop of yields to tell a task how many frames to wait, but you're using it in the main part of the script which means you're telling the game to continue all unfinished tasks 150 times before creating a boss, telling the game to continue all unfinished tasks at least another 30 times (I'm actually surprised that didn't cause an infinite loop) and then ending the stage, all on the very first frame of the game.

What you're looking for is this:
Code: [Select]
@Initialize {
LoadGraphic (GCSD~"LoadingScreen.png");
LoadMusic (GetCurrentScriptDirectory~"Cirno's Perfect Math Class.mp3");
StartStage;
}

@MainLoop {
yield;
}

task StartStage {
Wait(150);
CreateEnemyBossFromFile(GetCurrentScriptDirectory~"cpmcmain.txt", 0, 0, 0, 0, 0);
WaitForZeroEnemy;
Wait(30);
Clear;
}

@Initialize will start the task which immediately pauses. It won't go past the Wait(150) until the rest of the script (outside of any other task) hits a yield 150 times. That will happen in @MainLoop which is run every frame, so it'll take 150 frames to make the StartStage task to go past the Wait(150) command into creating the boss. Then you have the task yielding until there are no more enemies, then yielding for an extra 30 frames, and then ending the stage.
« Last Edit: June 04, 2011, 01:48:38 AM by Blargel »
<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.

RoninAngel2k5

  • Ghost in the Netherworld
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #161 on: June 04, 2011, 03:56:10 AM »
I am doing my first ever script for Danmkafu for a Yuyuko player, please tell me if there is any mistake in the coding.  I followed DoubleVla's youtube tutorials to some extent, of course giving some custom content for Yuyuko, as for the last part I beilive it is a added code for a more flourished bomb

http://pastebin.com/etiNY12h

<Naut> Please use pastebin when posting large blocks of code.
« Last Edit: June 04, 2011, 07:19:44 PM by Naut »

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #162 on: June 04, 2011, 04:31:43 AM »
Why you do this. So many errors. Everywhere. Oh god.

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

RoninAngel2k5

  • Ghost in the Netherworld
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #163 on: June 04, 2011, 04:45:03 AM »
well this is my first time scripting sheesh >.> give me a break

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #164 on: June 04, 2011, 04:54:10 AM »
No, I will not give you a break. In fact, if this is truly your first time scripting it's all the more reason for me not to give you a break. You start at the beginning of scriptmaking, not at creating a player. You did all this without checking for errors or actually regarding any syntax or how anything works or anything. If you're watching Helepolis' tutorials, you should have gone through twelve tutorials and scripts already before this.

These are your errors.

Things you missed are in BLUE
Things you screwed up are in RED



#TouhouDanmakufu[Player]
#Menu[Lady Yuyuko]
#Text[
Ready to shoot butterflies
]
#ReplayName[Lady Yuyuko]
#Image[.\yuyukoselect.png]
#ScriptVersion[2]

script_player_main{
   
   let CSD = GetCurrentScriptDirrectory;
   let maritex = CSD ` "yuyukodoll.png";

   let f = 0;
   let f2 = 0;

   let count = 01;

   @Initialize{
      SetSpeed(4,2);
      SetPlayerLifeImage(maritex, 0, 0, 23, 48);

      LoadGraphic(maritex);
      LoadPlayerShotData(CSD ~ "ShotData.txt");
   
   {

   @DrawLoop{

      SetTexture(maritex);
      SetAlpha(255);
      Set GraphicScale(1, 1);

      if(GetKeyState(VK_LEFT)==KEY_PUSH || GetKeyState(VK_LEFT)==KEY_HOLD) {
         SetGraphicAngel(0, 0, 0);
         if(f2<5) { setGraphicRect(0, 0, 32, 48); }
         if(f2>=5 && f2<10) { setGraphicRect(32, 48, 64, 96); }
         if(f2>=10 && f2<15) { setGraphicRect(64, 48, 96, 96); }
         if(f2>=15) { setGraphicRect(96, 48, 128, 96); }
         f2++;

      }
      else if(GetKeyState(VK_RIGHT)==KEY_PUSH || GetKeyState(VK_RIGHT)==KEY_HOLD) {
         SetGraphicAngel(0, 0, 0);
         if(f2<5) { setGraphicRect(0, 0, 32, 48); }
         if(f2>=5 && f2<10) { setGraphicRect(32, 48, 64, 96); }
         if(f2>=10 && f2<15) { setGraphicRect(64, 48, 96, 96); }
         if(f2>=15) { setGraphicRect(96, 48, 128, 96); }
         f2++;
      }
      else {

         if(f<15) { setGraphicRect(0, 0, 32, 48); }
         if(f>=15 && f<30) { setGraphicRect(32, 0, 64, 48); }
         if(f>=30 && f<45) { setGraphicRect(64, 0, 96, 48); }
         if(f>=45 && f<60) { setGraphicRect(96, 0, 128, 48); }
         f2 = 0;
      }
   {

   @Missed{
      yield;
   
   {

   @SpellCard{
      UseSpellCard("DeathSign", NULL);
   
   {

   @Finallize{
   
   {

   @MainLoop{
      if((GetKeyState(VK_SHOT)==Key_Push || GetKeyState(VK_SHOT) == KEY_HOLD) && count == -1){
         count = 0;

      }

      //when focused
      if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE) == KEY_HOLD){
         if(count == 5){
            mainShot(GetPlayerX, GetPlayerY-16, 20, 270, 1, 5);
            mainShot(GetPlayerX, GetPlayerY-18, 20, 265, 1, 5);
            mainShot(GetPlayerX, GetPlayerY-20, 20, 265, 1, 5);
            mainShot(GetPlayerX, GetPlayerY-22, 20, 270, 1, 5);
            count = -1;
         }
      }
      //when normal
      else {
         if(count == 5){
            mainShot(GetPlayerX, GetPlayerY-18, 20, 265, 1, 5);
            mainShot(GetPlayerX, GetPlayerY-20, 20, 265, 1, 5);
            count = -1;
         }
      }

      if(count >=0) {
         count++;
      }
      SetIntersectionCircle(GetPlayerX, GetPlayerY, 0);
      yield;
   
   }

   task mainshot(MISSING ALL YOUR PARAMETERS WHAT IS THIS I DON'T EVEN) {
      let obj = Obj_Create(OBJ_SHOT);

      Obj_SetPosition(obj, x, y);
      Obj_SetSpeed(obj, speed);
      Obj_SetAngel(obj, dir);
      OBj_SetAlpha(obj, 155);
      ObjShot_SetGraphic(obj,graphic);
      ObjShot_SetDamage(obj, dmg);
      ObjShot_SetPenetration(obj, 1);
   }
   function wait(w) { loop(w) {yield;} }
}

//spell card coding
script_spell DeathSign {

   let CSD = GetCurrentScriptDirectory;
   let textdata = CSD ~ ".\spellcardanm.png";
   let special1 = CSD ~ ".\spellblade.png";
   let special2 = CSD ~ ".\spelltag.png";
   let special3 = CSD ~ ".\spellblast.png";
   let cut = CSD ~ ".\yuyukospellcard.png";

   @Initialize{
      SetSpeed(2,2);

      Load Graphic(special3);
      LoadGraphic(cut);

      CutIn(KOAMA, "Death Sign: Reaper's Defense", cut 0,0, 512, 512);
      SetPlayerInvincibility(240);

      SpellTask;

   @MainLoop {
      yield;
      CollectItems;
   }

   @Finalize {

   }

   task SpellTask{
   wait(60);

   Scythe(GetPlayerX, GetPLayerY);
   wait(180);

   End;
   }

   task Scythe(x, y){
      let obj = obj_Create(OBJ_CREATE);

      let blade = 0;
      let c = 0;
      let scale = 0.5;

      obj_SetPosition(obj, GetPlayerX, GetPlayerY);
      obj_SetAngle(obj, 0);
      objEffect_SetTexture(obj, special2);
      objEffect_SetLayer(obj,3);
      ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
      ObjEffect_CreateVertex(obj, 4);
      ObjEffect_SetVertexXY(obj, 0, -32, -32);
      ObjEffect_SetVertexUV(obj, 0, 0, 0);
      ObjEffect_SetVertexXY(obj, 1, 32, -32);
      ObjEffect_SetVertexUV(obj, 1, 64, 0);
      ObjEffect_SetVertexXY(obj, 2, -32, 32);
      ObjEffect_SetVertexUV(obj, 2, 0, 64);
      ObjEffect_SetVertexXY(obj, 3, 32, 32);
      ObjEffect_SetVertexUV(obj, 3, 64, 64);

      while(!Obj_BeDeleted(obj)) {
         ObjEffect_SetAngle(obj, 0, 0, blade);
         ObjEffect_SetScale(obj, scale, scale);
         Obj_SetPosition(obj, GetPlayerX, GetPlayerY);
         
         if(c > 120){
            ObjSpell_SetIntersecrionCircle(obj,obj_GetX(obj), Obj_GetY(obj), 512, 700, true);
         }

   task CutIn{
      task hexagontext(x,y,v,draai,sx,sy) {
      let obj = Obj_Create(OBJ_EFFECT);
      let alphret = 0;
      let as = 0;
           let c = 0;
      let angle = draai;
      let speed = v;

      Obj_SetPosition(obj,x,y);   
      ObjEffect_SetRenderState(obj,ADD);
      ObjEffect_SetTexture(obj,textdata);
           ObjEffect_SetScale(obj, sx, sy);
      ObjEffect_SetLayer(obj,2);

      ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
      ObjEffect_CreateVertex(obj, 4);

      ObjEffect_SetVertexXY(obj, 0, -48, -128);
      ObjEffect_SetVertexUV(obj, 0, 0, 0);
      ObjEffect_SetVertexXY(obj, 1, 48, -128);
      ObjEffect_SetVertexUV(obj, 1, 128, 0);
      ObjEffect_SetVertexXY(obj, 2, -48, -104);
      ObjEffect_SetVertexUV(obj, 2, 0, 32);
      ObjEffect_SetVertexXY(obj, 3, 48, -104);
      ObjEffect_SetVertexUV(obj, 3, 128, 32);

      while(! Obj_BeDeleted(obj)){
         ObjEffect_SetAngle(obj,0,0,angle);
           ObjEffect_SetVertexColor(obj,0,alphret,255,255,255);
          ObjEffect_SetVertexColor(obj,1,alphret,255,255,255);
           ObjEffect_SetVertexColor(obj,2,alphret,255,255,255);
           ObjEffect_SetVertexColor(obj,3,alphret,255,255,255);

         if(as==0){alphret+=20; if(alphret>185){as=1;} }
         if(as==1){c++; if(c==90){as=2;} }      
         if(as==2){alphret-=10; if(alphret<0){ Obj_Delete(obj); } }
         angle += speed;

         yield;

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




http://www.shrinemaiden.org/forum/index.php/topic,6181.0.html

This is the great information thread. It contains tutorials galore and lots of other useful stuff. PLEASE READ THEM.
« Last Edit: June 04, 2011, 04:55:54 AM by Drake »

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

Chau

  • Warning! Incoming Engrish post!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #165 on: June 04, 2011, 04:27:01 PM »
Erm- I hope you don't mind that I change the topic.

Well, I think I've got a flaw in understanding how 3D-drawing works.
As far as I know, drawing in 3D is only possible in stage scripts. And if you make a full game with Danmakufu, you have to start up everything in a stage script. Does this also mean that you have to do all the drawing commands for all stages, menus, etc... in one stage script?
So I thought that it could be a bit easier if I put the drawing commands in tasks, e.g. task DrawStage1 or DrawMenu.
I tested it by putting some commands from @BackGround into a task, but it looked very weird (but it showed something at all...).

http://imageshack.us/g/828/24072391.png/
(Left image - Drawing in @BackGround,
right image - drawing in a task)  The background looks weird, but also interesting.

I think I'm just approaching this problem the wrong way. Are there other ways or should I avoid 3D-drawing at all?

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #166 on: June 04, 2011, 04:35:40 PM »
Let's see some code on those task drawans, yo. Also, typically, draw everything in the @BackGround of your stage script. Use conditional statements to switch between stages...

if(StageOne){

}else if(StageTwo){

}

etc.

Chau

  • Warning! Incoming Engrish post!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #167 on: June 04, 2011, 08:28:34 PM »
http://pastebin.com/DXraNi97
I switch between @BackGround-drawing and task drawing by commenting out Draw; or by misspelling @BackGround.

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #168 on: June 04, 2011, 09:21:01 PM »
Well first of all your @BackGround is spelled BackgGround :V oh that was on purpose

The problem is you've associated 'tasks' to go in @Initialize. Notice how your task is entirely just a per-frame loop? Notice how when you yield it shortcuts back to @MainLoop instead of any real drawing loop? Instead, you want that task to be a function or a subroutine, that is called inside @BackGround. That way when you call it, you're running the drawing code inside the drawing loop.

Here.

You run the stage through tasks as you normally would. When it gets to a point in the stage where you want to change the background behaviour, you change variables in the stage task, not the BackGround. These variables are then used as flags of sorts to tell the BackGround loop to "do this next thing now". I suppose you could run the whole logic in BackGround, but it's a dumb idea and Blargel will murder you.
« Last Edit: June 04, 2011, 09:29:35 PM by Drake »

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

Chau

  • Warning! Incoming Engrish post!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #169 on: June 05, 2011, 09:02:42 AM »
It works! I didn't consider that the drawing stuff still should be in @BackGround because it also showed something in @MainLoop (which actually surprised me). Thanks a lot!

Yuyuko Yakumo

  • Carry me~ow
  • Rawr I eat your face with maaaaaagicalness
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #170 on: June 06, 2011, 12:12:55 AM »
I'm gonna be asking so many questions in here, I can tell. :V

I'm using SetShotDataA and I want to change the direction of the bullet after 60 frames. All I want to do is add 90 degrees to the bullet's current angle. But how do I get the value of the bullet's current angle (if it was, say, determined randomly at first)?
I know, I know. I'll get a real avatar and signature soon. -_-

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #171 on: June 06, 2011, 12:17:24 AM »
let derp = rand(0,360);
createshotA(id blablabla)
setshotdataA(id, 0, blablablabla, derp, blablabla)
setshotdataA(id, 60, blablablabla, derp+90, blablabla)
fireshot(id)

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

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #172 on: June 06, 2011, 09:21:21 AM »
This also works, but requires more SetShotDataA coding:

turn = 90;
angle = rand(0,360);
SetShotDataA(id, 60, speed, angle, turn, acceleration, min/max speed, graphic);

turn=0;
SetShotDataA(id, 61, speed, NULL, turn, acceleration, min/max speed, graphic);

Adds 90 to the angle of the bullet for one frame. So, if the frame for the second SetShotDataA is 62, then the bullet will turn around completely.
« Last Edit: June 06, 2011, 09:27:46 AM by Darkness1 »

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #173 on: June 06, 2011, 10:45:43 PM »
ok....here i go again with more questions! yay! :D

Now recently, i read the basic tutorial (which was very nice  :3) and i wanted to create my first script. Basically, i wanted to put in 2 CreateShotA's, both opposites for the spell card........but everytime i put in the second one, it doesnt shoot in the game. The script will still run, but the shot wont appear. What do i have to use? Do i use like a...task fire 2, or something else...?

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

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 #174 on: June 07, 2011, 12:06:24 AM »
I can't see the script because I'm posting from my DS right now, but I assume you forgot the second FireShot(). That function is what tells Danmakufu to actually fire the shot you created with CreateShotA, so you need one copy of it after each CreateShotA/SetShotDataA system.
« Last Edit: June 07, 2011, 12:08:08 AM by Azure Lazuline »

rogus247

  • Rogus is serious...
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #175 on: June 07, 2011, 12:11:25 AM »
oh. So if i create another task fire and ShotA, i have to put FireShot(2)?
"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 #176 on: June 07, 2011, 12:25:48 AM »
Just for the future as a nitpick, wait is a function that loops a yield. You don't need to put a yield after or before a wait function.

Secondly, as long as you aren't waiting any extra frames or modifying the A bullet at any point, just move the FireShot(1); to right after the SetShotData.

Thirdly, there isn't even a second CreateShotA in there, so I can't really tell what the problem is. What this is currently doing is making 36 of each bullet in that while loop, on the same frame, doing the exact same thing. The CreateShotA bullets in particular should have four 03 bullets overlapped onto each other in a circle of nine bullets around the boss. It waits 16 frames, and then loops through the 36 times again, and so on.

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 #177 on: June 07, 2011, 12:29:52 AM »
kk....so say if i wanted to add another CreateShotA thats the opposite of the one i have now. Would i put it in the same task fore, or in a new one? I remember reading somewhere that other variable shots like ShotA need to be put into another task fire...
« Last Edit: June 07, 2011, 12:47:19 AM by rogus247 »
"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 #178 on: June 07, 2011, 12:46:39 AM »
It's really up to you. Also, it's usually better to name your functions a little more descriptively than just "fire". I dunno what you're making so I can't help you name it, though.

Anyways to answer your question a bit better, depending on what "opposite" means to you for a bullet, you may or may not want to separate it into a different function. Consider this example:
Code: [Select]
function CurveShot(startAng, angVel){
    CreateShotA(0, GetX, GetY, 10);
    SetShotDataA(0, 0, 3, startAng, angVel, 0, 3, RED01);
    SetShotData(0, 60, 3, NULL, 0, 0, 3, RED01);
    FireShot(0);
}

If by opposite you mean you want the bullet to just curve in the opposite way, you can safely just use the same function like this. For example, you can put this somewhere:
Code: [Select]
CurveShot(45, 1);
CurveShot(135, -1);
This would make two bullets with "opposite" curves that can be controlled with the same function, just with different parameters. However, if the differences between the two bullets are more complicated, you might want to consider splitting them into two functions instead.

EDIT: I just noticed you had a pastebin up there. I posted this from work and if no one answers this question by the time I get home, I'll edit this post to address your problem more specifically after reading the code.
« Last Edit: June 07, 2011, 12:50:34 AM by Blargel »
<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 #179 on: June 07, 2011, 12:49:54 AM »
Alright! Also, heres my script that didnt work.

http://pastebin.com/R59sdyMK

Im not sure why the task fire2 didnt work but...im gonna keep trying! i wanna get better at this and finally stop being lazy! i gotta make this game by the end of summer!!! 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