~Hakurei Shrine~ > Rika and Nitori's Garage Experiments

I'm really lost @_@

Pages: (1/12) > >>

Halca:

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)

Suikama:

Try poking around http://touhou.wikia.com/wiki/Touhou_Danmakufu:_Functions

Stuffman:

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.

Naut:


--- Quote from: yuritakehashi on April 30, 2009, 09:47:14 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?
--- End quote ---

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


--- Code: ---#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
--- End code ---

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.




--- Quote from: yuritakehashi on April 30, 2009, 09:47:14 PM ---(btw, I can't figure out how to get the target version of the enemy character to appear)

--- End quote ---


Declare a variable to equal your boss graphic at the beginning of the script, so that you can easily reference it many times:

--- Code: ---let BossImg = "script\ExRumia\img\ExRumia.png";
--- End code ---

Load the graphic in @Initialize:

--- Code: ---LoadGraphic(BossImg);
--- End code ---

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: ---SetTexture(BossImg);
SetGraphicRect(0, 0, 64, 64);
DrawGraphic(GetX, GetY);
--- End code ---

When the script finishes, you'll want to delete everything to free up space, so you'll delete the graphic in @Finalize:

--- Code: ---DeleteGraphic(BossImg);
--- End code ---

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:

My scripts keep getting errors and I'm not sure what I'm doing wrong.

Pages: (1/12) > >>

Go to full version