Author Topic: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)  (Read 140405 times)

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #90 on: May 12, 2011, 09:46:14 PM »
In addition, frame++ needs a semicolon at the end.

Next time, don't spoiler your code either. You should host large excerpts at pastebin.com.
« Last Edit: May 12, 2011, 09:48:57 PM by Drake »

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

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #91 on: May 12, 2011, 09:49:25 PM »
Spoiler:
Tsuchigumo...?? Are you who I think you are?

Ah well. Requesting merge or lock - this guy clearly didn't read the sticky - that popup better be possible soon.
« Last Edit: May 12, 2011, 10:22:50 PM by みゅーキュゥ »

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #92 on: May 12, 2011, 10:25:26 PM »
Game still hates me, and returns Wait, which sticky?
---------------------------
ScriptError「C:\Users\Power One\Desktop\th_dnh\th_dnh\script\Loop1-Tutorial(Refuses to work).txt」
---------------------------
一回も代入していない変数を使おうとしました(26行目)

   if(frame==120){

   loop(36){

      

   CreateShot01(GetX + 60*cos(angle), GetY + 60*sin(angle), 3, angle, WHITE22, 12);

      angle +
~~~
---------------------------
OK   
---------------------------
... Isn't that the same thing?
Anyway, brackets and lone semicolon addition didn't seem to do anything. The code seems really finicky. Trying to build another that spreads, but for some reason the @Initilization { line errors. It wants a semicolon somewhere, I think, so I'll hunt it down later.
But yeah, no dice. And yes, I am who you think I am. More than likely.

Also, lets say the code is to work. I think I noticed that because the loop dosen't hit, it will set frame to 40, add one, then set it back over and over. Guess I need to re-arrange some things.
« Last Edit: May 12, 2011, 10:39:13 PM by Tsuchigumo550 »

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #93 on: May 12, 2011, 10:42:56 PM »

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #94 on: May 12, 2011, 10:56:31 PM »
Oh crap, not good. I already angered someone in a higher position than me on the totem pole.

Ok, well, what I meant was if there was something I missed or accidentally passed over.
Most of that code is an amalgam of tutorial code anyway.  Even so, I can't stop getting random errors. I have ONE working code that was a PAIN to code. (This was before I knew that math could create circles.)  So, I need lots of help. Even reading the beginner tutorial (Which is a lifesaver, BTW) over and over is not pounding it in. Code + Me usually = The game explodes, but still.

Something tells me I have a long, long road ahead of me.

At least I'm getting a new error.
---------------------------
ScriptError「C:\Users\Power One\Desktop\th_dnh\th_dnh\script\Loop1-Tutorial(Refuses to work).txt」
---------------------------
項として無効な式があります(26行目)

   if(frame>=:120){

   loop(36){

   CreateShot01(GetX + 60*cos(angle), GetY + 60*sin(angle), 3, angle, WHITE22, 12);

Didn't see that on translated errors, but it's, literally, a different language so I may have missed it too. I'm going to go sticky-reading now.

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #95 on: May 12, 2011, 11:14:15 PM »
How can I switch Backgrounds in a Stage script?

Like in Stage 4 of PCB, that has multiple Backgrounds through all the stage.
Small Teaser of my upcoming project~

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

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #96 on: May 12, 2011, 11:18:28 PM »
Why is there a random colon in that line what are you doing take it out.

Assuming this is what you now have.

@MainLoop{
    SetCollisionA(GetX, GetY, 32);
    SetCollisionB(GetX, GetY, 16);

    if(frame==120){
        loop(36){
            CreateShot01(GetX + 60*cos(angle), GetY + 60*sin(angle), 3, angle, WHITE22, 12);
            angle += 360/36;
        }
        angle += 4;
        speedvar += 5;
    }
    let frame = speedvar;
    frame++;
}


First of all, you should not be redefining frame every frame, and you should not be using let here either. This will give frame a value of 40, then it will increment, then it'll reset the next frame to 40 again and so on.
If frame did hit 120, after firing bullets and the angle increase, speedvar increases and then you assign it right away to frame. Why don't you just have frame increase faster or decrease the frames needed (120) or something if you want the bullets to fire faster? This is super roundabout and you don't even need the speedvar variable. And once again, even if it did go through the loop once, it would just have frame set to 45 every frame again.

What tutorial are you even following here, and what do you even want your final product to do?
« Last Edit: May 12, 2011, 11:21:03 PM by Drake »

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

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #97 on: May 12, 2011, 11:22:38 PM »
Define another image and draw it like anything else...? Not too sure what you mean.

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

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #98 on: May 12, 2011, 11:28:57 PM »
Just some general tips to avoid a lot of random errors. Whenever you have a loop, if, while, ascent, descent, function, sub, task, and probably some stuff I forgot, it will need curly braces. Put both the opening and the closing braces in before writing what goes inside them so that you don't forget them later. This is an important habit to have because it'll prevent you from having mismatched braces later. Same goes for functions and their parentheses and arrays with their square brackets. If you type an opening anything type the matching closing one immediately. Develop this habit and a lot of syntax errors will magically stop appearing in future things you write. Another common error is missing semicolons. If there's a missing semicolon, the error will actually point at the line after that, so always check the line before as well, just in case.

Lastly, don't get discouraged with the errors. If you read the beginner tutorial, you should have read that if you can't deal with errors, you shouldn't be a programmer. When writing stuff, the computer will yell at you and explode more times than it won't. Just keep at it and eventually you'll be able to know what's wrong just by glancing at the line the error tells you to look at.

Also, if you want faster answers, the irc channel is always available to answer your questions. It has some international people and a lot of them are good at Danmakufu so there's a good chance that someone that can answer your question might be awake to talk to you no matter what time it is.
« Last Edit: May 12, 2011, 11:30:37 PM by Blargel »
<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.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #99 on: May 12, 2011, 11:33:35 PM »
Sounds like he's just having trouble getting the logic to change from one scene to another or something. Make a global variable called bgstate or something and make it hold a value. Change the value in the stage task and read it in the BackGround loop. If it's one value, draw the background one way, and if it's another value, draw it the other way.
<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.

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #100 on: May 13, 2011, 01:03:27 AM »
Well, it worked, but now, I'm having a little issue, and is that the BG appears suddenly, and I don't know how to make it appear slowly from the center of the screen and expanding it .

Sorry if the above is too confusing...
Small Teaser of my upcoming project~

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

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #101 on: May 13, 2011, 01:22:43 AM »
Well, thanks guys (or girls, lets not offend anyone) for the help. I wasn't really following any tutorial, just shoving stuff together is a way that seemed logical. Looking at it again, I wonder just what I was thinking. The errors don't bug me, it's that when i get around code, I break stuff. Irreversibly. Like, on EVERY ACTION REPLAY EV- Ok, back to topic. I'll try to increase frame addition every time, but I don't exactly know how to do anything aforementioned. I guess I'll figure it out though, since my learning style is to bash it till it works. Well, again, thanks for helping the resident newb. And, I don't exactly know how an irc works. Is it like a torrent, in the sence I need additional software to run it? Just wondering.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #102 on: May 13, 2011, 02:22:13 AM »
I wasn't really following any tutorial, just shoving stuff together is a way that seemed logical.
READ A TUTORIAL HOLY CRAP

Quote
I guess I'll figure it out though, since my learning style is to bash it till it works.
YOU DO NOT NEED TO GO THROUGH THIS THE WAY I DID  :colonveeplusalpha:

Quote
And, I don't exactly know how an irc works. Is it like a torrent, in the sence I need additional software to run it? Just wondering.
You could just click the link in my last post, put in a nickname, and click connect.

Edit: Seriously, read the tutorials. If you're just going to bash on code and then ask for help on things that are already explained in a nicely documented tutorial, you're going to piss off some people. Also, spoiler tags on code = annoying and we have a Q&A thread for future questions if you don't feel like going on IRC. (inb4 merge with the Q&A thread anyway)
« Last Edit: May 13, 2011, 02:25:15 AM by Blargel »
<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.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #103 on: May 13, 2011, 02:27:44 AM »
Well, it worked, but now, I'm having a little issue, and is that the BG appears suddenly, and I don't know how to make it appear slowly from the center of the screen and expanding it .

Sorry if the above is too confusing...

Make another variable that the @BackGround loop can read that counts upward and use that to slowly make things bigger.
« Last Edit: May 13, 2011, 08:58:29 PM by Blargel »
<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.

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #104 on: May 13, 2011, 07:57:14 PM »
Ah well. Requesting merge or lock

report posts

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #105 on: May 14, 2011, 08:45:33 PM »
I'm back, this time with 35% less failure!
No, seriously. My shotgun danmaky finally came through, after giving up on the complicated circle thing.
But yeah, now I have more circular problems.

            loop(24){
         CreateShot02(GetX*cos(60), GetY*sin(60), 1, angle, -0.1, -3/1, BLUE12, 0);
         angle += 360/24;
      
That's the general gist of it. When I use it, the bullets don't spawn even near the boss, and honestly, tinkering around didn't work too good. So, what I'm asking is...
I want bullets that spawn in a cirlce AWAY from the boss. Like, a 100px radius away. I have the acceleration part down, and an alternative to bullet rotation. One problem though-

Through all my time hunting through tutorials, I can't figure out how to get my bullets to spiral. My bullets, like me, apparently hate circles. I haven't had too many errors with this one, just the script written wrong.I'm kinda unsure of how to do it right. So, I came for help. Once I get the basics down, I should be able to take elements and get them together.

Also, I'm kind of uneducated. I haven't a clue what (sin) and (cos) even are, tangents included, except for one thing-
They involve the dreaded no-sided one.
So, I'm basically asking for this:
How to get bullets to spawn in a radius away from the boss but still centered on said boss
How to curve bullets in a uniform way to produce spirals
A crash course in circle logic (As in, what is a (sin), and what is a (cos)?
I can has cheeseburger?  :derp:

Oh yeah. If I missed a tutorial with this in it, just give me that. Also, feel free to slap me if that's the case.  :V

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #106 on: May 14, 2011, 08:55:56 PM »
All you really need to know about sin and cos is that they're used for a circle. Cos returns the horizontal component of the angle, and sin returns the vertical component. In other words, cos(0) returns 1 and sin(0) returns 0, because angle 0 is directly right (full horizontal component, no vertical component). Cos(90) returns 1 and sin(90) returns 0, because 90 is straight down, which is all vertical and no horizontal, etc.

What you're looking for would be something like this:

CreateShot02(GetX+cos(angle)*60, GetY+sin(angle)*60, 1, angle, -0.1, -3/1, BLUE12, 0);

That would spawn the bullet 60 pixels away from the boss in the same direction that the bullet will travel (the angle variable). Play around with it until you get it - sin and cos are extremely useful. (For a nice exercise, try making it cos(angle+90) and sin(angle+90) instead to see what happens!)

As for spirals, you can use pretty much the exact same code, but put it in a task, and yield; after each shot. If you don't know what tasks are, look up that tutorial too, since they're very useful.

Yuyuko Yakumo

  • Carry me~ow
  • Rawr I eat your face with maaaaaagicalness
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #107 on: May 14, 2011, 09:21:13 PM »
What exactly are effect objects? I've seen the tutorial on it and I've seen people use it in scripts, but I don't know what its exact function is.
I know, I know. I'll get a real avatar and signature soon. -_-

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #108 on: May 14, 2011, 09:25:45 PM »
Effect objects do what the name implies - they're effects. Most of the time, they're just used for visual effects, like explosions. You get much more control over an effect object than if you used DrawLoop, so for example, you can take an image that's just a line and make it into a spell circle, which can distort and wave. Or you can use it to draw on other layers than the default one that DrawLoop does, such as drawing an overlay across the entire screen (Mystia's darkness) or drawing something onto the frame.

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #109 on: May 14, 2011, 09:27:25 PM »
I owe ya one. Thanks, and mabye soon I`ll upload the final code. 2 of the three elements are now ready to be placed in the code. Again, thanks!

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #110 on: May 16, 2011, 12:42:01 PM »
Hullo,

How are the hitboxes for custom bullets determined ? When I create a bullet, I do specify a rectangle for the graphics, but not the hitbox. Can I specify it (how ?) or is it automatically calculated (then how?) ?

For example, how come the butterfly bullet hits at its center but  not its wings ?
Thanks !
« Last Edit: May 16, 2011, 01:18:04 PM by Ginko »

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #111 on: May 16, 2011, 04:46:59 PM »
I don't think anyone knows exactly how the hitbox is determined, but it's definitely based off of the size of the graphic. If, for example you had a 16x16 pixel graphic for a bullet, the hitbox is probably something like 8x8 on the center. By this logic, if you wanted a larger hitbox but same graphic, you can add transparent space around the graphic and redefine the graphic rectangle to be 32x32 and it'll look the same but have a hitbox of 16x16. The hitbox isn't necessarily half the size of the graphic though as no one that I know of actually did any detailed tests about this.

If you really want to have control over the size of your bullet's hitbox, you can use shot scripts, but almost no one uses those and there aren't any tutorials on them. Another way is to use effect objects and the boss's SetCollisionB function on the same position as the effect.
<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.

Stuffman

  • *
  • We're having a ball!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #112 on: May 16, 2011, 09:34:26 PM »
I estimate the automatic hitboxes are around 1/3 of the bullet's size. Someone should lab this though :V

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #113 on: May 16, 2011, 09:40:45 PM »
Also note that the hitbox depends on whichever of the sides (height or width) is smaller. A 20x20 bullet has the same hitbox as a 20x40 bullet.

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #114 on: May 17, 2011, 01:52:05 AM »
From my testing it eventually seems that the hitbox diameter is 60% (well it could be more precise but it'd seem arbitrary, eh ;) ) of the smaller side of the defining rectangle.

Thanks for your help !

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #115 on: May 18, 2011, 07:18:18 AM »
Any advice on how much HP a Non-Spell must have? and a Spellcard?
Small Teaser of my upcoming project~

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #116 on: May 18, 2011, 09:03:20 AM »
Any advice on how much HP a Non-Spell must have? and a Spellcard?
That is extremely subjective and for everybody different. You might want to check out official games and see how ZUN does it.

"For example does using a bomb kill the non-card? Or does it leave some health? What about spell cards? What about the player type and shottype?"

Using this mindset, you set certain damage rate and life and test out if it feels 'good' to you. Remember, if someone is boring or too long for your own taste, it will most likely be to anybody else. The biggest foolish mistake people make with life/dmg rate is thinking: "Oh, to make it difficult, I'll just increase life / drop dmg rate".

As long as you don't make that foolish mistake, you are fine.

CK Crash

  • boozer
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #117 on: May 18, 2011, 06:36:07 PM »
This is how I handle health and spell armor:

For nonspells, I usually give them 60 frames of invincibility, and 2000-4000 health, depending on how long the pattern takes to reach the player.
For spells, I give them 800-1400 health, but I use a task to make them start with SetDamageRate(10,10), and change to (50,50) after about 800 frames. This means they tend to have less variability in how long they last.

Atfyntify

  • Danmakufu worshipper
  • I worship Danmakufu
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #118 on: May 18, 2011, 07:17:01 PM »
I don't know if this is suppose to be posted in this topic (sorry if it isn't) but doesn anyone know where I can get danmakufu fuujinroku MoF cutins? like these type of images: http://imageshack.us/photo/my-images/863/rumiacutin.png/
I CAN'T WAIT FOR TOUHOU 14!

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #119 on: May 18, 2011, 08:19:18 PM »
Using this mindset, you set certain damage rate and life and test out if it feels 'good' to you. Remember, if someone is boring or too long for your own taste, it will most likely be to anybody else. The biggest foolish mistake people make with life/dmg rate is thinking: "Oh, to make it difficult, I'll just increase life / drop dmg rate".
Another mistake that is even more common I would say, is that people love their patterns so much that they leave it with huge amounts of HP for the player to play it for a long time. It isn't always something that the programmer realizes, but really long noncards and spellcards are common even in full scripts. It isn't a difficulty thing, but probably more of "you have to witness the whole card!", and people try too hard to get the player to play it.

If I were to name an example from ZUN's work himself, I would nominate Shou. Her cards are very long. Not unnecessarily, but they are really long. In this case it's more of overall card design than elongation.

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