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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #540 on: February 10, 2013, 06:32:19 PM »
OK. Another Question, this time regarding Sparks.

I'm trying to make a master spark, but combining an obj_laser and obj_effect doesn't seem to work. There are two main issues: the first is that the spark turns out red ( I don't know what happened; there's NO red in my picture, and the UV vertices should be fine. THe values are 255, 255, 255, 255 as well.)

The second is that I do not know how to apply delay to the spark. I mean, like a precursor laser before the spark comes. Technically, I could do that by altering the object, but...

Yeah, I have no clue how to do this. I also have no scripts besides player scripts that have sparks in them. My only reason for using an effect object is because my shotsheet doesn't contain the spark built in, so I have to summon it via other means.

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #541 on: February 11, 2013, 12:14:20 AM »
Shotsheets are terrible for large objects anyways, especially detailed lasers.

Use Obj_SetScale() and only modify the x-scale, really, that's all you need. And don't give it a hitbox until it starts growing. I can't guess why it would turn red besides maybe the laser beneath it being red and not invisible lol.

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 #542 on: February 11, 2013, 12:55:14 AM »
Shotsheets are terrible for large objects anyways, especially detailed lasers.

Use Obj_SetScale() and only modify the x-scale, really, that's all you need. And don't give it a hitbox until it starts growing. I can't guess why it would turn red besides maybe the laser beneath it being red and not invisible lol.

Regarding the hitbox, I stared at the list of commands available for 0.12m, and I saw no way to put delay on an object laser. Should I use loop(XYZ){yield;} and cram it somewhere? Thank you.

(P.S. There is absolutely no red in the picture... And I don't think it's possible for my Okuu shotdata to have carried over.)

The script in question is attached. (no pastebin yet because I just wrote three long essays right now)


Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #543 on: February 11, 2013, 02:32:00 AM »
Your program flow doesn't work right, firstly. You make a loop for the laser part, wait for it to be deleted, and then make another loop for the effect part. Even if this worked, they would run one at a time, not together. It doesn't work like this either though, because the laser is never being deleted so the second loop isn't actually ever reached.
Anyways, the solution besides fixing your flow is just to fire the laser when the effect starts expanding. You also don't need the counting variables or the notdeleted loop since the task is just divided into several parts that don't rely on any condition.

Here, I assumed some things about how you have things set up, but I redid like the whole task for you. It should work given your graphic is set up the way I think it is and whatnot.
http://pastebin.com/rSmiHMqj

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

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #544 on: February 12, 2013, 03:58:06 PM »
How to mimic Miko's effect of her Butterfly Wings? I'm not 100% sure that manipulating the Z distance could help (Oh my, I'm so outdated with coding...)

Forget about it, played around with coding and found out how (Inefficient, but functional. Will update)
« Last Edit: February 14, 2013, 11:24:06 PM by Teff007 »
Small Teaser of my upcoming project~

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

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #545 on: February 14, 2013, 11:19:25 AM »
Solved my problem (bottom of previous page). My atan3 function wasn't working properly: turns out Danmakufu can't handle negative angles. In the code below, the line before the return had a = -a; instead of a += 180;
Code: [Select]
function atan3(x,y){
if ( x == 0 && y == 0 ){
break;
}
if ( x == 0 ){
if ( y > 0 ){
return 90;
}else{
return 270;
}
}
if ( y == 0 ){
if ( x > 0 ){
return 0;
}else{
return 180;
}
}
let a = atan(y/x);
if ( x < 0 ){a += 180;}
return a;
}

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #546 on: February 14, 2013, 09:43:41 PM »
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
1. For random stuff, just put rand(min,max), an example is "rand(1,48)" whic means, Danmakufu would choose a random number between 1 and 48. (including decimals) Full Example: CreateShot01(GetX, GetY-rand(-50,50) ,3, 90, BLUE05, 0); Did I explain that clearly?
2. Right=0 Down=90 Left=180 Up=270 So 83 would be aimed down and a little to the right. Aimed at player=GetAngleToPlayer (caps are important!)
3. Don't know about the last one, but you can just use these:
GetClipMinY: Top of the playable area.
GetClipMaxY: Bottom of the playable area.
GetClipMinX: Far left of the playable area.
GetClipMaxX: Far right of the playable area.
Wait, I just found this: http://dmf.shrinemaiden.org/wiki/Mathematical_or_Information_Functions_(0.12m)#GetClipMinX (Better explained and answers your question).

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 #547 on: February 14, 2013, 10:15:47 PM »
1. For random stuff, just put rand(min,max), an example is "rand(1,48)" whic means, Danmakufu would choose a random number between 1 and 48. (including decimals) Full Example: CreateShot01(GetX, GetY-rand(-50,50) ,3, 90, BLUE05, 0); Did I explain that clearly?

Alternatively, you can call: let (enter your varable) = rand(Min Number, MaxNumber) in task fire. IE: let rand = rand(0,359). <- This tells Danmakufu that you want this bullet to fire anywhere from 0-359 (360 is 0)

Calling it will make your life easier and it'll make your script much cleaner.
Code: [Select]
task fire{
    let rand = rand(0,360);     
 
loop{
   CreateShot01(GetX-100,GetY,2,rand,RED01,20);   
           
wait(60);
                       yield;     
        }
                          }
       

Also, if you want to use whole numbers you can use: rand_int(Min number, Max number).

« Last Edit: February 14, 2013, 10:19:02 PM by PhantomSong »

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #548 on: February 14, 2013, 11:58:21 PM »
Solved my problem (bottom of previous page). My atan3 function wasn't working properly: turns out Danmakufu can't handle negative angles. In the code below, the line before the return had a = -a; instead of a += 180;
Wait what. A negative angle is just not the same thing as an angle+180, that's all.

PhantomSong: lol what is with that tabbing. More notably, that will save the one random angle and just keep firing the bullet at that angle every time. Using the word "rand" as a variable might bork as well, since it's already defined.

...And wait(60); yield; is just wait(61).

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 #549 on: February 15, 2013, 01:36:17 AM »
Ok, I have another question.
How to I make a spell harder as the boss's life decreases? (Specifically decreasing the wait function)
Would I use if statements? If so how would I write it?
Edit: And how do I make object bullets bounce of walls, but not stahp?
« Last Edit: February 15, 2013, 01:51:27 AM by Qwertyzxcv »

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 #550 on: February 15, 2013, 02:03:14 AM »

Edit: And how do I make object bullets bounce of walls, but not stahp?

What do you mean by they stop?

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #551 on: February 15, 2013, 02:04:51 AM »
What do you mean by they stop?
They bounce once, then not bounce again on another wall.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #552 on: February 15, 2013, 02:12:04 AM »
Ok, I have another question.
How to I make a spell harder as the boss's life decreases? (Specifically decreasing the wait function)
Would I use if statements? If so how would I write it?
Edit: And how do I make object bullets bounce of walls, but not stop?

1&2
Code: [Select]
if((GetLife < 3000 || count > 900)&&count%30==0){
  angle=GetAngleToPlayer;
  loop(15){
    CreateShot01(GetX, GetY, 2, angle, 5, 0);
    angle+=24;
  }
}
Use GetLife and/or a counter variable.

3
I have a task that does that, but accepts a user-defined amount of bounces.

// Wall and sky reflecting bullets.

    task QED(x, y, speed, angle, graphic, delay, num, Bombres) {
      let obj=Obj_Create(OBJ_SHOT);
      let bouncecount = num;
      Obj_SetPosition(obj, x, y);
      Obj_SetAngle(obj, angle);
      Obj_SetSpeed(obj, speed);
      ObjShot_SetGraphic(obj, graphic);
      ObjShot_SetDelay(obj, 0);
      ObjShot_SetBombResist (obj, Bombres);
      while(Obj_BeDeleted(obj)==false && bouncecount > 0) {
        if(Obj_GetX(obj)<GetClipMinX) {
          Obj_SetAngle(obj, 180 - Obj_GetAngle(obj) );
          Obj_SetX(obj,  Obj_GetX(obj) + 0.1);
          bouncecount -= 1;
        }
        if(Obj_GetX(obj)>GetClipMaxX) {
          Obj_SetAngle(obj, 180 - Obj_GetAngle(obj) );
          Obj_SetX(obj,  Obj_GetX(obj) - 0.1);
          bouncecount -= 1;
        }
        if(Obj_GetY(obj)<GetClipMinY) {
          //Obj_SetAngle(obj, Obj_GetAngle(obj) + (2 * (180 - Obj_GetAngle(obj))) ); //Original NetLogo code
          Obj_SetAngle(obj, -1*Obj_GetAngle(obj)); //Equally correct code for Danmakufu
          Obj_SetY(obj,  Obj_GetY(obj) + 0.1);
          bouncecount -= 1;
        }
        yield;
      }
    }


If you don't want the sky reflection, just get rid of the GetClipMinY part.
P.S. Try to make something original; just spamming things like this isn't going to receive an excellent reception most of the time.
« Last Edit: February 15, 2013, 02:16:35 AM by Sparen »

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #553 on: February 15, 2013, 03:13:28 AM »
1&2
Code: [Select]
if((GetLife < 3000 || count > 900)&&count%30==0){
  angle=GetAngleToPlayer;
  loop(15){
    CreateShot01(GetX, GetY, 2, angle, 5, 0);
    angle+=24;
  }
}
Use GetLife and/or a counter variable.

3
I have a task that does that, but accepts a user-defined amount of bounces.

// Wall and sky reflecting bullets.

    task QED(x, y, speed, angle, graphic, delay, num, Bombres) {
      let obj=Obj_Create(OBJ_SHOT);
      let bouncecount = num;
      Obj_SetPosition(obj, x, y);
      Obj_SetAngle(obj, angle);
      Obj_SetSpeed(obj, speed);
      ObjShot_SetGraphic(obj, graphic);
      ObjShot_SetDelay(obj, 0);
      ObjShot_SetBombResist (obj, Bombres);
      while(Obj_BeDeleted(obj)==false && bouncecount > 0) {
        if(Obj_GetX(obj)<GetClipMinX) {
          Obj_SetAngle(obj, 180 - Obj_GetAngle(obj) );
          Obj_SetX(obj,  Obj_GetX(obj) + 0.1);
          bouncecount -= 1;
        }
        if(Obj_GetX(obj)>GetClipMaxX) {
          Obj_SetAngle(obj, 180 - Obj_GetAngle(obj) );
          Obj_SetX(obj,  Obj_GetX(obj) - 0.1);
          bouncecount -= 1;
        }
        if(Obj_GetY(obj)<GetClipMinY) {
          //Obj_SetAngle(obj, Obj_GetAngle(obj) + (2 * (180 - Obj_GetAngle(obj))) ); //Original NetLogo code
          Obj_SetAngle(obj, -1*Obj_GetAngle(obj)); //Equally correct code for Danmakufu
          Obj_SetY(obj,  Obj_GetY(obj) + 0.1);
          bouncecount -= 1;
        }
        yield;
      }
    }


If you don't want the sky reflection, just get rid of the GetClipMinY part.
P.S. Try to make something original; just spamming things like this isn't going to receive an excellent reception most of the time.
wut

Sorry, but I didn't understand that bouncecount thing.
 
 :blush:
« Last Edit: February 19, 2013, 08:20:34 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 #554 on: February 15, 2013, 11:05:43 PM »
num is stated when you call the task. It is how many times the bullet can bounce off of walls

The PS: Don't take things that others have created and spit them out as if they were your own. The QED task is one of the most commonly used tasks in Danmakufu among beginners, for example. Everyone uses it at one point or another. I'm saying to create something creative, new, and original. Something that you can be proud of.

For example, you need to put thought into what you do.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #555 on: February 15, 2013, 11:14:14 PM »
num is stated when you call the task. It is how many times the bullet can bounce off of walls

The PS: Don't take things that others have created and spit them out as if they were your own. The QED task is one of the most commonly used tasks in Danmakufu among beginners, for example. Everyone uses it at one point or another. I'm saying to create something creative, new, and original. Something that you can be proud of.

For example, you need to put thought into what you do.
Ok, guess I understand moar... :derp:
The PS: k (potassium lol)  :derp: :derp: :derp: :derp: :derp: :derp: :derp: :derp: :derp: :derp: :derp: :derp: :derp: :derp: :derp: :derp: :derp: :derp: :derp:

Keegster2

  • Green shroom
  • The guy that was dead for like 5 years
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #556 on: February 16, 2013, 08:45:18 AM »
I tried to install AppLocal (In English), and then installed this game, I then installed AppLocal in Japanese, but it still doesn't work (It crashes as soon as it starts), what am I doing wrong?
"I'll give you old-timey, you mountebank!"

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #557 on: February 16, 2013, 03:21:36 PM »
I tried to install AppLocal (In English), and then installed this game, I then installed AppLocal in Japanese, but it still doesn't work (It crashes as soon as it starts), what am I doing wrong?

You have to RUN Touhou Danmakufu in Japanese Locale. Installing it and then doing nothing with it will not help you.

There should be at least three or four Applocale help threads in this forum. If you have no luck searching in RaNGE (Read the stickies), then check the Tech Help board.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #558 on: February 17, 2013, 05:48:48 PM »
I now have ANOTHER issue with effect objects. Given that I've done this so many times already, it's probably a stupid error somewhere. However, after the red master spark which used graphics from a completely different folder, I'm starting to question what's going on.

Code: [Select]
    task thunderorb(angle, xcor, ycor){
let thorb = Obj_Create(OBJ_EFFECT);
let origangle = angle;
let thorbx = xcor;
let thorby = ycor;
let orbcount = 0;
let shots = GetCurrentScriptDirectory~"shots.png";
Obj_SetPosition(thorb,thorbx,thorby);
        Obj_SetSpeed(thorb,0);
ObjEffect_SetTexture(thorb, shots);
ObjEffect_SetRenderState(thorb, ADD);
ObjEffect_CreateVertex(thorb,4);
        ObjEffect_SetPrimitiveType(thorb,PRIMITIVE_TRIANGLEFAN);
        ObjEffect_SetVertexUV(thorb,0,99,8);
        ObjEffect_SetVertexUV(thorb,1,143,8);
        ObjEffect_SetVertexUV(thorb,2,143,52);
        ObjEffect_SetVertexUV(thorb,3,99,52);
ObjEffect_SetVertexXY(thorb,0,-22,-22);
        ObjEffect_SetVertexXY(thorb,1,22,-22);
        ObjEffect_SetVertexXY(thorb,2,22,22);
        ObjEffect_SetVertexXY(thorb,3,-22,22);
        ascent(i in 0..4){ObjEffect_SetVertexColor(thorb, i, 255, 255, 255, 255);}
while(!Obj_BeDeleted(thorb)){
  thorbx = GetPlayerX+45*cos(angle+orbcount);
  thorby = GetPlayerY+45*sin(angle+orbcount);
  Obj_SetPosition(thorb,thorbx,thorby);
          SetCollisionB(GetX, GetY, 24); //I don't know if this is how to do it.
  //etc.
  orbcount++;
  yield;
}
    }
Basically, there are eight orbs rotating around the boss. Problem: The graphics don't load.

Code: [Select]
if(count == 20){
  loop(8){
    thunderorb(angle, GetX+45*cos(angle), GetY+45*sin(angle));
    angle+=45;
  }
PlaySE(bullet);
}
I call it with this. However, the SFX plays, so that means that the objects were indeed created. That's why I'm so confused.

Any and all help will be greatly appreciated.

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #559 on: February 17, 2013, 06:04:27 PM »
Not entirely sure that it will work, but replace this line...

Code: [Select]
let shots = GetCurrentScriptDirectory~"shots.png";
...with this one...

Code: [Select]
let shots = GetCurrentScriptDirectory ~ ".\shots.png";
Small Teaser of my upcoming project~

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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #560 on: February 17, 2013, 06:25:45 PM »
Not entirely sure that it will work, but replace this line...
Code: [Select]
let shots = GetCurrentScriptDirectory~"shots.png"; ...with this one...
Code: [Select]
let shots = GetCurrentScriptDirectory ~ ".\shots.png";

Didn't work.

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #561 on: February 18, 2013, 03:56:10 AM »
Heh. I'm past the "This doesn't work" stage. At least I hope.
So this is more of a "How do I do this?"
Question
I've seen many games use their own fonts, but I just don't know how to implement them and not have all of the letters cram together.

Question #2
In a Mima Script. I saw custom bomb and player images for the default players. How do I do that?

Question #3
Simplest question: Those lines that are under the name of the a spellcard in a spellcard looks editable. Do I have to create a new cutin function to implement that?
Currently a normal player

JCTechnic

  • Hikkikomori Jesus
  • Goran no suponsaa no teikyou de okurishimasu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #562 on: February 19, 2013, 02:04:52 PM »
1. For random stuff, just put rand(min,max), an example is "rand(1,48)" whic means, Danmakufu would choose a random number between 1 and 48. (including decimals) Full Example: CreateShot01(GetX, GetY-rand(-50,50) ,3, 90, BLUE05, 0); Did I explain that clearly?
2. Right=0 Down=90 Left=180 Up=270 So 83 would be aimed down and a little to the right. Aimed at player=GetAngleToPlayer (caps are important!)
3. Don't know about the last one, but you can just use these:
GetClipMinY: Top of the playable area.
GetClipMaxY: Bottom of the playable area.
GetClipMinX: Far left of the playable area.
GetClipMaxX: Far right of the playable area.
Wait, I just found this: http://dmf.shrinemaiden.org/wiki/Mathematical_or_Information_Functions_(0.12m)#GetClipMinX (Better explained and answers your question).

THank you for answering my questions, although I'm asking another thing on the second question.
What I meant was when defining the coordinates I was refering to where the bullet travels to, for example
The bullet first travels to the coordinates (100,300) then goes to (80,100) and finishes at (300,400).
So if we started with the enemy in the top middle the bullet would go, down and left, up and left, down and right.

And a homing bullet I was refering to a bulllet that would follow the player wherever he moved, not just shot at the player's general direction and continue until the end of the screen.
";" 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 #563 on: February 19, 2013, 03:37:43 PM »
THank you for answering my questions, although I'm asking another thing on the second question.
What I meant was when defining the coordinates I was refering to where the bullet travels to, for example
The bullet first travels to the coordinates (100,300) then goes to (80,100) and finishes at (300,400).
So if we started with the enemy in the top middle the bullet would go, down and left, up and left, down and right.

And a homing bullet I was refering to a bulllet that would follow the player wherever he moved, not just shot at the player's general direction and continue until the end of the screen.

Honing bullet: Create an object bullet that, while a certain variable is a certain number, sets Obj_SetAngle to GetAngleToPlayer. If you want it to hone infinitely, then just say GetAngleToPlayer every frame.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #564 on: February 19, 2013, 10:29:22 PM »
How do I make a bullet curve back and forth? (Like the familiars in SA stage 1)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #565 on: February 19, 2013, 10:47:10 PM »
@Qwertyzxcv: Object bullets that, if var is less than number, set angle angle+= number, or if var >, etc.

I have an annoying question. Basically, my thunder orbs showed up. the bigger issue for me is that using the same collision data, my Seiga bullets refuse to collide with the player.

http://pastebin.com/mYFX10kg

the thunder orb task works perfectly. The seigabullet task would work perfectly if it wasn't for that weird inability for the hitbox to work.

[attach=1]

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #566 on: February 20, 2013, 03:06:56 AM »
Honing bullet: Create an object bullet that, while a certain variable is a certain number, sets Obj_SetAngle to GetAngleToPlayer. If you want it to hone infinitely, then just say GetAngleToPlayer every frame.
GetAngleToPlayer returns the angle from the Boss to the Player. If you want to get the angle from any other point (like from the homing bullet) to the player, you will need to use something like this instead: atan2(GetPlayerY - Obj_GetY(objbullet), GetPlayerX - Obj_GetX(objbullet))

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #567 on: February 20, 2013, 03:22:13 AM »
GetAngleToPlayer returns the angle from the Boss to the Player. If you want to get the angle from any other point (like from the homing bullet) to the player, you will need to use something like this instead: atan2(GetPlayerY - Obj_GetY(objbullet), GetPlayerX - Obj_GetX(objbullet))

*Shoot. I forgot*

Now I have another question, this time regarding one of those stupid issues with Danmakufu.

Apparently, you can only load a certain amount of images at once, correct? Because
Code: [Select]
    let BossImage = GetCurrentScriptDirectory~"suiroga.png";
    let BossCutIn = GetCurrentScriptDirectory~"\system\cutin.png";
    let bullet = GetCurrentScriptDirectory~"bullet.wav";
    let laser = GetCurrentScriptDirectory~"laser.wav";
    let wave = GetCurrentScriptDirectory~"wave.wav";
    let ZUNbullet = GetCurrentScriptDirectory~"supershot.txt";
    let spellsfx = GetCurrentScriptDirectory~"spell.wav";
    let charge = GetCurrentScriptDirectory~"charge.wav";
    let Background = GetCurrentScriptDirectory~"\system\Underwater.jpg";
    let backicon = GetCurrentScriptDirectory~"\system\thunderorb.png";

    @Initialize {
LoadGraphic(BossImage);
LoadGraphic(BossCutIn);
LoadUserShotData(ZUNbullet);
LoadGraphic(Background);
LoadGraphic(backicon);
cutin("NAZRIN","Seiryuu "\""Talisman Eruption"\",BossCutIn,0,0,340,443);
Does not run the cutin correctly while
Code: [Select]
    let BossImage = GetCurrentScriptDirectory~"suiroga.png";
    let BossCutIn = GetCurrentScriptDirectory~"\system\cutin.png";
    let bullet = GetCurrentScriptDirectory~"bullet.wav";
    let laser = GetCurrentScriptDirectory~"laser.wav";
    let wave = GetCurrentScriptDirectory~"wave.wav";
    let ZUNbullet = GetCurrentScriptDirectory~"supershot.txt";
    let spellsfx = GetCurrentScriptDirectory~"spell.wav";
    let charge = GetCurrentScriptDirectory~"charge.wav";
    let Background = GetCurrentScriptDirectory~"\system\Underwater.jpg";
    let backicon = GetCurrentScriptDirectory~"\system\thunderorb.png";

    @Initialize {
LoadGraphic(BossImage);
LoadGraphic(BossCutIn);
LoadUserShotData(ZUNbullet);
//LoadGraphic(Background);
LoadGraphic(backicon);
cutin("NAZRIN","Seiryuu "\""Talisman Eruption"\",BossCutIn,0,0,340,443);
does. I just noticed it AFTER I posted the Version 0.19 video and realized that with the backgrounds, the cutins decided not to load. I tried running cutin("NAZRIN","Seiryuu "\""Talisman Eruption"\",GetCurrentScriptDirectory~"\system\cutin.png",0,0,340,443);, but that didn't work.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #568 on: February 21, 2013, 02:32:38 AM »
@Qwertyzxcv: Object bullets that, if var is less than number, set angle angle+= number, or if var >, etc.
Can I have an example code?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #569 on: February 21, 2013, 02:44:38 AM »
Can I have an example code?
Code: [Select]
let count = 0;
//Obj declarations
while(!ObjBeDeleted(obj)){
count++;
if(count%20<10){Obj_SetAngle(obj, Obj_GetAngle(obj)+1);}else{Obj_SetAngle(obj, Obj_GetAngle(obj)-1);}
}

Tweak it for your own purposes, and experiment. Maybe you'll want to put a % 2 limit or something.