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

8lue Wizard

  • Cobalt Magician
  • (Apparently)
Re: Danmakufu Q&A/Problem thread number 4
« Reply #780 on: January 24, 2011, 03:56:25 AM »
Quote from: Stuffman
CreatePlayerShot01 is the only bullet function for players; anything else will need to be an object shot. Anyway, it's pretty similar to the enemy version, CreateShot01. The difference is the addition of two arguments, which is the two next-to-last. The first (2.5) is the damage the bullet will do. The second (1) is the penetration, or the number of hits the bullet can score, once per frame. If you set the penetration to some huge number the bullet will be able to shoot through every enemy it hits, but be sure to set the damage low if you do something like that! The final argument is the bullet graphic, in this case the blue knives we defined earlier. Player shots cannot have delay.
Huh. Must've skipped that part. Besides, it only specifies bullet functions; it doesn't say anything about lasers.

Object lasers do not use Obj_SetSpeed. You will have to set their position every frame using Obj_SetPosition (or Obj_SetX and Obj_SetY).

I figured as much. Oh well.

GuardianTempest

  • Adorably Awkward Android
Re: Danmakufu Q&A/Problem thread number 4
« Reply #781 on: January 24, 2011, 10:08:54 AM »
Code: [Select]
    @MainLoop {
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 32);
        if(frame==10){
            CreateShot01(GetX, GetY, 5, angle1, WHITE11, 0);
          angle1 = angle1 + 10;
        }
        if(frame==10){
            CreateShot01(GetX, GetY, 5, GetAngleToPlayer, BLUE21, 0);
        }

        if(frame==120){
            SetMovePosition03(GetCenterX, GetCenterY, 10, 3);
            frame = 0;
        }
        frame++;
        yield;
    }
New Problem, yes it moves, it fires though it doesn't fire at the way I want it to.

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem thread number 4
« Reply #782 on: January 24, 2011, 10:20:55 AM »
New Problem, yes it moves, it fires though it doesn't fire at the way I want it to.

Let me guess - you want it to fire once every 10 frames, right? As it stands, the CreateShot01's will happen when 'frame' equals 10, but then 'frame' will keep increasing until it reaches 120, where it resets to zero.

Instead of
"if(frame==10)"
try
"if(frame%10==0)"
which basically tells the script to fire the shots whenever 'frame' is divideable with 10 (at least that's what I think it does). This means that the shots will be fired when 'frame' equals 0, 10, 20, 30, 40 and so on. This will also mean that the shots will be fired just as the script starts, since 'frame' start out as 0. To negate this you can place your frame++ at the top of your main loop instead. That way 'frame' will equal 1 when the script reaches the if-statements for the first time.

GuardianTempest

  • Adorably Awkward Android
Re: Danmakufu Q&A/Problem thread number 4
« Reply #783 on: January 24, 2011, 10:27:52 AM »
Let me guess - you want it to fire once every 10 frames, right? As it stands, the CreateShot01's will happen when 'frame' equals 10, but then 'frame' will keep increasing until it reaches 120, where it resets to zero.

Instead of
"if(frame==10)"
try
"if(frame%10==0)"
which basically tells the script to fire the shots whenever 'frame' is divideable with 10 (at least that's what I think it does). This means that the shots will be fired when 'frame' equals 0, 10, 20, 30, 40 and so on. This will also mean that the shots will be fired just as the script starts, since 'frame' start out as 0. To negate this you can place your frame++ at the top of your main loop instead. That way 'frame' will equal 1 when the script reaches the if-statements for the first time.

HAh!! Brilliant!! Thanks alot! Once I'm done tweaking my 50-50 sweep....

EDIT: Oh great...Step 2 problem.
Code: [Select]
        if(frame%1==0){
            CreateShot01(GetX, GetY, 6, angle1, WHITE11, 0);
          angle1 = angle1 + 2;
        }
//        if(frame%1==0){
//            CreateShot01(GetX, GetY, 6, angle2, WHITE11, 0);
//          angle1 = angle2 + 2;
//        }
//        if(frame%1==0){
//            CreateShot01(GetX, GetY, 6, angle3, WHITE11, 0);
//          angle1 = angle3 + 2;
//        }
//        if(frame%1==0){
//            CreateShot01(GetX, GetY, 6, angle4, WHITE11, 0);
//          angle1 = angle4 + 2;
//        }

The spinning motion works fine but when I uncomment the three parts, then the fountain just freezes in place for UBER-graze points.
Then once this is fixed I'm done.

Clumping them together didn't work either.
« Last Edit: January 24, 2011, 11:28:08 AM by GuardianTempest »

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem thread number 4
« Reply #784 on: January 24, 2011, 11:32:12 AM »
The spinning motion works fine but when I uncomment the three parts, then the fountain just freezes in place for UBER-graze points.
Then once this is fixed I'm done.

Clumping them together didn't work either.

Of all your angle variables, you're only ever increasing the value of 'angle1'.  The other bullet streams will remain static.

It should be
angle2 = angle2 + 2
angle3 = angle3 + 2
angle4 = angle4 +2

Edit:
You could give this method a shot, too. Put the variables in your @Initialize an the if-statement in your @MainLoop (after removing all other if-statements. This new one fires four bullets per frame on its own).
Code: [Select]
let angle = 2;
let dir = 0;

if(frame%1==0)
{
     loop(4)
     {
          CreateShot01(GetX,GetY,6,dir,WHITE11,0);
          dir+=360/4;
     }
    dir+=angle;
}
« Last Edit: January 24, 2011, 11:43:31 AM by MasterSpark »

GuardianTempest

  • Adorably Awkward Android
Re: Danmakufu Q&A/Problem thread number 4
« Reply #785 on: January 24, 2011, 11:44:58 AM »
*facepalm*

Wish I was more aware of this....man this behavior of mine is exhibited in all of the roleplays I've been to, both IC and OOC.

Anyway it worked, seems I need to be more aware now.

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: Danmakufu Q&A/Problem thread number 4
« Reply #786 on: January 30, 2011, 03:30:00 AM »
I swear, I need to favorite this thread, I fail so bad :V
Anyways, I tried making a stage for the first time, and I decided to animate the enemies using Helepolis's tutorial  so it wouldn't be so boring.
BAD IDEA
So many errors: All enemies dissapear and reapear when just one dies. Some animate correctly, some don't. Etc.

http://www.mediafire.com/?ozcwda17f45zx4l

I'd use pastebin, but I had to include the enemy image I used to replicate the error as close as possible.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #787 on: January 30, 2011, 04:51:58 AM »
So many errors: All enemies dissapear and reapear when just one dies. Some animate correctly, some don't. Etc.
All enemies disappear when one dies, eh?
Obviously, you're: 1) deleting the fairy graphic in the enemy file's @Finalize; then 2) loading the fairy graphic again in the same enemy file's @Initialize.
That's a big no-no.
Instead, you should load and delete every graphic you're gonna use, in the stage itself, rather than in every enemy file.

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: Danmakufu Q&A/Problem thread number 4
« Reply #788 on: January 30, 2011, 05:35:33 AM »
All enemies disappear when one dies, eh?
Obviously, you're: 1) deleting the fairy graphic in the enemy file's @Finalize; then 2) loading the fairy graphic again in the same enemy file's @Initialize.
That's a big no-no.
Instead, you should load and delete every graphic you're gonna use, in the stage itself, rather than in every enemy file.

Oh my- *facepalm*
That makes so much sense, thanks  :]

Re: Danmakufu Q&A/Problem thread number 4
« Reply #789 on: February 01, 2011, 01:40:58 AM »
I tried to load up a danmakufu  script  (Thaws snow V3 Attack phase 1-L ) and it crashed the Game.
any help? :/

KuraiShoka

  • Now son, don't touch that cactus...
  • Son, I Am Dissapoint
Re: Danmakufu Q&A/Problem thread number 4
« Reply #790 on: February 01, 2011, 02:09:56 AM »
I tried to load up a danmakufu  script  (Thaws snow V3 Attack phase 1-L ) and it crashed the Game.
any help? :/

Are you running Danmakufu through Applocal or with a computer set to japanese system local? If not, you need to do that or Danmakufu will keep crashing.

Schezo

  • en-counse
Re: Danmakufu Q&A/Problem thread number 4
« Reply #791 on: February 06, 2011, 04:38:31 AM »
Ok so these Event scripts that do the dialogue are just stumping me and I've hit a rough point that I can't make them do what I want.

So I've created an object effect for when the boss dies and I'm making it go in this order:
Code: [Select]
task mainTask{
startexplode;
wait(180);
VanishEnemy;
}

So now, I'm trying to get an event script to go off after all that, since it is just programmed in a separate attack at the end of the plural file.  But I also want it to be able to choose various event scripts depending on how the script was played (ie. say something different if a continue was used) but all the different ways I've tried it didn't even create an event script at the end.  I'm guessing that I should place the events in if statements like:

if(Continued==true){
   CreateEventFromScript("lol");
   }
if(Continued==false){
   CreateEventFromScript("Winnerwhatwhat");
   }

Or I could be totally wrong.  The problem is, I don't know where to place this or if I'm missing something important to make the event go off before the script ends or if I should be using a different method to make the boss sprite disappear when it explodes.

If it matters the plural is in a stage file and using that as a method is possible (?).

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: Danmakufu Q&A/Problem thread number 4
« Reply #792 on: February 10, 2011, 01:30:00 PM »
Hello, I am trying to make the familiars spawn, but they don't. Whenever I run the script it tells me that there is an error with the Function and closes.

http://pastebin.com/YvDPTfR0

There is the whole code, Danmakufu throws me an error on Line 65. Thanks.
Small Teaser of my upcoming project~

No need to call me Teff007. Teff will do just as well~

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #793 on: February 10, 2011, 02:11:48 PM »
The problem is actually in line 117:

Code: [Select]
script_enemy_starFam {should be
Code: [Select]
script_enemy starFam {
Because you have worded it the way you did, danmakufu does not recognize "starFam" as the name of the enemy, so the CreateEnemyFromScript function doesn't recognize it and throws up an error.
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."

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: Danmakufu Q&A/Problem thread number 4
« Reply #794 on: February 10, 2011, 09:13:53 PM »
Well, now aparrently the problem is on line 161.

http://pastebin.com/Xqt0ajdF
Small Teaser of my upcoming project~

No need to call me Teff007. Teff will do just as well~

Zengar Zombolt

  • Space-Time Tuning Circle - Wd/Fr
  • Green-Red Divine Clock
Re: Danmakufu Q&A/Problem thread number 4
« Reply #795 on: February 10, 2011, 10:14:58 PM »
I don't see an error, prolly because I'm not that experienced, but I do see that since rad = 0 you're not moving the boss anywhere.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #796 on: February 10, 2011, 10:15:53 PM »
Well, now aparrently the problem is on line 161.

http://pastebin.com/Xqt0ajdF
You have not defined "dir".

This was an error that you could have figured out by yourself pretty easily, though.  :derp:
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."

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #797 on: February 10, 2011, 10:23:43 PM »
Come on people. At least try read your goddamn errors and figure your problems out for yourself. We may be bored here, but not bored enough to answer every little tidbit that you complain about when you try to make a whole script without testing then go "oops it doesn't work better go ask motk".

seriously jesus



EDIT: To demonstrate slightly more thoroughly, take the above question. Since Iryan identified the (or one of the) problem(s) to be an undefined variable, there likely would have been ERROR: LINE X: "dir" HAMITEIGINOSHIKIBETSUSHI. You see the variable name, and you should be able to understand that there's something wrong with the variable on line X. If you know how these errors work and look, then you should be able to pick up automatically that it's an undefined variable. Otherwise, you can look around to see why it errors, and quickly figure out that it's undefined simply because well you didn't define it.

It's the same thing with more complicated errors, and it's the reason we have a small error database. You should have a japanese locale method enabled or at least available; there are few excuses for not knowing the actual error before asking a question. Some people (lol hi) can even tell the error in non-localed DNH, where it just spews garbage and identifier names everywhere. Your error messages are key to solving your problems and you need to learn or at least reference this shit.

If you seriously cannot figure out why it's giving you a certain error or the error makes no sense or whatever and you can't deduce the problem yourself after going over your script a few times, THEN PLEASE ask why it isn't working (run-on sentence woo). In addition, although it only really matters for more advanced shit, if you can't figure out the problem after all this, don't mess up your whole goddamn script before coming to ask a question.
« Last Edit: February 11, 2011, 01:31:40 AM by Drake »

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

Re: Danmakufu Q&A/Problem thread number 4
« Reply #798 on: February 13, 2011, 02:36:45 PM »
Neh Neh, I have a question.

I don't really understand how to use || [The or thing]
So let's say you want a bullet to either go at 0 or 90 degree how would you use this ?
[No other angle only 0 and 90]
Hey There !

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #799 on: February 13, 2011, 02:44:12 PM »
You mean, randomized?

That you do by using let coin=rand_int(0, 1); if(coin==0){ ... } else{ ... }.

|| is a logic operator that you can use inside the if( ) brackets so that the conditions are fulfilled if at least one of two conditions is met.

if(coin==0||coin==1){ stuff }  would mean the stuff happens if at least one of the conditions is true, and if coin is always either 0 or 1, that would be everytime.
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."

Re: Danmakufu Q&A/Problem thread number 4
« Reply #800 on: February 13, 2011, 03:02:29 PM »
You mean, randomized?

That you do by using let coin=rand_int(0, 1); if(coin==0){ ... } else{ ... }.

|| is a logic operator that you can use inside the if( ) brackets so that the conditions are fulfilled if at least one of two conditions is met.
if(coin==0||coin==1){ stuff }  would mean the stuff happens if at least one of the conditions is true, and if coin is always either 0 or 1, that would be everytime.

Thanks Iryan, this is what I was trying to do



I took the easy way but Thanks for the idea  :]

http://pastebin.com/7tThNVF6
Hey There !

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #801 on: February 14, 2011, 05:20:51 AM »
Neh Neh, I have a question.

I don't really understand how to use || [The or thing]
So let's say you want a bullet to either go at 0 or 90 degree how would you use this ?
[No other angle only 0 and 90]

[0,90][rand_int(0,1)]
or
90*rand_int(0,1)

... What.
Remember, sometimes the answer is right in front of you. It's just invisible to you.
« Last Edit: February 14, 2011, 05:40:57 AM by Mewkyuu »

Uzumaki_tenma

  • JAOOOOOOOOO!!!!!!!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #802 on: February 15, 2011, 04:58:25 AM »
Hello, I have a question:
In the event script you can use as default MARISA and REIMU scripts...
Quote
   if(GetPlayerScriptName=="REIMU"){
      CreateEventFromScript("Reimu");
   
   }else if(GetPlayerScriptName=="MARISA"){
      CreateEventFromScript("Marisa");}
But, if you have another player script, how can I do to make the event only for this script?

Quote
   
OPTION 1

}else if(GetPlayerScriptName=="player\Sanae\SanaeA.txt"){
      CreateEventFromScript("Sanae");}

OPTION 2

   }else if(GetPlayerScriptName=="Sanae A"){
      CreateEventFromScript("Sanae");}

No one worked

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #803 on: February 15, 2011, 05:23:04 AM »
Hello, I have a question:
In the event script you can use as default MARISA and REIMU scripts...But, if you have another player script, how can I do to make the event only for this script?
No one worked
For SanaeA, use "SanaeA.txt".

Seriously, test it with the given Rumia script - it would return "Rumia.txt" (I think).

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #804 on: February 15, 2011, 11:56:17 AM »
If you're not sure what a function is outputting, you can always use the DrawText or RaiseError functions to see what it's giving you.

In your case, you can try RaiseError(GetPlayerScriptName, "player script name"); in @Initialize and select the Sanae player you want to check. This will cause Danmakufu to spit out an error message with the name of the player.
<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.

Uzumaki_tenma

  • JAOOOOOOOOO!!!!!!!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #805 on: February 15, 2011, 05:38:22 PM »
Uhm.... uh? sry, im a little slow...

mmmm well, check this image please
http://i580.photobucket.com/albums/ss249/Uzumaki_Tenma/test_desktop_1.jpg

Zengar Zombolt

  • Space-Time Tuning Circle - Wd/Fr
  • Green-Red Divine Clock
Re: Danmakufu Q&A/Problem thread number 4
« Reply #806 on: February 15, 2011, 06:39:03 PM »
That's because GetPlayerScriptName gives SanaeA, not SanaeA.txt.

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #807 on: February 15, 2011, 07:41:24 PM »
YOU MESSED UP YOUR BRACKETS. THE ERROR SAYS IT CAN'T FIND THE END OF THE LINE.

ALWAYS CHECK YOUR BRACKETS.

if(reimubla){
    reimuthing;
}else if(marisabla){
    marisathing;}
}else if(sanaebla){
    sanaething;}

It would have really helped if you just tabbed and enclosed things properly. Move the bracket at the end of sanaething one line down, and get rid of the bracket after marisathing.
But also realize that the problem wasn't the player name, so change that back to "Sanae A".
« Last Edit: February 15, 2011, 07:43:02 PM by Drake »

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

Uzumaki_tenma

  • JAOOOOOOOOO!!!!!!!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #808 on: February 16, 2011, 04:10:37 PM »
whops
hehehe... sorry ^^U, fixed
well, thank you very much
***EDIT***
new problem: the program closed when I tried, trying "with player\Sanae\SanaeA.txt"

and...

Quote
@Initialize{
   SetLife(1);
   SetDamageRate(1,1);
   LoadGraphic(Boss);
   SetGraphicRect(0,0,63,93);
   SetX(GetClipMaxX-50);
   SetY(-110);
   CollectItems;
   RaiseError(GetPlayerScriptName, "Sanae A");
   SetEnemyMarker(true);
   SetMovePositionHermite(cx,120,-90,290,0,0,100);

   if(GetPlayerScriptName=="REIMU"){
      CreateEventFromScript("Reimu");
   
   }else if(GetPlayerScriptName=="MARISA"){
      CreateEventFromScript("Marisa");

   }else if(GetPlayerScriptName=="Sanae A"){
      CreateEventFromScript("Sanae");
   }   

}

http://i580.photobucket.com/albums/ss249/Uzumaki_Tenma/test_desktop_3.jpg

What the hell happened??!!??

Zengar Zombolt

  • Space-Time Tuning Circle - Wd/Fr
  • Green-Red Divine Clock
Re: Danmakufu Q&A/Problem thread number 4
« Reply #809 on: February 16, 2011, 04:39:20 PM »
That's the effect of RaiseError. So yeah, comment it out / Delete it.