Author Topic: Danmakufu Q&A/Problem Thread v3  (Read 213421 times)

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #210 on: February 19, 2010, 08:36:10 PM »
Strings are stored as an array, numbers aren't. In order to get each digit, this is what I did:

Code: [Select]
let num=GetScore;
while(num>0){
  digit=num%10; //get the ones digit

  //do stuff to draw the number to the screen

  num=trunc(num/10);  //divide by ten, so next loop will get the tens digit instead, and so on
}

Oh, thanks. This will be useful for some time. *saves code*

P.S. Aw, dang. You remind me of the time I spend playing Mario games, Azure.

EDIT: That snippet of code!!
This is what the creators of Touhou Mushuugeki ~ Concealed the Conclusion did, isn't it!?

Re: Danmakufu Q&A/Problem Thread v3
« Reply #211 on: February 19, 2010, 08:39:55 PM »
Oh, thanks. This will be useful for some time. *saves code*

P.S. Aw, dang. You remind me of the time I spend playing Mario games, Azure.

EDIT: That snippet of code!!
This is what the creators of Touhou Mushuugeki ~ Concealed the Conclusion did, isn't it!?

To me it doesn't matter who did it, its a lifesaver  :* Il be done with my customized status setup by the end of today thanks to this

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #212 on: February 19, 2010, 08:42:59 PM »
I got a question myself.
You know that bonus thingy under the name of the spell cards?
Is there a function to get this number?

...P.S. This post to be edited, once I get a screenshot of the thing.
« Last Edit: February 19, 2010, 08:51:50 PM by Always Mew⑨ »

Re: Danmakufu Q&A/Problem Thread v3
« Reply #213 on: February 19, 2010, 08:50:06 PM »
I got a question myself.
You know that bonus thingy under the name of the spell cards?
Is there a function to get this number?

...P.S. This post to be edited, once I get a screenshot of the thing.

Do you mean the one set with SetScore?

lactose

Re: Danmakufu Q&A/Problem Thread v3
« Reply #214 on: February 19, 2010, 09:53:14 PM »
Thanks. You got me through that problem, but now I have another.

Code: [Select]
#TouhouDanmakufu
#Title[blizzbullet]
#BGM[.\bgm.mp3]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
 
        let CSD = GetCurrentScriptDirectory;

        let imgBoss = CSD ~ "system\cirno.png";
        let cut = CSD ~ "system\cirnocut.png";
        let bg = CSD ~ "system\snowbg.png";
        let lay = CSD ~ "system\blizzard.png";

        let f = 0;
        let f2 = 0;

        let slide = 0;
     



         @Initialize {
                 SetLife(3000);
                 SetTimer(30);
                 SetScore(50000);
         SetMovePosition01(GetCenterX,GetCenterY,10);
                 LoadGraphic(imgBoss);
                 LoadGraphic(cut);
                 LoadGraphic(bg);
                 LoadGraphic(lay);

                 CutIn(YOUMU,"Powder storm",cut,0,0,300,384);

         mainTask;

         }

         @MainLoop{
                SetCollisionA(GetX,GetY,32);
                SetCollisionB(GetX,GetY,16);
            yield;
         }

         @DrawLoop{       
 
                 // data for the boss
                 SetTexture(imgBoss);   
                 SetRenderState(ALPHA);
                 SetAlpha(255);
                 SetGraphicRect(0,0,110,110);
                 SetGraphicScale(0.7,0.7);
                 SetGraphicAngle(0,0,0);
                 DrawGraphic(GetX,GetY);

         }

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

                 SetTexture(lay);   
                 SetRenderState(ADD);
                 SetGraphicRect(0,0,20000,20000);
                 SetGraphicScale(1,1);
                 SetGraphicAngle(0,0,0);
                 DrawGraphic(GetCenterX+slide,GetCenterY+slide);

                 slide+=2;
         }   
     
         @Finalize{
                 // delete the image from memory
                 DeleteGraphic(imgBoss);
                 DeleteGraphic(cut);
                 DeleteGraphic(bg);


         }

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

         // main task. activates stuff.
         task mainTask{
                 wait(120);
         yield;
                 movement;
                 fire2;
         }



         task movement{

                 loop{

                         SetMovePositionRandom01(60,30,10,GetCenterX-120,GetCenterY-100,GetCenterX+120,GetCenterY-40);
                         wait(30);
                         SetColor(128,128,255);
                         Concentration01(80);
                         SetColor(225,225,225);
                         wait(30);
                         fire;
                         wait(180);
                         yield;
       
                  }

         }
         task fire{
                 let x = 0;
                 let dir = rand_int(0,359);

                 while(x<16){
                          superbullet(GetEnemyX+60*cos(dir),GetEnemyY+60*sin(dir),3,dir,AQUA03,0);
                          dir+=22.5;
                          x++;
                      }
         }

         task fire2{
                 let x = 0;
                 let dir = 0;
   
                 loop{
                         while(x<36){
                                CreateShotA(1,GetEnemyX+20*cos(dir),GetEnemyY+20*sin(dir),0);
                                SetShotDataA(1,0,1,dir,-0.2,0,1,AQUA23);
                                FireShot(1);

                                CreateShotA(2,GetEnemyX+20*cos(dir),GetEnemyY+20*sin(dir),0);
                                SetShotDataA(2,0,1,dir,-0,2,0,1,AQUA23);
                                FireShot(2);

                                dir+=360/36;
                                x++;
                          }
                          x = 0;
                          dir = 0;
                          wait(90);
                          yield;
                      }


             }



         // object bullet task
task superbullet(x,y,v,dir,graphic,delay){
                 
                 let obj = Obj_Create(OBJ_SHOT);

                 Obj_SetPosition(obj,x,y);
Obj_SetSpeed(obj,v);
                 Obj_SetAngle(obj,dir);
                 ObjShot_SetGraphic(obj,graphic);
                 ObjShot_SetDelay(obj,0);
ObjShot_SetBombResist(obj,true);

                 while(!Obj_BeDeleted(obj)){
                     
                        wait(15);
                        Obj_SetSpeed(obj,0);
                        Concentration02(15);
                        wait(45);
                        ObjShot_SetGraphic(obj,RED03);
                        loop(8){
                                CreateLaser01(Obj_GetX(obj),Obj_GetY(obj),4,dir,300,10,BLUE01,0);
                                dir+=360/8;
                 }
                 wait(60);
                 ObjShot_FadeDelete(obj);
                 yield;
                 }                 
        }
         





         }


     }


Apparently something is wrong with SetShotDataA. I have the 8 arguments. Should there be a function before hand telling danmakufu what SetShotData is?

Re: Danmakufu Q&A/Problem Thread v3
« Reply #215 on: February 19, 2010, 09:55:31 PM »
Thanks. You got me through that problem, but now I have another.

*snip*

Apparently something is wrong with SetShotDataA. I have the 8 arguments. Should there be a function before hand telling danmakufu what SetShotData is?

CreateShotA(2,GetEnemyX+20*cos(dir),GetEnemyY+20*sin(dir),0);
SetShotDataA(2,0,1,dir,-0,2,0,1,AQUA23);
FireShot(2);

Your -0.2 has an extra comma in it, making it nine arguments.

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem Thread v3
« Reply #216 on: February 19, 2010, 10:16:37 PM »
To me it doesn't matter who did it, its a lifesaver  :* Il be done with my customized status setup by the end of today thanks to this
I don't know if anyone else thought of it before, but I made that up about 6 hours before I posted that. It's pretty simple when you think about it, actually.

Always Mew⑨: I think the function you want is GetSpellCardBonusScore.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #217 on: February 19, 2010, 11:28:51 PM »
Always Mew⑨: I think the function you want is GetSpellCardBonusScore.

Thank you thank you thank you...
*goes to make custom cut in stuff*

Re: Danmakufu Q&A/Problem Thread v3
« Reply #218 on: February 20, 2010, 01:28:55 AM »
Is there a way to obtain the high score? I need to draw it using my number function ^^

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #219 on: February 20, 2010, 01:39:56 AM »
Is there a way to obtain the high score? I need to draw it using my number function ^^

There is a way to get the current score. If you want to get and store high score, you'll need to use common data.
oh hai im back and ready to answer questions again
<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.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #220 on: February 20, 2010, 01:40:17 AM »
Is there a way to obtain the high score? I need to draw it using my number function ^^
Use common data.
Example:
Code: [Select]
if(GetScore >= GetCommonDataDefault("HighScore", 0)) { SetCommonData("HighScore", GetScore); }

EDIT: Ah, fuck. Blargelunar-dial'd.

Re: Danmakufu Q&A/Problem Thread v3
« Reply #221 on: February 20, 2010, 01:50:51 AM »
There is a way to get the current score. If you want to get and store high score, you'll need to use common data.
oh hai im back and ready to answer questions again

Is there a way to make it so that the value wont be erased if the script is reset? =o

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #222 on: February 20, 2010, 01:54:05 AM »
Is there a way to make it so that the value wont be erased if the script is reset? =o
Code: [Select]
SaveCommonData;
It saves all the common data in the file to a file named "The_Script_That_Is_Currently_Running.dat"

You can go to the Danmakufu Wiki if you want more info on common data and stuff.
« Last Edit: February 20, 2010, 01:55:48 AM by Always Mew⑨ »

Re: Danmakufu Q&A/Problem Thread v3
« Reply #223 on: February 20, 2010, 08:31:07 PM »
Is there a way to have a A Laser to move straight down?

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #224 on: February 20, 2010, 08:41:52 PM »
When in doubt, use an object laser with Obj_SetY(obj, Obj_GetY(obj) + v); in the while{} brackets, v being the velocity of course.
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: Danmakufu Q&A/Problem Thread v3
« Reply #225 on: February 20, 2010, 08:55:55 PM »
FRICKEN YIELD;!!!!! fixed it
« Last Edit: February 20, 2010, 09:12:18 PM by Demonbman »

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #226 on: February 20, 2010, 09:11:28 PM »
That is odd. With your code, it shouldn't crash, it should freeze because you forgot the yield;  :V

Also, if you increase v by one every frame, the laser will accelerate to a speed of 10 after 10 frames. You will barely see it before it rushes off the screen with a velocity so fast that it can easily jump through the players hitbox.

Also, Obj_SetSpeed does nothing for a laser if I remember correctly.

Also, the crashing could be because YELLOW60 is not a bullet graphic in the shotsheet you are using.

Also, it looks like you might have an additional closing } bracket in there. That could of course be the couse for your crashing, too.
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."

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread v3
« Reply #227 on: February 20, 2010, 09:17:50 PM »
Speaking of lasers, what bullet type is the best one to use for a projectile-type laser? Mine stretches out a ton, so I'm not quite sure what to use.

I'm using the 4.1 shotsheet, because it matters.
« Last Edit: February 20, 2010, 09:19:28 PM by AweStriker Nova »

Furienify

  • Yeehaw!
  • Equestrian Fansubber
    • Youtube Channel
Re: Danmakufu Q&A/Problem Thread v3
« Reply #228 on: February 20, 2010, 09:25:55 PM »
Speaking of lasers, what bullet type is the best one to use for a projectile-type laser? Mine stretches out a ton, so I'm not quite sure what to use.

I'm using the 4.1 shotsheet, because it matters.

You're usually looking for the big bubble bullets, the ones with the white outline and actual tiny hitboxes.

Furienify

  • Yeehaw!
  • Equestrian Fansubber
    • Youtube Channel
Re: Danmakufu Q&A/Problem Thread v3
« Reply #229 on: February 20, 2010, 09:27:16 PM »
Also, for some reason I can't figure this out- how can I make custom player characters actually appear on my list? Right now it's only Reimu/Marisa/Rumia.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #230 on: February 20, 2010, 09:29:25 PM »
Well, put the respective folder in your player folder, make shure that the player script has the correct head, and then try to scroll sideways inside the player select menu.

Also, if you are making your own player character, make shure that the folder your player script is in has a one-word-name. For some reason danmakufu will read a folder "Youmu Player" as two folders named "Youmu" and "Player" when inside the player directory, so danmakufu will crash when you try to select the player.

Other than that, I don't know...
« Last Edit: February 20, 2010, 09:32:07 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."

Furienify

  • Yeehaw!
  • Equestrian Fansubber
    • Youtube Channel
Re: Danmakufu Q&A/Problem Thread v3
« Reply #231 on: February 20, 2010, 09:34:25 PM »
Well, put the respective folder in your player folder, make shure that the player script has the correct head, and then try to scroll sideways inside the player select menu.

Also, if you are making your own player character, make shure that the folder your player script is in has a one-word-name. For some reason danmakufu will read a folder "Youmu Player" as two folders named "Youmu" and "Player" when inside the player directory, so danmakufu will crash when you try to select the player.

Other than that, I don't know...

My bad, it's the card/plural scripts themselves restricting the characters to the default. Derp.

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread v3
« Reply #232 on: February 20, 2010, 09:44:53 PM »
You're usually looking for the big bubble bullets, the ones with the white outline and actual tiny hitboxes.

That works fairly well, but I was thinking more along the lines of the Nue/Letty/Merlin/Shou curved lasers.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #233 on: February 20, 2010, 09:52:09 PM »
In that case I'd use the ones commented as "Glowing medium round bullets (right side)"
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."

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread v3
« Reply #234 on: February 21, 2010, 01:15:25 AM »
Code: [Select]
task gammaray(theta){
let dtheta = rand(-25,25);
let tracked = false;
let gamray = Obj_Create(OBJ_SINUATE_LASER);
Obj_SetPosition(gamray,GetX,GetY);
Obj_SetSpeed(gamray,1);
Obj_SetAngle(gamray,theta+dtheta);
ObjShot_SetGraphic(gamray,GREEN41);
ObjSinuateLaser_SetWidth(gamray,4);
ObjSinuateLaser_SetLength(gamray,30);
while(!Obj_BeDeleted(gamray)){
while(tracked == false){
if(GetDistance(GetPlayerX,GetPlayerY,Obj_GetX(gamray),Obj_GetY(gamray)))<150){
Obj_SetAngle(gamray,atan2(GetPlayerY-GetY,GetPlayerX-GetX));
Obj_SetSpeed(gamray,4);
tracked = true;
}
yield;
}
if(Obj_GetY(gamray)>GetClipMaxX){
Obj_SetAngle(gamray,180-Obj_GetAngle(gamray));
}
yield;
}
}
...
function GetDistance(x1,y1,x2,y2){
return((((x2-x1)^2)+((y2-y1)^2))^(1/2);
}

I get an error saying I have mismatched braces somewhere in this task. Where is it?

Fetch()tirade

  • serial time-waster
Re: Danmakufu Q&A/Problem Thread v3
« Reply #235 on: February 21, 2010, 01:35:34 AM »
         if(GetDistance(GetPlayerX,GetPlayerY,Obj_GetX(gamray),Obj_GetY(gamray)))<150){

   function GetDistance(x1,y1,x2,y2){
      return((((x2-x1)^2)+((y2-y1)^2))^(1/2);
   }


Wrong number of parentheses. Put another one after if.

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread v3
« Reply #236 on: February 21, 2010, 02:02:50 AM »
Ah. That worked.

Next issue: I can't get AddShot to work correctly.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #237 on: February 21, 2010, 02:18:26 AM »
It would help if we knew what you were doing, but I'm pretty sure I know what it is already.

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

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread v3
« Reply #238 on: February 21, 2010, 02:32:32 AM »
Here's a sample of broken AddShot:
Code: [Select]
//Moving, shooting wall laser:Crazy Wall
task crazywall{
let spawnpoint = 0;
let direction = 0;
if(GetPlayerX>GetCenterX){
spawnpoint = GetClipMinX;
direction = 0;
}else{
spawnpoint = GetClipMaxX;
direction = 180;
}
CreateLaserA(1,spawnpoint,0,GetCenterX,25,AQUA03,60);
SetLaserDataA(1,0,direction,0,0,0,90);
SetLaserDataA(1,60,direction,0,0,0.25,90);
SetShotKillTime(1,600);
ascent(a in 0..20){
CreateLaserC(2,0,0,4,30,AQUA41,0);
SetLaserDataC(2,0,4,90,0,0,0);
ascent(b in 0..10){
AddShot(30*a,1,2,GetCenterX*b/10);
}
ascent(b in 0..9){
AddShot(30*a+15,1,2,GetCenterX*b/9);
}
}
FireShot(1);
}

Edited; the code means the wall will spawn on the side of the field the player's not on.
« Last Edit: February 21, 2010, 02:35:16 AM by AweStriker Nova »

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #239 on: February 21, 2010, 02:36:09 AM »
AddShot(30*a,1,2,GetCenterX*b/10);

You're telling it to shoot at GetCenterX*b/10 from the base of the laser. GetCenterX just means 244 so you're telling it to shoot at 244*b/10 from the laser's base along the laser.

(Does that even make sense?)
<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.