Author Topic: Danmakufu Q&A Thread 4 - V3 Edition.  (Read 8722 times)

0 Members and 2 Guests are viewing this topic.

Sparen

  • Danmakufu Artist
    • YouTube
    • AFCDTech
  • Gender: Male
Re: Danmakufu Q&A Thread 4 - V3 Edition.
« Reply #30 on: August 26, 2020, 01:55:12 PM »
There are some tasks that I can't understand well, like TStageScene() or RunPauseScene() for example; When are this kind of tasks executed in the package? I recently started to create stage scripts with bosses, so I know that maybe I need more experience but I'm just looking for some advice to start with packages because I'd like to do something bigger. I'll accept anything.

Thanks for the answer

Take a look at the package for how they are defined and used. I don't recommend working with packages until you have a firm understanding of how tasks and scripts work in Danmakufu.

Re: Danmakufu Q&A Thread 4 - V3 Edition.
« Reply #31 on: August 28, 2020, 10:08:10 AM »
I really dont understand how does sprite sheets work. I mean, i have 2 questions

1: Where can i find them?

i tried the "The sprite recourses" web (https://www.spriters-resource.com/pc_computer/touhoufuujinrokumountainoffaith/sheet/51906/) but in the image appears all the bosses, but i only need 1

2: The coordinates

Is there a way to know the sprite's coordinates to dont make it glitch in battle? (Same problem with shot sheets)

thanks
« Last Edit: August 28, 2020, 10:33:33 AM by ThisIsShort »

Sparen

  • Danmakufu Artist
    • YouTube
    • AFCDTech
  • Gender: Male
Re: Danmakufu Q&A Thread 4 - V3 Edition.
« Reply #32 on: August 28, 2020, 01:19:51 PM »
I really dont understand how does sprite sheets work. I mean, i have 2 questions

1: Where can i find them?

i tried the "The sprite recourses" web (https://www.spriters-resource.com/pc_computer/touhoufuujinrokumountainoffaith/sheet/51906/) but in the image appears all the bosses, but i only need 1

2: The coordinates

Is there a way to know the sprite's coordinates to dont make it glitch in battle? (Same problem with shot sheets)

thanks

1. You already have what you need. Any image editor can crop the image down to the boss you want

2. Most image editors will tell you the coordinates of a given pixel. In addition, in a sprite sheet, most sprites are the same size, so knowing the height and width of the area with the boss sprites is usually enough to determine the dimensions of a single sprite (e.g. width/#sprites)

xChumbo

  • Beginner
    • Twitter
  • Gender: Male
Stage enemies
« Reply #33 on: August 31, 2020, 01:34:17 AM »
Hello, I'm having troubles creating stage enemies; the thing is, I can create the stage enemies well, but is there a way to make the boss wait until the other enemies are defeated? I've tried some solutions by myself but still all the enemies appear with the boss and I can't make it work.


Another doubt I got is: In the StageEnemy creation, there's the following line: "SetDamageRateAtFrameEnm(objEnemy, 80, 50, 30);". This is a function/task that I'm not really sure what it does; the enemies still work but It would be nice if you can tell me its purpose.

Here's some code if you want to see:

Stage code: [ Attachment: You are not allowed to view attachments ]
STGEnemy code: [ Attachment: You are not allowed to view attachments ]

Thank you for your attention.


Sparen

  • Danmakufu Artist
    • YouTube
    • AFCDTech
  • Gender: Male
Re: Stage enemies
« Reply #34 on: September 01, 2020, 01:24:24 PM »
Hello, I'm having troubles creating stage enemies; the thing is, I can create the stage enemies well, but is there a way to make the boss wait until the other enemies are defeated? I've tried some solutions by myself but still all the enemies appear with the boss and I can't make it work.

Personally, I use this function from Ultima:

Code: [Select]
/* *************************************************************************
*void WaitForZeroEnemy() -- Waits for there to be no enemies on screen
************************************************************************* */
function WaitForZeroEnemy(){ //ULTIMA
    while(length(GetAllEnemyID()) > 0){yield;}
}

Skelly

  • Da-da-daisaku Ikeda
  • Gender: Male
Extend function using item points
« Reply #35 on: November 06, 2020, 02:11:35 PM »
Hello, I'm not so new to danmakufu but have stopped messing with it for a while and wanted to warm up again.

Recently I've been working on a simple function in PH3. Basically a function that extends the player whenever it gets a certain amount of points(Like PCB). The major problem I'm having is with the GetPoint function. It basically doesn't work, not returning the actual points collected.

I have tried checking if my function was written wrong. But I have noticed it works using GetGraze instead. I have also noticed that whenever I try to print the number of points collected(Using text functions), it basically doesn't update the actual count(Notice I am calling the function every frame). So I really wonder if the GetPoint function actually works on PH3...

Here is the function I am refering to(I have called it on the stage script btw): https://pastebin.com/cUxjiM2x

(Apologies if the post is messy, it's my first time posting here.)
Airmoto should be Touhou canon

Sparen

  • Danmakufu Artist
    • YouTube
    • AFCDTech
  • Gender: Male
Re: Extend function using item points
« Reply #36 on: November 08, 2020, 02:21:30 PM »
Recently I've been working on a simple function in PH3. Basically a function that extends the player whenever it gets a certain amount of points(Like PCB). The major problem I'm having is with the GetPoint function. It basically doesn't work, not returning the actual points collected.

I have tried checking if my function was written wrong. But I have noticed it works using GetGraze instead. I have also noticed that whenever I try to print the number of points collected(Using text functions), it basically doesn't update the actual count(Notice I am calling the function every frame). So I really wonder if the GetPoint function actually works on PH3...

Here is the function I am refering to(I have called it on the stage script btw): https://pastebin.com/cUxjiM2x

Danmakufu doesn't actually automatically add points - you need to do so manually via AddPoint.

Personally, I would have a task running in the system script that's checking a CommonData value in order to handle extends, and I'd use a CommonData value to track your custom points.

Skelly

  • Da-da-daisaku Ikeda
  • Gender: Male
Re: Extend function using item points
« Reply #37 on: November 11, 2020, 08:58:43 PM »
Danmakufu doesn't actually automatically add points - you need to do so manually via AddPoint.

Personally, I would have a task running in the system script that's checking a CommonData value in order to handle extends, and I'd use a CommonData value to track your custom points.

I see, gonna check your common data tutorials, thanks for the help!
Airmoto should be Touhou canon

Re: Danmakufu Q&A Thread 4 - V3 Edition.
« Reply #38 on: December 19, 2020, 05:29:02 PM »
Hi, i need help with some bullets. I want to make a hammer fall when the other one is deleted, however, i tried it and this is how it ended: https://gyazo.com/8fcff2a6ef204c393af1559907373f65

Here is the whole code for if i did something wrong with the speed or delay: https://pastebin.com/EEULKn2r

Thanks for the help

Luminous_DNH

  • help the ph3sx broke
  • no cool text just microintervals
    • Twitch
    • Twitter
    • Luminous Dawn#7351
  • Gender: Female
Re: Danmakufu Q&A Thread 4 - V3 Edition.
« Reply #39 on: February 05, 2021, 07:29:07 PM »
Hi, i need help with some bullets. I want to make a hammer fall when the other one is deleted, however, i tried it and this is how it ended: https://gyazo.com/8fcff2a6ef204c393af1559907373f65

Here is the whole code for if i did something wrong with the speed or delay: https://pastebin.com/EEULKn2r

Thanks for the help

It's a bit embarrassing replying to such an old topic. Do you still need help?  :cirnotan:

Note that I can't see your gyazo video as the link is invalid. Well, first off, your "move", "fire", and "fire2" tasks don't seem to be used anywhere. I would recommend not keeping unused tasks like these around your code.

Second,
Code: [Select]
ascent(i in 30 .. 3300)
{
if(Obj_IsDeleted(GoldHam)){break;}
let shotSpeed = rand(0.5,1.5);
let sx = ObjMove_GetX(GoldHam);
let sy = ObjMove_GetY(GoldHam);
CreateShotA1(sx, sy - 10, rand(0.5,1.5), rand(0,360), 226, 30);
yield;
}

You don't need an ascent loop for this. You could handle this code with a normal loop. Only use an ascent or descent loop when you need to use the iteration variable that comes with it. (in this case, that would be "i")

Now, I'm a bit confused, but are you trying to fire bullets when GoldHam is deleted? If so, then you will never be able to do this because of the following line:
Code: [Select]
if(Obj_IsDeleted(GoldHam)){break;}
This line of code terminates the loop if GoldHam has been deleted. With this line of code, you'll never be able to spawn bullets because GoldHam is deleted, the loop terminates and shots from firing.

Instead, I would handle this with a "while" loop that runs as long as the GoldHam object has *not* been deleted. In this loop, I will save GoldHam's position to a variable and then "yield;". (if you dont put a yield in an infinite loop, DNH will freeze up as it tries to do infinite things all at once.) The yield also makes DNH stay parsing the loop until the condition becomes false (in this case, until GoldHam is deleted). Meanwhile, there's a reason GoldHam's position has to be saved and updated within this loop. By the time you fire shots, GoldHam has already been deleted. If you try to spawn another object at the X and Y position of an object that does not exist, it will instead spawn at the top left corner of the playing field. Because of this, you will have to save the hammer's last position in the "while" loop. I would do it like so:
Code: [Select]
let sx = 0;
let sy = 0;
while(!Obj_IsDeleted(GoldHam)){
         sx = ObjMove_GetX(GoldHam);
sy = ObjMove_GetY(GoldHam);
         yield;
}
CreateShotA1(sx, sy - 10, rand(0.5,1.5), rand(0,360), 226, 30);

Hopefully this is a clear example, but when GoldHam gets deleted, DNH will stop processing the while loop and will continue to what's directly below. At this point, it will spawn your new shot at the X and Y position GoldHam was at just before it got deleted.

Again, I hope I described this in a way that makes sense. If you still need help, I suggest you join the Bullet Hell Engines Discord server. (https://discord.gg/4wNvvPHxeU)

 
« Last Edit: February 05, 2021, 07:33:40 PM by Luminous_DNH »
i dont have a life

i play touhou a lot, normal mode player or something. i also code in danmakufu a lot.

i love eub please buy it idk