Author Topic: ※ Danmakufu Q&A/Problem thread 3 ※  (Read 489920 times)

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1500 on: September 07, 2018, 05:08:53 PM »
I'm trying to render a Mitori to a script, but when I mirror the scale/angle, the sprite bugs.
https://pastebin.com/tvn4KtZR (code)
Edit:I've managed to correct it and thanks for Sparen for pointing out my linking error
« Last Edit: September 07, 2018, 11:04:25 PM by Zinochan »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1501 on: September 07, 2018, 09:45:01 PM »
I'm trying to render a Mitori to a script, but when I mirror the scale/angle, the sprite bugs.
https://pastebin.com/tvn4KtZR(code)

You have a malformed URL. Please add a space after your URL (IE separate (code)) to ensure that the link works properly.

Kinedyme

  • Dream Magic - Duplex Spark!
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1502 on: September 08, 2018, 08:26:34 AM »
Do shots created by CreateShotB1() and CreateShotB2() output the correct values when called with the functions ObjMove_GetSpeed() and ObjMove_GetAngle() ?

Crescendo

  • Trying to be a little less lazy
  • ;
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1503 on: September 08, 2018, 09:20:47 PM »
I'm trying to replicate a spell card (for practice purposes) and all is going well until:

https://imgur.com/D69b2Za

...I need a curly bracket? After a wait?

And even if I do add it, it just springs to another problem (movement not defined, CenterX() something, etc.).

Normally I'd just think I messed up since I'm still a coding newbie, but every code I made beforehand worked fine. The only difference between this and previous codes is what the bullets are doing.

Can an extra set of eyes help me out? I'm honestly stumped at this point.

Full code:  https://pastebin.com/aKH9vHMH

Normal 1cc's: EoSD(RA), PCB(SA), IN(BT), MoF(RA), SA(MC), UFO(RB), TD(R), DDC(SA), PDLoLK(Reimu, 921 tries), HSiFS(CWin)
Fangame 1cc's: HSoB-Normal(SPurple,KWhite)
Current goals:  EoSD hard, EoSD extra.
Attempting the art of danmakufu.

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1504 on: September 09, 2018, 04:27:23 AM »
Yes. I think it's likely that internally the engine just does a transform into angle/velocity and there's no real difference between bullets created from A or B.

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

FlareDragon

  • Gensokyo's Infernal Hellstorm
  • When will you come to Gensokyo, Satsuki Rin?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1505 on: September 09, 2018, 12:35:53 PM »
I'm trying to replicate a spell card (for practice purposes) and all is going well until:

https://imgur.com/D69b2Za

...I need a curly bracket? After a wait?

And even if I do add it, it just springs to another problem (movement not defined, CenterX() something, etc.).

Normally I'd just think I messed up since I'm still a coding newbie, but every code I made beforehand worked fine. The only difference between this and previous codes is what the bullets are doing.

Can an extra set of eyes help me out? I'm honestly stumped at this point.

Full code:  https://pastebin.com/aKH9vHMH
A quick glance show me a missing semi-colon:
ObjMove_SetDestAtFrame(objBoss, GetCenterX(), 112, 60);
Normal 1CC's: SoEW, LLS, MS, EoSD, PCB, IN, PoFV, MoF, SA, UFO, GFW, TD, HM, DDC, ULiL, LoLK(PD), CtC |IaMP|
Hard 1CC's: EoSD, PCB, MoF, IN(B), TD, LoLK(PD), |???|
Lunatic 1CC's: None
Extra 1CC's: SoEW, MS, EoSD, PCB, IN, PoFV, MoF(NB), SA, UFO, GFW, TD, DDC, CtC, LoLK, |???|

Crescendo

  • Trying to be a little less lazy
  • ;
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1506 on: September 09, 2018, 01:26:49 PM »
A quick glance show me a missing semi-colon:
ObjMove_SetDestAtFrame(objBoss, GetCenterX(), 112, 60);

*facepalms* Darn you semicolons....

On a serious note though, thank you for your time! I checked the brackets but somehow semicolons slipped my mind.

 I'll keep this in mind for future issues. Thanks again for your time.
Normal 1cc's: EoSD(RA), PCB(SA), IN(BT), MoF(RA), SA(MC), UFO(RB), TD(R), DDC(SA), PDLoLK(Reimu, 921 tries), HSiFS(CWin)
Fangame 1cc's: HSoB-Normal(SPurple,KWhite)
Current goals:  EoSD hard, EoSD extra.
Attempting the art of danmakufu.

Kinedyme

  • Dream Magic - Duplex Spark!
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1507 on: September 11, 2018, 12:16:43 AM »
Code: [Select]
The laser generated by the following code appears to have no hitbox detection.
Can somebody please explain to me what's going wrong?

[code>]
laserObj = CreateStraightLaserA1(xPos,yPos,aim,512,5,5,graphic,0);
ObjShot_SetIntersectionEnable(laserObj,true);

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1508 on: September 11, 2018, 01:38:09 AM »
If you check the documentation, then you'll see that the sixth parameter is how many frames that the laser exists for before disappearing. You've set that to 5, which means your laser exists for a fraction of a second before disappearing, which isn't enough time for it to impact anything. I also really suggest moving the delay and length up to at least 30 and 20 respectively.

Kinedyme

  • Dream Magic - Duplex Spark!
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1509 on: September 11, 2018, 11:29:03 AM »
If you check the documentation, then you'll see that the sixth parameter is how many frames that the laser exists for before disappearing. You've set that to 5, which means your laser exists for a fraction of a second before disappearing, which isn't enough time for it to impact anything. I also really suggest moving the delay and length up to at least 30 and 20 respectively.

Okay,
So does this mean that it takes time for the laser's hitbox to form? If the laser is aimed directly at the player and is not dodged, then I would expect it to be able to kill the player in that instant, if only for a 12th of a second, given that there is zero delay.

JDude :3

  • tururu
  • boy with code
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1510 on: September 17, 2018, 11:16:47 PM »
A few questions about the HUD Frame and System files:
  • What I need to use to make a Highscore gimmick?
  • How can I make one? Or are there any scripts for research?
  • Should I use a image or Danmakufu's text funcs? (EX: Score, Lives, Difficulty, etc)
  • Help with the Player's Hearts and Stars?
  • Should I use ZUN's HUD rips or try to make a new one?
"dnh is hard" - said no one
"dnh is bullshit" - everyone making a creative pattern

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1511 on: September 18, 2018, 02:30:43 AM »
A few questions about the HUD Frame and System files:
  • What I need to use to make a Highscore gimmick?
  • How can I make one? Or are there any scripts for research?
  • Should I use a image or Danmakufu's text funcs? (EX: Score, Lives, Difficulty, etc)
  • Help with the Player's Hearts and Stars?
  • Should I use ZUN's HUD rips or try to make a new one?

1: CommonData Areas
2: Pretty much any script that saves High Score data uses Common Data Areas to do so.
3: Images are usually better
4: Depends on what you mean. What kind of system do you want (Life/Bomb fragments? Fairies of Sorcery style? Fairy Wars style?)
5: Do not use ZUN's.

JDude :3

  • tururu
  • boy with code
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1512 on: September 18, 2018, 11:03:58 PM »
4: Depends on what you mean. What kind of system do you want (Life/Bomb fragments? Fairies of Sorcery style? Fairy Wars style?)

The old style, without the pieces/fragments ^^
"dnh is hard" - said no one
"dnh is bullshit" - everyone making a creative pattern

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1513 on: September 22, 2018, 08:12:28 PM »
Hi!

I'm completely new to Danmakufu, but I've been keeping up with a lot of tutorials from both Helepolis and Sparen when it comes to making scripts.

However, I have had trouble looking for any resources concerning player scripts and I'm left completely in the dust when it comes to this. The one big question I have for this is:

How can I create the little options/familiars that are present with the player? Like Reimu's yin-yang orbs or Marisa's lasers.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1514 on: September 23, 2018, 12:09:52 AM »
Hi!

I'm completely new to Danmakufu, but I've been keeping up with a lot of tutorials from both Helepolis and Sparen when it comes to making scripts.

However, I have had trouble looking for any resources concerning player scripts and I'm left completely in the dust when it comes to this. The one big question I have for this is:

How can I create the little options/familiars that are present with the player? Like Reimu's yin-yang orbs or Marisa's lasers.

A familiar is essentially a Render Object with a position relative to GetPlayerX/Y, that just happens to fire player bullets.

JDude :3

  • tururu
  • boy with code
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1515 on: September 23, 2018, 12:42:33 AM »
Help, I don't what to put about AreaCommonData to make it a true HiScore...

https://pastebin.com/FGFYdR48
"dnh is hard" - said no one
"dnh is bullshit" - everyone making a creative pattern

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1516 on: September 27, 2018, 04:02:07 PM »
i'm now trying parametric equations with my danmaku to make a heart but my issue is that the heart only spawns in one direction regardless of angle

Code: [Select]
task TFire (loopNum, speed, angle, shotID, delay) {
let hx;
let hy;
loop (loopNum) {
hx = (13 * cos(angle)) - (5 * cos(2 * angle)) - (2 * cos(3 * angle)) - cos(4 * angle);
hy = 16 * sin(angle)^3;
CreateShotA1(bossX + (2 * hx), bossY + (2 * hy), speed, angle, shotID, delay);
angle += 360/loopNum;
}
}

is there any way i can fix this to change the direction the heart is pointing? its always pointing at a 180 degree angle

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1517 on: September 27, 2018, 04:41:38 PM »
i'm now trying parametric equations with my danmaku to make a heart but my issue is that the heart only spawns in one direction regardless of angle

is there any way i can fix this to change the direction the heart is pointing? its always pointing at a 180 degree angle

I recommend researching rotation matrices. They will allow you to rotate a parametric equation arbitrarily and you will not be constrained to the specific curve.

Crescendo

  • Trying to be a little less lazy
  • ;
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1518 on: September 30, 2018, 10:59:34 PM »
 ̶e̶l̶l̶o̶ ̶s̶e̶m̶i̶-̶c̶o̶l̶l̶o̶n̶ ̶n̶e̶w̶b̶ ̶i̶s̶ ̶b̶a̶c̶k̶ :V

I've been messing with parametric stuff and I want to use tricuspoids (deltoids) for a spellcard I'm making. (http://www-history.mcs.st-and.ac.uk/Curves/Tricuspoid.html)

...Though I'm definitely doing something wrong as it's coming out as a spiral instead. I've stalked the site a little bit to see if I could piece it together myself, but no luck. How do I fix that?

Code: [Select]
task phantomPrism{
//loop and speed is set weird to make sure it's shaped correctly
let angleT = 90;
PlaySE(charge);
BFX_Charge(ObjMove_GetX(objBoss),ObjMove_GetY(objBoss),150,60);
wait(60);
loop(500){
if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;}
let obj = CreateShotA1(ObjMove_GetX(objBoss) + (2*cos(angleT) + cos(angleT*2)), ObjMove_GetY(objBoss) + (2*sin(angleT) - sin(angleT*2)), 0, angleT, 204, 0);
angleT += 360/60;
yield;
        }
//ObjMove_SetDestAtFrame(objBoss, rand(GetCenterX -120, GetCenterX + 120), rand(GetCenterY - 100, GetCenterY - 170), 60);
}

Also side question (you don't have to answer this), but general things to keep in mind when putting parametric equations into Danmakufu code? There might be a time when I need more complex equations and I don't want to get into this situation again (especially if the answer turns out to be super obvious)
« Last Edit: October 01, 2018, 01:56:42 AM by Crescendo »
Normal 1cc's: EoSD(RA), PCB(SA), IN(BT), MoF(RA), SA(MC), UFO(RB), TD(R), DDC(SA), PDLoLK(Reimu, 921 tries), HSiFS(CWin)
Fangame 1cc's: HSoB-Normal(SPurple,KWhite)
Current goals:  EoSD hard, EoSD extra.
Attempting the art of danmakufu.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1519 on: October 01, 2018, 01:23:51 AM »
Code: [Select]
let obj = CreateShotA1(ObjMove_GetX(objBoss) + (2*cos(angleT) + cos(angleT*2)), ObjMove_GetY(objBoss) + (2*sin(angleT) + sin(angleT*2)), 0, angleT, 204, 0);

Quote
x = a(2cos(t) + cos(2t)), y = a(2sin(t) - sin(2t))

In your y component you're doing 2sin(t) + sin(2t) instead of 2sin(t) - sin(2t)?

Crescendo

  • Trying to be a little less lazy
  • ;
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1520 on: October 01, 2018, 01:55:50 AM »
In your y component you're doing 2sin(t) + sin(2t) instead of 2sin(t) - sin(2t)?

Actually saw that earlier and tried that, but it still spirals. Just spawns a little differently.
Now why I didn't put that in when I pasted it here idek. I'll update that.
Even took a leap and changed the first + in the y into a - also, but its still spiraling. 

I know trig is a tricky section, but it's still kinda weird. 

« Last Edit: October 01, 2018, 01:57:22 AM by Crescendo »
Normal 1cc's: EoSD(RA), PCB(SA), IN(BT), MoF(RA), SA(MC), UFO(RB), TD(R), DDC(SA), PDLoLK(Reimu, 921 tries), HSiFS(CWin)
Fangame 1cc's: HSoB-Normal(SPurple,KWhite)
Current goals:  EoSD hard, EoSD extra.
Attempting the art of danmakufu.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1521 on: October 01, 2018, 02:48:09 AM »
Actually saw that earlier and tried that, but it still spirals. Just spawns a little differently.
Now why I didn't put that in when I pasted it here idek. I'll update that.
Even took a leap and changed the first + in the y into a - also, but its still spiraling. 

I know trig is a tricky section, but it's still kinda weird.

I copy-pasted your code in Danmakufu, multiplied the x and y components by 64 so that you can see the pattern, and it's working perfectly.
[attach=1]

JDude :3

  • tururu
  • boy with code
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1522 on: October 01, 2018, 06:56:00 AM »
I'm just trying to put random curves in Danmakufu to train my math skills (which are horrible lol)

The page of the Rhodonea curve doesn't have the parametric way...
http://www-history.mcs.st-and.ac.uk/Curves/Rhodonea.html

Code: [Select]
Polar form: r = a sin(kθ)
Cartesian form: (x^2+ y^2)^3 = 4 a^2x^2y^2

I don't even know where to start to transform it :V
"dnh is hard" - said no one
"dnh is bullshit" - everyone making a creative pattern

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1523 on: October 01, 2018, 01:30:57 PM »
Polar form: r = a sin(kθ)
Cartesian form: (x^2+ y^2)^3 = 4 a^2x^2y^2

You can convert polar coordinates to parametric coordinates quite easily. Recall that r = effective radius. Therefore, you can take the sine and cosine to get the y and x components of the radius.

Code: [Select]
task Rhodonea{
        let t = 0;
        let numflowers = 5;
        let radius = 128;
        while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0) {
            loop(5) {
                let effectiverad = radius * sin(numflowers * t);
                let obj = CreateShotA1(ObjMove_GetX(objBoss) + effectiverad*cos(t), ObjMove_GetY(objBoss) + effectiverad*sin(t), 0, 0, DS_BALL_BS_SKY, 10);
                Obj_DeleteAtFrame(obj, 120);
                t += 360/5;
            }
            t += 0.5;
            yield;
        }
    }

[attach=1]

For more references, refer to:
https://sparen.github.io/ph3tutorials/ph3u1l11.html
https://sites.google.com/site/sparensdanmakufututorials/danmakufu-0-12m-tutorials-part-2/008-scripting-createshota-and-trigonometry#TOC-008-07:-Polar-Equations-in-Danmakufu

(And yes, I am referring you to the 0.12m tutorial on polar equations in Danmakufu. This is probably the first time it has ever been relevant in half a decade.)

Crescendo

  • Trying to be a little less lazy
  • ;
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1524 on: October 01, 2018, 09:21:16 PM »
I copy-pasted your code in Danmakufu, multiplied the x and y components by 64 so that you can see the pattern, and it's working perfectly.
Oh wow! Thanks. T̶h̶o̶u̶g̶h̶ ̶I̶ ̶k̶i̶n̶d̶a̶ ̶d̶o̶n̶'̶t̶ ̶u̶n̶d̶e̶r̶s̶t̶a̶n̶d̶ ̶w̶h̶y̶ ̶a̶ ̶6̶4̶ ̶w̶a̶s̶ ̶n̶e̶e̶d̶e̶d̶ ̶i̶n̶ ̶t̶h̶e̶ ̶f̶i̶r̶s̶t̶ ̶p̶l̶a̶c̶e̶.̶.̶.̶ ̶d̶a̶n̶m̶a̶k̶u̶f̶u̶ ̶t̶h̶i̶n̶g̶s̶,̶ ̶I̶ ̶g̶u̶e̶s̶s̶?̶ Nevermind I figured that out. It's for size. There's my error's origin then  :V
Off with experimenting I go.
« Last Edit: October 01, 2018, 09:25:14 PM by Crescendo »
Normal 1cc's: EoSD(RA), PCB(SA), IN(BT), MoF(RA), SA(MC), UFO(RB), TD(R), DDC(SA), PDLoLK(Reimu, 921 tries), HSiFS(CWin)
Fangame 1cc's: HSoB-Normal(SPurple,KWhite)
Current goals:  EoSD hard, EoSD extra.
Attempting the art of danmakufu.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1525 on: October 09, 2018, 12:43:45 PM »
Hi, i have a problem with my code, the sprite is just not showing up. Its a 32 by 32 sprite.

https://pastebin.com/gaVzrub0

Image:
https://imgur.com/a/iK7RJXK

the sprite's a 32 x 32
Please help me take a look at it.

« Last Edit: October 09, 2018, 03:05:50 PM by Jaykin »

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1526 on: October 10, 2018, 04:33:06 PM »
Hello, everyone. I'm trying to implement a replay system, but this error on the picture always pops up when i finish writing the name. I use default replay script as the base. It resulted in the same error even before I reworked it. What could be the issue?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1527 on: October 10, 2018, 05:14:55 PM »
Hello, everyone. I'm trying to implement a replay system, but this error on the picture always pops up when i finish writing the name. I use default replay script as the base. It resulted in the same error even before I reworked it. What could be the issue?

Please provide a Minimal, Complete, and Verifiable example that includes your code so that we can try to find the problem and work out a solution.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1528 on: October 10, 2018, 05:30:52 PM »
Hi, i have a problem with my code, the sprite is just not showing up. Its a 32 by 32 sprite.

https://pastebin.com/gaVzrub0

Image:
https://imgur.com/a/iK7RJXK

the sprite's a 32 x 32
Please help me take a look at it.
You're setting the scale of the image to 0,0,0. Take a look at line #89. The scale is set specifically to zero when speed is equal to 0 or when the boss is "moving". No idea why you're doing this.

I think you're using the wrong functions. You're probably looking for ObjRender_SetAngleXYZ because that flips the image around.

Edit:
Another thing for you to consider: Why are you working with animations when you're using a single-frame sprite as boss image? You shouldn't worry at this stage about rendering animations. Just draw the boss sprite and that is about it.
« Last Edit: October 11, 2018, 11:13:21 AM by Helepolis »

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1529 on: October 11, 2018, 11:46:01 AM »
Here's replay scirpt and part of the package I call it in. Hope, that's enought