Author Topic: I'm really lost @_@  (Read 31743 times)

Halca

  • Kawaii Bastard
I'm really lost @_@
« on: April 30, 2009, 09:47:14 PM »
Well I read all of Blargel's tutorial and was able to perform all of the tasks that were shown, but I really don't understand how to put it all together.  What I mean is that, I just can't figure out how to get all the images and attacks into one boss fight.  I've tried looking at scripts that I've downloaded as a reference but they really didn't help. 

So could someone tell me how to put this all together?

(btw, I can't figure out how to get the target version of the enemy character to appear)


Stuffman

  • *
  • We're having a ball!
Re: I'm really lost @_@
« Reply #2 on: April 30, 2009, 11:17:22 PM »
Basically, each attack/spellcard script you make should be self-sufficient. You don't need to share resources between them or anything. When you go to make a full boss, it's a matter of creating a Plural file. The Plural file is pretty simple, it just runs each spellcard in the order you list them.

Take a look at the ExRumia that comes with Danmakufu to get an idea of how it all comes together. "ExRumia.txt" is her plural file.

Re: I'm really lost @_@
« Reply #3 on: April 30, 2009, 11:45:53 PM »
I just can't figure out how to get all the images and attacks into one boss fight. So could someone tell me how to put this all together?

A Plural file is what you're looking for, sir. Plural files look like this:

Code: [Select]
#TouhouDanmakufu[Plural]
#Title[ExRumia Boss Stage]
#Text[ExRumia boss fight, including regular attacks and spell-cards.]
#Image[.\img\ExRumia(¯•„uƒ~ƒbƒhƒiƒCƒgƒŒƒ”ƒ@ƒŠƒGv).png]
#BackGround[Default]
#Player[FREE]
#ScriptVersion[2]

#ScriptPathData
#ScriptPath[.\ExRumia01.txt]
#ScriptPath[.\ExRumiaSpell01.txt]
#ScriptPath[.\ExRumiaSpell02.txt]
#ScriptNextStep
#ScriptPath[.\ExRumia02.txt]
#ScriptPath[.\ExRumiaSpell03.txt]
#ScriptPath[.\ExRumiaSpell05.txt]
#ScriptNextStep
#ScriptPath[.\ExRumiaSpell04.txt]

#EndScriptPathData

Alrighty, the first little bit should be self-explanatory. Declare that this is a TouhouDanmakufu script, indicate that it is a plural script on the same line, set a title for the script, set some descriptive text, set an image to appear when you're selecting the script from Danmakufu's menu, set the background, set what player characters may be used, then indicate it's script version two.

Now, onto some of these new parameters.

#ScriptPathData starts the script path data (no wai). Be sure to declare this at the beginning of this string, it tells Danmakufu that the following is data for your plural script.
#ScriptPath[] tells Danmakufu to load and play the script you indicate in it's braces. It's relative to this file, so if your scripts are located in a subfolder, be sure to show that with [.\Sub Folder Name\script.txt]
#ScriptNextStep tells Danmakfu how to arange the life bars at the top of the screen. Everytime you call this, a new life bar is broken up and created, so all the scripts inbetween #ScriptNextStep will appear on the same lifebar. Test it out to see what I mean.
#EndScriptPathData does exactly what it says. Declare this at the end of your plural script.

And that's about it. Playing this script will tell Danmakufu to play all the scripts you've indicated inside this file, in decending order. So in the example, ExRumia01.txt will be played first, then when that script ends, ExRumiaSpell01.txt will be played, then ExRumiaSpell02.txt will be played, then a new lifebar will be created, then we'll move onto ExRumia02.txt, etc.



(btw, I can't figure out how to get the target version of the enemy character to appear)


Declare a variable to equal your boss graphic at the beginning of the script, so that you can easily reference it many times:
Code: [Select]
let BossImg = "script\ExRumia\img\ExRumia.png";
Load the graphic in @Initialize:
Code: [Select]
LoadGraphic(BossImg);
Declare the texture you want to edit, set the coordinates on the graphic of the area you want to display, then draw the graphic on the boss' position in @DrawLoop:
Code: [Select]
SetTexture(BossImg);
SetGraphicRect(0, 0, 64, 64);
DrawGraphic(GetX, GetY);

When the script finishes, you'll want to delete everything to free up space, so you'll delete the graphic in @Finalize:
Code: [Select]
DeleteGraphic(BossImg);
If you've strung together spells, don't worry about the boss disappearing in-between spells with DeleteGraphic();, since you'll redeclare the boss image information in the next spell anyway.

Nuclear Cheese has a drawing tutorial if you'd like a more in-depth lesson on drawing things in Danmakufu.

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #4 on: May 01, 2009, 07:10:14 PM »
My scripts keep getting errors and I'm not sure what I'm doing wrong.

Re: I'm really lost @_@
« Reply #5 on: May 01, 2009, 07:27:46 PM »
Unfortunately, that doesn't tell us much. You can post your script here and we can troubleshoot it for you, if you like.

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #6 on: May 01, 2009, 11:09:00 PM »
Ok, here's what my script looks like:

Code: [Select]
#TouhouDanmakufu
#Title[Attack Name]
#Text[Attack Description]
#BGM[.\bgm.mp3]
#PlayLevel[Normal]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
    let BossImage = ".\img\moe.png";
    let BossCutIn = ".\img\moetancut.png";
    @Initialize {
        LoadGraphic(BossImage);
        SetLife(1000);
        SetDamageRate(10, 10);
        SetTimer(50);
        SetInvincibility(30);
        CutIn(YOUMU, "Learning Sign"\"Magic Pencil"\", BossCutIn, 0, 0, 512, 512);
        SetScore(500000);
        SetEnemyMarker(true);
        SetDurableSpellCard;
        LastSpell;
        Concentration01(60);
        Concentration02(0);
        MagicCircle(false);
        SetEffectForZeroLife(180, 100, 1);
    }

    @MainLoop {
    }

    @DrawLoop {
       SetTexture(BossImage);
       SetGraphic(0, 0, 64, 64);
       DrawGraphic(GetX, GetY);
       
    }

    @Finalize {
    }
}

When I try to run it, it bugs out.

Drake

  • *
Re: I'm really lost @_@
« Reply #7 on: May 01, 2009, 11:24:24 PM »
SetGraphicRect(0, 0, 64, 64);

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

Re: I'm really lost @_@
« Reply #8 on: May 01, 2009, 11:27:53 PM »
Your CutIn script is missing a quotation for it's name declaration. It should be:
Code: [Select]
CutIn(YOUMU, "Learning Sign "\""Magic Pencil"\", BossCI, 0, 0, 512, 512);
Notice the extra quotation between "\" and Magic Pencil. Don't ask how this works out, it's just a really confusing way of writing quotations in a text string. It works, no need to confuse you on why it's like this.


It should also be noted, in your @DrawLoop, "SetGraphic" doesn't exist, you left out the "Rect" part. So it should be:

Code: [Select]
SetGraphicRect(0, 0, 64, 64);
PFF Drake noticed this too.

Your code should run properly without any errors if you make these adjustments.

When you see a pop-up error message, it usually features a little snippet of code where the problem originates. Be sure to check for quotations, semi-colons, and proper brackets, as they're the most common problems that you'll see. The next most common is the one doesn't give you any code snippets, but instead has the characters {...} in it. This means that your squiggly braces {} don't pair up with eachother and need to be changed.

If the snippet of code is small, then I recommend just re-typing it out. If it's large, or you just don't know what's going on, then you should probably look for help. We'll be happy to assist you.

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #9 on: May 01, 2009, 11:55:02 PM »
Thank you very much :D

But still there's an issue @_@
The script runs fine now but the cut in image is completely white and the boss image does not appear on screen.  Help?

EDIT!:

Figured it out!
According to what I did it seems that scripts like to take images out of the scriptimg folder.
Correct?

I'm going to start scripting the bullets now! <3
« Last Edit: May 02, 2009, 12:04:38 AM by yuritakehashi »

Re: I'm really lost @_@
« Reply #10 on: May 02, 2009, 12:48:31 AM »
It takes them out of the folder you designated in your script. So since you said:

Code: [Select]
let BossCutIn = ".\img\moetancut.png";
It will move into the script folder (you said .\ at the start, I think this gets the script folder when declared outside of square braces...? Not sure...), move into the img folder, then look for a file called moetancut.png. If you'd like to base everything on the current script (which is what most people do), you could have Danmakufu look for the image like this:

Code: [Select]
let BossCutIn = GetCurrentScriptDirectory~"img\moetancut.png";
Which would find the path of the current script, move into the subfolder img from the folder that this script is in, then locate moetancut.png.

Good luck with your bullet script~.

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #11 on: May 02, 2009, 01:40:12 AM »
Ok, my bullets are doing great so far, I was just wondering though...
How would you create a semicircle pattern that bursts from a point?
Kind of would look like this:
  /   /  |   \   \
 /   /   |    \   \
/   /    |     \   \

I hope that makes sense >_<

Re: I'm really lost @_@
« Reply #12 on: May 02, 2009, 01:47:33 AM »
I won't mess with looping structures since your pretty new, so here's the bare-bones way:

Code: [Select]
CreateShot01(GetX, GetY, 3, angle - 20, RED01, 0);
CreateShot01(GetX, GetY, 3, angle - 10, RED01, 0);
CreateShot01(GetX, GetY, 3, angle, RED01, 0);
CreateShot01(GetX, GetY, 3, angle + 10, RED01, 0);
CreateShot01(GetX, GetY, 3, angle + 20, RED01, 0);

This creates a 5 bullets, each aimed slightly off from eachother (notice the direction parameter), and will cause a fanning pattern, hopefully like the one you're looking for.

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #13 on: May 02, 2009, 03:07:54 PM »
I tried to add the fanning pattern, but the script won't run.  Here's my current @MainLoop:
Code: [Select]
    @MainLoop {
        SetCollisionA(240, 150, 32);
        SetCollisionB(240, 150, 24);
        if(frame==60){
            CreateShot01(GetX, GetY, 3, -20, RED12, 0)
            CreateShot01(GetX, GetY, 3, -15, RED12, 0)
            CreateShot01(GetX, GetY, 3, -10, RED12, 0)
            CreateShot01(GetX, GetY, 3, -5, RED12, 0)
            CreateShot01(GetX, GetY, 3, 0, RED12, 0)
            CreateShot01(GetX, GetY, 3, 5, RED12, 0)
            CreateShot01(GetX, GetY, 3, 10, RED12, 0)
            CreateShot01(GetX, GetY, 3, 15, RED12, 0)
            CreateShot01(GetX, GetY, 3, 20, RED12, 0)
        }   
        if(frame==20){
            CreateShot01(240, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            CreateShot01(230, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            CreateShot01(250, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            CreateShot01(260, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            CreateShot01(270, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            CreateShot01(220, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            CreateShot01(210, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            frame = 0;
        }   
        frame++;
    }

Where did I go wrong?  Another thing- when I try to set the LastSpell to false like this:
Code: [Select]
LastSpell(false);It won't run properly.

Cyclone722

  • Danmakufu beginner
Re: I'm really lost @_@
« Reply #14 on: May 02, 2009, 03:23:19 PM »
Ok, I'm not too good at this myself.
But your bullet angles are wrong, you can't have negitive angles.
and Naut seems to use a variable to control the angle here.

Try this.
Code: [Select]
if(frame==60){
            CreateShot01(GetX, GetY, 3, 60, RED12, 0);
            CreateShot01(GetX, GetY, 3, 65, RED12, 0);
            CreateShot01(GetX, GetY, 3, 70, RED12, 0);
            CreateShot01(GetX, GetY, 3, 85, RED12, 0);
            CreateShot01(GetX, GetY, 3, 90, RED12, 0);
            CreateShot01(GetX, GetY, 3, 95, RED12, 0);
            CreateShot01(GetX, GetY, 3, 100, RED12, 0);
            CreateShot01(GetX, GetY, 3, 105, RED12, 0);
            CreateShot01(GetX, GetY, 3, 110, RED12, 0);
        }   
This will shoot a fan of bullets with the center one going straight down.
 
Your frame = 0; should be in the attack with (frame==60) if you call it before,
frame will never reach 60 and the red shots won't be fired.



« Last Edit: May 02, 2009, 03:39:24 PM by Cyclone722 »
Kaze ha watashi no ha ninaru!
The wind becomes my blade!

Garlyle

  • I can't brain today
  • I have the dumb
    • Tormod Plays Games
Re: I'm really lost @_@
« Reply #15 on: May 02, 2009, 03:35:45 PM »
First off, that's incorrect: you CAN have Negative angles on your bullets.  In fact, in the manual text with Danmakufu, it refers to up as -90, not 270.

With that said, it's important to remember that Right = 0', and Down = 90', so you may want to adjust for that.

Also, your error is in this:
LastSpell(false);

LastSpell doesn't call a parameter.  It's either present in a script as LastSpell; (In which case it's a last spell), or it's not in at all (in which case it's a normal spell).

Cyclone722

  • Danmakufu beginner
Re: I'm really lost @_@
« Reply #16 on: May 02, 2009, 03:41:59 PM »
Oh. Well, I just learned something new!
Kaze ha watashi no ha ninaru!
The wind becomes my blade!

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #17 on: May 02, 2009, 07:26:52 PM »
I used your advice and now the script runs, but the bullets won't appear >_<
Here's what the code looks like:
Code: [Select]
    @MainLoop {
        SetCollisionA(240, 150, 32);
        SetCollisionB(240, 150, 24);
        if(frame==60){
            CreateShot01(GetX, GetY, 3, 60, RED12, 0);
            CreateShot01(GetX, GetY, 3, 65, RED12, 0);
            CreateShot01(GetX, GetY, 3, 70, RED12, 0);
            CreateShot01(GetX, GetY, 3, 85, RED12, 0);
            CreateShot01(GetX, GetY, 3, 90, RED12, 0);
            CreateShot01(GetX, GetY, 3, 95, RED12, 0);
            CreateShot01(GetX, GetY, 3, 100, RED12, 0);
            CreateShot01(GetX, GetY, 3, 105, RED12, 0);
            CreateShot01(GetX, GetY, 3, 110, RED12, 0);
            frame = 0;

        }   
        if(frame==20){
            CreateShot01(240, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            CreateShot01(230, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            CreateShot01(250, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            CreateShot01(260, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            CreateShot01(270, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            CreateShot01(220, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            CreateShot01(210, 150, 3, GetAngleToPlayer, YELLOW01, 10);
            frame = 0;
        }   
        frame++;
    }

Re: I'm really lost @_@
« Reply #18 on: May 02, 2009, 07:42:15 PM »
Hmm, your collision detection should be on GetX, GetY, so even if you move the boss moves around it will still accurately detect her hitbox.

Those yellow bullets should spawn, but keep in mind that GetAngleToPlayer gets the angle from the boss to the player. So because you're not spawning the bullets on GetX, GetY, the bullet angle will probably be inaccurate. The red bullets won't spawn because when frame = 20 (when you spawn the yellow bullets), you set frame back to 0 again, so frame will never go above 20, or high enough to spawn the red ones. If you take out "frame = 0;" from the yellow bullet spawning tree, then it should run properly and spawn both red and yellow bullets, then repeat.

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #19 on: May 02, 2009, 07:45:19 PM »
Hmm, your collision detection should be on GetX, GetY, so even if you move the boss moves around it will still accurately detect her hitbox.

Those yellow bullets should spawn, but keep in mind that GetAngleToPlayer gets the angle from the boss to the player. So because you're not spawning the bullets on GetX, GetY, the bullet angle will probably be inaccurate. The red bullets won't spawn because when frame = 20 (when you spawn the yellow bullets), you set frame back to 0 again, so frame will never go above 20, or high enough to spawn the red ones. If you take out "frame = 0;" from the yellow bullet spawning tree, then it should run properly and spawn both red and yellow bullets, then repeat.

Oh, the yellow bullets are fine, I'm having an issue with the red ones.

Re: I'm really lost @_@
« Reply #20 on: May 02, 2009, 11:25:46 PM »
Well, that's because you didn't finish reading the paragraph, sir.

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #21 on: May 03, 2009, 12:15:18 AM »
Well, that's because you didn't finish reading the paragraph, sir.

Sorry... I feel so embarassed now :X
Thank you!

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #22 on: May 03, 2009, 12:23:32 AM »
My spell is beggining to have the effect I want.  How can I make the different types of shots appear at a different rate from eachother?

Re: I'm really lost @_@
« Reply #23 on: May 03, 2009, 12:43:57 AM »
There are a few ways for that effect. I'll explain two of them, the first is extremely easy to understand, but requires making a variable for every section.

If you want to maker things spawn at different rates, then you could make a couple frame variables, like "frame1", "frame2", "frame3", etc., and have them all counting up in your @MainLoop. Then it's just a matter of resetting them everytime you use them. So your @MainLoop could look something like this:

Code: [Select]
@MainLoop{
 SetCollisionA(GetX, GetY, 32);
 SetCollisionB(GetX, GetY, 16);

 frame1++;
 frame2++;
 frame3++;

 if(frame1==60){
  CreateShot01(GetX, GetY, 3, GetAngleToPlayer, RED01, 0);
  frame1 = 0;
 }

 if(frame2==40){
  CreateShot01(GetX, GetY, 4, GetAngleToPlayer, BLUE02, 0);
  frame2 = 0;
 }

 if(frame3==16){
  CreateShot01(GetX, GetY, 2.4, GetAngleToPlayer, GREEN03, 0);
  frame3 = 0;
 }
}

Another way is using a function called modulus (%). When we say frame%15, it returns the remainder of frame if it was divided by 15. So if frame was 45, frame%15 would equal 0, because 15 evenly divides into 45 three times, with no remainder. If frame was 38, frame%15 would equal 8 because 38 divided by 15 equals 2, with a remainder of 8. If frame was 1573, frame%15 would equal 13, etc.
So by using this modulus function, we can have one incrementing frame counter in MainLoop, and still have many bullets spawning at different intervals. Here's an example:

Code: [Select]
@MainLoop{
 SetCollisionA(GetX, GetY, 32);
 SetCollisionB(GetX, GetY, 16);
 frame++;

 if(frame%15==0){
  CreateShot01(GetX, GetY, 3, GetAngleToPlayer, RED01, 0);
 }

 if(frame%20==0){
  CreateShot01(GetX, GetY, 2, 90, YELLOW03, 0);
 }

 if(frame%42==0){
  CreateShot01(GetX, GetY, 5, GetAngleToPlayer, GREEN02, 0);
 }
}

In this MainLoop, we have a small red bullet being fired towards the player every 15 frames, a large yellow bullet being fired straight downwards every 20 frames, and a medium green bullet being fired towards the player every 42 frames.
« Last Edit: May 03, 2009, 12:47:53 AM by Naut »

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #24 on: May 03, 2009, 01:29:09 AM »
It worked beautifully :D
Now to the next spell card! <3
(Thanks Naut :3)

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #25 on: May 13, 2009, 10:06:33 PM »
Does anyone know how to go about making dialogue between characters?

Garlyle

  • I can't brain today
  • I have the dumb
    • Tormod Plays Games
Re: I'm really lost @_@
« Reply #26 on: May 13, 2009, 10:37:32 PM »

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #27 on: May 17, 2009, 02:53:12 AM »
Whelp- I started a new project that is already farther than the last :D

I have a little issue with the plural script though, check it for me pweeze :3

Code: [Select]
#TouhouDanmakufu[Plural]
#Title[Stage 1 Midd-Boss, Jiao Lan]
#Text[Boss Fight with Jiao Lan]
#BackGround[Default]
#Player[FREE]
#ScriptVersion[2]


#ScriptPathData
#ScriptPathData[.\Pre-Spell01.txt]
#ScriptNextStep[.\Spell01.txt]

#EndScriptPathData

This script won't run and I'm not sure why.

JormundElver

  • Baron Von Parakeet
Re: I'm really lost @_@
« Reply #28 on: May 17, 2009, 03:07:19 AM »
I think I've had that issue with plurals not running and I think it was resolved by changing your first line there into

#?????e????[Plural]

If that works, I don't know how it makes a difference.

Halca

  • Kawaii Bastard
Re: I'm really lost @_@
« Reply #29 on: May 17, 2009, 03:44:46 AM »
Still not working, still don't know why D: