Author Topic: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m [Closed, read last post!]  (Read 186071 times)

Lunarethic

  • Local Trashy Edgelord
  • *
  • I can cut people with all this edge
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #600 on: December 13, 2013, 02:52:21 PM »
This might be a bit sketchy but it works.

Yeah your right its sketchy but hey i wont complain ^^

oh and concerning my last question about animation

both of these codes wont show an attack animation at all
http://pastebin.com/KsXy4teT
http://pastebin.com/MQQCJFvB

even though i did what KuroArashi and the others told me to do soooo am i missing something here? X_X
いつもニコニコあなたの隣に這いよる!生放送!は好き。月です~す。略してニコニャル
Learned how to use a custom shotsheet : 12/28/13 *clapclapclap*
東方謎佚光 ~ Dimensional Light Abscence Work In Progress Touhou Fangame

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #601 on: December 13, 2013, 04:23:50 PM »
Yeah your right its sketchy but hey i wont complain ^^

oh and concerning my last question about animation

both of these codes wont show an attack animation at all
http://pastebin.com/KsXy4teT
http://pastebin.com/MQQCJFvB

even though i did what KuroArashi and the others told me to do soooo am i missing something here? X_X
I really hope this is not the error:
Code: [Select]
SetGraphicRect(more more stuff)which should be:
Code: [Select]
SetGraphicRect(more more stuff);Since you aren't showing the "real" code for those graphic rects, it's hard to tell.

Another obvious error is if you didn't call attack correctly in your attack (single) script, as in setting
Code: [Select]
atk = true; when you want the attack animation to play and later turn it to false again when you don't want it to show anymore.
The second script you post would work better.

Another thing to mention is that by using f2 for the attack animation and only resetting it at the idle animation, if you set "atk" to true while the boss is moving, something strange would happen~

Hope this helps in any way since I don't really see what is wrong otherwise.

Lunarethic

  • Local Trashy Edgelord
  • *
  • I can cut people with all this edge
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #602 on: December 13, 2013, 04:26:37 PM »
well i kinda rushed that post

but no the semi colon was not the error because if it was there would be an error
and as i said it was rushed to attack is "atk" as it was in the variable

and by turn it to false again do you mean this?

Code: [Select]
       if(attack==true){
                if(f2<10){ SetGraphicRect(stuff)}
        if(f2>=10 && f2<20){ SetGraphicRect(more stuff)}
        if(f2>=20 && f2<30){ SetGraphicRect(more more stuff)}
        f2++;
}
    attack = false;
« Last Edit: December 13, 2013, 04:28:22 PM by Lunarethic »
いつもニコニコあなたの隣に這いよる!生放送!は好き。月です~す。略してニコニャル
Learned how to use a custom shotsheet : 12/28/13 *clapclapclap*
東方謎佚光 ~ Dimensional Light Abscence Work In Progress Touhou Fangame

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #603 on: December 13, 2013, 04:33:27 PM »
and by turn it to false again do you mean this?

more like:
Code: [Select]
task shoottask{
loop{

wait(120);

//start attack animation for having the boss firing bullets.
attack = true;

//Insert bullet code here.

//end attack animation once the bullets are all shot.
attack = false;
wait(60);
//movement code?

//end of task.
}}

My point here is that you should probably show how you did the script using the animation as well. Since the error might be there (unless I just simply missed something important in your drawing script), only showing the animation part may not help.
« Last Edit: December 13, 2013, 04:35:50 PM by Darkness1 »

K+ ~ Bake-Danuki

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #604 on: December 13, 2013, 09:30:25 PM »
Is the problem isolated to this code? Or did you make other changes and add other effects? I used the Last Comer's code, and was spawning one petal every 6 or so frames, and I had no FPS dropping.
This code, without it, runs 60FPS. 
That isn't a huge amount of calculating, I don't think it should be a massive problem. How many are you spawning to get it to drop FPS that much, and how many can you spawn without negative effects? Can you run the contest entry without lag?
Contest  ??? Wat
i think ascent(n in 0..470) is spawning them.

KuroArashi100

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #605 on: December 13, 2013, 10:26:10 PM »
Contest  ??? Wat
i think ascent(n in 0..470) is spawning them.
He wants to know if you can run Victini's RaNGE contest 10 entry without lag.

And the ascent loop only moves the petals around, it doesn't spawn them.

K+ ~ Bake-Danuki

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #606 on: December 13, 2013, 10:35:21 PM »
         let v = 1+n/340;
this was the line  :D sorry  :blush:

and yes I can run it without lag

SilentYukiro

  • Silent Soul of the Electronic Skies
  • Clearly a Satori lover :3
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #607 on: December 18, 2013, 02:53:37 AM »
Is there a way for a certain boss (example: yuyuko in the script provided in the link) to move from (example: the top-right to the center or top-left to the center) other than from the top center?

here's the link:
http://pastebin.com/gucmYbVW

And oh, I've been trying to make the spiral patterns execute in sequence, not just in instant after a certain number frames that has been decleared in the loops and in the main task.
"UNYUUU?"

Music is the essence of my soul.
Planned Fan-game: Touhou: Mad Tengu ~ Hellic Memories

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #608 on: December 18, 2013, 03:28:42 AM »
Is there a way for a certain boss (example: yuyuko in the script provided in the link) to move from (example: the top-right to the center or top-left to the center) other than from the top center?

here's the link:
http://pastebin.com/gucmYbVW

And oh, I've been trying to make the spiral patterns execute in sequence, not just in instant after a certain number frames that has been decleared in the loops and in the main task.

First point: What exactly do you mean by move from something other than from the top-center?

Second point: Is this thing about spiral patterns a question or a comment?

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #609 on: December 18, 2013, 04:27:45 AM »
You probably just mean that you want the boss to spawn elsewhere. All you need to do for a single script is use SetX(x) and SetY(y) before using SetMovePosition().

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

SilentYukiro

  • Silent Soul of the Electronic Skies
  • Clearly a Satori lover :3
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #610 on: December 18, 2013, 06:47:35 AM »
First point: What exactly do you mean by move from something other than from the top-center?

Second point: Is this thing about spiral patterns a question or a comment?

Sorry about not being precise to the point, I want the boss (Yuyuko) to spawn elsewhere rather than from the top-center of the screen, like in the official games. In my opinion, spawning from the top-center is not a good entrance for a boss.

And about the second, sorry for an another misunderstanding.  :(
I'm trying to spawn the spiral bullets in sequence without them overlapping at some intervals. I've been trying to modify the delays so that each pattern will execute at a time, yet it seems I can't get the right timing for the delays.


You probably just mean that you want the boss to spawn elsewhere. All you need to do for a single script is use SetX(x) and SetY(y) before using SetMovePosition().

Yeah, that's the point. So the value in SetX and SetY will be initial starting point for the boss?
Not being a bother but umm....can you provide a sample code? I hope it's okay.

 


Edit: Seems that I figured out the solution to the boss positioning problem that I had.  xDDD
« Last Edit: December 18, 2013, 09:23:04 AM by SilentYukiro »
"UNYUUU?"

Music is the essence of my soul.
Planned Fan-game: Touhou: Mad Tengu ~ Hellic Memories

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #611 on: December 20, 2013, 10:33:24 PM »
Hey, I know this might be a bit of a nooby question, but how do I turn off the floating white square things that float around the enemy?

PhantomSong

  • The Ghost Living through Everyday Life.
  • Eh, it doesn't matter.
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #612 on: December 20, 2013, 11:45:16 PM »
Hey, I know this might be a bit of a nooby question, but how do I turn off the floating white square things that float around the enemy?

MagicCircle(false);

or something like that

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #613 on: December 21, 2013, 09:27:50 AM »
Keep in mind that it will also turn off the magic circle itself for your bosses. Either insert your own or if you insist on keeping the magic circle of danmakufu, edit out the white squares in the dnh system textures.

Lunarethic

  • Local Trashy Edgelord
  • *
  • I can cut people with all this edge
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #614 on: December 22, 2013, 07:44:55 AM »
Okey so this is just a point me towards question

(i havent seen a tutorial about this so i want to ask for directions)
can anyone show me a tutorial where i can learn how to make my own concentration effect and apply it in my boss?
いつもニコニコあなたの隣に這いよる!生放送!は好き。月です~す。略してニコニャル
Learned how to use a custom shotsheet : 12/28/13 *clapclapclap*
東方謎佚光 ~ Dimensional Light Abscence Work In Progress Touhou Fangame

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #615 on: December 22, 2013, 10:03:42 AM »
Okey so this is just a point me towards question

(i havent seen a tutorial about this so i want to ask for directions)
can anyone show me a tutorial where i can learn how to make my own concentration effect and apply it in my boss?
There is no specific tutorial for this indeed, though concentration effects are part  of Effect Objects which is again a part of Objects in danmakufu.

The learning curve is
1) Tasking / functions
2) Objects and behaviour
3) Effect objects

http://dmf.shrinemaiden.org/wiki/Nuclear_Cheese%27s_Effect_Object_Tutorial
http://www.youtube.com/watch?v=EMw7DOWYMkw

Once you understand how to make effect objects and control them, you should be able to make your own and apply it.  Basically it is almost same principal as firing bullets, instead you fire effect objects.

Lunarethic

  • Local Trashy Edgelord
  • *
  • I can cut people with all this edge
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #616 on: December 22, 2013, 10:23:47 AM »
Thanks for directions Helepolis ^^  :D
いつもニコニコあなたの隣に這いよる!生放送!は好き。月です~す。略してニコニャル
Learned how to use a custom shotsheet : 12/28/13 *clapclapclap*
東方謎佚光 ~ Dimensional Light Abscence Work In Progress Touhou Fangame

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #617 on: December 22, 2013, 10:47:45 AM »
Keep in mind that a concentration effect is a small square texture/sprite being summoned as effect object then pulled towards the boss. It isn't a beginner or intermediate task you're taking. I think such effects and ideas would easily categorize under expert level, because it combines a lot of different things to achieve one thing. Therefore start simple. First try to summon several effect objects around the boss (like 4-5) and make them move towards the boss disappearing. And if you learn to do this, you can pretty much make any custom-X-effect for your bosses: Explosions, glitters, beams, fog and so on.

The biggest mistake people make is think too difficult and try to do everything in one go. This is why you need to break it down in steps.

Lunarethic

  • Local Trashy Edgelord
  • *
  • I can cut people with all this edge
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #618 on: December 22, 2013, 10:51:28 AM »
Understood Helepolis!  :justasplanned:

Soo i guess first order of buisness is Learning Effect Object (oh joy this is gonna be fun XD)
いつもニコニコあなたの隣に這いよる!生放送!は好き。月です~す。略してニコニャル
Learned how to use a custom shotsheet : 12/28/13 *clapclapclap*
東方謎佚光 ~ Dimensional Light Abscence Work In Progress Touhou Fangame

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #619 on: December 22, 2013, 02:45:00 PM »
Soo i guess first order of buisness is Learning Effect Object (oh joy this is gonna be fun XD)
Oh boy. You have a lot of fun ahead of you. -_-
Make sure that you understand TriangleStrip and TriangleFan before you make your vertices (UV is on the image file, XY is rendering). Understanding the order of the vertices will save you a lot of stress. The player script tutorial should also help with rendering effect objects.

Lunarethic

  • Local Trashy Edgelord
  • *
  • I can cut people with all this edge
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #620 on: December 22, 2013, 03:08:52 PM »
Wayyyy ahead of you sparen just reading the things on the tutorial, made my head bleed  :colonveeplusalpha: , *sigh* well you know what they say. "Let's do this shit"  8)
いつもニコニコあなたの隣に這いよる!生放送!は好き。月です~す。略してニコニャル
Learned how to use a custom shotsheet : 12/28/13 *clapclapclap*
東方謎佚光 ~ Dimensional Light Abscence Work In Progress Touhou Fangame

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #621 on: December 31, 2013, 05:38:46 PM »
Normally I use the wiki's list of functions and parameters to help with the many, and I mean many, different functions.
And also, some spaces in between lines might help organize the different steps. I like to separate the SetVertexXY and the SetVertexUV on its own. Making it a lot easier to find when you have a visual problem with the sprite.
The main action parts of the effect object, I like to also organize the steps into miniature tasks. I usually put these tasks outside the effect objects main task and call it inside. This way you can have two tasks, one being the moving part and another being the lengthening of the effect objects to make it look like it's actually being pulled. Afterwards, a simple deletion of the effect object will end the task and you can finally move on to other things.
Of course, though, I've never actually tried such a big effect object bullet task, so my only other advice left is to start with an easier part, test it, than try for the more difficult one.
Currently a normal player

SilentYukiro

  • Silent Soul of the Electronic Skies
  • Clearly a Satori lover :3
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #622 on: January 02, 2014, 01:42:34 AM »
I've been creating this 4th non-spell card of Yuyuko's for a while and somehow it is "almost" how I want it to be like in this video. But somehow it is still not that accurate.  :(

The first pattern (which fires the purple/lilac shots) should fire towards the player, but somehow it is not working even though I used GetAngleToPlayer.

Here's the source code:
http://pastebin.com/urWadbv5

Note:
the fastMovement, InitBoss and the global variables are separated in another textfile/s (variables.txt* and functions.txt*)
*See the attachments if it is needed



Any suggestions or modifications can be made so that it can be almost like the original non-spell attack?

« Last Edit: January 02, 2014, 01:56:06 AM by SilentYukiro »
"UNYUUU?"

Music is the essence of my soul.
Planned Fan-game: Touhou: Mad Tengu ~ Hellic Memories

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #623 on: January 02, 2014, 02:40:38 AM »
I've been creating this 4th non-spell card of Yuyuko's for a while and somehow it is "almost" how I want it to be like in this video. But somehow it is still not that accurate.  :(

The first pattern (which fires the purple/lilac shots) should fire towards the player, but somehow it is not working even though I used GetAngleToPlayer.

Here's the source code:
http://pastebin.com/urWadbv5

Any suggestions or modifications can be made so that it can be almost like the original non-spell attack?

Your problem is not easily solved. The thing is that you are your setting your bullets to go towards the player, but by the time the bullets reach the point when they are supposed to change angles, the angle to the player is different because they're no longer in the same location.

Create object shots and after the x number of frames, call Obj_GetAngleToPlayer. You can find the function in the helpful function thread, but I'll just post it her to be sure.

P.S. The code is ugly and not optimized, but it works.

Code: [Select]
function Obj_GetAngleToPlayer(obj){
  return Obj_GetAngleToPoint(obj,GetPlayerX,GetPlayerY)
}
   
function Obj_GetAngleToPoint(obj,tarX,tarY){
  if(Obj_GetX(obj) > tarX && Obj_GetY(obj) < tarY){
    return 180 - atan2((|Obj_GetY(obj)-tarY|),(| Obj_GetX(obj)-tarX |));
  }
  if(Obj_GetX(obj) > tarX && Obj_GetY(obj) >= tarY){
    return 180 - atan2((tarY-Obj_GetY(obj)),(| Obj_GetX(obj)-tarX |));
  }
  if(Obj_GetX(obj) < tarX && Obj_GetY(obj) >= tarY){
    return atan2((tarY-Obj_GetY(obj)),(| Obj_GetX(obj)-tarX |));
  }
  if(Obj_GetX(obj) == tarX && Obj_GetY(obj) >= tarY){
    return 270;
  }
  if(Obj_GetX(obj) == tarX && Obj_GetY(obj) < tarY){
    return 90;
  }
  return atan2((|Obj_GetY(obj)-tarY|),(| Obj_GetX(obj)-tarX |));
}

Shadow

  • Forever waiting for tomorrow
  • ...
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #624 on: January 02, 2014, 04:37:04 AM »
The problem here is not only that "GetAngleToPlayer" largely misses the activation timing of 90 frames, there is also the fact "GetAngleToPlayer" only calculates the angle from the boss to the player. What you are doing here is setting a bullet which waits 90 frames before it is aimed at the angle given to you by "GetAngleToPlayer"... 90 frames ago. The solution is to code an object bullet which you can then accurately calculate the position of with Obj_GetX or Obj_GetY functions, and then use the atan2 function to calculate the angle from these coordinates to the player's. Either that, or you can cheat a bit and use SetShotDirectionType. :V

Code: [Select]
SetShotDirectionType(PLAYER);
SetShotDataA(1,90,2,0,0,0,0,12);
SetShotDirectionType(ABSOLUTE);

What this does is change the way angles are calculated in Danmakufu; "PLAYER" makes them all relative to the player's position, so simply inputting a value of "0" will make the bullets be redirected towards the player. It then changes it back to ABSOLUTE (which is the default), so it does not get in the way when calculating angles outside whatever loop you put them in.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #625 on: January 02, 2014, 08:46:03 AM »
Important to remember: I would use atan2() no matter what for any bullet that isn't spawned from the boss' centre. ShotDirectionType isn't working when the bullet has an offset, i.e: GetX+30 or similar.

Shadow

  • Forever waiting for tomorrow
  • ...
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #626 on: January 02, 2014, 09:25:19 AM »
That is strange, because I recall using SetShotDirectionType like that and working for me as desired. Needless to say, though, this is a very roundabout way of making bullets aim at the player with CreateShotA, and as Helepolis mentioned, using atan2 would be a much "safer" route if you find problems using the aforementioned method. You will need to use object bullets for that, of course.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #627 on: January 02, 2014, 10:29:55 AM »
It is indeed quite confusing and odd.

It is somewhere in an ancient 0.12m Q&A thread where I stumbled on similar issue with aiming towards the player. Several people suggested to use the SetShotDirection. It didn't matter for me what ever type I used, the bullet would graze the player at the exact offset it was fired at.
[attach=1]

Yes, the bullet goes towards the angular position of the player, but not AT the player's centre. That is why someone told me to use obj bullets with atan2() for homing bullets in such conditions. Basically it boils down to the question:
- Is the bullet fired from centre of boss/familiar? --> GetAngleToPlayer or atan2 (if obj).
- Is the bullet fired from boss, but with an offset? --> atan2 advised.

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #628 on: January 02, 2014, 11:09:52 AM »
Strange, since SetShotDirectionType seems to work well for me. Atleast in the cases I've tried for 0.12m.
Example:
Code: [Select]
SetShotDirectionType(PLAYER);
CreateLaserA(1,GetClipMinX-15,-10,600,10,2,1);
SetLaserDataA(1,0,0,0,0,0,0);
SetShotKillTime(1,2);
FireShot(1);
SetShotDirectionType(ABSOLUTE);
Fires a short laser from the left corner of the screen aimed at the players hitbox.

Not sure if SetShotDirectionType only works with some types of positions, because I have no idea where everyones different views on the questionable usage of SetShotDirection comes from.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #629 on: January 02, 2014, 12:06:55 PM »
My concern was regarding shots fired from the boss. Not a static location on the game field. Try to fire that at an offset from the boss?  GetEnemyX/GetX minus / plus <value> as offset. I am extremely curious.