Author Topic: Danmakufu Q&A/Problem thread number 4  (Read 206535 times)

Schezo

  • en-counse
Re: Danmakufu Q&A/Problem thread number 4
« Reply #630 on: December 20, 2010, 06:00:00 AM »
I can't seem to figure out why this code is doing this with ascent.

Code: [Select]
task fire{
loop{
ascent(i in -29..30){
ascent(j in -14..15){
CreateShot01(GetX, GetY, 3, 90+(i*4), 54, 5);
CreateShot01(GetX, GetY, 1.5, 90+(j*9), 225, 5);
} }
wait(120);
}
}

So, when this task runs, it slows down the framerate and each 1 bullet that I graze gives me 50+ grazes so I assume there a really hundreds of bullets on top of each other but I can't figure out how to make them only one bullet/ spread out.

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem thread number 4
« Reply #631 on: December 20, 2010, 06:05:48 AM »
The outer ascent runs 58 times, and the inner ascent (called once for every loop through the outer one) runs 28 times. This means it's creating 58x28 = 1624 bullets every 120 frames. A lot of them are stacked on top of each other.
I don't know what you're trying to do, so I can't give you the fixed code, but that explains the slowdown.

Schezo

  • en-counse
Re: Danmakufu Q&A/Problem thread number 4
« Reply #632 on: December 20, 2010, 06:09:58 AM »
Hmm, if I'm trying to just fire some spreads of bullets, what would be the correct way to run that without running the loop more than once so the bullets don't stack on each other?

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem thread number 4
« Reply #633 on: December 20, 2010, 06:24:53 AM »
(Note in advance: When I say "loop," I mean all of loop{}, while(){}, or ascent(){} as a general term, not just loop{}.)
For a simple spread, you'd just need one loop, not two. I think you're just uncertain about how exactly ascent loops work. What they do is create the variable that you specify and set its value to the first number, then loop through the code inside while incrementing that variable by one every time until it hits the second number. If you're just going to be changing one variable - in this case, the angle - you only need one loop. If there's a loop inside a loop, the inner loop will fully execute once for every time the outer loop runs, which isn't what you want. You probably want the stuff involving j to be a separate loop entirely.

Schezo

  • en-counse
Re: Danmakufu Q&A/Problem thread number 4
« Reply #634 on: December 20, 2010, 06:31:39 AM »
Ah ok, thank you so much!  It works how I want it to now, so I should stop combining loops from now on as they usually just make unwanted problems.

Zengar Zombolt

  • Space-Time Tuning Circle - Wd/Fr
  • Green-Red Divine Clock
Re: Danmakufu Q&A/Problem thread number 4
« Reply #635 on: December 21, 2010, 11:26:45 PM »
Buncha questions here!
1) In which layer is the life bar drawn? As in, what layers are ok to draw Effect Objects over it.
2) Does GetTimer give out anything if there's no SetTimer?
3) Does GetTimer deliver the correct time if there's over 99 seconds left?

Schezo

  • en-counse
Re: Danmakufu Q&A/Problem thread number 4
« Reply #636 on: December 22, 2010, 01:15:40 AM »
For 2 and 3, I think this is what you mean.

2. From my testing (it was brief) when I didn't specify SetTimer it gave me a value of 15.
3. Yes, like in the normal Touhous if you specify 120 sec it will just show 99 until the value is <99 then it will count regularly.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #637 on: December 22, 2010, 04:48:56 AM »
Those questions aren't exactly hard to test on your own... :3
<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.

Zengar Zombolt

  • Space-Time Tuning Circle - Wd/Fr
  • Green-Red Divine Clock
Re: Danmakufu Q&A/Problem thread number 4
« Reply #638 on: December 22, 2010, 11:38:03 PM »
Well I don't have enough time to test at all so yeah. :P
Anyways thanks for the third answer, but I already had a good idea to cover that. Thanks again anyways!

Re: Danmakufu Q&A/Problem thread number 4
« Reply #639 on: December 25, 2010, 03:30:24 PM »
Hello I have a question.

Code: [Select]
http://pastebin.com/xXUZkxKZcode by : Supreme Gamesmaster

I can't make the task to work  :( and I don't know what's wrong.
Hey There !

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #640 on: December 25, 2010, 07:28:28 PM »
I'm assuming you call the task once and then it should run forever. Otherwise you'd be instantiating the thresholds over and over every time you call it.
In which case, your loop(1){ should be loop{ . The former runs once, the latter runs forever. As it stands, the checking code only runs once.



Also, not saying this wouldn't work, since it should, but what would be a more efficient code is if you kept only one threshold counter variable and an array of possible points. You can also just have it run only until you max out points. Like this:

let pointThreshold = [1,400,600,800,1000,etc];
let thresholdCount = 0;

while( thresholdCount<8 ){ //At least, according to your code it's 8.
         if(GetPoint >= pointThreshold[thresholdCount]) {
            ExtendPlayer(1);
            thresholdCount++;
         }
}

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

Re: Danmakufu Q&A/Problem thread number 4
« Reply #641 on: December 26, 2010, 08:37:10 AM »
Quote from Drake

Yay it's working :D thanks
Hey There !

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem thread number 4
« Reply #642 on: December 26, 2010, 03:46:54 PM »
I'm having some more troubles with the AddShot function. How do I get an AddShotted bullet to recognise the angle of the parent shot, and continue in that same direction?

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #643 on: December 26, 2010, 09:06:31 PM »


Think of AddShot like some upside-down tree.

You script the bullets from trunk to branches to smaller branches, then compile the smaller branches into the larger branches, then the larger branches into the trunk. The bullets are fired then from trunk and up.

You can't make the child recognize the angle of the parent, but if you're ascenting through the bullets (as you probably should be doing), then you just use the same counting variable. How exactly are you building your pattern?

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

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #644 on: December 26, 2010, 09:49:48 PM »
If you know the starting angle and angular rotation of the bullet, and the time elapsed, you can get the current angle with some calculations and apply it from there. This sort of thing is much more easily handled with shot objects though since you can just create a new shot at the position of the shot object with Obj_GetX and Obj_GetY as well as get the current angle of the shot object with Obj_GetAngle.

It's worth looking into if you're comfortable with AddShot and the like already as that's the next step in Danmakufu scripting anyway.
<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.

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem thread number 4
« Reply #645 on: December 27, 2010, 05:05:27 PM »
Yes, I nailed it after some more tinkering about, thanks. I was actually planning on remaking the pattern I'm building and use object bullets instead of AddShots, but I've run into another snag. I want the bullet spawn to move in a smooth clockwise circle around the boss, starting at GetEnemyX,GetEnemyY-25. I know it involves the use of sin and cos, but I don't fully understand how they work and my random changing of the variables isn't doing much for me either.

Is there a tutorial or something for tricky x and y coordination understanding?
« Last Edit: December 27, 2010, 08:14:31 PM by MasterSpark »

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #646 on: December 27, 2010, 08:30:54 PM »
This was covered in the intermed tutorial. SIMPLE TRIGONOMETRYYYYYY



The middle point is your point of origin. If you want to spawn a bullet at (x,y) away from your origin (ox,oy), you spawn your bullet at
ox+cos(A)*L
oy+sin(A)*L

But really just read the intermed tutorial. The above image really has all you need, but the tutorial goes through examples that make it easy to understand.

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

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem thread number 4
« Reply #647 on: December 27, 2010, 09:12:04 PM »
Ah, now that was just what I needed! Thanks a lot.  :)

Zengar Zombolt

  • Space-Time Tuning Circle - Wd/Fr
  • Green-Red Divine Clock
Re: Danmakufu Q&A/Problem thread number 4
« Reply #648 on: December 27, 2010, 09:46:35 PM »
Quick question!
Is it possible to use AnimationData (Animated bullets) on a Player's Shot Data?

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem thread number 4
« Reply #649 on: December 28, 2010, 06:53:25 AM »
Quick question!
Is it possible to use AnimationData (Animated bullets) on a Player's Shot Data?
And this is another question that can be simply tested out yourself with minimum effort you know. Afaik, it doesn't work because player shots are different than regular shots, even though the shot sheets are scripted similar.

And even if it is not possible, you can work your way around using effect objects or object bullets with swapping texture.

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem thread number 4
« Reply #650 on: December 28, 2010, 08:44:32 AM »
It's possible.

Re: Danmakufu Q&A/Problem thread number 4
« Reply #651 on: December 28, 2010, 06:50:52 PM »
hi
I have a little problem about sprite animation, I connot animate the boss when he create bullets
the animation of the sprite holds four thumbnail

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #652 on: December 28, 2010, 07:31:10 PM »
hi
I have a little problem about sprite animation, I connot animate the boss when he create bullets
the animation of the sprite holds four thumbnail

We're gonna have to see your code. Not to be rude or anything, but since Danmakufu does not inherently have anything that handles animation for you, that means you had to write the code that does the animation so there's probably something wrong with it.
<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.

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #653 on: December 28, 2010, 07:50:09 PM »
blargel-sama is so patient

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

Marco

  • DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI
  • DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI
Re: Danmakufu Q&A/Problem thread number 4
« Reply #654 on: December 28, 2010, 09:39:15 PM »
Hi!
I've a problem with bouncing bullets.
My script is here: http://pastebin.com/4EYRvMQA
I used the tutorial-like-script that I found around in this forum to try BUT IT WON'T WORK BWAAAA!!!!
Can you help me please?
PS: I havn't used default bullets... My bullets are named 01,02,03,04,05,06,07,08.
DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI

CK Crash

  • boozer
Re: Danmakufu Q&A/Problem thread number 4
« Reply #655 on: December 28, 2010, 09:56:50 PM »
You need a yield; in @MainLoop. Otherwise, when the task yields to @MainLoop, it will never resume (specifically, the part of the bullet task that checks if it should be bouncing).

Marco

  • DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI
  • DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI
Re: Danmakufu Q&A/Problem thread number 4
« Reply #656 on: December 28, 2010, 10:04:56 PM »
Oh my *die*
That's right I forgot the yield huahua thanks Lucas!
DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI DANZAI

KrackoCloud

  • I don't mean to be greedy...
  • ... but white rice is my favorite food.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #657 on: December 28, 2010, 11:45:09 PM »
How can I turn all the bullets into point / star items without ending the spell card?

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #658 on: December 28, 2010, 11:46:27 PM »
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."

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #659 on: December 29, 2010, 05:10:27 AM »
How can I turn all the bullets into point / star items without ending the spell card?

Now the real question is:
How can I end the spell card without turning all the bullets into point/star items?
I try checking if the boss has a low enough life (I used 10 HP of 1000 Max), delete all the bullets, then AddLife(-GetLife);
But the bullets still convert into star items. Do I need to use all object bullets (ObjShot_ToItem)? :ohdear:

Oh, the star items are so ugly, no matter what~
« Last Edit: December 30, 2010, 04:26:35 AM by Mewkyuu »