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

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread II
« Reply #810 on: January 09, 2010, 06:38:46 AM »
Offhand, if it doesn't spit one of those moonrune errors at you, it'll probably just ignore it like it would ignore a draw command for a picture that wasn't loaded, or something like that.

Re: Danmakufu Q&A/Problem Thread II
« Reply #811 on: January 09, 2010, 06:50:12 AM »
Does anyone know what Danmakufu returns when you divide a number by 0? ???

  @DrawLoop {
   DrawText(ToString(1/0), 180, 240, 50, 255);
  }



Took me longer to upload the damn image than it did to write the script. We're getting pretty lazy nowadays, aren't we?

EDIT: Also, this is not the universal output for dividing by zero. Many of Danmakufu's internal functions have defaults for dividing by zero. For example, the function atan2(y, x) is defined as:

function atan2(y, x){
   if(y==0){
      if(x<0){
         return 180
      }else{
         return 0
      }
   }else{
      return 2*atan(((x^2 + y^2)^0.5 - x)/y)
   }
}


Or something like that. The point is that the function is defined seperately if y = 0, since the function is supposed to divide by y. Yet, when you just type in ToString(1/0), it comes out as dsfglf. Kind of odd that some things are defined as numbers, whereas others get weird text gibberish?
« Last Edit: January 09, 2010, 07:04:35 AM by Naut »

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread II
« Reply #812 on: January 09, 2010, 07:02:43 AM »
But does it say 1.#INF00 or 1.#INFOO, or possibly even 1.#INFO0? This is important.

Re: Danmakufu Q&A/Problem Thread II
« Reply #813 on: January 09, 2010, 07:05:34 AM »
But does it say 1.#INF00 or 1.#INFOO, or possibly even 1.#INFO0? This is important.

Also, taking the logarithm of a negative number or getting the squareroot of a negative number will yield:

-1.#IND00
« Last Edit: January 09, 2010, 07:14:06 AM by Naut »

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 #814 on: January 09, 2010, 07:32:18 AM »
Kind of odd that some things are defined as numbers, whereas others get weird text gibberish?

That IS weird...
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Fetch()tirade

  • serial time-waster
Re: Danmakufu Q&A/Problem Thread II
« Reply #815 on: January 10, 2010, 12:53:00 AM »
I want to make a value that would change the colors of the shots randomly. I was thinking that I could first define a certain set of numbers as those colors (say 601, a large number to avoid conflicts in the script,  = RED01, and so on). Then I could define the value as equal to rand_int(601,604) or however many different colors, and then it would select a different graphic when it loops. Is that at all possible? If so, how?

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread II
« Reply #816 on: January 10, 2010, 12:59:43 AM »
Make it an array.

let COLORS=[RED01,ORANGE01,etc];

Then just access random colors with COLORS[rand_int(etc,etc)]. You could use it in SetShotDataAs and stuff.

Fetch()tirade

  • serial time-waster
Re: Danmakufu Q&A/Problem Thread II
« Reply #817 on: January 10, 2010, 01:19:15 AM »
Oh okay. Thanks.

EDIT: Is there a square root function? I'm trying to make a distance formula, but I need the last part.
« Last Edit: January 10, 2010, 04:20:44 AM by Flashtirade »

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread II
« Reply #818 on: January 10, 2010, 05:11:55 AM »
Take the value to the half power. Or just download my common functions package.[/self-promotion]
<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.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #819 on: January 10, 2010, 06:19:26 AM »
[/self-promotion]
:V

Oh, what is the shot way down there at the bottom left of the img\Shot.png? Is it the delay thing??

EDIT: ww I changed the ice shards to cards because they look better. w

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem Thread II
« Reply #820 on: January 10, 2010, 03:20:43 PM »
This isn't so much of a problem as it is one that I already solved, but I can see someone potentially breaking a few keyboards over this, so I'm saying it anyway.

In the header, the script title doesn't have a built-in character limit, so it can be however long you want. However, in one case, I accidentally deleted the end bracket, which made the entire script into the title. Loaded up DMF, went into the script menu, and it crashed. No problem though, I noticed the error and fixed it... but it still crashed. Even after entirely deleting the script, it still crashed.

Turns out DMF archives script names for faster access, so it was loading the archived one, coming across the name, and blowing up. I had to delete script_index.dat to get everything to work again.

Maybe this could be added to a sticky thread somewhere? I know it's not going to be a common occurrence, but listing all possible reasons for an error (especially weird ones like this) is always welcome.

CK Crash

  • boozer
Re: Danmakufu Q&A/Problem Thread II
« Reply #821 on: January 10, 2010, 04:04:09 PM »
Azure, maybe it could be added to a troubleshooting page on the DMF wiki?

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #822 on: January 10, 2010, 06:26:58 PM »
In a stage script, is there a way to keep the child enemies from dying when the boss enemy dies?
I'm not talking about child enemies the boss spawns or from the boss's script, but the ones spawned in the stage script, separate from the boss. They somehow automatically die if the enemy boss dies, and I want to get rid of that.

Re: Danmakufu Q&A/Problem Thread II
« Reply #823 on: January 10, 2010, 06:51:02 PM »
In a stage script, is there a way to keep the child enemies from dying when the boss enemy dies?
I'm not talking about child enemies the boss spawns or from the boss's script, but the ones spawned in the stage script, separate from the boss. They somehow automatically die if the enemy boss dies, and I want to get rid of that.
This is just a guess but try ending the boss with VanishEnemy

Re: Danmakufu Q&A/Problem Thread II
« Reply #824 on: January 10, 2010, 08:49:56 PM »
In a stage script, is there a way to keep the child enemies from dying when the boss enemy dies?
I'm not talking about child enemies the boss spawns or from the boss's script, but the ones spawned in the stage script, separate from the boss. They somehow automatically die if the enemy boss dies, and I want to get rid of that.

All enemies and bullets are deleted when a spellcard ends, save for the boss. There is no way around this. You may respawn enemies and bullets the frame after if you wish, lol.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #825 on: January 11, 2010, 01:11:30 AM »
There is no way around this, lol.


Danmakufu gets harder and harder to work with. Everytime I manage to do something new it always, ALWAYS comes back at me with an obstacle. How annoying...

Re: Danmakufu Q&A/Problem Thread II
« Reply #826 on: January 11, 2010, 01:34:45 AM »
Well the thing is when a boss dies that's supposed to be the end of the stage right? If it's a midboss or something, you could make the rest of the stage part of a spellcard.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread II
« Reply #827 on: January 11, 2010, 09:34:11 AM »
What are you trying to accomplish? There's almost always a workaround to every limitation that Danmakufu has, even if it's very roundabout.
<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.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #828 on: January 11, 2010, 02:07:26 PM »
Couldn't you just have the supposed boss enemy be a regular non-boss enemy? I mean, a special sprite and a magic circle ought to be enough to distinguish it from the regular enemies, and you can call CutIn in non-boss enemies.

For every attack, you'd have a singular enemy script with the same framework and which you can call with CreateEnemyFromFile. To make the transition from one boss attack to the next work properly, you'd have to use Set/GetCommonData to keep track of the boss' position and the animation data of the magic circle. This is somewhat tedious, but it seems to be possible.

If you declare a spell card, it won't end until a boss enemy dies, so you'll have to use SetText(""); in the @Finalize. I have no idea how to work around the lack of spell card bonus score, though. I mean, you can add the score manually, but the effect that usually occurs when you capture something won't occur until a boss dies.

Other than this last issue, right now I can't think of anything that cannot be worked around. If you consider that one negligible and if you are dedicated enough to type out the workarounds for the rest... well, go for it!

...  :V
« Last Edit: January 11, 2010, 02:13:47 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."

Infy♫

  • Demonic★Moe
  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #829 on: January 11, 2010, 04:14:20 PM »
how do I recreate the scope collision detection things from PoFV?
especially the one of medicine looks difficult to make

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #830 on: January 11, 2010, 05:31:05 PM »
Effect Objects?

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

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #831 on: January 11, 2010, 08:08:01 PM »
Couldn't you just have the supposed boss enemy be a regular non-boss enemy? I mean, a special sprite and a magic circle ought to be enough to distinguish it from the regular enemies, and you can call CutIn in non-boss enemies.

I was thinking about doing that. By the way, I make my own cutins, I don't like Danmakufu's system. The magic circle and the scores, too. I make them all myself. The bonus score would be extremely easy. The only thing I have left to find out is if enemies die when the child enemy declares a spellcard and then dies. If they don't, then this might be the answer I'm looking for. If they do die, well... it's impossible without reprogramming Danmakufu.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #832 on: January 11, 2010, 08:19:03 PM »
I was thinking about doing that. By the way, I make my own cutins, I don't like Danmakufu's system. The magic circle and the scores, too. I make them all myself. The bonus score would be extremely easy.
...thought so.  :V
Quote
The only thing I have left to find out is if enemies die when the child enemy declares a spellcard and then dies. If they don't, then this might be the answer I'm looking for. If they do die, well... it's impossible without reprogramming Danmakufu.
Well, to test this, I made a script that spawns the same non-boss enemy two times, which has a CutIn and a SetScore,  with two seconds in between each spawn. Neither of them dies when I kill the other one, so...  :V

I don't think you really have a problem anymore. Besides the position saving with the common data, anyways.
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 II
« Reply #833 on: January 11, 2010, 11:05:43 PM »
This isnt so much a question dealing with Danmaku in Danmakufu but, when I run Danmakufu, it opens up twice, and then one closes and I use the window not closed, why is this?

ChaoStar

  • Dark History Boy
Re: Danmakufu Q&A/Problem Thread II
« Reply #834 on: January 12, 2010, 02:05:16 PM »
This isnt so much a question dealing with Danmaku in Danmakufu but, when I run Danmakufu, it opens up twice, and then one closes and I use the window not closed, why is this?

Maybe you're clicking too much?

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #835 on: January 12, 2010, 02:34:27 PM »
Maybe you're clicking too much?
Yeah, probably that. Except sometimes I click just once.

P.S. There are only 5 impossible requests.

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #836 on: January 13, 2010, 03:41:19 AM »
I think I'm having a problem with the Shot Replace V4.

Every time I attempt to call it, something amiss happens.

I have it saved in lib\ExpandedShotDatav4\.

Gc

  • youtu.be/pRZpjlrKM8A
Re: Danmakufu Q&A/Problem Thread II
« Reply #837 on: January 13, 2010, 03:48:25 AM »
I think I'm having a problem with the Shot Replace V4.

Every time I attempt to call it, something amiss happens.

I have it saved in lib\ExpandedShotDatav4\.
#include_function |lib\ExpandedShotDatav4\shot_replace.dnh" before @Initialize
then ShotInit; in @Initialize ?

(I should really get to making that readme...)

Nimble

  • Broken English Fox
  • Rushing toward the bullet!
    • Viewmix
Re: Danmakufu Q&A/Problem Thread II
« Reply #838 on: January 13, 2010, 03:13:30 PM »
Some bullet questions again.

How can I create spiral bullet stream like this?

And how can I create bullet that bounch on each side?
From Naut's Tutorial I can make them bounch in X but when I try in Y, the bullet act very odd.
(I want them to bounching around permanently until spell brake.)

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #839 on: January 13, 2010, 03:55:19 PM »
Some bullet questions again.

How can I create spiral bullet stream like this?
Either with object bullets or with ShotA bullets.

for object bullets,

x, y = starting coordinates
v = speed in stream direction
ang = stream direction
delta = phase of the bullet. Putting 90 and 270 here will do what you want to do.
phi = speed of direction change
ampli = maximum velocity at a right angle to the stream direction
graph = bullet graphic
Code: [Select]
    task TBullet(x, y, v, ang, delta, phi, ampli, graph){

       let obj=Obj_Create(OBJ_SHOT);

       Obj_SetPosition(obj, x, y);
       Obj_SetAngle(obj, ang);
       Obj_SetSpeed(obj, 0);
       ObjShot_SetGraphic(obj, graph);
       ObjShot_SetDelay  (obj, 0);

       while(Obj_BeDeleted(obj)==false) {

           delta+=phi;

           Obj_SetX(obj, Obj_GetX(obj) + v*cos(ang) + ampli*sin(delta)*cos(ang+90) );
           Obj_SetY(obj, Obj_GetY(obj) + v*sin(ang) + ampli*sin(delta)*sin(ang+90) );

           Obj_SetAngle(obj, ang+90-atan( v/(ampli*sin(delta)) ) );
           yield;
       }
    }

Hmm, I gotta use a variation of that code somewhere...  :V
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."