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

capt. h

  • Only sane townie
Re: Danmakufu Q&A/Problem thread number 4
« Reply #750 on: January 14, 2011, 08:40:33 PM »
Of course Directory loads faster, it doesn't load every script at once.

Also.

http://alcahest.perso.sfr.fr/perso/apploc/applocpatched.zip

Download that, replace the applocale exe in C:\Windows\AppPatch.

http://alcahest.perso.sfr.fr/perso/apploc/localejaptoexecontext.zip

Download that, run the install reg file.

Right click th_dnh.exe, Properties. Compatibility Mode, change stuff.

Restart comp, right-click th_dnh.exe, Locale Japanese.

All problems solved.

Using this, I was able to get inside the program's title screen without crashing. I try to run a script (Hit anything other than directory) and it stops working immediately. I'm running danmakufu in 2000 compatibility mode, but only the main program and the config program; I don't think I can put an entire file into compatibility mode like that.

Thanks, I am able to get much farther than last time, but I'm still crashing before I pass the title screen. Is there anything else I could do?
« Last Edit: January 14, 2011, 08:42:46 PM by capt. h »

Re: Danmakufu Q&A/Problem thread number 4
« Reply #751 on: January 14, 2011, 10:13:53 PM »
It might be a problem with the script (or how you extracted it), since danmakufu runs fine without compatibility mode on both vista and win7.
« Last Edit: January 14, 2011, 10:17:06 PM by Master Bigode »

Re: Danmakufu Q&A/Problem thread number 4
« Reply #752 on: January 14, 2011, 11:32:11 PM »
I'm taking a wild guess here and will be embarrassed if I'm wrong, but if you haven't yet, move everything to your documents folder, executables and all.  Windows Vista and 7 do not play well with older programs installed into Program Files.  You can make them work if you try hard enough, or you can just ship off elsewhere.  Also, even though AppLocale is supposed to solve the problem, try renaming folders so they don't contain japanese characters.

I'm just going over random stuff that has fixed other Jap programs for me before...

capt. h

  • Only sane townie
Re: Danmakufu Q&A/Problem thread number 4
« Reply #753 on: January 14, 2011, 11:42:48 PM »
It might be a problem with the script (or how you extracted it), since danmakufu runs fine without compatibility mode on both vista and win7.

Oddly, deleting and reinstalling danmakufu got it up and running perfectly. Thanks!

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #754 on: January 14, 2011, 11:48:43 PM »
The problem was your script index file. You could have deleted that and it would have started working again.

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

Re: Danmakufu Q&A/Problem thread number 4
« Reply #755 on: January 15, 2011, 01:54:02 AM »
Can you move enemies during an event script?  Like on PCB stage 4, when Lunasa pops out in the middle.

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #756 on: January 15, 2011, 01:58:50 AM »
An event script doesn't just randomly halt the main script, it'll keep going unless you tell it to yield while OnEvent. When you get to the part that you want to do something, just throw in a omgflag=true; and have the main script act accordingly. Or even, just yield until omgflag is true. Or something of the sort.

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

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #757 on: January 15, 2011, 01:59:16 AM »
Can you move enemies during an event script?  Like on PCB stage 4, when Lunasa pops out in the middle.

SetStep and GetEventStep.
Combine them with a task in the enemy script that calls the event = KABLAM. Moving!!

I'll type up an example later.

Re: Danmakufu Q&A/Problem thread number 4
« Reply #758 on: January 15, 2011, 10:54:59 AM »
Does anybody know how to imitate this spellcard for Danmakufu?
http://www.youtube.com/watch?v=UwUtw_kzTBM
I really want to make that one.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #759 on: January 15, 2011, 11:10:13 AM »
Code: [Select]
function SuperHuman(tx, ty, v, ang, n, t, delay){
  let px=GetX; let py=GetY;
  ascent(i in 0..n){
    CreateShotA(1, px+ (tx-px)*i/(n-1), py+ (ty-py)*i/(n-1), t);
    SetShotDataA(1, 0, 0, ang+720*i/(n-1), 0, 0, 0, BLUE01);
    SetShotDataA(1, delay, 0, ang+720*i/(n-1), 0, 0.1, v, BLUE01);
  }
  SetMovePosition02(tx, ty, t);
}
Not tested, but this should give you one of Byakuren's dashes in a customizable way. If it works, calibrate, then abuse.
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 #760 on: January 15, 2011, 01:38:21 PM »
Code: [Select]
function SuperHuman(tx, ty, v, ang, n, t, delay){
  let px=GetX; let py=GetY;
  ascent(i in 0..n){
    CreateShotA(1, px+ (tx-px)*i/(n-1), py+ (ty-py)*i/(n-1), t);
    SetShotDataA(1, 0, 0, ang+720*i/(n-1), 0, 0, 0, BLUE01);
    SetShotDataA(1, delay, 0, ang+720*i/(n-1), 0, 0.1, v, BLUE01);
  }
  SetMovePosition02(tx, ty, t);
}
Not tested, but this should give you one of Byakuren's dashes in a customizable way. If it works, calibrate, then abuse.
It worked, but the shots appear from the top of the screen and not from Byakuren's trails. Here's the code if there are any problems:
Code: [Select]
task dash{
let px=GetX;
let py=GetY;
let tx=GetCenterX-125;
let ty=GetCenterY-155;
wait(60);
ascent(i in 0..30){
CreateShotA(i,px+(tx-px)*i/(20-1),py+(ty-py)*i/(20-1),1);
SetShotDataA(i,0,0,GetX+720*i/(60-1),0,0,0,246);
SetShotDataA(i,180,0,GetX+720*i/(60-1),0,0.03,2,246);
FireShot(i);
}
SetMovePosition03(GetCenterX-125,GetCenterY-155,10,20);
}

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #761 on: January 15, 2011, 01:57:15 PM »
Heh, I totally forgot the FireShot(1);  :derp:

First off:

Quote
   ascent(i in 0..30){
      CreateShotA(i,px+(tx-px)*i/(20-1),py+(ty-py)*i/(20-1),1);
      SetShotDataA(i,0,0,GetX+720*i/(60-1),0,0,0,246);
      SetShotDataA(i,180,0,GetX+720*i/(60-1),0,0.03,2,246);
      FireShot(i);
      }

These numbers should all be the same. If the orange numbers don't match the green one, the bullets will get misplaced because the line will overshoot. If the blue ones don't match, the angle of the bullets will be a little off. If you want to change the angle range, change 720 to another number, but try keeping it to a multiple of 180 so that it still looks symmetrical.

Second,
Quote
wait(60);
will cause the bullet trail to be dislocated if the boss moves in these 60 frames.

There are other things I would change, but that would depend on what pattern exactly you were trying to make, so I am not going to talk about that.  :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."

Re: Danmakufu Q&A/Problem thread number 4
« Reply #762 on: January 15, 2011, 02:34:45 PM »
 ???
I'm sorry for being such a beginner, but nothing really changes...
I made some changes so that it looks harder.
Here's the whole script if I did something wrong:

http://pastebin.com/0EKaWbcK

Never mind the variables below the include function blabla.  :V
Oh, and the wait(60) in the task trail? If you meant for it as the time for it to appear, then I did that on purpose. ;D
Sorry, still a beginner. ;_;
« Last Edit: January 19, 2011, 07:42:53 AM by Helepolis »

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #763 on: January 15, 2011, 03:00:39 PM »
Quote
CreateShotA(b,px+(tx-px)*b/(150-3),py+(ty-py)*b/(150-2),5);
[...]
CreateShotA(c,px+(tx-px)*c/(150-5),py+(ty-py)*c/(150-3),5);
Why are these not 1?

The original code I posted (which, if you add FireShot(1);, works perfectly fine) was coded like that for a reason.
You want to place n bullets on a line between two points. The length difference between these points is tx-px on the x-axis and ty-py on the y-axis. since you will have one bullet on the starting and end point of the line, the distance on one axis between each individual bullet is equal to the total axial distance divided by (n-1). If you change this number, you will shorten or lengthen the distance between any two bullets and thus the line on which the bullets are actually placed. If you change it to two different values for x and y positions, you will alter the angle of the line as well.

I probably should have explained that from the start. ^^'



Also, when you want to post a long excerpt of code, please don't post it directly in the thread, it stretches the topic out and makes it harder to read.
Use pastebin instead.
 ;)
« Last Edit: January 15, 2011, 03:03:11 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."

Re: Danmakufu Q&A/Problem thread number 4
« Reply #764 on: January 15, 2011, 03:22:31 PM »
OH! It seems I found out what was wrong. xD
Thanks a lot! I owe you billions!

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem thread number 4
« Reply #765 on: January 19, 2011, 08:45:33 PM »
I'm trying to recreate Utsuho's sun bullets from Subterranean Animism as Object Effects (with vertices, in other words), but I am completely unable to make it come out right with the colouring and transparency. Have anyone pieced together the correct recipe for them?

Edit: I am using the standard sun components, axed from Drake's thread.
« Last Edit: January 19, 2011, 08:51:01 PM by MasterSpark »

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #766 on: January 22, 2011, 07:42:22 PM »
I'm trying to recreate Utsuho's sun bullets from Subterranean Animism as Object Effects (with vertices, in other words), but I am completely unable to make it come out right with the colouring and transparency. Have anyone pieced together the correct recipe for them?

Edit: I am using the standard sun components, axed from Drake's thread.

If I remember correctly it's left part alpha blended with rgb(255, 255, 255) on the bottom and the right part add blended with rgb(255, 0, 0) on top. I believe in SA, one or both the parts are rotating and pulsing too so you'll have to experiment with that.
<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.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem thread number 4
« Reply #767 on: January 23, 2011, 06:57:06 AM »
I'm trying to recreate Utsuho's sun bullets from Subterranean Animism as Object Effects (with vertices, in other words), but I am completely unable to make it come out right with the colouring and transparency. Have anyone pieced together the correct recipe for them?

Edit: I am using the standard sun components, axed from Drake's thread.


From what I remember, the object showed its true colors in the center, and became more "pure" red toward the edges. Your best bet would be making an object effect as TRIANGLEFAN. Make a circle with your first vertex at the center with, as blargel said, RGB 255,255,255, and each vertices on the outside or outer edge RGB 255,0,0.
This should give it that glow you want.

GuardianTempest

  • Adorably Awkward Android
Re: Danmakufu Q&A/Problem thread number 4
« Reply #768 on: January 23, 2011, 07:23:00 AM »
Code: [Select]
script_enemy_main {
    let frame = 0;
    let BossImage = "script\GuardianTempest\img\DemoTrap.jpg";
    let BossCutIn = "script\GuardianTempest\img\GeneralJuhziz.jpg";
    let angle1 = 0;
    @Initialize {
    [Juhziz Stuff]
    }

    @MainLoop {
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 69);
        if(frame==60){
            CreateShot01(GetX, GetY, 3, angle1, WHITE11, 10);
            angle = angle + 10;
            frame = 0;
        }
        frame++;
        if(frame==10){
            CreateShot01(GetX, GetY, 5, GetAngleToPlayer, BLUE21, 0);
            frame = 0;
        }
        frame++;
        if(frame==120){
            SetMovePosition03(GetCenterX, GetCenterY, 10, 3);
        }
    }

    [stuff]
}

Can't get it to work...
What I was trying to do was tweak the White stream of bullets to act like a water sprinkler where there is a 50/50 chance of grazing it or die before the GLA. There is also a blue stream that shoots at you so you have to dodge two things at once. But before all those the enemy will move to the center of the screen.


I know I lost the values on the 50-50 sweep but I'll nail it again later...

EDIT: I finally found the edit button.....Hooray!!
« Last Edit: January 23, 2011, 08:03:11 AM by GuardianTempest »

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem thread number 4
« Reply #769 on: January 23, 2011, 08:49:27 AM »
Can't get it to work...

I see a couple of continuity errors in your code. I'll list them below, for clarity:

  • You declare the variable 'angle1' above your @Initialize, but in your MainLoop you increase the value of just 'angle'. The bullets will all keep flying in the same direction because of this, sincle 'angle1' will never increase above its starting value.
  • Follow the logic in your @MainLoop with me. Your 'frame' is increased by 2 for each lap through the main loop (might want to turn it down to just 1 to mimic real time. Simply place a single 'frame++;' at the bottom of your main loop). Then, when it reaches 10, you create a Shot - and then 'frame' is reset to 0 again. This way it'll never be able to reach the other desired values since it'll not go above 10. Place your 'frame = 0;' only with the last action that the boss does, in this case the SetMovePosition.
  • Your main loop is going to need a 'yield;' at the end of it, or else it'll all crash. That's true for all loops in DMF, except the ones that have a finite length (such as a 'loop(number){}' statement, where the stuff in the loop is only carried out for 'number' amount of times). Yielding the loop causes it to wait one frame before starting the next lap through it, and this is absolutely vital. Imagine an endless loop where the actions of every lap through the loop are all carried out in the same frame. It'd be something like a paradox, with the past, present and future all happening at the same time.  :V

If you make these rectifications the script should work, leaving you to experiment to get it just right - and that's the best part.  :3
« Last Edit: January 23, 2011, 08:58:41 AM by MasterSpark »

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem thread number 4
« Reply #770 on: January 23, 2011, 09:12:19 AM »
If I remember correctly it's left part alpha blended with rgb(255, 255, 255) on the bottom and the right part add blended with rgb(255, 0, 0) on top. I believe in SA, one or both the parts are rotating and pulsing too so you'll have to experiment with that.
Using that RGB setup looks right, but what's giving me the real trouble is the way that SetVertexColor forces me to apply an Alpha value to each vertex. A lower value for the top part brings transparency, but it also dulls the colour. What I end up with is a solid white core with a drab pink tinting the edges. If I crank the top layer's Alpha up to max it overpowers the rest of it. Can the parameter in SetVertexColor be overridden to assume the original value found in the image?

From what I remember, the object showed its true colors in the center, and became more "pure" red toward the edges. Your best bet would be making an object effect as TRIANGLEFAN. Make a circle with your first vertex at the center with, as blargel said, RGB 255,255,255, and each vertices on the outside or outer edge RGB 255,0,0.
This should give it that glow you want.
I've never used a TRIANGLEFAN primitive type before, do you have an example somewhere of how the vertices are connected? I'm currently using TRIANGLESTRIP for this object effect (4 vertices) with these as the drawing coordinates.

Code: [Select]
ObjEffect_SetVertexXY(bottom,0,-128,-128);
ObjEffect_SetVertexXY(bottom,1,128,-128);
ObjEffect_SetVertexXY(bottom,2,-128,128);
ObjEffect_SetVertexXY(bottom,3,128,128);
ObjEffect_SetVertexUV(bottom,0,0,0);
ObjEffect_SetVertexUV(bottom,1,256,0);
ObjEffect_SetVertexUV(bottom,2,0,256);
ObjEffect_SetVertexUV(bottom,3,256,256);
The object in the image is 256x256. The drawing looks the same for the top part as well, aside from some different UV coordinates as they're in the same image file.

Thanks for the input.  :moogy:
« Last Edit: January 23, 2011, 09:13:57 AM by MasterSpark »

Re: Danmakufu Q&A/Problem thread number 4
« Reply #771 on: January 23, 2011, 12:43:41 PM »
Ok  I have a problem with Animation lib.
My script is:

#TouhouDanmakufu
#Title[MurasaNS1]
#Text[]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
function wait(w){loop(w){yield;}}
#include_function "script\Murasa\lib\AnimationLib\AnimationLib.dnh";
let Murasa=GetCurrentScriptDirectory ~ ("\murasa.png");
@Initialize
{
            LoadGraphic(Murasa);
            SetLife(4000);
            SetTimer(100);
            SetInvincibility(30);
            SetMovePosition02(GetCenterX, GetCenterY - 100, 120);
    CreateAnimation("murasa", "idle", 4);
    SetAnimationFrame("murasa", "idle", 0,Murasa, 0, 0, 0, 64, 64);
    SetAnimationFrame("murasa", "idle", 1,Murasa, 0, 64, 0, 128, 64);
    SetAnimationFrame("murasa", "idle", 2,Murasa, 0, 128, 0, 196, 64);
    SetAnimationFrame("murasa", "idle", 3,Murasa, 0, 196, 0, 256, 64);
    Animate("murasa", "idle", true);

}
   
@MainLoop
{
SetCollisionA(GetX,GetY,32);
SetCollisionB(GetX,GetY,16);
yield;
}
@DrawLoop{
   SetGraphicScale(1,1);
   SetTexture(Murasa);
   SetGraphicAngle(0,0,0);
   SetColor(255,255,255);
   SetRenderState(ALPHA);
   

}
@Finalize{

   DeleteGraphic(Murasa);

}

}


And I have:

Kyaksa

  • Fred-Erika Bernkastel Mirrors Rika's True Nature: Spoiled child
  • When They Cry: You are probably dead now
Re: Danmakufu Q&A/Problem thread number 4
« Reply #772 on: January 23, 2011, 01:55:47 PM »
I have a problem with creating patterns... My Cirno freezes and then the script just dies.

*Edit*FIX
« Last Edit: January 23, 2011, 06:08:27 PM by Kyaksa »

Re: Danmakufu Q&A/Problem thread number 4
« Reply #773 on: January 23, 2011, 04:10:01 PM »
In your "fire" task you have a "while 0 is smaller than 36, do stuff," and since 0<36 is pretty much true always, DMF attempts to do infinite amounts of stuff in one frame.
(Or something like that, I forgot :c)

But change the "while(0<36){" to "while(x<36){" or something and then it should work.
(Also might as well note that DMF questions should go to the Q/A thread.)

Kyaksa

  • Fred-Erika Bernkastel Mirrors Rika's True Nature: Spoiled child
  • When They Cry: You are probably dead now
Re: Danmakufu Q&A/Problem thread number 4
« Reply #774 on: January 23, 2011, 06:06:34 PM »
Thank you. It works...

 :ohdear: I'm sorry for posting in the wrong place... But I wasn't sure since people (or from the videos I've watched) Task and Loops are very different things ^^; Since I was watching his videos I thought I should ask here. Meh, sorry again

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #775 on: January 23, 2011, 07:41:07 PM »
Uh, you'd think the answer is pretty obvious? You've set all the frames to animate for 0 frames. Which is impossible. Did you just try coding it all at once then when it didn't work immediately, you showed it to us? You gotta test this stuff, man.

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

8lue Wizard

  • Cobalt Magician
  • (Apparently)
Re: Danmakufu Q&A/Problem thread number 4
« Reply #776 on: January 24, 2011, 02:51:04 AM »
So I've been experimenting with lasers recently, intending to finally get around to making a Nazrin B player in the near future, and dnh is giving me an error which, according to the troubleshooting thread, says the CreateLaserX functions don't exist. Yes, I double, triple, quadruple checked my spelling and capitalization. The hell?

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #777 on: January 24, 2011, 03:03:45 AM »
create anything functions don't exist in player scripts

besides createplayershot but it might as well be nothing

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

8lue Wizard

  • Cobalt Magician
  • (Apparently)
Re: Danmakufu Q&A/Problem thread number 4
« Reply #778 on: January 24, 2011, 03:16:34 AM »
Huh. 'd be nice if the player tut mentioned that. In that case, is there any way to get object lasers to move automatically? Obj_SetSpeed doesn't appear to be doing anything.

Re: Danmakufu Q&A/Problem thread number 4
« Reply #779 on: January 24, 2011, 03:34:49 AM »
create anything functions don't exist in player scripts

besides createplayershot but it might as well be nothing
Huh. 'd be nice if the player tut mentioned that.
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.

Hmm.

In that case, is there any way to get object lasers to move automatically? Obj_SetSpeed doesn't appear to be doing anything.

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).