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

Nimono

  • wat
Re: Danmakufu Q&A/Problem Thread
« Reply #180 on: June 22, 2009, 12:56:20 AM »
The last few bullets of a wave will also not move on occasion, if that helps your debugging process. I can't see the problem either, though I'm having a hard time wrapping my head around the cavalcade of arrays you've constructed...

Oh yeah, that's intentional, somewhat. The original Red Magic did that for some bullets, too. And sorry about the arrays... Is there anything I can do to help with that?

Re: Danmakufu Q&A/Problem Thread
« Reply #181 on: June 22, 2009, 02:12:26 AM »
Not at all, it's my fault -- I just don't work with arrays beyond selecting a random color for a bullet, so this is a bit advanced for me. Hopefully I can get the jist of it enough to understand what's going on in your txt file... If somebody else doesn't first, hehe.

EDIT: A possible workaround is to have the bullets force move into a NULL angle (or random, failing that) after a set period of time after spawning, at least to prevent them from staying on the screen. I'm not seeing what's making them not move properly though.
« Last Edit: June 22, 2009, 02:16:23 AM by Naut »

Re: Danmakufu Q&A/Problem Thread
« Reply #182 on: June 22, 2009, 03:02:28 AM »
For some odd reason or another, when I used some part of a code in two different scripts, the same result does not occur.


Code: [Select]
#TouhouDanmakufu
#Title[Blazing Wheel of Hell]
#Text[Round and Round it goes. When it stops, nobody knows.]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
let ImgBoss = "script\thC\IMAGE\CHAR\DOT\boss_remilia.png";

let count = 540;
let count2 = -120;

@Initialize {
SetLife(2500);
SetTimer(60);
SetScore(10000000);

SetMovePosition02(225, 200, 60);

LoadGraphic(ImgBoss);
SetTexture(ImgBoss);
SetGraphicRect(0, 0, 100, 100);
}

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

if(count == 600) {
ascent( i in 0..1050)
{
                CreateShotA(i, GetX, GetY, 10);
                SetShotDataA(i, 0+i*0.5, 2, i*93, 0, -0.05, 0, RED04);
                SetShotDirectionType(PLAYER);
                SetShotDataA(i, 60+i*0.5, 3, 0, 0, -0.05, 0, RED04);
                SetShotDataA(i, 120+i*0.5, 9, 0, 0, -0.05, 0, RED04);
                SetShotDataA(i, 180+i*0.5, 9, 0, 0, 0, 9, RED04);
                SetShotDirectionType(ABSOLUTE);
                FireShot(i);
}
count=0;
}



if(count2 == 60){
ascent( j in 0..9)
{
                CreateShotA(j, GetX, GetY, 10);
                SetShotDirectionType(ABSOLUTE);
                SetShotDataA(j, 0, 2, rand(0, 360), 0, -0.05, 0.5, GREEN01);
                SetShotDirectionType(ABSOLUTE);
                FireShot(j);
}
count2 = 0;
}

count++;
count2++;
}

@DrawLoop {
DrawGraphic(GetX, GetY);
}

@Finalize {
DeleteGraphic(ImgBoss);
}
}

Code: [Select]
#TouhouDanmakufu
#Title[Spawn Test]
#Text[Test script]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
let ImgBoss = "script\thC\IMAGE\CHAR\DOT\boss_remilia.png";

let count = 0;
let a = 0;

@Initialize {
SetLife(2500);
SetTimer(60);
SetScore(10000000);

SetMovePosition01(GetCenterX, GetClipMinY + 120, 120);

LoadGraphic(ImgBoss);
SetTexture(ImgBoss);
SetGraphicRect(0, 0, 100, 100);
}

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

if(count == 60) {
ascent( i in 0..120)
{
                CreateShotA(i, GetX + 100*cos(a), GetY + 100*sin(a), 10);
                SetShotDataA(i, i*0.5, 2, i*37.01, 0, 0, 2, GREEN01);
                SetShotDirectionType(ABSOLUTE);
                FireShot(i);

a += 37.01;
}
count=0;
}


count++;
}

@DrawLoop {
DrawGraphic(GetX, GetY);
}

@Finalize {
DeleteGraphic(ImgBoss);
}
}

Code: [Select]
#TouhouDanmakufu
#Title[Spawn 3]
#Text[Test script]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
let ImgBoss = "script\thC\IMAGE\CHAR\DOT\boss_remilia.png";

let count = 0;
let a = 0;

@Initialize {
SetLife(2500);
SetTimer(60);
SetScore(10000000);

SetMovePosition01(GetCenterX, GetClipMinY + 120, 120);

LoadGraphic(ImgBoss);
SetTexture(ImgBoss);
SetGraphicRect(0, 0, 100, 100);
}

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

if(count == 60) {
ascent( i in 0..120)
{
                CreateShotA(i, GetX + 100*cos(a), GetY + 100*sin(a), 10);
                SetShotDataA(i, 0+i*0.5, 0, i*a, 0, 0, 0, GREEN01);
                SetShotDataA(i, 30+i*0.5, 2, i*a, 0, 0, 2, GREEN01);
                SetShotDirectionType(ABSOLUTE);
                FireShot(i);

a += 33;
}
count=0;
}


count++;
}

@DrawLoop {
DrawGraphic(GetX, GetY);
}

@Finalize {
DeleteGraphic(ImgBoss);
}
}




See, in the first script, all of the bullets in | ascent( i in... ) | appear in their delayed order, while the bullets in the second and third scripts in the same area appear all at once as red bullets, THEN start to fire off in their order of delay. I want the second and third scripts to function like the first script. Why are they all appearing at once instead of individually?




Or how do I at least make it so that the first/whichever bullet in the i.d. changes angle as well?

Take this script, for example. Half of the bullets are thrown around in a ribbon in varied angles, while the other half of the bullets fly directly to the right, i.e. angle 0:

Code: [Select]
#TouhouDanmakufu
#Title[Spawn 4]
#Text[Test script]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
let ImgBoss = "script\thC\IMAGE\CHAR\DOT\boss_remilia.png";

let count = -60;
let a = 0;

@Initialize {
SetLife(2500);
SetTimer(60);
SetScore(10000000);

SetMovePosition01(GetCenterX, GetClipMinY + 120, 120);

LoadGraphic(ImgBoss);
SetTexture(ImgBoss);
SetGraphicRect(0, 0, 100, 100);
}

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

if(count == 1) {
ascent( i in 0..2)
{
                CreateShotA(i, GetX + 100*cos(a), GetY + 100*sin(a), 10);
                SetShotDataA(i, i*0.5, 2, i*a, 0, 0, 2, GREEN01);
                SetShotDirectionType(ABSOLUTE);
                FireShot(i);

a += 13.01;
}
count=0;
}


count++;
}

@DrawLoop {
DrawGraphic(GetX, GetY);
}

@Finalize {
DeleteGraphic(ImgBoss);
}
}
« Last Edit: June 22, 2009, 03:12:46 AM by Frazer »

Re: Danmakufu Q&A/Problem Thread
« Reply #183 on: June 22, 2009, 03:24:30 AM »
Do not multiply your delay field by a decimal, make sure that the number in the second parameter of SetShotDataA is an integer greater than or equal to 0 or it will not function properly. Because your delay comes out to a decimal fairly often, it does wierd stuff (don'tcha wish it just flagged an error, like when you try to make it negative?). Also note that you should always called the bullet's motion as it spawns (the 0th frame), or even more wierd stuff could happen. The reason for the former is because you can't tell Danmakufu to process something on a half frame. Multiply your second parameter by a positive integer and it should actually give you results, however correct or otherwise they may be.

At least I think that's what's happening. Colon backslash forwardslash.

Wait, no, this is fucked. I must be really tired.

Oh fucking ass buckets I'm an idiot. When you ascent(i in 0..2) for the last script, the first numerical value you place on i is 0, which is multiplied in your angular parameter and thus gives you an angle of 0. You could say (i+1)*a so that the first bullet will still have an angle other than 0.


Agghhh that was so simple. Time for sleep.
« Last Edit: June 22, 2009, 03:35:49 AM by Naut »

Re: Danmakufu Q&A/Problem Thread
« Reply #184 on: June 22, 2009, 03:45:06 AM »
Well, I don't want the bullets to delay that long before appearing and firing (every frame). Say, in the second script's case, I want the bullets to appear where they are, but I want all 120 of the bullets to appear within 60 frames.

That is why I asked the latter, second question at the bottom of my previous post, because that is what led me to asking the first question in the first place.


However, the explanation in the bottom half of your post really helped and worked. Thank you.

Nimono

  • wat
Re: Danmakufu Q&A/Problem Thread
« Reply #185 on: June 22, 2009, 06:12:32 PM »
Not at all, it's my fault -- I just don't work with arrays beyond selecting a random color for a bullet, so this is a bit advanced for me. Hopefully I can get the jist of it enough to understand what's going on in your txt file... If somebody else doesn't first, hehe.

EDIT: A possible workaround is to have the bullets force move into a NULL angle (or random, failing that) after a set period of time after spawning, at least to prevent them from staying on the screen. I'm not seeing what's making them not move properly though.

Thanks for the idea, but I FINALLY solved my problem. I realized that the problem was that at frame5 == 210, I was deleting some of the bullets in the arrays, thus, this screwed up some things. After removing that and some other things I did to kinda counter that, I finally had it fixed.


Oh, and after changing the thing in the RedMagic task about Bounce > 0 to where it affects the code that makes the orbs bounce off the walls and NOT the code spawning the small, red bullets, the spellcard suddenly became difficult. Heh heh heh... PERFECT.

Re: Danmakufu Q&A/Problem Thread
« Reply #186 on: June 23, 2009, 07:03:05 AM »
Hello, I have a question regarding Danmakufu...

How would you make a bit of a code that affects all of the bullets on the screen, regardless of the type of bullet used?

For example, if I wanted all of the bullets onscreen to change speed, how would I do that?

 

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread
« Reply #187 on: June 23, 2009, 07:13:46 AM »
Quote
How would you make a bit of a code that affects all of the bullets on the screen, regardless of the type of bullet used?

For example, if I wanted all of the bullets onscreen to change speed, how would I do that?

Sorry, there are no functions of this sort. Different bullet functions are processed in different ways, and generally you cannot affect a non-object bullet after it's been fired. Either you're going to need to set up all your bullets as CreateShotA with data that will cause them all to change speed at the same time, or you're going to need to make them all object bullets that use a global variable to determine when to change speed.

Re: Danmakufu Q&A/Problem Thread
« Reply #188 on: June 23, 2009, 08:52:01 AM »
Oh...  D:

Well, thanks anyway.

*Sulks*



*Then starts to code*
« Last Edit: June 23, 2009, 08:53:32 AM by renaryuugu »

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread
« Reply #189 on: June 23, 2009, 02:42:57 PM »
Hey, I have a question.  What's the difference with
Code: [Select]
#TouhouDanmakufu
#Title[Bullets]
#Text[test script for bullets]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
    let frame = 0;
    @Initialize {
        SetLife(1000);
        SetEnemyMarker(true);
    }

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

        if(frame==60){


            CreateShotA(1, GetX, GetY, 10);
SetShotDataA(1, 0, 5, 0, 2.2, 0, 5, RED03);
SetShotDataA(1, 60, 5, 132, 0, 0.1, 8, RED03);
ascent(i in 1..60){
    CreateShotA(2, 0, 0, 30);
    SetShotDataA_XY(2, 0, rand(-1, 1), rand(-1, -4), 0, 0.1, 0, 3, RED01);
    AddShot(i*2, 1, 2, 0);
    AddShot(i*2, 2, 1, 0);

frame = 0;
}


FireShot(1);


        }


        frame++;

    }

    @DrawLoop {       
    }

    @Finalize {
    }
}

And

Code: [Select]
#TouhouDanmakufu
#Title[Bullets]
#Text[test script for bullets]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
    let frame = 0;
    @Initialize {
        SetLife(1000);
        SetEnemyMarker(true);
    }

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

        if(frame==60){


            CreateShotA(1, GetX, GetY, 10);
SetShotDataA(1, 0, 5, 0, 2.2, 0, 5, RED03);
SetShotDataA(1, 60, 5, 132, 0, 0.1, 8, RED03);
ascent(i in 1..60){
    CreateShotA(2, 0, 0, 30);
    SetShotDataA_XY(2, 0, rand(-1, 1), rand(-1, -4), 0, 0.1, 0, 3, RED01);
    AddShot(i*2, 1, 2, 0);
    AddShot(i*2, 2, 1, 0);


FireShot(1);

frame = 0;
}




        }


        frame++;

    }

    @DrawLoop {       
    }

    @Finalize {
    }
}

I know its the 'FireShot(1);', but why would it make a difference if I'd put it in with the same brackets as 'frame = 0' or outside of them?  What's exactly going on?

Obviously it makes  a huge difference, and I find it confusing as to why.  Any help?

Re: Danmakufu Q&A/Problem Thread
« Reply #190 on: June 23, 2009, 02:50:25 PM »
If it's in the brackets, it's fired every 60 frames since it's only run when frame==60. Outside the brackets, then it gets fired every single frame instead.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread
« Reply #191 on: June 23, 2009, 03:35:35 PM »
@ Suikama 

Thanks alot.  I see what you mean, that makes things a lot more simple...

Oh, one other question.  I can't seam to get the Boss thing down.  I mean, I can make the boss move and all, but as for the boss graphics and making the boss move in correspondence to the spells etc.
I can only get one image, and it's static.  I want it to be more lifelike, (move arms, lean on air, etc)  What can I do?
Can anyone give me a code or something?  Thanks in advance.

Re: Danmakufu Q&A/Problem Thread
« Reply #192 on: June 23, 2009, 04:49:15 PM »
You have to get information on which direction the boss is moving, then set an image in correspondance. GetSpeedX will yield a positive value if the boss is moving right, or a negative value if the boss is moving left. If the boss is horizontally stationary, then the value will be 0. So using this information, we can "animate" the boss by changing her graphic depending on her horizontal speed:


@DrawLoop{
SetTexture(BossRumia);
if(GetSpeedX==0){
   SetGraphicRect(0, 0, 64, 64);
}
if(GetSpeedX>0){
   SetGraphicRect(64, 0, 128, 64);
}
if(GetSpeedX<0){
   SetGraphicRect(128, 0, 192, 64);
}
DrawGraphic(GetX, GetY);
}

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread
« Reply #193 on: June 23, 2009, 04:51:36 PM »
Oh man I didn't know about GetSpeedX, all this time I've been doing bullshit like checking the direction of random movement and passing variables. D:

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread
« Reply #194 on: June 23, 2009, 05:02:11 PM »
You have to get information on which direction the boss is moving, then set an image in correspondance. GetSpeedX will yield a positive value if the boss is moving right, or a negative value if the boss is moving left. If the boss is horizontally stationary, then the value will be 0. So using this information, we can "animate" the boss by changing her graphic depending on her horizontal speed:


@DrawLoop{
SetTexture(BossRumia);
if(GetSpeedX==0){
   SetGraphicRect(0, 0, 64, 64);
}
if(GetSpeedX>0){
   SetGraphicRect(64, 0, 128, 64);
}
if(GetSpeedX<0){
   SetGraphicRect(128, 0, 192, 64);
}
DrawGraphic(GetX, GetY);
}

Ahh, thanks, this was helpful, and it worked.  But what if I want to set an animation for when the boss isn't moving, but rather during a spellcard, in correspondance to the bullets.  Like lets say, Mokou's "Immortal Bird Flying Phoenix" spellcard.  How can that be arranged?

Nimono

  • wat
Re: Danmakufu Q&A/Problem Thread
« Reply #195 on: June 23, 2009, 06:19:00 PM »
Ahh, thanks, this was helpful, and it worked.  But what if I want to set an animation for when the boss isn't moving, but rather during a spellcard, in correspondance to the bullets.  Like lets say, Mokou's "Immortal Bird Flying Phoenix" spellcard.  How can that be arranged?

Simple. Start a variable to count animation, for example, "anim_frame". Increase this variable as you wish, and in your draw loop, check if it's equal to certain values. If it is, check your GetSpeedX stuff. So like, for me, I tend to increase it every frame, and for things that animate every 4 frames, I check if the value is greater than or equal to 0, but less than 4, then greater than or equal to 4, but less than 8, etc. 4 frames of animation tells me to reset the value at 12, so...

You get the idea, right? I hope I explained it well enough...

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread
« Reply #196 on: June 23, 2009, 06:46:46 PM »

Simple. Start a variable to count animation, for example, "anim_frame". Increase this variable as you wish, and in your draw loop, check if it's equal to certain values. If it is, check your GetSpeedX stuff. So like, for me, I tend to increase it every frame, and for things that animate every 4 frames, I check if the value is greater than or equal to 0, but less than 4, then greater than or equal to 4, but less than 8, etc. 4 frames of animation tells me to reset the value at 12, so...

You get the idea, right? I hope I explained it well enough...

Uh, sort of.  Can you please give me an code example to make it more clear?

Re: Danmakufu Q&A/Problem Thread
« Reply #197 on: June 23, 2009, 07:01:20 PM »
Pikaguy900 is just talking about standard boss animation loops to make the boss seem more life-like (which, by the way, is probably easier to accomplish using modular division.... But I digress). To get the boss to do a standard animation in correspondance to bullets firing (like Mokou's hand raising), you're going to need to do a bit of dicking around. This is only because you can't draw things in the @MainLoop. I find it easier to do this using tasks, but I'll spare you that headache for today and just show you how to using conditional statements in your @MainLoop.

For Mokou, you'll notice that she raises her hand a few frames before she starts firing bullets. So to mimic this, we'll say something like this:

@MainLoop{
frame++;

if(frame==50){
 anim = 1;
}

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

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

if(frame==80){
 anim = 0;
 frame = 0;
}

}

@DrawLoop{
 SetTexture(boss);
 if(anim==1){
  SetGraphicRect(0, 0, 64, 64);
 }
 if(anim==0){
  SetGraphicRect(64, 0, 128, 64);
 }
}

So this way, we set a variable to equal 1 right before shooting our bullets, then in our @DrawLoop we constantly check for that variable. If it equals a certain value, we set her graphic to be something else, otherwise we set it to her default graphic. Is this understandable? I'm not sure if I'm being clear.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread
« Reply #198 on: June 24, 2009, 01:01:33 AM »
@Naut

Yes, very clear.  Thanks alot, you've been very helpful.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #199 on: July 03, 2009, 06:25:09 AM »
Code: [Select]
#TouhouDanmakufu[Player]
#ScriptVersion[2]
#Menu[Reimu D]
#Text[Hakurei Reimu ?u一点集中攻撃力重視型?v

?uアブソルジョンニードル?v
        ?uAbsolution Needle?v

?u完敗乱舞?v
         ?uWild Annihilation Dance?v]
#Image[.\sl_pl00.png]
#ReplayName[ReimuD]
#include_function ".\common.txt"

script_player_main{

let c = GetCurrentScriptDirectory();
let bNextShot = false;

@Initialize{
LoadGraphic(c~"pl00.png");
LoadPlayerShotData(c~"plshot00.txt");
                                          SetPlayerLifeImage(c~"pl00.png", 222, 302, 234, 314);
SetSpeed(4, 1.5);
}

@MainLoop{
SetIntersectionCircle(GetPlayerX, GetPlayerY, 2);
yield;
}
@Missed{}
@SpellCard{
SetSpeed(4, 1.5);
UseSpellCard("WildAnnihilationDance", 0);
}
@DrawLoop{
SetTexture(c~"pl00.png");
if(IsPressLeft()==true){
SetGraphicRect(240, 73, 275, 150);
}else if(IsPressRight()==true){
SetGraphicRect(248, 126, 272, 176);
}else{
SetGraphicRect(22, 27.5, 42, 60.5);
}
DrawGraphic(GetPlayerX(), GetPlayerY());
}

@Finalize{}
}

script_spell WildAnnihilationDance{

@Initialize{
}
@MainLoop{
}
@Finalize{
}
}
y not workin

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

Re: Danmakufu Q&A/Problem Thread
« Reply #200 on: July 03, 2009, 09:27:32 PM »
#include_function can go outside script_player_main? News to me.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #201 on: July 03, 2009, 10:07:16 PM »
Sorry, I meant that it doesn't show up on Danmakufu's list of players.

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

Re: Danmakufu Q&A/Problem Thread
« Reply #202 on: July 03, 2009, 10:45:40 PM »
Probably in the wrong folder, it shows up for me.

« Last Edit: July 03, 2009, 10:47:14 PM by Naut »

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #203 on: July 05, 2009, 04:38:12 AM »
The problem was that I encoded it in Unicode. Oh well, no Japanese for me, as I can't find a UTF8-to-messy-ANSI converter.

New question, is it actually possible for drawings to overlap things such as bullets and more importantly, the default hitbox? I know Stuffman said some stuff about SetEffectLayer before, but the wiki says it only works with Concentrate, and Josette's hitbox doesn't overlap the default, either.
« Last Edit: July 05, 2009, 04:41:44 AM by Drake »

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

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread
« Reply #204 on: July 05, 2009, 05:29:13 AM »
When I was talking about layers earlier we were talking about whether it was possible to draw on top of the frame, which it's not; however for any layer below that, SetEffectLayer or whatever it's called works fine. So you can draw on different layers but they have to be effect objects.

I don't know what layer the default hitbox dot is on, I'll have to try that as a workaround.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #205 on: July 06, 2009, 12:48:26 AM »
Oh dammit, then. Well, originally I was painfully making Effect Objects, but I found that I couldn't rotate them properly at all because of the xyz coordinates. But if the only way to get the nice hitbox is make an effect object...

Then again, I might be able to make an object bullet with no collision and a hitbox graphic. That might work.


I'm making a perfect UFO-style Reimu. I have the option movement patterns, option rotation, entire neutral sprite animation, right sprite, left sprite, and the focus circle complete with bouncing entry and such. It's makes me squeal every time I finish something.
EDIT:

atai wa genius desu
EDIT: Gonna need super tweaking. When it rotates it ends up going in a small circle, or when I press a direction it gets set off. Probably because it goes before MainLoop instead of after...?
EDIT: Practically, it works well. I need to get rid of the other hitbox graphic, though.


EDIT: Er, how exactly would I go about using an image that when it's loaded, is already turned on it's side? I'm using a shot graphic from Reimu's sheet that's turned 90 degrees, and I need it straight. Obviously without editing the sprite sheet as I don't want to calculate new coordinates for everything. I tried graphic_rotation even though I knew it wouldn't work, but eh.

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

Re: Danmakufu Q&A/Problem Thread
« Reply #206 on: July 06, 2009, 02:12:56 AM »
ObjEffect_SetAngle(object id, x angle, y angle, z angle);

???

Alternatively, yeah, you'll need to edit the spritesheet and calculate new verticies. This is why I don't do object effects.


EDIT:

And uh...
I don't know what layer the default hitbox dot is on, I'll have to try that as a workaround.

Layer three, unfortunately. With the rest of the damn sprite. It's under items (4), bullets (5), events (6) and the foreground (7). If you guys are making a better hitbox, might I recommend layer 6 or 7, so that it is above mostly everything (think Okuu, Hell's Tokamak Reactor, lots of Additive blends and shit but your hitbox is still clearly visible above everything. Like that). That would be my personal choice, anyway.
« Last Edit: July 06, 2009, 05:05:46 AM by Naut »

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #207 on: July 06, 2009, 05:53:30 AM »
By the way controlling the hitbox as an Object Bullet lets it stay above all the danmaku and the default hitbox like it should be.

<3

But yeah goddammit and stuff

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread
« Reply #208 on: July 06, 2009, 08:01:27 AM »
I have been fooling around with the @DrawLoop section in scripts to add the animating spellcircle for my cards. As I am a person of paying more attention to detail, I was wonder HOW THE HELL do you make your sprites animate in appearance?


Just like every Touhou game the bosses/chars have sprite ranges for animating. But whatever I seem to do it won't work proper.

I tried already to make it animate with counting frames. Rough example below:

Code: [Select]
if(frame == 20) { SetGraphicRect(1st sprite in animation range) }
if(frame == 40) { SetGraphicRect(2nd sprite in animation range) }

But I fail horribly at it. What is the method for using a range of sprites to make it animate?

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread
« Reply #209 on: July 06, 2009, 03:21:22 PM »
I think the only problem with your way is that the GraphicRect has to be chosen anew every time the sprite is drawn, so you have to change first "==" to "<=" and add as a second condition for the second one for the variable to be higher than twenty. It should work out fine, then.

Code: [Select]
if(frame <= 20) { SetGraphicRect(1st sprite in animation range) }
if(frame <= 40&&frame>20) { SetGraphicRect(2nd sprite in animation range) }

Or maybe it won't, I have no idea. But that is what I would try.  :V
« Last Edit: July 06, 2009, 03:24:04 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."