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

Henry

  • The observer
  • Exploring to the new world of Danmaku
Re: Danmakufu Q&A/Problem Thread
« Reply #690 on: September 12, 2009, 05:12:55 AM »
The Select() function in Danmakufu can only allow 2 choice.

Is there anyway to make more than 2 choice? (In event script)
Old/Forgotten member.

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread
« Reply #691 on: September 12, 2009, 07:37:48 AM »
The only quite close immitated shaking I have seen was in CaSercan's EoSD Phantasm game. Meiling used a laser attack which shakes before it breaks into bullets. I was quite impressed by the effect.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread
« Reply #692 on: September 13, 2009, 05:45:36 AM »
That would only make the background shake, not the whole screen.
But if you want everything shake, you also need to make the bullets shake, too, and would be annoying, wouildn't it?
Um.. yeah.

Re: Danmakufu Q&A/Problem Thread
« Reply #693 on: September 13, 2009, 06:59:18 PM »
Im trying to run it, I installed applocale, and Japanese wasn't on the drop down list. Then I tried installing the japanese language files from the windows XP cd. It installed fine (I think) but Japanese is still not on the list. What should I do?

puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem Thread
« Reply #694 on: September 13, 2009, 07:33:06 PM »
Im trying to run it, I installed applocale, and Japanese wasn't on the drop down list. Then I tried installing the japanese language files from the windows XP cd. It installed fine (I think) but Japanese is still not on the list. What should I do?

Did you look all the way at the bottom? It's written in Japanese characters, so try using the last option if that looks unreadable to you.
Full Danmakufu game "Juuni Jumon - Summer Interlude" is done!
By the same person who made Koishi Hell 1,2 (except this game is serious)
Topic: http://www.shrinemaiden.org/forum/index.php/topic,9647.0.html

Re: Danmakufu Q&A/Problem Thread
« Reply #695 on: September 13, 2009, 08:02:42 PM »
Im trying to run it, I installed applocale, and Japanese wasn't on the drop down list. Then I tried installing the japanese language files from the windows XP cd. It installed fine (I think) but Japanese is still not on the list. What should I do?

Did you look all the way at the bottom? It's written in Japanese characters, so try using the last option if that looks unreadable to you.

Yes, I tried all the ones at the bottom, every time it said something like "your system can't run that language" or something.

Re: Danmakufu Q&A/Problem Thread
« Reply #696 on: September 14, 2009, 01:49:10 AM »
When using #include_script, is there any way to actually change the included script from the script that receives the data or does it only take everything from the script adn make a copy of it in the script with #include_script in it?

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread
« Reply #697 on: September 15, 2009, 12:57:47 AM »
I know there IS a way to enable/disable shooting/bombing, but is there a way to get whether shooting/bombing is enabled/disabled?

Re: Danmakufu Q&A/Problem Thread
« Reply #698 on: September 15, 2009, 02:31:16 AM »
I know there IS a way to enable/disable shooting/bombing, but is there a way to get whether shooting/bombing is enabled/disabled?
Since enabling/disabling shooting/bombing is manual, you can simply make a variable (like isDisabled or something) and make it True whenever you enable and False when ever you disable.

Then just pull out that variable when you want to know if it's enabled or disabled.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread
« Reply #699 on: September 15, 2009, 04:21:53 AM »
The Select() function in Danmakufu can only allow 2 choice.

Is there anyway to make more than 2 choice? (In event script)

Actually, no, but...

Code: [Select]
#TouhouDanmakufu
#Title[MENU FTW]
#Text[This is the description. Did you know that? Oh, sorry.]
#Player[FREE]
#ScriptVersion[2]
script_enemy_main {
    let number = 0;
    let orange = [255, 142, 78];
    let white = 255;
    let r1 = 0; let g1 = 0; let b1 = 0;
    let r2 = 0; let g2 = 0; let b2 = 0;
    let r3 = 0; let g3 = 0; let b3 = 0;
    @Initialize {
        SetLife(1);
    }

    @MainLoop {
    //////////////////////////////////
    ForbidBomb(true); ForbidShot(true);
    ///////////////////////////////////
    if(number == 0) {
    r1 = white; g1 = white; b1 = white;
    r2 = orange[0]; g2 = orange[1]; b2 = orange[2];
    r3 = orange[0]; g3 = orange[1]; b3 = orange[2];
    }
    if(number == 1) {
    r2 = white; g2 = white; b2 = white;
    r1 = orange[0]; g1 = orange[1]; b1 = orange[2];
    r3 = orange[0]; g3 = orange[1]; b3 = orange[2];
    }
    if(number == 2) {
    r3 = white; g3 = white; b3 = white;
    r1 = orange[0]; g1 = orange[1]; b1 = orange[2];
    r2 = orange[0]; g2 = orange[1]; b2 = orange[2];
    }
    ///////////////////////////////////
    if(number < 0) {
    number = 0;
    }
    if(number > 2) {
    number = 2;
    }
    if(GetKeyState(VK_UP) == KEY_PUSH) {
    number--;
    }
    if(GetKeyState(VK_DOWN) == KEY_PUSH) {
    number++;
    }
    //////////////////////////////////
    if(GetKeyState(VK_SHOT)==KEY_PUSH) {
VanishEnemy;
    //Here you put stuff that happens depending what the variable "number" finally is, blah, blah, blah
    }
    }
    @DrawLoop {
               SetFontColor(r1, g1, b1, r1, g1, b1);
DrawText("The first choice", 40, 45, 20, 255);
               SetFontColor(r2, g2, b2, r2, g2, b2);
DrawText("Choice 2", 40, 65, 20, 255);
               SetFontColor(r3, g3, b3, r3, g3, b3);
DrawText("Choice 3", 40, 85, 20, 255);
    }

    @Finalize {
    ForbidBomb(false); ForbidShot(false);
    SetPlayerX(GetCenterX); SetPlayerY(GetClipMaxY-75);
    }
}

But I think I did something entirely wrong here...

Henry

  • The observer
  • Exploring to the new world of Danmaku
Re: Danmakufu Q&A/Problem Thread
« Reply #700 on: September 15, 2009, 10:32:30 AM »
Maybe the player shouldn't move when making the choice.
Thanks for your help.
I'm thinking in this way now :)
Old/Forgotten member.

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

Re: Danmakufu Q&A/Problem Thread
« Reply #701 on: September 15, 2009, 01:35:51 PM »
As of yesterday, danmakufu just started crashing with a majority of scripts. Both player AND boss.
even the default danmakufu exrumia, as well as the ctc chars, even rumia itself.
I'm using applocal and it crashes whenever you get to the select screen. Such as the exrumia folder when browsing via directory, or the char select screen.
I've made sure I had applocal in japanese for Danmakufu.

Yeah, this has only been happening since yesterday
 I don't know what caused it, but all I did was install the dll needed to play touhou 11, and something I used to rip primeus gfx from mugen(Though I uninstalled it)

I tried reinstalling danmakufu fresh, with only the defaults like the rumia scripts. But the problem still persists.
Specifically, the crash is a "send error report" crap. Not even an error.

I have no clue why this is happening and only recently. But this is a very bad PC that has been becoming worse and worse over time. I wouldn't be surprised if it is my pc since I doubt the original danmakufu is corrupt. Still. Has anyone heard of this problem before?

Re: Danmakufu Q&A/Problem Thread
« Reply #702 on: September 15, 2009, 03:11:33 PM »
When using #include_script, is there any way to actually change the included script from the script that receives the data or does it only take everything from the script adn make a copy of it in the script with #include_script in it?

Permanently, not really, but if you used an intricate series of Set- and Get-CommonData, then you could probably do it. Wouldn't be feasable for more than one script though.

@Lishy:
Have you tried setting your computer's localization to Japanese (in the control panel)? Might screw over some other programs though. Generally if you have an old computer and it's fucking up everwhere, it's time to get a new one.

Infy♫

  • Demonic★Moe
  • *
corrupt music
« Reply #703 on: September 15, 2009, 05:33:48 PM »
I've got like, 7 albums of awesome music with some songs which really fit shooting games. however when i try to use these songs for danmakufu, it often crashes with no warning.
what can i do to fix this? converting them to ogg format simply doesnt help.

Johnny Walker

  • Perdition Crisis~
Re: corrupt music
« Reply #704 on: September 15, 2009, 06:56:31 PM »
I've got like, 7 albums of awesome music with some songs which really fit shooting games. however when i try to use these songs for danmakufu, it often crashes with no warning.
what can i do to fix this? converting them to ogg format simply doesnt help.

Try converting the files to "44Khz -128 kpbs (or less) - Stereo " . That works for me.
I use 96kbps for a 'nice quality-low weight relationship' in my scripts.
« Last Edit: September 15, 2009, 07:00:50 PM by JohnnyWalker- »

Re: Danmakufu Q&A/Problem Thread
« Reply #705 on: September 16, 2009, 01:25:09 AM »
So I got my new vista hp laptop and I installed danmakufu.
Problem? It takes a long time to load up, only ending up to be (Not responding) then it gets the "send error message" crash error that usually happens when something crashes.
I have both the Japanese IME and and applocal. But even if I use either of them, it still crashes.

Other times, it opens as a process shown in task manager, but technically doesn't "open", if you know what I mean.

.......Halp?
« Last Edit: September 16, 2009, 01:29:06 AM by Lishy »

Johnny Walker

  • Perdition Crisis~
Re: Danmakufu Q&A/Problem Thread
« Reply #706 on: September 16, 2009, 08:27:57 AM »
Well. I have a little problem creating a "Dream Bonus" like function (Base stolen(?) from Naut's Yuka Kazami Extra Graze Bonus).
I want to put a penalty for bomb use but I can't do it well.
Here's the base code for a stage script:

Code: [Select]
@MainLoop(){
//Dreamer Bonus
Dream = (GetGraze*20);//Test number
if(Dream >=100){Dream = 100;}
if(Dream >= 100 && DreamMax == true){
        DeleteEnemyShotToItem(SHOT);
        DreamMax = false;
                }
if(Dream < 100 && DreamMax == false){DreamMax = true;}
if(Dream<=0){Dream = 0;}

if(OnBomb==true){Dream-=20}  // <-----THIS?
yield;

}

And here is the problem:

Every time I bomb, the line works, but when the "OnBomb==true" dissapears, that "Dream-=20" too.

Let me explain:

1 - Graze: Dream at 50 %.
2 - Bomb: Dream  -20% = 30%
3 - Bomb Ends... Dream at 50 % again...


The Drawing functions...
Code: [Select]

@DrawTopObject{
      let string = "" ~ ToString(Dream);
      let n = 0.0;
      let res = "";

      while (n < length(string) && string[n] != '.'){

         res = res ~ ToString(string[n]);
         n++;

      }

//Draw Text
if(Dream<=99){DrawText(res , 37, 425, 12, 255);}
if(Dream>=100){DrawText("MAX" , 37, 425, 12, 255);}
DrawText("%" , 65, 425, 12, 255);
DrawText("Dreamer Bonus:", 37, 410, 12, 255);

}


I know I'm doing it wrong, but I can't find any solution.
This is making me crazy. Please, help me MoTK. Thank you.

Re: Danmakufu Q&A/Problem Thread
« Reply #707 on: September 16, 2009, 01:58:24 PM »
I'm not entirely sure what you're trying to accomplish (some fusion between Mystic Square and Subterranean Animism's point system?), but it seems to me that the reason your Dream bonus keeps maxing after you bomb is because Dream keeps getting set to 100 (Dream = GetGraze*20) as long as you have more than 5 graze. So even though you're setting it lower during the bomb phase, it keeps getting set back to normal every frame, and will always be maxed so long as you remain above 5 graze.

To accomplish what I think you're trying to do, you would need to find the difference between your graze a few frames beforehand and your current graze (which would likely involve tasks), this way your Dream bonus would actually drop if you aren't actively grazing.

EDIT:
Something like this maybe...?

Code: [Select]
#TouhouDanmakufu
#Title[gggggggg]
#Text[ggggg]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {

    let ImgBoss = "script\img\ExRumia.png";
let Dream = 0;
let DreamMax = true;
let g2 = 0;
let h = 250;

    @Initialize {
        SetLife(6000);
        SetTimer(120);
        SetScore(1000000);
        SetMovePosition02(GetCenterX, GetCenterY - 120, 120);
        SetDamageRate(75, 0);
        LoadGraphic(ImgBoss);
Grazer;
    }

    @MainLoop {
Grazer;
CreateShot01(GetX, GetY, 3, 0, RED01, 10);
   Dream = g2;
   if(Dream >=100){Dream = 100;}
   if(Dream >= 100 && DreamMax == true){
           DeleteEnemyShotToItem(SHOT);
           DreamMax = false;
   }
   if(Dream < 100 && DreamMax == false){DreamMax = true;}
   if(Dream<=0){Dream = 0;}

   if(OnBomb==true){Dream-=20; DreamMax=true;}  // <-----THIS?
      yield;   
   

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

    @DrawLoop {
SetTexture(ImgBoss);
SetGraphicRect(0, 0, 64, 64);
        DrawGraphic(GetX, GetY);
let string = "" ~ ToString(Dream);
      let n = 0.0;
      let res = "";

      while (n < length(string) && string[n] != '.'){

         res = res ~ ToString(string[n]);
         n++;
   
      }
   
   //Draw Text
   if(Dream<=99){DrawText(res , 37, 425, 12, 255);}
   if(Dream>=100){DrawText("MAX" , 37, 425, 12, 255);}
   DrawText("%" , 65, 425, 12, 255);
   DrawText("Dreamer Bonus:", 37, 410, 12, 255);

}

task Grazer{
let g = GetGraze;
loop(h){yield;}
g2 = GetGraze - g;
if(g2==0){
h--;
}
if(g2>0){
h++;
}
if(h<=250){
h=250;
}
if(h>=450){
h=450;
}
}


    }

    @Finalize {
        DeleteGraphic(ImgBoss);
    }


The line of bullets is to graze off of and test the code's effects.
« Last Edit: September 16, 2009, 02:16:27 PM by Naut »

Henry

  • The observer
  • Exploring to the new world of Danmaku
Re: Danmakufu Q&A/Problem Thread
« Reply #708 on: September 16, 2009, 02:43:17 PM »
Talking about the 'multiple choice' event:

Code: [Select]
#TouhouDanmakufu
#Title[Menu test]
#Text[This is the description. Did you know that? Oh, sorry.]
#Player[FREE]
#ScriptVersion[2]
script_enemy_main {
    let ImgBoss = GetCurrentScriptDirectory~"images\patchouli.png";
    let bg = "";
    let frame=0;
    let number = 0;
    let orange = [255, 142, 78];
    let white = 255;
    let finish=0;
    let r1 = 0; let g1 = 0; let b1 = 0;
    let r2 = 0; let g2 = 0; let b2 = 0;
    let r3 = 0; let g3 = 0; let b3 = 0;
    let r=[0,0,0,0,0];
    let g=[0,0,0,0,0];
    let b=[0,0,0,0,0];
    let x=GetPlayerX;
    let y=GetPlayerY;
    SetX(GetCenterX);
    SetY(GetClipMinY+120);
    @Initialize {
       SetLife(1);
       MagicCircle(false);
    }

    @MainLoop {
       ForbidBomb(true);
       ForbidShot(true);
       SetPlayerX(x);
       SetPlayerY(y);
       ascent(i in 0..5){
  r[i]=orange[0];
  g[i]=orange[1];
  b[i]=orange[2];
       }
       r[number]=255;
       g[number]=255;
       b[number]=255;
       if(GetKeyState(VK_UP)==KEY_PUSH && number>0) {
          number--;
       }
       if(GetKeyState(VK_DOWN)==KEY_PUSH && number<4) {
          number++;
       }
       if(GetKeyState(VK_SHOT)==KEY_PUSH){
  alternative(number)
  case(0){
  }
  case(1){
  }
  case(2){
  }
  case(3){
  }
  case(4){
  }
  finish=1;
       }
       frame++;
       if(finish==1){AddLife(-10);}
    }
    @DrawLoop{
       LoadGraphic(ImgBoss);
       SetTexture(ImgBoss);
       SetGraphicAngle(0, 0, 0);
       SetGraphicRect(49*floor(2-absolute(frame/15-2)), 0, 49*floor(3-absolute(frame/15-2)), 80);
       SetGraphicScale(1, 1);
       DrawGraphic(GetX, GetY);
       SetFontColor(r[0], g[0], b[0], r[0], g[0], b[0]);
       DrawText("Choice 1", GetClipMinX+60, GetClipMaxY-120, 15, 255);
       SetFontColor(r[1], g[1], b[1], r[1], g[1], b[1]);
       DrawText("Choice 2", GetClipMinX+60, GetClipMaxY-105, 15, 255);
       SetFontColor(r[2], g[2], b[2], r[2], g[2], b[2]);
       DrawText("Choice 3", GetClipMinX+60, GetClipMaxY-90, 15, 255);
       SetFontColor(r[3], g[3], b[3], r[3], g[3], b[3]);
       DrawText("Choice 4", GetClipMinX+60, GetClipMaxY-75, 15, 255);
       SetFontColor(r[4], g[4], b[4], r[4], g[4], b[4]);
       DrawText("Choice 5", GetClipMinX+60, GetClipMaxY-60, 15, 255);
    }
    @Finalize {
       ForbidBomb(false);
       ForbidShot(false);
    }
}
(Note that this is not an event script)
The above demonstrates how 5 choices can be made (modified from above), but still you cannot use #ScriptPath[...] inside the alternative control statement.
The (probably) only way to solve the problem is to use SetCommonData? (Can SetCommonData be used in plural script?)
« Last Edit: September 16, 2009, 02:45:37 PM by Henry »
Old/Forgotten member.

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

Re: Danmakufu Q&A/Problem Thread
« Reply #709 on: September 16, 2009, 06:17:54 PM »
So I got my new vista hp laptop and I installed danmakufu.
Problem? It takes a long time to load up, only ending up to be (Not responding) then it gets the "send error message" crash error that usually happens when something crashes.
I have both the Japanese IME and and applocal. But even if I use either of them, it still crashes.

Other times, it opens as a process shown in task manager, but technically doesn't "open", if you know what I mean.

.......Halp?
Just for the sake of providing more info and that someone will have a greater chance of helping me, here's the problem details:
Problem signature:
  Problem Event Name:   APPCRASH
  Application Name:   th_dnh.exe
  Application Version:   0.0.0.0
  Application Timestamp:   45293ba4
  Fault Module Name:   th_dnh.exe
  Fault Module Version:   0.0.0.0
  Fault Module Timestamp:   45293ba4
  Exception Code:   c0000005
  Exception Offset:   000050ac
  OS Version:   6.0.6001.2.1.0.768.2
  Locale ID:   4105
  Additional Information 1:   7484
  Additional Information 2:   44aabdaab8bebc883a520397c81b786c
  Additional Information 3:   b637
  Additional Information 4:   d8a80cf26ab7da46d94762599887f105

That probably won't help, but meh. Maybe...

Johnny Walker

  • Perdition Crisis~
Re: Danmakufu Q&A/Problem Thread
« Reply #710 on: September 16, 2009, 06:29:04 PM »
I'm not entirely sure what you're trying to accomplish (some fusion between Mystic Square and Subterranean Animism's point system?), but it seems to me that the reason your Dream bonus keeps maxing after you bomb is because Dream keeps getting set to 100 (Dream = GetGraze*20) as long as you have more than 5 graze. So even though you're setting it lower during the bomb phase, it keeps getting set back to normal every frame, and will always be maxed so long as you remain above 5 graze.

To accomplish what I think you're trying to do, you would need to find the difference between your graze a few frames beforehand and your current graze (which would likely involve tasks), this way your Dream bonus would actually drop if you aren't actively grazing.

<code here>

The line of bullets is to graze off of and test the code's effects.

Very thank you Naut! You saved my script. I love you D:

Re: Danmakufu Q&A/Problem Thread
« Reply #711 on: September 16, 2009, 07:52:19 PM »
I love you too <3

Lopsidation

  • Exploring the Twin Labyrinths
  • Be light of heart;
Re: Danmakufu Q&A/Problem Thread
« Reply #712 on: September 16, 2009, 08:43:23 PM »
Right now I'm trying to script a series of cards for Youmu where each of the bullets are half-ghosts, so you only die if you're hitting two of them at once.
My plan is to make the player invincible and manually test collisions with each bullet.
1. How do you make the player invincible without making them destroy every bullet they touch?
2. Will the manual collision detection slow Danmakufu down horribly?
3. Is there any way to make the bullets slightly trasparent so you can better see where two of them overlap?
4. Or is this just generally a terrible idea?
"Happiness is like a cat, If you try to coax it or call it, it will avoid you; it will never come. But if you pay no attention to it and go about your business, you'll find it rubbing against your legs and jumping into your lap."

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread
« Reply #713 on: September 17, 2009, 02:50:07 AM »
Talking about the 'multiple choice' event:

Code: [Select]
#TouhouDanmakufu
#Title[Menu test]
#Text[This is the description. Did you know that? Oh, sorry.]
#Player[FREE]
#ScriptVersion[2]
script_enemy_main {
    let ImgBoss = GetCurrentScriptDirectory~"images\patchouli.png";
    let bg = "";
    let frame=0;
    let number = 0;
    let orange = [255, 142, 78];
    let white = 255;
    let finish=0;
    let r1 = 0; let g1 = 0; let b1 = 0;
    let r2 = 0; let g2 = 0; let b2 = 0;
    let r3 = 0; let g3 = 0; let b3 = 0;
    let r=[0,0,0,0,0];
    let g=[0,0,0,0,0];
    let b=[0,0,0,0,0];
    let x=GetPlayerX;
    let y=GetPlayerY;
    SetX(GetCenterX);
    SetY(GetClipMinY+120);
    @Initialize {
       SetLife(1);
       MagicCircle(false);
    }

    @MainLoop {
       ForbidBomb(true);
       ForbidShot(true);
       SetPlayerX(x);
       SetPlayerY(y);
       ascent(i in 0..5){
  r[i]=orange[0];
  g[i]=orange[1];
  b[i]=orange[2];
       }
       r[number]=255;
       g[number]=255;
       b[number]=255;
       if(GetKeyState(VK_UP)==KEY_PUSH && number>0) {
          number--;
       }
       if(GetKeyState(VK_DOWN)==KEY_PUSH && number<4) {
          number++;
       }
       if(GetKeyState(VK_SHOT)==KEY_PUSH){
  alternative(number)
  case(0){
  }
  case(1){
  }
  case(2){
  }
  case(3){
  }
  case(4){
  }
  finish=1;
       }
       frame++;
       if(finish==1){AddLife(-10);}
    }
    @DrawLoop{
       LoadGraphic(ImgBoss);
       SetTexture(ImgBoss);
       SetGraphicAngle(0, 0, 0);
       SetGraphicRect(49*floor(2-absolute(frame/15-2)), 0, 49*floor(3-absolute(frame/15-2)), 80);
       SetGraphicScale(1, 1);
       DrawGraphic(GetX, GetY);
       SetFontColor(r[0], g[0], b[0], r[0], g[0], b[0]);
       DrawText("Choice 1", GetClipMinX+60, GetClipMaxY-120, 15, 255);
       SetFontColor(r[1], g[1], b[1], r[1], g[1], b[1]);
       DrawText("Choice 2", GetClipMinX+60, GetClipMaxY-105, 15, 255);
       SetFontColor(r[2], g[2], b[2], r[2], g[2], b[2]);
       DrawText("Choice 3", GetClipMinX+60, GetClipMaxY-90, 15, 255);
       SetFontColor(r[3], g[3], b[3], r[3], g[3], b[3]);
       DrawText("Choice 4", GetClipMinX+60, GetClipMaxY-75, 15, 255);
       SetFontColor(r[4], g[4], b[4], r[4], g[4], b[4]);
       DrawText("Choice 5", GetClipMinX+60, GetClipMaxY-60, 15, 255);
    }
    @Finalize {
       ForbidBomb(false);
       ForbidShot(false);
    }
}
(Note that this is not an event script)
The above demonstrates how 5 choices can be made (modified from above), but still you cannot use #ScriptPath[...] inside the alternative control statement.
The (probably) only way to solve the problem is to use SetCommonData? (Can SetCommonData be used in plural script?)

#ScriptPath[] as in the one you use in the plural scripts...? (insert here: a colon followed by a capital V)

Henry

  • The observer
  • Exploring to the new world of Danmaku
Re: Danmakufu Q&A/Problem Thread
« Reply #714 on: September 17, 2009, 08:16:07 AM »
Yes. (As I'm making a project, when in the middle of the fight, players are asked with 'choice' to choose, then the spell card changes according to the choice)

Right now I'm trying to script a series of cards for Youmu where each of the bullets are half-ghosts, so you only die if you're hitting two of them at once.
My plan is to make the player invincible and manually test collisions with each bullet.
1. How do you make the player invincible without making them destroy every bullet they touch?
2. Will the manual collision detection slow Danmakufu down horribly?
3. Is there any way to make the bullets slightly trasparent so you can better see where two of them overlap?
4. Or is this just generally a terrible idea?
To your first problem, you can use ShootDownPlayer (in here even the bullets is destroyed.

2. You will need to detect collision for all bullets and player, this (well, of course) slows down Danmakufu a lot.

3. You can use object bullets to make them transparent and also to detect their collision.

4. This idea is not bad, don't worry. It is cool if you can make it correctly and neatly. But bear in mind that the difficulty is lowered as player has to hit 2 bullets simultaneously to die.
« Last Edit: September 17, 2009, 08:22:48 AM by Henry »
Old/Forgotten member.

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

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread
« Reply #715 on: September 17, 2009, 05:07:27 PM »
Lopsidation: I think the best way to do that card is, rather than comparing every bullet's position against every other, have each bullet just check for its own collision against the player, and if it's true have it set a variable declaring it; then the other bullet type can check for collision and if that variable is true, you know they're both hitting and you can use ShootDownPlayer.

Also, be sure to set the variable to false each loop before running through the collision detections so that it's being unset once a bullet isn't on you anymore.

Oh one more thing, I don't know how you plan to do it but make sure it's somehow communicated to the player that touching two bullets is what will kill them; if I started playing a card with transparent bullets that didn't hit me I probably wouldn't be able to figure out why I was dying.
« Last Edit: September 17, 2009, 05:18:15 PM by Stuffman »

puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem Thread
« Reply #716 on: September 17, 2009, 07:32:36 PM »
I have a question regarding reflecting bullets.
I set up this piece of script:

Code: [Select]
if(Obj_GetX(obj)<=GetClipMinX) {
Obj_SetAngle(obj,180-Obj_GetAngle(obj));
Obj_SetX(obj,Obj_GetX(obj)+0.1);
}
if(Obj_GetX(obj)>=GetClipMaxX) {
Obj_SetAngle(obj,180-Obj_GetAngle(obj));
Obj_SetY(obj,Obj_GetY(obj)-0.1);
}

//The above reflect horizontally. Below is supposed to do it vertically, except it doesn't.

if(Obj_GetY(obj)<=GetClipMinY) {
Obj_SetAngle(obj,180+Obj_GetAngle(obj));
Obj_SetY(obj,Obj_GetY(obj)-0.1);
}
if(Obj_GetY(obj)>=GetClipMaxY) {
Obj_SetAngle(obj,180+Obj_GetAngle(obj));
Obj_SetX(obj,Obj_GetX(obj)+0.1);
}

I tried doing all sorts of stuff to enable vertical reflection, but whatever I try, the outcome it either:
-The bullets sink into the top/bottom of the screen upon contact.
Or -They reflect, but in the exact opposite direction for both Y and X, and not just Y alone.

What did I do wrong?

As for the whole script, it goes something likes this...:

Code: [Select]
#TouhouDanmakufu
#Title[Test 2]
#Text[(***)]
#Player[FREE]
#Image[script\Images\Faces\.png]
#ScriptVersion[2]

script_enemy_main {

let angle=0;
let shift=0;
let enemies=[];
let usespell=0;
let bgfade=0;
let frame=0;
let time=0;
let timercount=0;
let cx=GetCenterX;
let cy=GetCenterY;
let enemylife=0;
let lowhealth1=("script\SoundEffects\lowhealth1.wav");
let lowhealth2=("script\SoundEffects\lowhealth2.wav");
let timeout1=("script\SoundEffects\timeout1.wav");
let timeout2=("script\SoundEffects\timeout2.wav");
let BG1=("\script\Images\BackgroundLayers\kurumi1.png");
let Portrait=("\script\Images\Faces\KurumiNorm1.png");
let Boss=("\script\Images\CharacterSprites\KurumiNorm.png");

@Initialize{
LoadUserShotData("script\shots\Shots1Pos.txt");
LoadGraphic(Boss);
LoadGraphic(BG1);
LoadGraphic(Portrait);
LoadSE(lowhealth1);
LoadSE(lowhealth2);
LoadSE(timeout1);
LoadSE(timeout2);

CutIn(YOUMU,""\"""\",Portrait,0,0,200,520);
SetScore(500000);
SetLife(500);
SetTimer(50);
SetGraphicRect(0,0,96,96);
SetInvincibility(30);
SetDamageRate(10,10);
SetEnemyMarker(true);
MagicCircle(true);
SetColor(255,160,200);
Concentration01(60);
Concentration02(60);
SetColor(255, 255, 255);
SetEffectForZeroLife(60,100,1);
SetMovePosition02(cx,cy-170,50);
// LastSpell;
}

@MainLoop {

SetCollisionA(GetX, GetY, 32);
SetCollisionB(GetX, GetY, 16);

SetShotAutoDeleteClip(64,64,64,64);



if(frame%80==0 && frame>60){
loop(30){
let enemy=Obj_Create(OBJ_SHOT);
Obj_SetPosition(enemy,cx,cy);
ObjShot_SetGraphic(enemy,RED01);
Obj_SetSpeed(enemy,2);
Obj_SetAngle(enemy,shift+angle);
Obj_SetAutoDelete(enemy,true);

enemies=enemies~[enemy];
angle+=360/30;
}
cx=rand(GetClipMinX+50,GetClipMaxX-50);
cy=rand(GetClipMinY+50,GetClipMaxY-200);
shift+=1;
}
let i=0;
while (i<length(enemies)){
if(Obj_BeDeleted(enemies[i])){
enemies=erase(enemies,i);
i--;
}
else{
let obj=enemies[i];
if(Obj_GetX(obj)<=GetClipMinX) {
Obj_SetAngle(obj,180-Obj_GetAngle(obj));
Obj_SetX(obj,Obj_GetX(obj)+0.1);
}
if(Obj_GetX(obj)>=GetClipMaxX) {
Obj_SetAngle(obj,180-Obj_GetAngle(obj));
Obj_SetY(obj,Obj_GetY(obj)-0.1);
}

if(Obj_GetY(obj)<=GetClipMinY) {
Obj_SetAngle(obj,180+Obj_GetAngle(obj));
Obj_SetY(obj,Obj_GetY(obj)-0.1);
}
if(Obj_GetY(obj)>=GetClipMaxY) {
Obj_SetAngle(obj,180+Obj_GetAngle(obj));
Obj_SetX(obj,Obj_GetX(obj)+0.1);
}



}
i++;
}




time++;
frame++;

if(GetLife<50 && (time-3)%4==0){ enemylife=GetLife; }
if(GetLife<enemylife && (time-0)%4==0){ PlaySE(lowhealth1);
 }
if(GetLife<enemylife && (time-2)%4==0){ PlaySE(lowhealth2);
 }

if(GetTimer<=10 && GetTimer>3 && time%60==0){ PlaySE(timeout1); }
if(GetTimer<=3 && time%60==0 && timercount<3){ PlaySE(timeout2);
 timercount+=1; }

}

@BackGround{
if(bgfade<70){bgfade+=5;}

SetGraphicRect(0,0,512,512);
SetGraphicScale(1.5,1.5);
SetTexture(BG1);
SetAlpha(50);
SetColor(255,255,255);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,-(time/3));
DrawGraphic(cx,cy);
}

@DrawLoop{
SetGraphicRect(1,1,96,96);
SetGraphicScale(1,1);
SetTexture(Boss);
SetGraphicAngle(0, 0, 0);
SetColor(255,255,255);
SetRenderState(ALPHA);
SetGraphicAngle(0, 0, 0);

if(usespell>0){SetGraphicRect(288,0,384,96);
DrawGraphic(GetX, GetY);}

if(usespell==0){if(GetSpeedX==0){SetGraphicRect(0,0,96,96);}
else if(GetSpeedX>0){SetGraphicRect(192,0,288,96);}
else if(GetSpeedX<0){SetGraphicRect(96,0,192,96);}
DrawGraphic(GetX, GetY);}}
}

@Finalize{
DeleteGraphic(Portrait);
DeleteGraphic(Boss);
DeleteSE(lowhealth1);
DeleteSE(lowhealth2);
DeleteSE(timeout1);
DeleteSE(timeout2);
}

}


Which reminds me of my 2nd question:
What do I need to do to make each sepparate bullet take another action after a certain amount of frames of existance?
Full Danmakufu game "Juuni Jumon - Summer Interlude" is done!
By the same person who made Koishi Hell 1,2 (except this game is serious)
Topic: http://www.shrinemaiden.org/forum/index.php/topic,9647.0.html

CK Crash

  • boozer
Re: Danmakufu Q&A/Problem Thread
« Reply #717 on: September 17, 2009, 07:42:28 PM »
I have a question regarding reflecting bullets.
Reflecting bullets is a bit strange. For reflection off of the sides, you have it right, but for the top and bottom, you need to make it Obj_SetAngle(obj,-Obj_GetAngle(obj));. I agree, it's a bit hard to wrap your head around how that works :P

puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem Thread
« Reply #718 on: September 17, 2009, 07:58:01 PM »
I have a question regarding reflecting bullets.
Reflecting bullets is a bit strange. For reflection off of the sides, you have it right, but for the top and bottom, you need to make it Obj_SetAngle(obj,-Obj_GetAngle(obj));. I agree, it's a bit hard to wrap your head around how that works :P

Ah! I was so close! But I really didn't expect that you had to remove the 180 degrees thing.
Thanks man, I'll be sure to make a fun spellcard out of that info. ^_^v


Oh, just in case my whole previous post won't be forgotten now I got this answered. I have a 2nd question too:

What do I need to do to make each sepparate object bullet take another action after a certain amount of frames of existance? :3 (See previous post for the script)
Full Danmakufu game "Juuni Jumon - Summer Interlude" is done!
By the same person who made Koishi Hell 1,2 (except this game is serious)
Topic: http://www.shrinemaiden.org/forum/index.php/topic,9647.0.html

CK Crash

  • boozer
Re: Danmakufu Q&A/Problem Thread
« Reply #719 on: September 17, 2009, 08:09:39 PM »
Code: [Select]
task objectbullet
{
let obj = Obj_Create(OBJ_SHOT);
let count = 200;
setting bullet stuff, blah blah;
while (count > 100)
{
do stuff;
count--;
yield;
}
loop(howlongyouwanttowait){yield;}
while(count > 0)
{
do more stuff;
count--;
yield;
}
}