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

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile

Re: Danmakufu Q&A/Problem Thread II
« Reply #271 on: November 09, 2009, 02:17:40 AM »
How would i make bullets that start at the top left corner(32, 16) fill all of X and Y of the field in a downward, right way every frame? ive tried using ascents but it just spawns them at the same time. like this:

« Last Edit: November 09, 2009, 02:26:49 AM by Demonbman »

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #272 on: November 09, 2009, 02:30:26 AM »
Put in a yield after you spawn the bullet.

I try to to refrain from ascents, because it limits you to use a limited number of bullets.  I'd rather use loop, because there's no limit, but everyone has their thing I guess.


EDIT: If you're using ascent to make, oh lets say, 30 bullets spawn, instead of using
Code: [Select]
ascent(i in 0..30){
bullets go here;
}

Use instead
Code: [Select]
loop(30){
bullets go here;
}


and if you want to shoot 30 bullets out of there, every frame, you'd want to put in
Code: [Select]
loop{
loop(30){ bullets go here;}
yield;}

But if you microthread, and want stuff to happen afterwords, you'd want to use that definition in a task instead.

Code: [Select]
stuff happens;
stuff happens;
loop(30){yield;}
I want this to happen now;
stuff happens;


///somewhere in the script_stage_main brackets///

task I want this to happen now{
loop{ stuff happens; yield; }
}
« Last Edit: November 09, 2009, 02:37:13 AM by Fujiwara no Mokou »

Re: Danmakufu Q&A/Problem Thread II
« Reply #273 on: November 09, 2009, 02:36:46 AM »
I tried that and it does the same thing, im using CreateShotAs as well.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #274 on: November 09, 2009, 02:37:55 AM »
I tried that and it does the same thing, im using CreateShotAs as well.


Then put the yield at wherever FireShot is, because that's the one that actually fires the bullet.

Re: Danmakufu Q&A/Problem Thread II
« Reply #275 on: November 09, 2009, 02:42:20 AM »

Then put the yield at wherever FireShot is, because that's the one that actually fires the bullet.
Code: [Select]
if(frame%40==0){
ascent(x in 2..60){
ascent(y in 1..60){
CreateShotA(0, 31*x, 16*y, 1);
SetShotDataA(0, 0, 0, 0, 0, 0, 0, BLUE01);
SetShotDataA(0, 20, 2, 90, 0, 0, 0, BLUE01);
yield;FireShot(0);
}}}//x,y,frame closure in order
this is what i have been using, and its in the mainloop.
« Last Edit: November 09, 2009, 02:44:27 AM by Demonbman »

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #276 on: November 09, 2009, 02:49:42 AM »
How would i make bullets that start at the top left corner(32, 16) fill all of X and Y of the field in a downward, right way every frame? ive tried using ascents but it just spawns them at the same time. like this:



Try using delayed bullets...

Re: Danmakufu Q&A/Problem Thread II
« Reply #277 on: November 09, 2009, 02:50:54 AM »

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #278 on: November 09, 2009, 02:51:18 AM »
mainloop

Gah, I hate arrays.  You really should microthread. It makes things a lot easier.

Re: Danmakufu Q&A/Problem Thread II
« Reply #279 on: November 09, 2009, 02:53:55 AM »
Gah, I hate arrays.  You really should microthread. It makes things a lot easier.

been there, tried that, failed miserably  :V

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #280 on: November 09, 2009, 02:58:49 AM »
how?
CreateShot01(x, y, velocity, angle, graphic, delay);
CreateShotA(ID, x, y, delay);
SetShotDataA(..., ...);
FireShot(ID);

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #281 on: November 09, 2009, 03:00:03 AM »
It's pretty simple.  Before @Initialize or after @Finalize, load up your task and tell what it does.  Microthreading is essential if you want to make good scripts without confusing yourself, and if you want stuff to happen after one another or if other standards are met, or if you want timed shots so they are in sync with music or etc.


Code: [Select]
script_enemy_main{


@Initialize{
stuffhappens;
}


@DrawLoop{
}

@MainLoop{
yield;}


@Finalize{
}


task stuffhappens{  CreatShot...whatever you want to happen...
  }
}


If you want stuffhappens to repeat over and over again, simply put the task in a loop, and a yield at the end of it.  It makes things VERY easy to use, because it doesn't load up over and over again every frame, like @MainLoop. That can really mess things up.  Microthreading a task can make it happen just once, or as many times as you want.
« Last Edit: November 09, 2009, 03:07:18 AM by Fujiwara no Mokou »

Re: Danmakufu Q&A/Problem Thread II
« Reply #282 on: November 09, 2009, 03:16:32 AM »
*woops clicked the wrong button*
Thanks Mokou!

Lawence Codye

  • The Nine Tails of Subconscious...
  • Come & your desires shall all become reality...
Re: Danmakufu Q&A/Problem Thread II
« Reply #283 on: November 09, 2009, 04:10:51 AM »
Okay, next Question(s)...
1. Do I use a separate task if I want to change the SetEffect_SetVertexUV coordinates of my player's Options...or do I just place that info somewhere in the task the handles my options...?

2. How do I get a line to form a circle like below(if a tutorial tells me how, point me to it)...
I am the Nine Tails of Subconscious...

Come & your greatest desires will be reality...

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #284 on: November 09, 2009, 06:42:45 AM »
Okay, next Question(s)...
1. Do I use a separate task if I want to change the SetEffect_SetVertexUV coordinates of my player's Options...or do I just place that info somewhere in the task the handles my options...?

2. How do I get a line to form a circle like below(if a tutorial tells me how, point me to it)...
2. you can visit nuclear cheese's effect object tutorial (here)... just form lots of vertices... I think...

ChaoStar

  • Dark History Boy
Re: Danmakufu Q&A/Problem Thread II
« Reply #285 on: November 09, 2009, 04:04:13 PM »
So, for some reason, Danmakufu won't load any single spellcards. All I can get to work are entire boss fights and such.

I run Danmakufu on windows XP, via parallels.

Re: Danmakufu Q&A/Problem Thread II
« Reply #286 on: November 09, 2009, 04:10:14 PM »
@ChaoStar:

By "wont load", do you mean crashes on start up, or wont appear in the game menu? Any and all text files that do not start with #TouhouDanmakufu will not appear in the main menu. This way you can make runnable scripts that cannot be played individually (like how full games consist of many small scripts but none of them appear in the menu), perhaps this is the issue? Screenshots would be helpful towards clarification.


@UltimaRepman
:
1. Handle the ObjEffect_SetVertexUV in the option task, it's so much easier.

2. Unfortunately, Danmakufu doesn't have a function capable of clipping the image into a circle (available to us, that is, the Magic Circle function does this internally... Fffffff), so you'll have to make an ObjEffect with a trillion vertices, like AlwaysThe⑨ said.
« Last Edit: November 09, 2009, 04:17:34 PM by Naut »

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #287 on: November 09, 2009, 07:02:19 PM »
Unfortunately, Danmakufu doesn't have a function capable of clipping the image into a circle (available to us, that is, the Magic Circle function does this internally... Fffffff), so you'll have to make an ObjEffect with a trillion vertices, like AlwaysThe⑨ said.


Do you mean make a straight image and bend it into a circle?  It's actually pretty simple, and I can show you how to do it if you want.  I can even take that circle and bend it into a star, or whatever other shape you can think of.  Both pointy edges and smooth.  It took a while, but I've figured it out.

ChaoStar

  • Dark History Boy
Re: Danmakufu Q&A/Problem Thread II
« Reply #288 on: November 09, 2009, 08:54:36 PM »
@ChaoStar:

By "wont load", do you mean crashes on start up, or wont appear in the game menu? Any and all text files that do not start with #TouhouDanmakufu will not appear in the main menu. This way you can make runnable scripts that cannot be played individually (like how full games consist of many small scripts but none of them appear in the menu), perhaps this is the issue? Screenshots would be helpful towards clarification.

By 'won't load', I mean it crashes upon loading the spellcard. It gives me no error message, either.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #289 on: November 09, 2009, 10:19:57 PM »
By 'won't load', I mean it crashes upon loading the spellcard. It gives me no error message, either.

The way I see it, one of three things could be happening. One, you're trying to load an object effect at Initialize without putting in yield; first.  Two, you're spawning infinite bullets, or calling infinite tasks all in one frame by placing it in a loop and forgetting to put yield; in it. Or three, you're loading a filetype that danmakufu doesn't recognise (a different type of text file, a music file that isn't .mp3, .ogg, or .wav.

Try looking over the script.  If the problem persists, post it here.

Lawence Codye

  • The Nine Tails of Subconscious...
  • Come & your desires shall all become reality...
Re: Danmakufu Q&A/Problem Thread II
« Reply #290 on: November 09, 2009, 10:44:54 PM »

Do you mean make a straight image and bend it into a circle?  It's actually pretty simple, and I can show you how to do it if you want.  I can even take that circle and bend it into a star, or whatever other shape you can think of.  Both pointy edges and smooth.  It took a while, but I've figured it out.

yes...this is what I mean...& could you please?
I am the Nine Tails of Subconscious...

Come & your greatest desires will be reality...

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #291 on: November 10, 2009, 06:03:22 AM »
Derrrrrp.
Code: [Select]
CreateShotA(idused, ((idused%48)*8)+32, (floor(idused/48)*8)+16), 5);
SetShotDataA(idused,0,0,270,0,0,0,WHITE05);
FireShot(idused);
gives me error 「CreateShotAの引数の数が違います」, which means "CreateShotA has the wrong number of arguments", except... there are four. Which there should be. I dun get it. Only thing I can think of is idused gets too big or something; it goes from 0 to 2351.

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

Re: Danmakufu Q&A/Problem Thread II
« Reply #292 on: November 10, 2009, 06:14:03 AM »
Only thing I can think of is idused gets too big or something; it goes from 0 to 2351.

Probably this, yeah. The expanded shotdata script can only go up to 255, so it's possible that the same holds true for the standard functions as well.

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem Thread II
« Reply #293 on: November 10, 2009, 06:30:33 AM »
Code: [Select]
(floor(idused/48)*8)+16)

Code: [Select]
( ( ) ) )

Don't feel bad, we all make that mistake sometimes...

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #294 on: November 10, 2009, 06:31:06 AM »
HAHAHA IT WORKS I'M A GENIUS

« Last Edit: November 10, 2009, 06:39:25 AM by Drake »

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #295 on: November 10, 2009, 08:31:05 AM »
FFFF why is programming functions which are essential so hard in danmakufu. Or is just because I am an idiot. For Iyajitsu ( and my own use ) I am trying to program a spellcircle that shrinks in proportion with the given timer ( Hey, sounds familiar like my lifebar question ).

The math is this time not the problem, I think. More like the smoothness of the scaling. Spellcircle is 0.68 after it is done expanding/animating. So starting scale is 0.68.

let scale = 0.68;
let p = 0;   

- Inside @initialize -->  scale = 0.68/GetTimer
- Script boots . . .  'p' increases and decreases to its starting size --> 0.68.
- A task with delay of 60 frames does:   p -= scale;

It works, as timer reaches 0 the circle is also like gone/small. But the stepping is unnatural and not smooth. I want a similar feeling like the build in spellcircle or the ones you see in the official games.

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: Danmakufu Q&A/Problem Thread II
« Reply #296 on: November 10, 2009, 09:36:27 AM »
let scale = 0.68;
let p = 0;   

- Inside @initialize -->  scale = 0.68/GetTimer
- Script boots . . .  'p' increases and decreases to its starting size --> 0.68.
- A task with delay of 60 frames does:   p -= scale;

It works, as timer reaches 0 the circle is also like gone/small. But the stepping is unnatural and not smooth. I want a similar feeling like the build in spellcircle or the ones you see in the official games.

try doing something like 0.68/(a-GetTimer), where a is the starting timer... so as the timer decreases the value 0.68 is divided by increases... not sure if this would work though...
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread II
« Reply #297 on: November 10, 2009, 10:57:44 AM »
Try making a variable that stores GetTimer*60-1 and decrements every frame instead. Then you can update the circle every frame to make it smooth instead of jumpy every second. The -1 is so that it disappears the frame before the timer runs out and doesn't just stay there in as a minuscule circle.
« Last Edit: November 10, 2009, 10:59:50 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.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #298 on: November 10, 2009, 11:54:45 AM »
Try making a variable that stores GetTimer*60-1 and decrements every frame instead. Then you can update the circle every frame to make it smooth instead of jumpy every second. The -1 is so that it disappears the frame before the timer runs out and doesn't just stay there in as a minuscule circle.

size = (0.68)/(GetTimer*60-1);

=

win

Thank you. You are awesome. Now that this is tackled, time to script the bursting animation of the inner circle.

Henry

  • The observer
  • Exploring to the new world of Danmaku
Re: Danmakufu Q&A/Problem Thread II
« Reply #299 on: November 10, 2009, 01:07:36 PM »
(**Back to here at last**)
Can I reflect the graphics by reversing the x-coordinates in SetGraphicRect?
Old/Forgotten member.

Old Patchouli Project was outdated but new one is in progress.