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

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #30 on: October 24, 2009, 10:46:10 PM »
hm...
Code: [Select]
#TouhouDanmakufu
#Title[Flower Test]
#Text[????]
#Player[FREE]
#ScriptVersion[2]
script_enemy_main {
let BossImage = "script\img\ExRumia.png";
let frame = -60;
let a = 0;
let num = 10;
let graphic = [RED12, ORANGE12, YELLOW12, GREEN12, AQUA12, BLUE12, PURPLE12, WHITE12];
@Initialize {
SetLife(2400);
SetDamageRate(40, 0);
SetEnemyMarker(true);
LoadGraphic(BossImage);
SetMovePosition02(GetCenterX, GetClipMinY+100, 60);
CutIn(KOUMA,"「花の色は良いですか?」", "", 0, 0, 0, 0);
SetScore(1000000);
SetDurableSpellCard;
}
@MainLoop {
SetCollisionA(GetX, GetY, 32); //32 for boss, 10 for fairy
SetCollisionB(GetX, GetY, 24);//24 for boss, 5 for fairy
if(frame == 90) {
loop(num) {
ascent (i in 0..8) {
ascent (j in 0..8) {
CreateShot01(GetX, GetY, 0.75*(i+j*0.5)+1, a+i*2.75, graphic[j], 10);
CreateShot01(GetX, GetY, 0.75*(i+j*0.5)+1, a-i*2.75, graphic[j], 10);
}
}
a+=360/num;
}
a+=9.5;
frame = 0;
}
frame++;
}
@DrawLoop {
SetTexture(BossImage);
SetGraphicRect(0, 0, 64, 64);
DrawGraphic(GetX, GetY);
}
@Finalize {
DeleteGraphic(BossImage);
}
}

Re: Danmakufu Q&A/Problem Thread II
« Reply #31 on: October 25, 2009, 04:42:48 AM »
While working on my Halloween Contest entry, I was fiddling with the BGM for a spellcard, and found that the MP3 I'm using doesn't work when I call it with #BGM. Strange, because a test spellcard I made the other day also uses an MP3, and that track works just fine.

Should I find a different MP3, or come back to that later?

Thaws

  • _m廿廿m_
Re: Danmakufu Q&A/Problem Thread II
« Reply #32 on: October 25, 2009, 04:59:32 AM »
While working on my Halloween Contest entry, I was fiddling with the BGM for a spellcard, and found that the MP3 I'm using doesn't work when I call it with #BGM. Strange, because a test spellcard I made the other day also uses an MP3, and that track works just fine.

Should I find a different MP3, or come back to that later?
I've never gotten a .mp3 to work and somehow it works when converted to .wav, maybe you can try that.

Re: Danmakufu Q&A/Problem Thread II
« Reply #33 on: October 25, 2009, 05:13:47 AM »
I've never gotten a .mp3 to work and somehow it works when converted to .wav, maybe you can try that.
I tried a freeware converter I found, and not only did it not work, but it magically changed the file size from 4.5 MB to 30 MB.  :V

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #34 on: October 25, 2009, 05:17:04 AM »
wav files are unnecessarily huge

don't worry about it

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

Re: Danmakufu Q&A/Problem Thread II
« Reply #35 on: October 25, 2009, 05:34:14 AM »
oh wut

There was an extraneous LoadGraphic(BossImage); keeping the MP3 from playing. Go figure.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #36 on: October 25, 2009, 07:59:32 AM »
When mp3s or wav files don't play, use Audacity (freeware and very good program) to change their format such as hz/channels etc. No need to nessecary turn them into wav files.

Henry

  • The observer
  • Exploring to the new world of Danmaku
Re: Danmakufu Q&A/Problem Thread II
« Reply #37 on: October 25, 2009, 01:27:01 PM »
Can somebody tell me about the usage of "~" character in Danmakufu?
Old/Forgotten member.

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #38 on: October 25, 2009, 02:58:52 PM »
Mostly used with GetCurrentScriptDirectory. Like:

GetCurrentScriptDirectory ~ "pathname/file.txt"

 Further more I don't know.

Cabble

  • Ask me about my Cat.
  • Not unwilling to shank you.
Re: Danmakufu Q&A/Problem Thread II
« Reply #39 on: October 25, 2009, 03:01:52 PM »
Whenever I try to play this no bullets come out.

I know it has something to do with the shotdata but I don't know what!

Code: [Select]
#TouhouDanmakufu
#Title[Water Sign [Flowing Current]]
#Text[]
#BackGround[Default]
#PlayLevel[Probably Hard]
#ScriptVersion[2]

script_enemy_main{
   let frame = 0;
   let count = 0;
   let angle2 = 15;
   let count2 = 0;
#include_function "lib\ExpandedShotData\shot_replace.dnh";

    @Initialize{
        SetLife(8000);
      SetScore(100000);
      SetMovePosition01(GetCenterX, GetCenterY - 60, 3);
      SetInvincibility(300);
     
      CutIn(YOUMU, "Water Sign [Flowing Current]", 0, 0, 0, 0, 0);
shotinit;
    }

    @MainLoop{
      SetCollisionA(GetX, GetY, 32);
      SetCollisionB(GetX, GetY, 16);
frame+=5;
count++;
count2++;
if(count==2){
CreateShot01(GetX, GetY, 2, frame+GetAngleToPlayer, SP02, 0);
CreateShot01(GetX, GetY, 2, 0-frame+GetAngleToPlayer, SP02, 0);
count=0;
}
if(count2==72){
loop(30){
CreateShot01(GetX, GetY, 2, GetAngleToPlayer-angle2, WHITE02, 0);
angle2--;
}
angle2=15;
count2 =0;
}
}
    @DrawLoop{}
    @Finalize{}

    @BackGround{}

}//end script
I had a teacher who used to play radiohead during class once.

ONCE.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #40 on: October 25, 2009, 03:07:48 PM »
Maybe load your shotdata inside @Initialize ^^   

Cabble

  • Ask me about my Cat.
  • Not unwilling to shank you.
Re: Danmakufu Q&A/Problem Thread II
« Reply #41 on: October 25, 2009, 03:10:53 PM »
And now it doesn't call the extra bullets that are in that shotdata and raises and error ^^
I had a teacher who used to play radiohead during class once.

ONCE.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #42 on: October 25, 2009, 03:16:21 PM »
And now it doesn't call the extra bullets that are in that shotdata and raises and error ^^

Odd. I copypasted your script from the code section and works fine for me. Spawns bullets and stuff.

Re: Danmakufu Q&A/Problem Thread II
« Reply #43 on: October 25, 2009, 03:17:07 PM »
While working on my Halloween Contest entry, I was fiddling with the BGM for a spellcard, and found that the MP3 I'm using doesn't work when I call it with #BGM. Strange, because a test spellcard I made the other day also uses an MP3, and that track works just fine.

Should I find a different MP3, or come back to that later?

So far i've managed mp3s to work, i usually record a "video?" with Hypercam or rip videos off youtube with the sound i want, then i put it into windows movie maker on the external audio portion and save it, so it saves as .wma then i use a freeware .wma > mp3 converter, and with that so far all mp3s have worked. (Note: when i just change the extension wma > mp3 without applying a converter it doesnt work, maybe that was the problem with yours?)

Can somebody tell me about the usage of "~" character in Danmakufu?

I remember i read somewhere ~ is used to concatenate 2 strings of characters, but like Helepolis explained earlier is mainly used to concatenate the string returned by GetCurrentScriptDirectory and the rest of the directory, but it could have other uses
« Last Edit: October 25, 2009, 03:19:23 PM by Sakura665 »

Cabble

  • Ask me about my Cat.
  • Not unwilling to shank you.
Re: Danmakufu Q&A/Problem Thread II
« Reply #44 on: October 25, 2009, 03:18:43 PM »
It keeps giving me errors about "SP02"
I had a teacher who used to play radiohead during class once.

ONCE.

Re: Danmakufu Q&A/Problem Thread II
« Reply #45 on: October 25, 2009, 03:24:53 PM »
It keeps giving me errors about "SP02"

Weird, i copy/pasted your script and it doesnt give me an error either, maybe you should check your ExpandedShotData scripts

Cabble

  • Ask me about my Cat.
  • Not unwilling to shank you.
Re: Danmakufu Q&A/Problem Thread II
« Reply #46 on: October 25, 2009, 03:28:07 PM »
Re-downloaded V2, still didn't work. Bleh.
I had a teacher who used to play radiohead during class once.

ONCE.

Cabble

  • Ask me about my Cat.
  • Not unwilling to shank you.
Re: Danmakufu Q&A/Problem Thread II
« Reply #47 on: October 25, 2009, 03:34:19 PM »
Never mind i fixed it, it spawns them by the ids in shot_all  :V
I had a teacher who used to play radiohead during class once.

ONCE.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #48 on: October 25, 2009, 03:40:42 PM »
Then I guess there is something dodgy with the replacement words. I believe Onthenet already said some of them were dodgy/bugged.

You people should also learn to spawn them by IDs you know :V Makes it flexible when you want to spawn a rainbow coloured pattern with the same type of bullets. Saves you trouble of making arrays.

PS: if you are not far with your shots, I would either advice you to use v4 of ExpandedShotData. They are better because the graphicrects are fixed. Though you have to modify the IDs to find the same bullet again.

Cabble

  • Ask me about my Cat.
  • Not unwilling to shank you.
Re: Danmakufu Q&A/Problem Thread II
« Reply #49 on: October 25, 2009, 04:03:08 PM »
I thought it didn't have a shot replace  ???
I had a teacher who used to play radiohead during class once.

ONCE.

Re: Danmakufu Q&A/Problem Thread II
« Reply #50 on: October 25, 2009, 04:10:06 PM »
So far i've managed mp3s to work, i usually record a "video?" with Hypercam or rip videos off youtube with the sound i want, then i put it into windows movie maker on the external audio portion and save it, so it saves as .wma then i use a freeware .wma > mp3 converter, and with that so far all mp3s have worked. (Note: when i just change the extension wma > mp3 without applying a converter it doesnt work, maybe that was the problem with yours?)
It turns out that the problem with my mp3 was that I had an extra LoadGraphic statement. Not sure why that interfered, but my BGM works now.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #51 on: October 25, 2009, 04:23:35 PM »
I thought it didn't have a shot replace  ???

It doesn't therefor you should learn to spawn them by ID :V

Cabble

  • Ask me about my Cat.
  • Not unwilling to shank you.
Re: Danmakufu Q&A/Problem Thread II
« Reply #52 on: October 25, 2009, 04:26:39 PM »
It doesn't therefor you should learn to spawn them by ID :V

Well that's easy. Just go through the list until I find which one I want :D
I had a teacher who used to play radiohead during class once.

ONCE.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #53 on: October 25, 2009, 04:50:16 PM »
I've been working this for a while, but I don't quite get the ascent statement.  I know how to make it work, but I don't understand how it works or what it does.
Code: [Select]
ascent( (variable) in (first value)..(limit value) ) {
    (statements)
}

What is all this?

Re: Danmakufu Q&A/Problem Thread II
« Reply #54 on: October 25, 2009, 04:52:04 PM »
If I had to guess, I'd say it's the same thing as a for loop in Java, where (variable) starts at (first value), runs the statements, then goes up by one and loops until it runs the statements at (last value).

Does that make sense?

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #55 on: October 25, 2009, 04:58:42 PM »
Oh, I get it.  So it's like a
Code: [Select]
variable++; but with a starting and ending limit, right?


If that's the case, how can I make the ending limit infinite?

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #56 on: October 25, 2009, 05:01:18 PM »
ascent(x in a..b){ *stuff* }

...does the following:

Danmakufu creates a temporary variable x that can be used inside the stuff. Then the *stuff* is repeated several times; once for x=a, once for x=a+1 and so forth until x=b-1.

Basically it is similar to a regular loop where you use a variable that is increased inside the loop, but it takes less time to type. I think I have never used the loop statement besides loop(n){ yield; }. I always use ascent.


Edit: Infinite?!. If you could do that, the program would freeze because it has to do infite things in a single frame. What exactly do you want to accomplish..?
« Last Edit: October 25, 2009, 05:03:33 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."

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #57 on: October 25, 2009, 05:10:27 PM »
Edit: Infinite?!. If you could do that, the program would freeze because it has to do infite things in a single frame. What exactly do you want to accomplish..?

Well, lets say the variable I'm using will represent an angle and I want that to keep increasing every frame.  If I put in a random number, lets say, 360, then it will keep doing it until about 2Pi radians.  But what if I want it to keep increasing past that, so it keeps making "circles"?  Sure, I could put in a rediculously high number, but it will still stop at some point.  It wouldn't have to do everything all at once as long as if I put in a yield statement somewhere in with the ascent.  So, do you know what the statement for infinity is?


EDIT: I'm not really using angles with it, I'm just using an example here.  I'm making something big, and I want to keep it a secret until it comes out.
« Last Edit: October 25, 2009, 05:14:17 PM by Fujiwara no Mokou »

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #58 on: October 25, 2009, 05:16:46 PM »
Um, I don't think there is, but it sounds like whatever you want to accomplish would be easier if you just had a task with a while(GetEnemyLife>0){ *stuff* } that gets called during @Initialize and that includes a yield; and a variable increment.

Also, if you really need to go to a point where the program doesn't execute your orders anymore because you give it too many per frame, I think it may be time to reconsider the script you are trying to make.
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."

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #59 on: October 25, 2009, 05:23:35 PM »
Um, I don't think there is, but it sounds like whatever you want to accomplish would be easier if you just had a task with a while(GetEnemyLife>0){ *stuff* } that gets called during @Initialize and that includes a yield; and a variable increment.

Also, if you really need to go to a point where the program doesn't execute your orders anymore because you give it too many per frame, I think it may be time to reconsider the script you are trying to make.


I already do.  And believe me, this is necessary.