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

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem thread number 4
« Reply #90 on: July 05, 2010, 06:35:11 AM »
Code: [Select]
LoadUserShotData(CSD ~ "\shots\supershot.png");

I'm not sure if this is the only problem, but you should remove the "\" before "shots." GetCurrentScriptDirectory includes the last slash, so that would double it up and make the directory incorrect.

Wotan Manasal

Re: Danmakufu Q&A/Problem thread number 4
« Reply #91 on: July 05, 2010, 06:40:18 AM »
I'm not sure if this is the only problem, but you should remove the "\" before "shots." GetCurrentScriptDirectory includes the last slash, so that would double it up and make the directory incorrect.
I've modified that, but it's still not working.

Still, many thanks.

Re: Danmakufu Q&A/Problem thread number 4
« Reply #92 on: July 05, 2010, 06:44:33 AM »
Your loading an image, not a shotdata


Shotdata must be a .txt, you can't load a image and call it shotdata

Wotan Manasal

Re: Danmakufu Q&A/Problem thread number 4
« Reply #93 on: July 05, 2010, 06:46:28 AM »
Your loading an image, not a shotdata


Shotdata must be a .txt, you can't load a image and call it shotdata
Indeed, that's what was going wrong. Many, many thanks.

Thaws

  • _m廿廿m_
Re: Danmakufu Q&A/Problem thread number 4
« Reply #94 on: July 05, 2010, 01:16:14 PM »

Code: [Select]
CreateShot01(GetEnemyX,GetEnemyY,4,GetAngleToPlayer-5,AQUA01,20);
CreateShot01(GetEnemyX,GetEnemyY,4,GetAngleToPlayer+5,AQUA01,20);
CreateShot01(GetEnemyX,GetEnemyY,4,GetAngleToPlayer-15,AQUA01,20);
CreateShot01(GetEnemyX,GetEnemyY,4,GetAngleToPlayer+15,AQUA01,20);
CreateShot01(GetEnemyX,GetEnemyY,4,GetAngleToPlayer-25,AQUA01,20);
CreateShot01(GetEnemyX,GetEnemyY,4,GetAngleToPlayer+25,AQUA01,20);
CreateShot01(GetEnemyX,GetEnemyY,4,GetAngleToPlayer-35,AQUA01,10);
CreateShot01(GetEnemyX,GetEnemyY,4,GetAngleToPlayer+35,AQUA01,10);


wait(30);
yield;

Err, I know your question has been answered, but just some things I'd like to mention...
I quoted a segment of a task in your script.
First of all, there is no need for writing out the CreateShot01s again and again, not only is it bothersome, it also makes it more difficult to make changes. You could use a loop to do something similar easily. For example:
Code: [Select]
let i = -35;
while(i <= 35)
{
CreateShot01(GetEnemyX,GetEnemyY,4,GetAngleToPlayer+i,AQUA01,10);
                        i += 5;
}
Can replace the bunch of CreateShot01s in the quote.

Secondly, you called the function wait(30), which basically is identical to writing " yield; yield; yield;... " 30 times, therefore the yield; at the end of your task is actually unnecessary. I just thought I'd mention this as the additional yield might throw off the timing of your danmaku pattern a bit. (Which I think it will because instead of every loop having yield;s in multiples of 10, you have them as numbers like 11, 61, etc. )

Finally, the yield; in the task mainTask is not necessary because you're not trying to loop anything and you need not stop the task for a frame.

Hope this helps with your scripting.

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #95 on: July 05, 2010, 06:24:26 PM »
I personally prefer using ascents. Arbitrary variables etc. You can use a local wrapper to do the same thing, but massive sigh anyways. Also, as a general guideline, similar bullets in any one pattern should all have the same amount of delay, and instead be launched later.
Code: [Select]
ascent(i in -3..4){
    CreateShot01(GetEnemyX,GetEnemyY,4,GetAngleToPlayer+(i*10),AQUA01,10);
}
wait(10);
ascent(i in -7..8){
    if( (| (i*5)%10 |) == 5 ){
        CreateShot01(GetEnemyX,GetEnemyY,4,GetAngleToPlayer+(i*5),AQUA01,10);
    }
}

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

Re: Danmakufu Q&A/Problem thread number 4
« Reply #96 on: July 06, 2010, 01:52:22 PM »
Sum more questions  :]

I don't know why but why does the background and the drawloop connects to each other ?

http://s477.photobucket.com/albums/rr139/namethecool/Games/?action=view&current=b5.png

Code: [Select]
    @DrawLoop {
DrawAnimatedSprite("reimu", GetX, GetY);
DrawText("Minoriko Aki", 50, 50, 12, 255);

    }

   @BackGround
   {

LoadGraphic(BossImage2);
SetGraphicScale(5, 5);
SetTexture(BossImage2);
SetGraphicRect( 0, 0, 256, 256 );
SetGraphicAngle(0, 0, rotation);
DrawGraphic(GetCenterX , GetCenterY );


   }

    @Finalize {
      DeleteGraphic(BossImage2);
    }

And why can't you have backgrounds for non- spell cards ?
Hey There !

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem thread number 4
« Reply #97 on: July 06, 2010, 05:37:24 PM »
Sum more questions  :]

I don't know why but why does the background and the drawloop connects to each other ?

http://s477.photobucket.com/albums/rr139/namethecool/Games/?action=view&current=b5.png

Code: [Select]
    @DrawLoop {
DrawAnimatedSprite("reimu", GetX, GetY);
DrawText("Minoriko Aki", 50, 50, 12, 255);

    }

   @BackGround
   {

LoadGraphic(BossImage2);
SetGraphicScale(5, 5);
SetTexture(BossImage2);
SetGraphicRect( 0, 0, 256, 256 );
SetGraphicAngle(0, 0, rotation);
DrawGraphic(GetCenterX , GetCenterY );


   }

    @Finalize {
      DeleteGraphic(BossImage2);
    }

- LoadGraphic has to go to @initialize, not in @background
- I don't know what exactly DrawAnimatedSprite does, seems like a function or library. Cannot fully judge what your problem is.


And why can't you have backgrounds for non- spell cards ?
Because it is Danmakufu. If you want background for non-spells, you need to work with stage scripts.

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #98 on: July 06, 2010, 09:35:58 PM »
He's using Blargel's Animation Library.

In any case, don't load the background graphic in the BG loop. Load it in Initialize.

Have you even tried resetting the values to normal during DrawLoop? SetGraphicScale(1, 1);? SetGraphicAngle(0, 0, 0);?

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

puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #99 on: July 07, 2010, 07:32:45 AM »
I'm trying to make a caterpillar-like effect for a chain of object bullets/effects.
In other words, one bullet/effect will lead, and the others will follow its exact path with a set time and/or distance between them.

How would I properly code that in danmakufu? It has left me clueless!
Full Danmakufu game "Juuni Jumon - Summer Interlude" is done!
By the same person who made Koishi Hell 1,2 (except this game is serious)
Topic: http://www.shrinemaiden.org/forum/index.php/topic,9647.0.html

Re: Danmakufu Q&A/Problem thread number 4
« Reply #100 on: July 07, 2010, 07:47:25 AM »
I have an idea, but it would depend on how many bullets you wanted to do the  caterpiller affect  too

puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #101 on: July 07, 2010, 07:50:45 AM »
I have an idea, but it would depend on how many bullets you wanted to do the  caterpiller affect  too

I got various uses for it, so it's pretty variable. But the most important one is about 10-15.
Full Danmakufu game "Juuni Jumon - Summer Interlude" is done!
By the same person who made Koishi Hell 1,2 (except this game is serious)
Topic: http://www.shrinemaiden.org/forum/index.php/topic,9647.0.html

Re: Danmakufu Q&A/Problem thread number 4
« Reply #102 on: July 07, 2010, 07:56:54 AM »

It pretty much works like this, the ID of the object would have to be a number, and it would pretty much go like this:


if(count%howmanybulletsyouwant==(Id of the Object){
SetPosition(Id of the Object,LastX,LastY,2);
LastX = Obj_GetX(Id of the Object);
LastY= Obj_GetY(Id of the Object);
}


While having count increasing MainLoop, put this in the object bullet's code. It would cause that when the condition is met, to but the bullet at the last know X and Y, which would be the previous bullet's, so now this bullet is taking the other bullet's place


Does this work for you?

puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #103 on: July 07, 2010, 08:12:20 AM »
I'll try it out when I get home. ^_^
I'm not too familiar with how % works, but it seems it'll be useful in more ways than 1 if you can also use it for this.
Full Danmakufu game "Juuni Jumon - Summer Interlude" is done!
By the same person who made Koishi Hell 1,2 (except this game is serious)
Topic: http://www.shrinemaiden.org/forum/index.php/topic,9647.0.html

Re: Danmakufu Q&A/Problem thread number 4
« Reply #104 on: July 07, 2010, 08:28:45 AM »
He's using Blargel's Animation Library.

In any case, don't load the background graphic in the BG loop. Load it in Initialize.

Have you even tried resetting the values to normal during DrawLoop? SetGraphicScale(1, 1);? SetGraphicAngle(0, 0, 0);?

I tried moving LoadGraphic(BossImage2); to @Initialize and did what you said, it's still connected  :/
Hey There !

Re: Danmakufu Q&A/Problem thread number 4
« Reply #105 on: July 07, 2010, 09:46:08 AM »

I tried moving LoadGraphic(BossImage2); to @Initialize and did what you said, it's still connected  :/

Have you tried setting back the Angle and Scale like Drake also said?

Re: Danmakufu Q&A/Problem thread number 4
« Reply #106 on: July 07, 2010, 11:07:27 AM »

Have you tried setting back the Angle and Scale like Drake also said?


yes  :V still connected
Hey There !

Re: Danmakufu Q&A/Problem thread number 4
« Reply #107 on: July 07, 2010, 11:15:08 AM »
Try putting the SetScale after you call the Texture

Thaws

  • _m廿廿m_
Re: Danmakufu Q&A/Problem thread number 4
« Reply #108 on: July 07, 2010, 11:45:22 AM »
Wouldn't something like
Code: [Select]
SetGraphicScale(5, 5);
SetTexture(BossImage2);
SetGraphicRect( 0, 0, 256, 256 );
SetGraphicAngle(0, 0, rotation);
DrawGraphic(GetCenterX , GetCenterY );
SetGraphicScale(1, 1);
work?
That way, it doesn't matter if the loops are connected or not.

Edit : Oops Drake already said it long time ago. What are you trying to achieve by making them not connect though?
« Last Edit: July 07, 2010, 11:48:36 AM by Thaws »

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #109 on: July 07, 2010, 02:38:35 PM »
I'm trying to make a caterpillar-like effect for a chain of object bullets/effects.
In other words, one bullet/effect will lead, and the others will follow its exact path with a set time and/or distance between them.

How would I properly code that in danmakufu? It has left me clueless!
Eh.....
Why not just use a sinuate laser, or maybe you're trying to make something out of this effect??

Or you can just add delay to the trailing bullets. I think.
« Last Edit: July 07, 2010, 02:41:27 PM by μ⑨ »

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: Danmakufu Q&A/Problem thread number 4
« Reply #110 on: July 07, 2010, 02:41:04 PM »
Eh.....
Why not just use a sinuate laser...?

Uhhh... maybe to split the bullets from the line at some point? or maybe because caterpillars are circles instead of a smooth line...
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Re: Danmakufu Q&A/Problem thread number 4
« Reply #111 on: July 07, 2010, 04:36:31 PM »
Edit : Nvm thankyou all for your time helping me  :)

Quote
Wouldn't something like
Code: [Select]
SetGraphicScale(5, 5);
SetTexture(BossImage2);
SetGraphicRect( 0, 0, 256, 256 );
SetGraphicAngle(0, 0, rotation);
DrawGraphic(GetCenterX , GetCenterY );
SetGraphicScale(1, 1);
work?
That way, it doesn't matter if the loops are connected or not.

Edit : Oops Drake already said it long time ago. What are you trying to achieve by making them not connect though?

Almost >_< the background is working now but, minoriko is still spinning even though she doesn't have rotation. Do not want them to connect because it looks weird if the boss is huge and spinning.

This is why I can't script nice things  :colonveeplusalpha:
« Last Edit: July 07, 2010, 04:41:17 PM by Foremoster »
Hey There !

Thaws

  • _m廿廿m_
Re: Danmakufu Q&A/Problem thread number 4
« Reply #112 on: July 07, 2010, 04:57:46 PM »
Edit : Nvm thankyou all for your time helping me  :)


Almost >_< the background is working now but, minoriko is still spinning even though she doesn't have rotation. Do not want them to connect because it looks weird if the boss is huge and spinning.

This is why I can't script nice things  :colonveeplusalpha:

Code: [Select]
SetGraphicScale(5, 5);
SetTexture(BossImage2);
SetGraphicRect( 0, 0, 256, 256 );
SetGraphicAngle(0, 0, rotation);
DrawGraphic(GetCenterX , GetCenterY );
SetGraphicScale(1, 1);
SetGraphicAngle(0, 0, 0);


Basically you reset the scale and angle values to normal after you draw your background, so whatever you draw in your DrawLoop comes out normally.

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #113 on: July 07, 2010, 06:12:53 PM »
If you're really having that much trouble with it, take your entire script and talk to Blargel about it.

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

Zerro

  • ERRORS,
  • ERRORS EVERYWHERE
Re: Danmakufu Q&A/Problem thread number 4
« Reply #114 on: July 08, 2010, 04:34:42 AM »
I need help on making events different depending on which character you use.

I have found the GetPlayerType function but I don't know how I would use it for
a custom player and not Reimu or Marisa.

Or how to use it period, really.
Life's a shmup, play on lunatic.

Re: Danmakufu Q&A/Problem thread number 4
« Reply #115 on: July 08, 2010, 06:11:50 AM »
I need help on making events different depending on which character you use.

I have found the GetPlayerType function but I don't know how I would use it for
a custom player and not Reimu or Marisa.

I'm a beginner myself, but I think it's something to do with
Code: [Select]
if ((GetPlayerType == REIMU_A) || (GetPlayerType == REIMU_B))
and you can do SetStep(1); if the character is Reimu A and SetStep(2); if it's Reimu B. I think if you want to change the character you link the file your character is in. like GetCurrentScriptDirectory ~ "something".

Code: [Select]
else if ((GetPlayerType == MARISA_A) || (GetPlayerType == MARISA_B))and if it's not reimu and it's either marisa A or marisa B then stuff happens

or just any character you can just do
Code: [Select]
else
{

Bleh source from nimble's script  :getdown: this is in @MainLoop
Hey There !

Re: Danmakufu Q&A/Problem thread number 4
« Reply #116 on: July 09, 2010, 03:28:30 PM »
So I got Dnamakufu 0.12m, installed East Asian language files, tried to run it with Applocale... and still it crashes on opening.

Without applocale, it opens fine but crashes when I pick an option in the menu. I'm running XP.

Halp?

Re: Danmakufu Q&A/Problem thread number 4
« Reply #117 on: July 10, 2010, 12:34:30 AM »
So I got Dnamakufu 0.12m, installed East Asian language files, tried to run it with Applocale... and still it crashes on opening.

Probably running it under the wrong language? Japanese should be the very bottom option. If it doesn't work, you can switch your whole computer's locale to Japanese in the Control Panel, restart, then run Danmakufu normally. It should work fine. Switching your computer to Japanese locale will change almost nothing, so don't worry about it screwing with other programs.

Re: Danmakufu Q&A/Problem thread number 4
« Reply #118 on: July 10, 2010, 04:46:41 AM »
Probably running it under the wrong language? Japanese should be the very bottom option. If it doesn't work, you can switch your whole computer's locale to Japanese in the Control Panel, restart, then run Danmakufu normally. It should work fine. Switching your computer to Japanese locale will change almost nothing, so don't worry about it screwing with other programs.

No, I definitely ran it in japanese. I changed the computer's locale to Japanese and ran it, but it's the same as before - crashes when I go into any option on the main menu.

EDIT: Problem solved - I had to remove the EX Rumia and player Rumia files. Thanks puremrz!
« Last Edit: July 10, 2010, 06:41:21 PM by Alpha Werewolf »

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #119 on: July 11, 2010, 07:58:14 AM »
Quote
EDIT: Problem solved - I had to remove the EX Rumia and player Rumia files. Thanks puremrz!
Then Applocale isn't working right, because the reason Rumia crashes it and the reason Applocale fixes it is Danmakufu doesn't like scripts with moonrunes in them when running english settings.





Formula? :ohdear:

EDIT:
I think the first thing that needs to be done is to locate the point on the wall where it's going to rebound. I had the idea of getting the Y distance between the enemy and player to get the amount of wall that needs to be traversed, and then getting the X distance from the wall for both and comparing them to get a ratio of how much wall would be between them on the bounce.

Code: [Select]
ydist=GetPlayerY-GetY;
// get y distance between enemy and player
yratio=(GetX-GetClipMinX)/((GetX-GetClipMinX)+(GetPlayerX-GetClipMinX));
// get ratio of distance from wall for enemy and player (assuming left wall here)
ypoint=GetY+(ydist*yratio);
// apply ratio to y distance to get how far down the wall it needs to bounce
angle=atan2(GetClipMinX-GetX,ypoint-GetY);
// get the angle to that point
pointdist=((GetX-GetClipMinX)^2)+((GetY-ypoint)^2);
pointdist=pointdist^0.5;
// gets distance from enemy to that point
pointdist=floor(pointdist/2);
// divides by two for number of frames travelled, to know when to reflect (speed 2)
CreateShotA(0,GetX,GetY,0);
SetShotDataA(0,0,2,angle,0,0,0,65);
SetShotDataA(0,pointdist,2,180-angle,0,0,0,65);
FireShot(0);



Why not worky?

EDIT 2:
angle=atan2(GetClipMinX-GetX,ypoint-GetY);
angle=atan2(ypoint-GetY,GetClipMinX-GetX);

Not worky because y coords need to go first in atan2. Goddamnit :fail:

So there's how to do it if anyone wants to know, I guess
« Last Edit: July 11, 2010, 09:01:29 AM by Stuffman »