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

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem Thread v3
« Reply #840 on: May 25, 2010, 07:03:36 AM »
Hello,

I just had a quick little idea a few days ago and I'd like to hear what you guys thought of it and if it'd be possible to implement.

Is there any way to assign a value to a variable that can tell if the player is using a bomb or not? I can totally envision this being awesome..

Code: [Select]

let bombing = *player using a bomb*;

if (bombing) {
    Hell breaks loose;
}

Bombers will be in for some due punishment. :]
« Last Edit: May 25, 2010, 07:05:26 AM by MasterSpark »

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 v3
« Reply #841 on: May 25, 2010, 07:15:52 AM »
Hello,

I just had a quick little idea a few days ago and I'd like to hear what you guys thought of it and if it'd be possible to implement.

Is there any way to assign a value to a variable that can tell if the player is using a bomb or not? I can totally envision this being awesome..

Code: [Select]

let bombing = *player using a bomb*;

if (bombing) {
    Hell breaks loose;
}

Bombers will be in for some due punishment. :]

actually...
if(OnBomb==true){dostuff;}
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem Thread v3
« Reply #842 on: May 25, 2010, 07:38:13 AM »
Quote from: Kylesky
actually...
if(OnBomb==true){dostuff;}

...that just sounds so obvious now that you mention it. I'm sure I've seen that OnBomb around somewhere...

Oh well, the more you learn, huh? Thanks for helping me out. :)

Henry

  • The observer
  • Exploring to the new world of Danmaku
Re: Danmakufu Q&A/Problem Thread v3
« Reply #843 on: May 25, 2010, 08:10:00 AM »
OnBomb is true when the bomb is still effective, right?
Old/Forgotten member.

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

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 v3
« Reply #844 on: May 25, 2010, 01:35:37 PM »
OnBomb is true when the bomb is still effective, right?
as long as the player is currently on the bomb, yes...



Ok... my question :V

Collision_Obj_Objは未定義の識別子です(33行目)
if(Collision_Obj_Obj(obj, hitbox)==true){

^this says that the function Collision_Obj_Obj is undefined... what's weird is... I know I called it right... 2 arguments, the 2 objects... I'm 100% sure that both obj and hitbox are shot objects, etc...

I would just use the distance formula, but the problem is that different bullets would have different sizes...
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #845 on: May 25, 2010, 01:40:32 PM »
Well, maybe you didn't create hitbox as a global variable but only inside a task.

Another idea would be: Did you actually call Obj_SetCollisionToObject(hitbox, true); and Obj_SetCollisionToObject(obj, true); ?
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."

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 v3
« Reply #846 on: May 25, 2010, 01:44:18 PM »
Well, maybe you didn't create hitbox as a global variable but only inside a task.

Another idea would be: Did you actually call Obj_SetCollisionToObject(hitbox, true); and Obj_SetCollisionToObject(obj, true); ?

I did both...
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #847 on: May 25, 2010, 01:47:36 PM »
Wait, what kinds of objects do you want to check the collision of? I vaguely remember something along the lines of danmakufu being picky in that regard...
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."

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 v3
« Reply #848 on: May 25, 2010, 01:54:10 PM »
Wait, what kinds of objects do you want to check the collision of? I vaguely remember something along the lines of danmakufu being picky in that regard...
both are shot objects... nevermind, it has been resolved on IRC... apparently, Collision_Obj_Obj doesn't work in player or stage scripts...
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Elementoid

  • Having a heated affair with feux-familiars
Re: Danmakufu Q&A/Problem Thread v3
« Reply #849 on: May 26, 2010, 12:22:16 AM »
I've got something I need help with, it's probably obvious. Is there a way to check if a task object exists? Like if in mainloop you wanted if(BulletExists==false){SpawnBullet;} or something to that nature. I haven't been able to figure out a way for the task to change BulletExists to false when Obj_BeDeleted(Obj)=true, for logical reasons I suppose.

Bitz

  • So Moe!
  • *heart attack*
Re: Danmakufu Q&A/Problem Thread v3
« Reply #850 on: May 26, 2010, 12:46:39 AM »
I've got something I need help with, it's probably obvious. Is there a way to check if a task object exists? Like if in mainloop you wanted if(BulletExists==false){SpawnBullet;} or something to that nature. I haven't been able to figure out a way for the task to change BulletExists to false when Obj_BeDeleted(Obj)=true, for logical reasons I suppose.

Create a task that checks if the object shot still exists:
Code: [Select]
let BulletExists = false;

task SpawnBullet {
   //Initializing stuff here...
   let Obj = Obj_Create(OBJ_SHOT); //Or something similar
   BulletExists = true;
   BulletExistsChecker(Obj);
   //Controlling bullet, etc. here...
}

task BulletExistsChecker (id) {
   yield;
   loop {
      if (Obj_BeDeleted(id)) {
         BulletExists = false;
         return;
      }
      yield;
   }
}

Or you could increase the scope of Obj and directly code if (Obj_BeDeleted(Obj)) {SpawnBullet;}.

Henry

  • The observer
  • Exploring to the new world of Danmaku
Re: Danmakufu Q&A/Problem Thread v3
« Reply #851 on: May 26, 2010, 01:12:41 AM »
Is there a way to have 2 event scripts in a single talking script and between them there is some drawing effects.

I tried combining 2 event scripts into one and between them there is a looping yield; yet the whole looping yield is ignored.  :ohdear:
Old/Forgotten member.

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

Re: Danmakufu Q&A/Problem Thread v3
« Reply #852 on: May 26, 2010, 01:37:23 AM »
Just make two different events. You can use Event Steps but I find them pretty wonky, so just have two events separated by some drawing stuff.

Henry

  • The observer
  • Exploring to the new world of Danmaku
Re: Danmakufu Q&A/Problem Thread v3
« Reply #853 on: May 26, 2010, 01:42:03 AM »
If I set the drawing stuff in the Main script (the one calling others), there will be no problem?
Old/Forgotten member.

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

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #854 on: May 26, 2010, 09:49:09 AM »
You might want to rephrase your question a little better. It's kind of hard to understand what you mean by "drawing stuff" and "Main script". Perhaps you should give a short example of what you mean?

EDIT: Oh wait, in the context of event scripts? If you want to draw effects during an event script at a specific time during the event, you need to set and get event steps.
« Last Edit: May 26, 2010, 09:51:37 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.

DDRMANIAC007

  • The DDR Maniac
  • Dance Dance Revolution
    • The Touhou stream blog
My Danmakufu crashes instantly
« Reply #855 on: May 26, 2010, 09:07:18 PM »
Everytime I try to run it, it shows a window of solid color, than it says that it's stopped responding. I am using Applocale to try to run it. There is nothing in the FAQ about this problem. Help!

Bitz

  • So Moe!
  • *heart attack*
Re: My Danmakufu crashes instantly
« Reply #856 on: May 26, 2010, 10:29:31 PM »
Make sure you have DirectX installed, and that your sound card and graphics card are working properly. Danmakufu doesn't like anything being out of place; when I installed a fresh copy of Windows, Danmakufu refused to run until I had all my hardware drivers and DirectX installed.

DDRMANIAC007

  • The DDR Maniac
  • Dance Dance Revolution
    • The Touhou stream blog
Re: My Danmakufu crashes instantly
« Reply #857 on: May 26, 2010, 10:30:59 PM »
Even though all my Touhou games work perfectly? I'll go update DirectX. I'll post in a bit.

DDRMANIAC007

  • The DDR Maniac
  • Dance Dance Revolution
    • The Touhou stream blog
Re: My Danmakufu crashes instantly
« Reply #858 on: May 26, 2010, 10:37:35 PM »
I can hear sound on my games, and I'm capable of running stuff like CS:S and the Touhou Projects.
Seems like everything is fine to me. I have DirectX9. No reason for Danmakufu to be not working like this. -__-

Furienify

  • Yeehaw!
  • Equestrian Fansubber
    • Youtube Channel
Re: Danmakufu Q&A/Problem Thread v3
« Reply #859 on: May 27, 2010, 01:00:20 AM »
Does it do this immediately on startup, or do you choose any options?

Is it a clean install?

Tried tweaking the config options?

You could also try deleting script_index.dat, there may be an issue in that file. Rerunning danmakufu and checking your scripts forces its recreation.

Henry

  • The observer
  • Exploring to the new world of Danmaku
Re: Danmakufu Q&A/Problem Thread v3
« Reply #860 on: May 27, 2010, 02:01:26 AM »
You might want to rephrase your question a little better. It's kind of hard to understand what you mean by "drawing stuff" and "Main script". Perhaps you should give a short example of what you mean?

EDIT: Oh wait, in the context of event scripts? If you want to draw effects during an event script at a specific time during the event, you need to set and get event steps.
If my code is like this, 2 events with a time interval between them, how should I do that effect? :ohdear:
or should I use 2 events, but the third one would not work, perhaps due to the never-ending event 2.

(in all tutorials it is taught that killing the boss would end the event, but this won't work for 2 events in a single script)
sorry for the lengthiness of my script and my poor expression  :V
Code: [Select]
script_enemy_main{
   //image and variable declaration here
   SetX(GetCenterX);
   SetY(GetClipMinY+120);
   @Initialize{
      SetLife(1);
      SetDamageRate(0,0);
      MagicCircle(false);
      CreateEventFromScript("talk2");
   }

   @MainLoop{
      if(GetEventStep==3){AddLife(-10);}
      frame++;
      yield;
   }
   @DrawLoop{
      //draw the boss image here, there is no problem for this :V
      if(GetEventStep==2&&frame2<120){event=2;}
      if(event==2){ //since here it's the drawing of an image since the boss has gone out  :V
         LoadGraphic(blank);
         SetTexture(blank);
         SetAlpha(alpha);
         SetGraphicRect(0,0,512,542);
         if(alpha<255&&token==0){alpha+=2.5;}
         if(alpha==255||token==1){token=1;frame2++;}
         if(frame2>=120&&alpha>0){alpha-=2.5;}
         if(frame2>=120&&alpha==0){event=1;}
         SetGraphicScale(1, 1);
         DrawGraphic(GetCenterX, GetCenterY);
         if(frame2>=30&&frame2<90){
            LoadGraphic(awhile);
            SetTexture(awhile);
            SetAlpha(alpha2);
            if(frame2<=50&&alpha2<255){alpha2+=255/20;}
            if(frame2>=70&&alpha2>0){alpha2-=255/20;}
            SetGraphicRect(0, 0, 615, 168);
            SetGraphicScale(0.5, 0.5);
            DrawGraphic(GetCenterX, GetCenterY);
         }
      }
   }
   @Finalize{
      DeleteGraphic(ImgBoss);
   }
}
script_event talk2{
   //image declaration here
   @Initialize{
      //loading of image here
      alternative( GetPlayerType() )
        case( REIMU_A, REIMU_B ){
           //silly conversation 1, it's not the main point
        }
        case( MARISA_A, MARISA_B ){
           //silly conversation 2, it's not the main point again
        }
        SetStep(2);
        //remove graphics here since the boss goes out for a while
        loop(324){yield;} //suppose to wait 324 but this does not work
        //load image again here
        alternative( GetPlayerType() )
        case( REIMU_A, REIMU_B ){
           //2nd part of silly conversation 1
        }
        case( MARISA_A, MARISA_B ){
           //2nd part of silly conversation 2
        }
        SetStep(3);
        //remove all graphics here
   }
   @MainLoop{
      yield;
   }
   @DrawLoop{
   }
   @Finalize{
   }
}
Old/Forgotten member.

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

DDRMANIAC007

  • The DDR Maniac
  • Dance Dance Revolution
    • The Touhou stream blog
Re: Danmakufu Q&A/Problem Thread v3
« Reply #861 on: May 27, 2010, 02:05:10 AM »
Does it do this immediately on startup, or do you choose any options?

Is it a clean install?

Tried tweaking the config options?

You could also try deleting script_index.dat, there may be an issue in that file. Rerunning danmakufu and checking your scripts forces its recreation.
Never had an index. Fixed by getting another copy with included stuff from a friend. I also have to run it under applocale as an administrator.
(Gotta be a better fix than that.)

Re: Danmakufu Q&A/Problem Thread v3
« Reply #862 on: May 27, 2010, 02:24:10 AM »
I also have to run it under applocale as an administrator.
(Gotta be a better fix than that.)

Everybody does. This is required to play. You can make a shortcut icon with Applocale, y'know. If you really don't want to do that, just switch your computer's locale to Japanese and run the program normally.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #863 on: May 27, 2010, 08:42:37 AM »
If my code is like this, 2 events with a time interval between them, how should I do that effect? :ohdear:
or should I use 2 events, but the third one would not work, perhaps due to the never-ending event 2.

(in all tutorials it is taught that killing the boss would end the event, but this won't work for 2 events in a single script)
sorry for the lengthiness of my script and my poor expression  :V

long ass code here


I like how you're trying to yield 300 times in @Initialize.
An event script is not the same as a task so yielding it will not do anything. As far as I can tell, during event scripts, calling those TextOut functions actually pauses the script while the text is being displayed, so event scripts don't behave the same way as enemy scripts either. If you want to pause an event script, you can try using TextOutB and making it output a blank string and put the other parameter as the time you want to wait.
<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.

Henry

  • The observer
  • Exploring to the new world of Danmaku
Re: Danmakufu Q&A/Problem Thread v3
« Reply #864 on: May 27, 2010, 11:33:48 AM »
I like how you're trying to yield 300 times in @Initialize.
An event script is not the same as a task so yielding it will not do anything. As far as I can tell, during event scripts, calling those TextOut functions actually pauses the script while the text is being displayed, so event scripts don't behave the same way as enemy scripts either. If you want to pause an event script, you can try using TextOutB and making it output a blank string and put the other parameter as the time you want to wait.

perhaps the best solution is to use 2 scripts and stuff them into the plural script. :V
Old/Forgotten member.

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread v3
« Reply #865 on: May 27, 2010, 03:26:22 PM »
Wait(x)  in Event dialogue pauses the dialogue for the x-amount of seconds.

Hence why I told several people not to use 'wait' wit ha capital W as function for the task-method scripting.
« Last Edit: May 27, 2010, 03:36:51 PM by Helepolis »

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem Thread v3
« Reply #866 on: May 27, 2010, 03:50:06 PM »
There's another little thing I've been looking around for an answer to, but I've yet to find anything to help me. Is there some kind of function for shaking the screen in the way it does when you're using the Master Spark bomb in Imperishable Night and Perfect Cherry Blossom? There's also a funky laser attack in Uwabami Breakers that causes the screen to shake/tremble, and I'm sure there are more examples to be found in all of the games. So anyway, is there any kind of function for shaking the screen in that way, or would that have to be left up to the Drawing of things?

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #867 on: May 27, 2010, 05:11:32 PM »
It's... being worked on. There were a few different methods but I think someone was going to try render targets or something.

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

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem Thread v3
« Reply #868 on: May 27, 2010, 05:16:12 PM »
Alright, that's cool. :)

How about shrinking the player's field of vision, like when you're fighting Mystia in Imperishable Night? Would that work by applying a black curtain at the top layer or something like that?

Bitz

  • So Moe!
  • *heart attack*
Re: Danmakufu Q&A/Problem Thread v3
« Reply #869 on: May 27, 2010, 05:46:40 PM »
Alright, that's cool. :)

How about shrinking the player's field of vision, like when you're fighting Mystia in Imperishable Night? Would that work by applying a black curtain at the top layer or something like that?

Yeah, shove a giant "black curtain" Object Effect on top of everything.
« Last Edit: May 27, 2010, 08:45:24 PM by Helepolis »