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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #900 on: April 27, 2013, 01:20:41 PM »
It first seems to be working, but then alot of the spawned fairies gets stuck with the idle animation, even while moving sideways and I can't find the problem.
I have so many problems with this that it's not funny. My issue is this: SetMovePosition doesn't work correctly with GetAngle. And so half of the animations I use are botched up.

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #901 on: April 27, 2013, 04:20:10 PM »
I have so many problems with this that it's not funny. My issue is this: SetMovePosition doesn't work correctly with GetAngle. And so half of the animations I use are botched up.

When I use SetMovePosition it actually seems to work. I guess it's just a conflict of sorts between using SetAngle and SetSpeed inside the enemy script while defining the speed and angle in CreateEnemyFromFile; as well, since they were set as 0 and 0 inside the function.

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #902 on: April 28, 2013, 12:10:02 AM »
If that were the case then all of the fairies would be stuck at idle.

if(GetSpeedX==0 && counter3==0){
  Animate("fairy","idle",true);
  counter3=10;
Is the first problem.

If you change that to 1, we get these frames, given (GetSpeedX==0):
1:
Animate("fairy","idle",true);
counter3=1;
turnframe2++; (now =1)
2:
turnframe2++; (now =2)
Animate("fairy","turntoidle",false);
counter3++; (now =2)
At then it gets stuck at frame 3. If you changed it to counter3=0 then it would animate idle until you move so I guess that's what you want?

Really though the flow and decision structure of your DrawLoop is absurdly difficult to comprehend.

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

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #903 on: April 28, 2013, 09:38:39 AM »
I guess it was dumb to not comment more, but this version with more comments should make everything more clear. Also, yes, some of my if statements were kind of uneccessary to use. http://pastebin.com/MavWd64x (I don't think I changed it since last time, except for the comments of course.)
« Last Edit: April 28, 2013, 10:49:04 AM by Darkness1 »

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #904 on: April 28, 2013, 06:23:47 PM »
My arrow keys on the numpad aren't working in Danmakufu, and I have been using them in all my Touhou games because the regular ones don't work side-to-side. I don't want to have to try to beat everything using only vertical movement; I kind of suck at Touhou. I'm using a laptop in case that helps.

PhantomSong

  • The Ghost Living through Everyday Life.
  • Eh, it doesn't matter.
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #905 on: April 28, 2013, 10:56:24 PM »
My arrow keys on the numpad aren't working in Danmakufu, and I have been using them in all my Touhou games because the regular ones don't work side-to-side. I don't want to have to try to beat everything using only vertical movement; I kind of suck at Touhou. I'm using a laptop in case that helps.
You'll just have to use your normal arrow keys then... Unless I'm not understanding this correctly.

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #906 on: April 28, 2013, 11:14:43 PM »
Well, my left and right normal arrow keys don't work in any program. Only the up and down ones do. It isn't much fun to play shmups without horizontal movement.
(With the regular Touhou games I don't have this problem and the numpad keys work fine; I use them since the regular left and right keys don't work.)

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #907 on: April 29, 2013, 12:09:16 AM »
If DNH doesn't support numpad then you'll have to remap keys using an AHK script or something like that. It's pretty easy to use, but it becomes a bit cumbersome enabling and disabling the key map every time you want to play.

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

The Noodles Guy

  • Flip the screen
  • What if Seija met a guy with bipolar disease?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #908 on: April 29, 2013, 08:04:43 PM »
OK.

How can I make my boss immune to bombs? Like Flan-Chan and every EX-Boss.
Easy Modo? That's for kids, and for me.

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #909 on: April 29, 2013, 08:25:21 PM »
SetDamageRate(shot, bomb) sets the rate of damage the boss receives, out of 100. So you can set the second parameter to 0 to give bomb immunity.

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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #910 on: April 29, 2013, 08:47:09 PM »
OK.

How can I make my boss immune to bombs? Like Flan-Chan and every EX-Boss.

Also, remember that the tutorials explain most of this.

Tutorial List on stickied thread
My compilation of Tutorials from the wikis and MotK

Ozzy

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #911 on: April 29, 2013, 10:49:02 PM »
SetDamageRate(shot, bomb) sets the rate of damage the boss receives, out of 100. So you can set the second parameter to 0 to give bomb immunity.
One thing about that is that this solution will only make the boss immune to damage from the bomb itself. The boss CAN however still be damaged by normal shots during the duration of the bomb. If you're looking for something like what extra bosses do, you want to do something like this in @MainLoop:
Code: [Select]
if(OnBomb==true) { SetDamageRate(##,##); } else { SetDamageRate(0,0); }That will make the boss immune to all damage during the duration of a bomb, which is probably what you're looking for. Alternatively, you could also remove the boss's hitbox (SetCollisionA) during a bomb with a similar method.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #912 on: April 29, 2013, 11:00:53 PM »
Code: [Select]
if(OnBomb==true) { SetDamageRate(##,##); } else { SetDamageRate(0,0); }That will make the boss immune to all damage during the duration of a bomb, which is probably what you're looking for. Alternatively, you could also remove the boss's hitbox (SetCollisionA) during a bomb with a similar method.

Shouldn't it be
Code: [Select]
if(OnBomb==true) { SetDamageRate(0,0); } else { SetDamageRate(##,##); }?


Edit: Also, most people will shy away against removing the hitbox. It messes up players with honing bullets, since the bullets will collect and then deal their damage afterwards. Also, if it's used during a survival... it'll lag Danmakufu if your player uses honing bullets.
« Last Edit: April 29, 2013, 11:41:45 PM by Sparen »

Ozzy

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #913 on: April 29, 2013, 11:52:33 PM »
Shouldn't it be
Code: [Select]
if(OnBomb==true) { SetDamageRate(0,0); } else { SetDamageRate(##,##); }?
Oops.

Edit: Also, most people will shy away against removing the hitbox. It messes up players with honing bullets, since the bullets will collect and then deal their damage afterwards.
I've never had that problem myself (my homing shots just go through the boss and keep turning) but I'll take your word for it.

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #914 on: April 30, 2013, 05:33:22 AM »
Edit: Also, most people will shy away against removing the hitbox. It messes up players with honing bullets, since the bullets will collect and then deal their damage afterwards. Also, if it's used during a survival... it'll lag Danmakufu if your player uses honing bullets.

That's weird, I never noticed anything like that, but well, I only use the homing player that comes with danmakufu anyways. But it has one thing that stacks if you remove the hitbox, and that is her focused bombs, so I made the damage resistance last abit longer than the bombs instead.

Something like this:
Code: [Select]
     if(OnBomb && antibombtimer==0){
     shield=true; //Draws bomb-graphic
     hitbox=false; //Turns off hitbox
     antibombtimer=60;}

     if(!OnBomb && antibombtimer==0){
     shield=false;
     hitbox=true;}

     if(!OnBomb && antibombtimer>0){
     shield=true;
     hitbox=false;
     antibombtimer-=1;}
Yes, I know I wrote alot of uneccessary code, just an example of mine :V.
Also, for SetDamageRate, the bomb percentual damage might aswell be at 0 at all time since the boss is bomb immune and hence will never take damage from them.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #915 on: May 04, 2013, 12:32:59 AM »
How do i make a bullet bounce off a circle? Like one slightly above the player.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #916 on: May 04, 2013, 12:38:08 AM »
How do i make a bullet bounce off a circle? Like one slightly above the player.

Please explain what you are trying to do. What you just said makes no sense whatsoever.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #917 on: May 04, 2013, 12:41:43 AM »
Please explain what you are trying to do. What you just said makes no sense whatsoever.
so...
like a safety bubble somewhere on the screen.
i heard it requires ascent but I read an explanation that I didn't understand... :derp:

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #918 on: May 04, 2013, 12:43:20 AM »
so...
like a safety bubble somewhere on the screen.
i heard it requires ascent but I read an explanation that I didn't understand... :derp:

Are you referring to a task in a player script that makes all bullets bounce off of a bubble surrounding the player?

If so... that'a a problem in 0.12m...

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #919 on: May 04, 2013, 01:03:27 AM »
If you're saying that you want a bullet to bounce in a circle, like in Luminous Dream's Stage 5 boss.
I don't really know how to make it bounce the right way.

I think you make an object bullet.
Have the bullet make a loop that works if the bullet is on screen.
Code: [Select]
while(!Obj_BeDeleted(obj)){ yield; }Make a, if statement stating that if the bullet is beyond this circle, then bounce.
If you want to put it in the middle, you say:
Code: [Select]
let distance = (Obj_GetX(obj)-GetCenterX)^2+(Obj_GetY(obj)-GetCenterY)^2And then you would make another statement:
Code: [Select]
if(distance>How big you want your circle^2){ Bouncing effect }Of course, if you want it in front of the player, change the GetCenterX and GetCenterY to GetPlayerX and GetPlayerY-How far you want the circle to be.

Or you're talking about something else.
Currently a normal player

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #920 on: May 04, 2013, 01:59:25 AM »
I have no idea what you want done either.



This? If so, as an ability of the player script, or something particular that the enemy/pattern does? The former is impossible in 0.12, the latter you can do.
« Last Edit: May 04, 2013, 02:06:17 AM by Drake »

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

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #921 on: May 04, 2013, 07:40:05 AM »
You could use:
- Collision_Line_Circle.
- Collision_Obj_Obj.
- If you use like an effect object, you could save it's X and Y position every frame (if it's moving around) and make your own collision hitbox using if statements inside the object bullet code. I probably can't call this the most optimal solution. (Reason is, as I know getting a circular hitbox using this method is more difficult.)

I don't think ascent/arrays are needed here, unless you're going to use multiple circles.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #922 on: May 04, 2013, 01:07:39 PM »
I have no idea what you want done either.



This? If so, as an ability of the player script, or something particular that the enemy/pattern does? The former is impossible in 0.12, the latter you can do.
Yes, not in a player script though, in a boss script.
@Darkness1 im trying to do the if statements, but im confused about how to make a circle. I will look up your other methods.
« Last Edit: May 04, 2013, 01:10:42 PM by Qwertyzxcv »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #923 on: May 04, 2013, 01:09:51 PM »
Yes, not in a player script though, in a boss script.

That's simple then. You'll use object bullets that will reflect away if they enter a certain radius of the player. You'll need to do the angle work yourself though.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #924 on: May 04, 2013, 02:35:41 PM »
Ok, i'm sorry, but I think i'm going to change the question.
How do I make a bullet bounce when hits another bullet?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #925 on: May 04, 2013, 03:24:29 PM »
You could use:
- Collision_Line_Circle.
- Collision_Obj_Obj.
- If you use like an effect object, you could save it's X and Y position every frame (if it's moving around) and make your own collision hitbox using if statements inside the object bullet code. I probably can't call this the most optimal solution. (Reason is, as I know getting a circular hitbox using this method is more difficult.)

I don't think ascent/arrays are needed here, unless you're going to use multiple circles.

Qwerty: The question is already answered for you. Collision_Obj_Obj solves that for you.

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #926 on: May 04, 2013, 04:40:27 PM »
Qwerty: The question is already answered for you. Collision_Obj_Obj solves that for you.

Exactly. But I guess Obj_Obj gives a specific collision defined of the bullets own hitbox. This works perfectly, unless you somehow want a specific hitbox.

If you use only one bullet to collide with, it shouldn't be hard, but since you often want to spawn more than one of those bullets on the screen at once, you have to use ascent and array coding. Basically, you want to create a bullet array, store all the ID's of the bullets (only one of them) once they are created and later delete those ID's out of the array once the bullets are deleted. In the other object bullet, you just have to ascent loop through all the ID's in your array and check the collision between this bullets ID and all other ID's saved in your bullet-ID-array, and it should work.
« Last Edit: May 04, 2013, 05:02:13 PM by Darkness1 »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #927 on: May 04, 2013, 05:36:32 PM »
A script I need some assistance with. First a picture:

[attach=1]

Imagine the left image to be a simple square texture placed in 3D Drawing. What I want to do is emit some "light rays" from the checker locations. However, the light rays have to be randomized in each square with a total of X beams (where X is my maximum desired number). The 2nd picture (on the right) shows the example of a randomized pattern. To give elaborate my intention, my true "checker board" is 8x8 squares. I already used this code to spawn a beam in every square:

ascent(i in 0..8) {
   ascent(i2 in 0..8) { makelichtbundel(256,768-(i2*+128),-2560+(i*128),96,25,96); }
}

"makelichtbundel" is a function name that spawns the lightbeam in 3D drawing. To explain the parameters:  makelichtbundel( Xlocation, Ylocation, Zlocation, Red, Green, Blue );

Xlocation is static because it is against the wall of my stage. Logically I need a vertical/distance placement for each beams, hence Y and Z. The +128 is offset to centre the beam correctly. Don't worry too much about the offset.

Right, so as I said I was successful with the 8x8 beams, but I don't want this as it makes the effects look fake and blinding your eyes. For a more natural feeling, I want to randomize the rays in this 8x8 field. Just as shown in the picture, I want to spawn randomized rays with each cycle (this cycle I will eventually tie to a fade in/out effect (alpha reduction) so when the ray is "invisible" it will respawn with a different pattern.

Edit: To be more precise, I want to distribute the rays somewhat evenly. Spread out. Roughly guessing the maximum rays occurring in one row = 2. If a row doesn't summon any rays, that is fine as well now and then. After all, this is 8x8 so like 10 rays criss-cross placed will give the satisfying result (I hope).

How can I approach this effectively?

« Last Edit: May 04, 2013, 07:31:16 PM by Helepolis »

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #928 on: May 04, 2013, 08:03:14 PM »
Like I said in IRC, it might just be fine if you define a 3D array of sets of coordinates to pick from.
let lichtcoords = [
   [[x,y],[,],[,],[,],[,],[,],[,],[,]],   [[,],[,],[,],[,],[,],[,],[,],[,]],
   [[,],[,],[,],[,],[,],[,],[,],[,]],   [[,],[,],[,],[,],[,],[,],[,],[,]],
   [[,],[,],[,],[,],[,],[,],[,],[,]],   [[,],[,],[,],[,],[,],[,],[,],[,]],
   [[,],[,],[,],[,],[,],[,],[,],[,]],   [[,],[,],[,],[,],[,],[,],[,],[,]],
   [[,],[,],[,],[,],[,],[,],[,],[,]],   [[,],[,],[,],[,],[,],[,],[,],[,]],
   [[,],[,],[,],[,],[,],[,],[,],[,]],   [[,],[,],[,],[,],[,],[,],[,],[,]]
];
let bundel = lichtcoords[rand_int(0,12)];
ascent(i in 0..8) {
   makelichtbundel(256,768-(bundel[i][0]*+128),-2560+(bundel[i][1]*128),96,25,96);
}


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

Zoriri

  • Danmaku Trainee
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #929 on: May 04, 2013, 09:05:41 PM »
OK, I've been making a spell card for a while now, and i just got it to work in danmakufu, but the boss dies the second the script starts, and I have no idea why.

Code: [Select]
script_enemy_main {

let CSD = GetCurrentScriptDirectory;
let shot = CSD ~ "ZUNAST.txt";
let frame = 0;
let angle = 0;

                            }
@Initialize {
SetLife(1500);
SetDamageRate(100, 100)
SetTimer(45);
SetInvincibility(30);
SetScore(20000)
SetMovePosition02(GetCenterX, GetCenterY - 100, 120);
}

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

if(frame==120)

          loop(36){
      CreateShot01(Get X, Get Y, 2, GetAngleToPlayer, 28, 0);
      angle += 360/36;
}

angle = 0;
frame = 60;

@DrawLoop {
}

@Finalize {
}
}