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

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #510 on: January 30, 2013, 04:30:12 AM »
no

His ObjEffect_SetTexture() is right there at the beginning and he loads his graphics beforehand. The only reason a is there is because I put it there to test and didn't bother changing it back to what he had before. It's worth noting that even if the script didn't crash, it would still error because he defined effect twice, so Qwerty, you should change the variable or task name.

Also his vertices are fine. The ones you just posted would cross the image.

Qwerty, I still cannot replicate a freeze. I'm really not sure what you're doing if you found out the effect task is somehow the problem.

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

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #511 on: February 01, 2013, 03:40:36 PM »
no

His ObjEffect_SetTexture() is right there at the beginning and he loads his graphics beforehand. The only reason a is there is because I put it there to test and didn't bother changing it back to what he had before. It's worth noting that even if the script didn't crash, it would still error because he defined effect twice, so Qwerty, you should change the variable or task name.
Thank you! I finally got it to work! :)

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #512 on: February 01, 2013, 04:27:31 PM »
So, I have this task here:
Code: [Select]
task hypocycloid2(a,b,r,k,l){
loop{
let t = 0;
loop(210){
t += 12;
let x = a + r * ( (1 - k) * cos(t) + l * k * cos((1 - k) / k * t));
let y = b + r * ( (1 - k) * sin(t) - l * k * sin((1 - k) / k * t));
???
}
wait(300);
}
}
That will generate coordinates of a Hypocycloid. Placing bullets on these co?rdinates isn't hard, I can just use the regular bullets for that. But I want these shapes to 'spin' around their center (being a,b) while also moving downward. The problem is that the distance from a,b to a bullet will be different most of the time, making it very hard to do this. I tried several thing with object bullets already, even trying to put the function for the rotating object bullets inside the Hypocycloid task to enable me to use a and b directly instead of having to pass them as arguments, but all to no avail. Help?

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #513 on: February 02, 2013, 12:23:00 AM »
This doesn't look like a parametric equation for a hypocycloid. You mixed up the variables for the smaller circle r and the larger circle R = rk, and tried to factor out the wrong one, and you also didn't actually distribute r inside the second trig function (which also has the order mixed up).
  r*((1-k)*cos(t) + l*k*cos((1-k)/k*t))
= r*(1-k)*cos(t) + l*r*k*cos((1-k)/k*t)
= (r-R)*cos(t) + l*R*cos((1-k)/k*t)

When you want to end up with
  (R-r)*cos(t) + l*r*cos((R-r)/r*t)
= r*(k-1)*cos(t) + l*r*cos(r*(k-1)/r*t)
= r*((k-1)*cos(t) + l*cos((k-1)*t))

So your xy should be
x = a + r*((k-1)*cos(t) + l*cos((k-1)*t))
y = b + r*((k-1)*sin(t) - l*sin((k-1)*t))


But yeah, you're trying to essentially fire a spinning hypocycloid of bullets? If so, you were on the right track with the object bullets, it would be difficult to have them move down at the same time otherwise. There's probably a much better way to move a bullet along the same unknown radius the whole time, but I can't think of anything immediately other than finding the bullet's distance and angle to the center, then "moving" the bullet to the center and back out at a new angle.
« Last Edit: February 02, 2013, 12:25:46 AM by Drake »

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

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #514 on: February 02, 2013, 11:33:06 AM »
Okay, I'll try around some more with the object bullets then I guess.

Also, the formula here is correct, see here for the derivation of the formula. It isn't exactly the same as the hypocycloid one, I know, but I explicitly picked this one because the mathematical derivation was given with it (needed that for a school project). Besides, the formula produces the required hypocycloids as I want it to, the problem is just trying to get them to spin while retaining their shape.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #515 on: February 04, 2013, 12:20:27 AM »
Are there ant Danmakufu quizzes/tests? (I need more practice).

JCTechnic

  • Hikkikomori Jesus
  • Goran no suponsaa no teikyou de okurishimasu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #516 on: February 04, 2013, 12:59:15 AM »
OK I'm sorry for barging in on this current question but I have my own.
I'm trying to create a new bullet using a PNG image, the thing is no matter where i go there's nothing answering me on how to do so.
I went to the touhou wikia and found nothing in the tutorials that could help me.

I tried using the CreateShotFromScript but i don't really know how to use it.
And I've tried creating a new bullet with the #UserShotData in another TXT and  loading it in the game script with LoadUserShotData to no avail.

Help me please.
";" is my enemy.
Hated by many, loved by few.
Frustrating because you forget it but to attached to not want it.
The cause of many errors, but still it has it's own charm.
";" is my enemy, yet it is my best friend.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #517 on: February 04, 2013, 02:18:35 AM »
Are there ant Danmakufu quizzes/tests? (I need more practice).

What do you mean?

If you want basic assignments like they give in a standard Introduction to Science course such as "HW #1: Create six rings of bullets that fire from points in a semicircular arc above the boss with a radius of 120 pixels. Rings should start with 12 bullets and then increment up by one every 20 frames." It wouldn't be too hard for me to test you.

OK I'm sorry for barging in on this current question but I have my own.
I'm trying to create a new bullet using a PNG image, the thing is no matter where i go there's nothing answering me on how to do so.
I went to the touhou wikia and found nothing in the tutorials that could help me.

I tried using the CreateShotFromScript but i don't really know how to use it.
And I've tried creating a new bullet with the #UserShotData in another TXT and  loading it in the game script with LoadUserShotData to no avail.

What exactly do you mean? Are you using object bullets? Standard shot bullets loaded using LoadUserShotData from a predefined file path?

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #518 on: February 04, 2013, 02:34:19 AM »
JC: Don't bother using shot scripts just yet, they aren't really needed ever to begin with, it's really just a matter of utility.

First you have your png image with the graphic in it. Then you have a separate script file for shot data as you probably already have.
Code: (shotdata.txt) [Select]
#UserShotData
ShotImage = ".\shotimage.png"

ShotData{
id = 1 //bullet ID
rect = (0,0,32,32) //bullet image rects
}
And then in your main script, usually in @Initialize, you will call LoadUserShotData(GetCurrentScriptDirectory~"shotdata.txt");
Once you do this you can fire your bullet with, say, CreateShot01(GetEnemyX, GetEnemyY, 3, GetAngleToPlayer, 1, 0).

You say that you've already done this, so if you can't see a mistake I'd like you to pastebin your scripts. Also, confirm that your bullet graphic rects are correct.

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

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #519 on: February 04, 2013, 02:41:31 AM »
What do you mean?
If you want basic assignments like they give in a standard Introduction to Science course such as "HW #1: Create six rings of bullets that fire from points in a semicircular arc above the boss with a radius of 120 pixels. Rings should start with 12 bullets and then increment up by one every 20 frames." It wouldn't be too hard for me to test you.
I guess, and maybe muiltiple choice, open ended, etc...anything good for practice.
You to test me? How? Would you just PM me or something?
« Last Edit: February 04, 2013, 02:55:51 AM by Qwertyzxcv »

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #520 on: February 04, 2013, 02:56:52 AM »
I guess, or like muiltiple choice, open ended, etc...anything good for practice.
You to test me? How? Through personal messages or something?
I don't think multiple choices for scripting would be a good test. Hands on projects are much better to test your ability.

But since I also have a question.
I'm making a star shaped cyclone, that homes in on the player. I know how to make a star, I just don't know how to make it go in the player's direction while keeping it's shape.  :3 It should only go in the player's direction once though. Like the most basic enemies, except with stars. Help?
Oh yeah, I'm using object bullets. But Obj_SetAngle is being used to make the star spin.
« Last Edit: February 04, 2013, 03:22:47 AM by Lavalake »
Currently a normal player

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #521 on: February 04, 2013, 03:21:10 AM »
I guess, and maybe muiltiple choice, open ended, etc...anything good for practice.
You to test me? How? Would you just PM me or something?

If you need, I can probably create a thread or we can do this elsewhere. However, having the ability to attach attachments would be nice, so maybe a thread would be appropriate. However, you'd be PMming answers to me as attached files. I'll PM you back with results and comments to better your code and for overall stuff. If you would like to do this, send me a confirmation PM; it'll take a little while for me to come up with ideas, and remember:

The following link is your friend. http://dmf.shrinemaiden.org/wiki/Functions_(0.12m)
Though that applies to everyone. Always consult the dictionary when in doubt~

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #522 on: February 04, 2013, 03:43:34 AM »
I'm making a star shaped cyclone, that homes in on the player. I know how to make a star, I just don't know how to make it go in the player's direction while keeping it's shape.  :3 It should only go in the player's direction once though. Like the most basic enemies, except with stars. Help?
Oh yeah, I'm using object bullets. But Obj_SetAngle is being used to make the star spin.
Use atan2 to get the angle from the center of the star to the player when creating the star, and pass it to the bullets (or just make sure to do it all at once per bullet, but that would take a lot of needless processing). Then you use SetPosition to move as well, with the usual cos(angle)*speed stuff.

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

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #523 on: February 04, 2013, 04:44:41 AM »
Use atan2 to get the angle from the center of the star to the player when creating the star, and pass it to the bullets (or just make sure to do it all at once per bullet, but that would take a lot of needless processing). Then you use SetPosition to move as well, with the usual cos(angle)*speed stuff.

Hmm? But how do I pass it to the bullets? -Clueless- Unless I'm skipping over something really obvious.
Currently a normal player

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #524 on: February 04, 2013, 06:39:47 AM »
I'm assuming you have your setup like this:

star{
   centerx = something;
   centery = something;
   loop{
      bullet(centerx + bla, centery + bla, other parameters);
   }
}

bullet{
   blablabla
   while(!deleted){
      Obj_SetAngle(obj, angle + something); //in order to turn
   yield;
   }
}

You need to calculate the angle from (centerx, centery) to the player in the "star" block and use it as a parameter when spawning the "bullet". Then bullet uses that angle to move.

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

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #525 on: February 04, 2013, 03:29:10 PM »
Okay, got the spinning working, but for some reason my code acts rather strangely. It is supposed to generate a spinning hypocycloid of bullets every 300 frames (5 seconds), but instead it makes a second hypocycloid on top of the first one, regardless of its location, and then increases the speed of both of them. Another minor problem is that the shape somehow generates at x=GetCenterX and y=0 despite giving GetEnemyX and GetEnemyY as the coordinates, but I suspect I simply made a dumb mistake in the movement task there. Anyway, the entire code is below, along with added comments to explain what's going on.

NOTE: comments apply to the lines below them, not to those above them.
NOTE 2: You may want to change the wait(300); on line 172 to wait(30); to make the duplicating effect more visible.

--> Pastebin Here <--
« Last Edit: February 04, 2013, 03:32:17 PM by sjasogun1 »

JCTechnic

  • Hikkikomori Jesus
  • Goran no suponsaa no teikyou de okurishimasu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #526 on: February 04, 2013, 04:18:00 PM »
JC: Don't bother using shot scripts just yet, they aren't really needed ever to begin with, it's really just a matter of utility.

First you have your png image with the graphic in it. Then you have a separate script file for shot data as you probably already have.
Code: (shotdata.txt) [Select]
#UserShotData
ShotImage = ".\shotimage.png"

ShotData{
id = 1 //bullet ID
rect = (0,0,32,32) //bullet image rects
}
And then in your main script, usually in @Initialize, you will call LoadUserShotData(GetCurrentScriptDirectory~"shotdata.txt");
Once you do this you can fire your bullet with, say, CreateShot01(GetEnemyX, GetEnemyY, 3, GetAngleToPlayer, 1, 0).

You say that you've already done this, so if you can't see a mistake I'd like you to pastebin your scripts. Also, confirm that your bullet graphic rects are correct.

Thank you it works now, my problem was that i thought when you created a new bullet it would override the premade list of bullets, so a bullet i created with the id 1 would replace the premade bullet 1, with that being said, when youd create the bullet you had to add the WHITE01 to make the new bullet appear. But the id is a new id, this thing wasn't all that clear in the tutorials or the wikia so my mistake.
";" is my enemy.
Hated by many, loved by few.
Frustrating because you forget it but to attached to not want it.
The cause of many errors, but still it has it's own charm.
";" is my enemy, yet it is my best friend.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #527 on: February 04, 2013, 09:34:05 PM »
The following link is your friend. http://dmf.shrinemaiden.org/wiki/Functions_(0.12m)
Though that applies to everyone. Always consult the dictionary when in doubt~
THANK YOU FSWJGHFLUIYGEFLIYGTOLESWFIY&GUWOFLIYGUWF !!!  :getdown:

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #528 on: February 04, 2013, 10:29:02 PM »
THANK YOU FSWJGHFLUIYGEFLIYGTOLESWFIY&GUWOFLIYGUWF !!!  :getdown:

You're welcome, although the dictionary is something you should know about by now...

I'll start a thread, which you should click 'notify' to. If a mod moves it, keep that in mind.

http://www.shrinemaiden.org/forum/index.php/topic,14251.new.html#new
« Last Edit: February 04, 2013, 10:36:39 PM by Sparen »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #529 on: February 05, 2013, 11:11:19 PM »
So, new question.

http://pastebin.com/i2tE5gyr

Basically, the laser graphics are screwed up. I want 8 (or 12, I don't know if I changed it) lasers to face either the boss or the center of the screen, depending on whether or not there is a boss. They are to end at the boss, giving the impression that they are charging the sun at the middle.

The issues? Well, the graphics seem to interpret GetCenterX as the bottom right corner. I don't know why. Also, my trig is almost definitely screwed over. I may have also made SetVertexXY errors.

The only issue here is the spell_laser. Everything else I can tweak to my liking (the sun actually forms correctly, not that it matters if if it spawns elsewhere given that it wipes the screen clear).

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #530 on: February 06, 2013, 01:11:19 AM »
Okay, got the spinning working, but for some reason my code acts rather strangely. It is supposed to generate a spinning hypocycloid of bullets every 300 frames (5 seconds), but instead it makes a second hypocycloid on top of the first one, regardless of its location, and then increases the speed of both of them. Another minor problem is that the shape somehow generates at x=GetCenterX and y=0 despite giving GetEnemyX and GetEnemyY as the coordinates, but I suspect I simply made a dumb mistake in the movement task there. Anyway, the entire code is below, along with added comments to explain what's going on.
First thing, you call SetMovePosition01(center) in @Initialize, and then without waiting the five frames your start the movement task which does something else. It should just overwrite after the first frame, but it looks like you don't yield during the hypocycloid task and the movement task comes after that, so the center will be based on coordinates that are going to immediately change. I'm not sure how this actually affects the center coordinate but it's worth looking at.

As for the super speed, since you never define a and b locally you're modifying the parameter variables passed to the hypocycloid task. You're increasing b by 0.01 per bullet per frame, hence by 1 per frame overall. I'm not sure why it would spawn two cycloids on top of each other, though.

Here's mine, for reference. It's really lazily done and not optimized whatsoever, obviously.
http://pastebin.com/T5cpEM6N

Lavalake, you actually might want to take a look at sjasogun's script (and by proxy, mine above). There are a lot of things unrelated to your situation, but the core "rotate shape of bullets and fire it in a direction" is there and it might help.

Sparen: Oh god man if you're trying to just rotate the lasers to fit the angle just use ObjEffect_SetAngle(obj, 0, 0, angle). That's what it's there for. Don't start screwing around with the XYs when you don't have to.
« Last Edit: February 06, 2013, 01:13:18 AM by Drake »

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 #531 on: February 06, 2013, 01:34:48 AM »
Sparen: Oh god man if you're trying to just rotate the lasers to fit the angle just use ObjEffect_SetAngle(obj, 0, 0, angle). That's what it's there for. Don't start screwing around with the XYs when you don't have to.

Well... after having lighdramon's lasers inverted and thrust sideways with ObjEffect_SetAngle, here's the new mess.

And yes, these lasers ares supposed to all meet at the spawn point of that sun.

Edit: A bit of experimentation later, I realized that SOMETHING is wrong with this entire thing, and iti s probably the same as with the Lighdra Lasers from before.

Firstly, I have no way of testing the following code.
Code: [Select]
loop(8){
  spell_laser(spellangle+180, GetCenterX + 60*cos(spellangle), GetCenterY + 60*sin(spellangle));
  spellangle+=45;
}
The graphics are the only thing that allow me to actually test the crud. The graphics are completely off. When I adjust the radius (or what I hope to be the radius), I get something completely weird and unrelated to the pattern I'm trying to make.

Secondly, this entire chunk has something completely wrong with it.
Code: [Select]
    ObjEffect_SetVertexXY(objdwarf,0,x-10,-170);
    ObjEffect_SetVertexXY(objdwarf,1,x+10,-170);
    ObjEffect_SetVertexXY(objdwarf,2,x+10,0);
    ObjEffect_SetVertexXY(objdwarf,3,x-10,0);
    ObjEffect_SetAngle(objdwarf, 0, 0, angle);
    ascent(i in 0..4){ObjEffect_SetVertexColor(objdwarf, i, 255, 255, 255, 255);}
    while(!Obj_BeDeleted(objdwarf)){
      if(bosspres == 1){
ObjSpell_SetIntersecrionLine(objdwarf,Obj_GetX(objdwarf),Obj_GetY(objdwarf),GetEnemyX,GetEnemyY,10,2,true);
      }else{
ObjSpell_SetIntersecrionLine(objdwarf,Obj_GetX(objdwarf),Obj_GetY(objdwarf),GetCenterX,GetCenterY,10,2,true);
      }

The intersecrion lines are untestable, but I know for a fact that they aren't matching up with the graphics. They're probably correct, given that I murdered ExRumia with a single bomb (and with all 8 lasers on top of her hitbox dealing 12 damage per frame). The issue is what is above.

ObjEffect_SetAngle has never worked for me, period. Basically, I have a ring of lasers around a target pointing at the target. Or at least that's what I want (not what I get). The angle in question is the angle from the base of the laser to the boss. The SetVertexXYs I used to state the length and width of the laser's graphics. x is the original xposition (the base of the laser), and I planned to rotate the laser around the base using ObjEffectSetAngle to point directly at the center. (It doesn't work, of course.)

The question is... what am I doing wrong, because I've tweaked this, drawn diagrams covered in trig, and have absolutely no clue what is going on.
« Last Edit: February 06, 2013, 01:54:53 AM by Sparen »

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #532 on: February 06, 2013, 03:06:59 AM »
If you're adding x in the XYs you're doing it wrong. You were doing the same thing wrong in the previous version too but I only just realized it since I saw trig in there and "abort-abort"-ed.
The XYs designate the vertices' coordinates relative to the object's position. The SetAngle also rotates the vertices around the object position. You've already set the object position to be (x,y). You want your XYs to theoretically draw your thing pointing rightwards (0 degrees), in order to rotate it using SetAngle, so your XYs should be something like
ObjEffect_SetVertexXY(objdwarf,0, 170, -10);
ObjEffect_SetVertexXY(objdwarf,1, 170, 10);
ObjEffect_SetVertexXY(objdwarf,2, 0, 10);
ObjEffect_SetVertexXY(objdwarf,3, 0, -10);

If this is really the problem, it's only really the one concept you're messing up. The XY vertices are not meant to precisely draw where the vertices should be on the screen, they're meant to take the graphic and UV coordinates, and turn it into a renderable image (and to skew the graphic if needed). For rectangular objects that are just drawn rectangular (i.e. most things), you set your XYs as if you were just drawing the object flatly on some random point with no modifications. The object position takes care of the drawing position, the angle takes care of rotating graphics, the scale takes care of making it bigger and smaller, etc.

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 #533 on: February 06, 2013, 10:01:27 PM »
Thank's Drake. OkuuB player script completed. (I just hope that I got the Intersecrion line right...)

JCTechnic

  • Hikkikomori Jesus
  • Goran no suponsaa no teikyou de okurishimasu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #534 on: February 08, 2013, 06:51:06 AM »
Hey, back again with another question ~

Or might be several actually, First of all, is there a Random function in danmakufu? like Y = Random(100); I wanted to make like a random value for Y so the bullet shots horizontaly.

Second, I'm fairly new to danmakufu but i wanted to know if there's away to make a bullet's full trajectory. Like go up, right up, left, down, etc. or writting the coordinates. Might as well ask, can you make homing bullets?

And last question i can remember, what's the measure of the playable area?

Thanks in advance
";" is my enemy.
Hated by many, loved by few.
Frustrating because you forget it but to attached to not want it.
The cause of many errors, but still it has it's own charm.
";" is my enemy, yet it is my best friend.

Matteo

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #535 on: February 08, 2013, 07:05:17 AM »
Hi, do you know where could i find a Sariel boss image to use in a script as a boss? Like iryan's sariel one, i mean. But obviously i don't want his sariel because:

1- i don't know where to find it
2- it's not right to steal a image without permission.

If you can help me...thx!

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #536 on: February 08, 2013, 02:48:33 PM »
What's the way SetPosition02 works? I mean, what's the formula to calculate the speed?
Small Teaser of my upcoming project~

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

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #537 on: February 08, 2013, 06:14:16 PM »
What's the way SetPosition02 works? I mean, what's the formula to calculate the speed?

Do you mean SetMovePosition02? That just moves the enemy to the position in x amount of frames. If the distance from the boss to the position you want to move it to is 100 pixels and you tell it to move to that position in 50 frames, then the boss will travel at 100/50, or 2, pixels per frame. In that case, using SetMovePosition01 with a speed of 2 would produce the exact same results.


Hi, do you know where could i find a Sariel boss image to use in a script as a boss? Like iryan's sariel one, i mean. But obviously i don't want his sariel because:

1- i don't know where to find it
2- it's not right to steal a image without permission.

If you can help me...thx!

I'm sure he wouldn't mind but you can always just ask Iryan via PM on the forums.
<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.

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #538 on: February 08, 2013, 11:11:16 PM »
if you're looking for the movement speed when using setmoveposition02

then


just use setmoveposition01

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

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #539 on: February 10, 2013, 11:14:49 AM »
Okay, thanks to Drake's tips I managed to fix most of the script now, but there is one problem remaining. Somehow the RotatingBullet task will only generate half of the Hypocycloid, while replacing it with CreateShot01 will generate the Hypocycloid in one piece. The odd thing is that it really leaves half of the Hypocycloid out, as if cutting it in half, instead of just generating half of it which would make it look completely different (picture a smaller circle rolling inside of a bigger circle three times instead of six: the shape will still be circular but not closed. This is not what I'm seeing in my code.) Below the parts of code that I changed, the rest is still the same, save for the movement code which I omitted completely and replaced with SetX(GetCenterX); and SetY(GetClipMaxY/4); in @initialize. The odd thing is that this ought to have fixed the problem, since I thought that the enemy initially being at (GetCenterX, 0) made half of the shape generate off-screen, thereby deleting that half. But somehow that didn't fix anything. If you want to take a look at my entire code, below is another pastebin too.

-->Pastebin<--

The Hypocycloid task:
Code: [Select]
task hypocycloid2(a,b,r,k,l){
loop{
k = absolute(trunc(10*k)/10 - trunc(k));
let limit = 360 * (ToFractionNom(k) / GCD(ToFractionNom(k), ToFractionDeNom(k)));
let t = 0;
loop(200){
t += limit/200;
let x = a + r * ( (1 - k) * cos(t) + l * k * cos((1 - k) / k * t));
let y = b + r * ( (1 - k) * sin(t) - l * k * sin((1 - k) / k * t));
RotatingBullet(a, b, x, y, GetAngleToPlayer, RED01);
}
wait(300);
}
}

task RotatingBullet(a, b, x, y, angle, graphic) {
let obj=Obj_Create(OBJ_SHOT);

Obj_SetPosition(obj, x, y);
ObjShot_SetGraphic(obj, graphic);
ObjShot_SetBombResist (obj, true);

let angle2 = atan3(x-a,y-b);
let t2 = 0;
let r = dist(x,y,a,b);
while(Obj_BeDeleted(obj)==false) {
t2 += 1;
a += 2*cos(angle);
b += 2*sin(angle);
x = a + r * cos(t2 + angle2);
y = b + r * sin(t2 + angle2);
Obj_SetPosition(obj, x, y);
yield;
}
}

function dist(x1,y1,x2,y2){
let d = ((x1-x2)^2 + (y1-y2)^2)^0.5;
return d;
}
« Last Edit: February 10, 2013, 11:18:17 AM by sjasogun1 »