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

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem thread number 4
« Reply #660 on: December 29, 2010, 08:42:25 AM »
If you want to do that, then you'll have to spawn it as a normal enemy, not a boss, and make your own functions for clearing bullets and creating the next attack in @Finalize.

Schezo

  • en-counse
Re: Danmakufu Q&A/Problem thread number 4
« Reply #661 on: December 30, 2010, 04:20:45 AM »
These seem to be really silly questions, but

how do you create custom spell circles to get rid of the annoying white stuff flying around bosses and
how do you make a custom boss explosion for when the boss is destroyed?

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #662 on: December 30, 2010, 06:56:40 AM »
These seem to be really silly questions, but

how do you create custom spell circles to get rid of the annoying white stuff flying around bosses and
how do you make a custom boss explosion for when the boss is destroyed?

To make a custom spell circle, you just need to make an effect object and attach it to the boss and set MagicCircle(false);. To get rid of the white stuff flying around you can replace the effect by putting an transparent png int the th_dnh/img/ folder. I forget what you have to call it though, so maybe someone else can shed some light on that. As for custom boss explosions, there's no good way of doing this, but what I do is make an extra "attack" for the boss that has 1 life and no hitbox. I use this "attack" to make whatever effects I want and play whatever sound I want. Then, when all the effects are finished, I use VanishEnemy; to remove the boss instead of killing it which causes it to skip the default explosion.
<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.

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem thread number 4
« Reply #663 on: December 30, 2010, 06:58:16 AM »
To make a custom spell circle, you just need to make an effect object and attach it to the boss and set MagicCircle(false);. To get rid of the white stuff flying around you can replace the effect by putting an transparent png int the th_dnh/img/ folder.
MagicCircle(false) also removes the floating stuff. No need to mess around with the images.

Schezo

  • en-counse
Re: Danmakufu Q&A/Problem thread number 4
« Reply #664 on: December 30, 2010, 10:57:57 PM »
Thanks a lot for your answers.

Now I'm having trouble making all the bullets on the screen move towards the center at the same time.
Is there an easier way of doing this than just setting the individual angle of each bullet?  I have a feeling it is a object bullet of some kind but I need a little guidance on where to start.

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem thread number 4
« Reply #665 on: December 30, 2010, 11:00:15 PM »
atan2(endY-startY,endX-startX) gets the angle between (startX,startY) and (endX,endY). For example, if x and y are the bullet's current position, set their angle to atan2(GetCenterY-y,GetCenterX-x).

Re: Danmakufu Q&A/Problem thread number 4
« Reply #666 on: January 01, 2011, 08:10:12 AM »
Mmm would you like to explain about object lasers? Are they the same as object bullets?

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #667 on: January 01, 2011, 08:31:42 AM »
Object Lasers follow the same rules as Shots, but you just need to set a length and width as well. That's... pretty much it. Please take any further questions to the Q&A thread.

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

Re: Danmakufu Q&A/Problem thread number 4
« Reply #668 on: January 02, 2011, 08:16:35 AM »
I've recently discovered Danmakufu, and, being a computer guy, naturally got attracted by the programming stuff. However, while crafting up a script, I couldn't get the anchor bullets to work. And what's Murasa without her anchors (if you haven't gotten hint yet, I'm big on Murasa)? I don't know if it's appropriate to ask here, but I'll try. >_>

Code: [Select]
task superbullet(x,y,v,dir,graphic,delay){
let anchorbullet=0;
let anchorangle=0;
let anchorspawn=0;
PlaySE(CSD ~ "sfx\tan02.wav");
let anchortoss = Obj_Create(OBJ_EFFECT);
Obj_SetPosition(anchortoss,GetEnemyX,GetEnemyY);
ObjEffect_SetLayer(anchortoss,7);
ObjEffect_SetTexture(anchortoss,Anchor);
ObjEffect_SetPrimitiveType(anchortoss,PRIMITIVE_TRIANGLESTRIP);
ObjEffect_CreateVertex(anchortoss,4);
ObjEffect_SetScale(anchortoss,1,1);
ObjEffect_SetVertexXY(anchortoss,0,-64,-64);
ObjEffect_SetVertexUV(anchortoss,0,0,0);
ObjEffect_SetVertexXY(anchortoss,1,64,-64);
ObjEffect_SetVertexUV(anchortoss,1,128,0);
ObjEffect_SetVertexXY(anchortoss,2,-64,64);
ObjEffect_SetVertexUV(anchortoss,2,0,128);
ObjEffect_SetVertexXY(anchortoss,3,64,64);
ObjEffect_SetVertexUV(anchortoss,3,128,128);
ObjEffect_SetAngle(anchortoss,0,0,90);
Obj_SetSpeed(anchortoss,4);

let anchorbullet = Obj_Create(OBJ_SHOT);
Obj_SetPosition(anchorbullet,GetEnemyX,GetEnemyY);
Obj_SetSpeed(anchorbullet,4);
Obj_SetAngle(anchorbullet,GetAngleToPlayer);
ObjShot_SetBombResist(anchorbullet,true);
ObjShot_SetGraphic(anchorbullet,graphic);

while(!Obj_BeDeleted(anchortoss)){

CreateShot01(GetEnemyX,GetEnemyY,4,90,Anchor,0);

wait(60);
yield;
}
}

Now I've gotten the anchor bullet to load nice and well, but the problem is... the bullet sprite keeps on flying to the immediate right of the boss. However, the hitbox of the anchors continue flying towards me as usual. Which parameter do I switch up to cause the anchors to work properly?

First comment by the way. ;)

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem thread number 4
« Reply #669 on: January 02, 2011, 08:29:56 AM »
Effect object's angle is set using ObjEffect_SetAngle(obj,x,y,z); 

And next time, please post inside the Q&A thread all your questions. There is like obvious STICKY out there with guidelines on how to post =|

Re: Danmakufu Q&A/Problem thread number 4
« Reply #670 on: January 02, 2011, 08:36:31 AM »
I'm sorry, I just really want to get done with this script. >_> Desperation means I don't have much time to read. And thanks!

EDIT:

ObjEffect_SetAngle(obj,x,y,z); 

What do the parameters x, y and z stand for? If I leave both x and y as 0 and z as GetAngleToPlayer, the anchor comes out perfectly but it only flies to the right side of the boss. However, the tip of the anchor IS pointing towards the player.
« Last Edit: January 02, 2011, 08:46:43 AM by Captain Murasa »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem thread number 4
« Reply #671 on: January 02, 2011, 11:02:59 AM »
I'm sorry, I just really want to get done with this script. >_> Desperation means I don't have much time to read. And thanks!
That isn't the correct attitude to have though. Mainly because this thread is read and answered very fast, hence it has already 4 threads in history and lots of pages. There is no such thing as "I am in a hurry so I bluntly post a thread because it will help me faster" in this forum section. Now for your question.

ObjEffect_SetAngle(obj,x,y,z); 

What do the parameters x, y and z stand for? If I leave both x and y as 0 and z as GetAngleToPlayer, the anchor comes out perfectly but it only flies to the right side of the boss. However, the tip of the anchor IS pointing towards the player.
x y z are the parameters for flipping or tilting the image. X parameter flips the image around the x-axis, y around the y-axis and z makes it rotate. If it is flying to the right of the boss, it means it has a movement angle of 0.

Take a look at your own code. You are saying  "let anchorangle = 0;"  but doing nothing with it. And defining   ObjEffect_SetAngle(anchortoss,0,0,90); but you are nowhere defining WHERE the object bullet should move. You need to also define Obj_SetAngle(obj,angle);  Remember that these are two different angle functions. The ObjEffect one is only for the graphics and the Obj_Angle is for the actual angle of the object bullet.

To fix your issue:
- Remove let anchorangle = 0; because you are doing nothing with it.
- Add  Obj_SetAngle(obj,dir);   <-- because you are using the parameter dir in your task.
- Change the effect angle to ObjEffect_SetAngle(obj,0,0,dir);
- Call the bullet in your script with superbullet(x,y,v,dir,graphic,delay);  where dir = GetAngleToPlayer.

The parameter will automatically pass down the direction angle for both the Object it self and the effect angle.
« Last Edit: January 02, 2011, 11:05:08 AM by Helepolis »

Re: Danmakufu Q&A/Problem thread number 4
« Reply #672 on: January 02, 2011, 11:30:02 AM »
Very much thanks, and sorry again. That's just how I am, unfortunately.

Now that the anchor movement issue is fixed... The only other problem is the anchor hitbox. It's unusually small, which appears to be around 25 pixels in diameter. How do I go about changing that?

Re: Danmakufu Q&A/Problem thread number 4
« Reply #673 on: January 04, 2011, 09:50:15 PM »
Like Patchouli's Green Storm or Sylphae Horn (even though that's supposed to be leaves) or Moedan Spell Card 29?  I want to see how it's done and I'm drawing a blank on how to search for it.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #674 on: January 04, 2011, 11:00:29 PM »
I don't see what's so difficult to imitate about Patchouli's leaf attacks and I don't remember spellcard 29 in Moedan. You should probably be more specific on what part of the attack you don't understand.

Also, use this thread instead of making your own thread to ask simple questions from now on.
<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.

Re: Danmakufu Q&A/Problem thread number 4
« Reply #675 on: January 04, 2011, 11:03:55 PM »
I've never done anything danmakufu before and I was hoping to skip that tedious "learning" stage and modify something close to my goal.  Oh well, I'll start from the beginning like a good boy.

PS:  Is there a faq I missed about posting in this thread?  I feel guilty having to be moved.  Oh, nm, there it is.  ( -.-)  I'm sorry I missed it.  Could you maybe make that rules part of the faq a different color?  My eyes were drawn to the shiny blue FAQ link and I glossed right over it.
« Last Edit: January 04, 2011, 11:10:28 PM by Tubercular Ox »

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem thread number 4
« Reply #676 on: January 05, 2011, 07:38:28 AM »
Making the Rules heading larger and coloring it would probably be a good idea. We've been getting quite a few stray "help me" threads that have been merged in here lately. Maybe sticky the Q&A thread too so it's harder to miss?
<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.

Re: Danmakufu Q&A/Problem thread number 4
« Reply #677 on: January 05, 2011, 03:36:13 PM »
Maybe sticky the Q&A thread too so it's harder to miss?

People read stickies?

Re: Danmakufu Q&A/Problem thread number 4
« Reply #678 on: January 05, 2011, 03:42:48 PM »
This one reads stickies.  Mostly.

Is there an index of Danmakufu statements?  The wiki has a nice list of functions, but not statements.  I had a heck of a time finding a reference to "ascent"

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: Danmakufu Q&A/Problem thread number 4
« Reply #679 on: January 05, 2011, 04:00:11 PM »
This one reads stickies.  Mostly.

Is there an index of Danmakufu statements?  The wiki has a nice list of functions, but not statements.  I had a heck of a time finding a reference to "ascent"

Well... we have the great information thread (that's STICKIED). :V
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Re: Danmakufu Q&A/Problem thread number 4
« Reply #680 on: January 05, 2011, 04:13:22 PM »
I did read that.  It has several tutorials, but no indices.  There's a link to the wiki, which has a function index on the front page, but the wiki does not have a statement index.  I finally had the bright idea to search the wiki (I dunno I always forget about search functions) and found the ascent statement in the beginner's tutorial.  In retrospect that makes sense, but I stopped reading the beginner's tutorial when it started talking about how if statements worked.  I have a bit more comp sci behind me than that.

The function index gives the impression that all danmaku built-ins start with a capital letter, so when I was browsing code and saw "ascent" with a lower case letter, I made a lot of bad assumptions.  You have to admit it's not a statement found in common languages. 

The beginner tutorial shows a lot of neat statements now that I slog through all of it, but how do I know that's all of them?

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #681 on: January 05, 2011, 05:24:08 PM »
The old touhouwiki used to have arbitrary syntax rules somewhere, but they haven't yet been added to the DNH wiki.

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

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem thread number 4
« Reply #682 on: January 05, 2011, 05:47:20 PM »
Tagging along the talk about functions and stuff, what exactly are the functional differences between a Task and a Function? A common custom function is Wait(w), but how would a Task built in the same way be different?

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #683 on: January 05, 2011, 06:32:20 PM »
Tagging along the talk about functions and stuff, what exactly are the functional differences between a Task and a Function? A common custom function is Wait(w), but how would a Task built in the same way be different?
A function is just a shorthand for a piece of code.

A task, on the other hand, is a whole new code thread that runs alongside @MainLoop{} once you call it. Since it is seperate from the code thread that called it, you can suspend it with the yield; command without suspending the original code.

This means:
1. tasks called in the MainLoop{} can last for more than one frame while functions cannot.
2. tasks cannot be used to return information with the return(); command.
3. tasks take more processing power than a function that would accomplish the same.

There are many things tasks can do which functions can't, some things functions can that tasks can't, and in pretty much all other cases you will want a function rather than a task to keep the performance up.
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

TheMasterSpark

  • Lunatic lemurialist
Re: Danmakufu Q&A/Problem thread number 4
« Reply #684 on: January 05, 2011, 07:48:58 PM »
Ah, that's a significant fundamental difference to keep in mind. Now that you mention it, my attempts to stall the MainLoop with loop(){yield;} have never been successful - now I know why!

Thanks.  :derp:

Re: Danmakufu Q&A/Problem thread number 4
« Reply #685 on: January 05, 2011, 08:53:15 PM »
It should be noted that both tasks and functions can include parameters, while a sub cannot. A sub is basically a function that doesn't have parameters, and it runs much faster than a function as a result, so if you don't want your block of code to have parameters (or more accurately, don't need it to have them), then it's wise to use subs instead of functions.

Drake

  • *
Re: Danmakufu Q&A/Problem thread number 4
« Reply #686 on: January 05, 2011, 10:42:12 PM »
subs also cannot return values and are usually quite tasty

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem thread number 4
« Reply #687 on: January 06, 2011, 08:07:27 AM »
The old touhouwiki used to have arbitrary syntax rules somewhere, but they haven't yet been added to the DNH wiki.

Most time I use this http://en.touhouwiki.net/wiki/Category:Touhou_Danmakufu

I will see what I can do about increasing font in the FAQ

Re: Danmakufu Q&A/Problem thread number 4
« Reply #688 on: January 06, 2011, 05:28:56 PM »
When you're using CreateShotWhatever with a non-default bullet, what determines the hitbox?  Can you specify that in the shot data file?

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem thread number 4
« Reply #689 on: January 06, 2011, 05:33:33 PM »
The size of a bullet's hitbox is proportional to the size of its graphic rect. This means you can increase the hitbox size of a bullet by adding more empty space around the bullet inside the shotsheet and then encompassing it with the grapic rect.
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."