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

0 Members and 1 Guest are viewing this topic.

Tad Marx Barba

  • Mastermind Behind the Mirror
  • Struggling with my boring life =w=
  • Nickname: Marx
  • Gender: Male
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1770 on: May 09, 2019, 12:46:54 am »
Can you help me? My system has a problem...

When the player reach to a certain nonspell, and a certain percentage of vitality comes down, the boss's steps and difficulty indicator are deleted for no apparent reason...
I forgot delete
Code: [Select]
Obj_Delete(obj) from my Fade In task, my apologies  :V

tsunami3000

  • Touhou is cool i guess
  • Nickname: tsu
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1771 on: May 09, 2019, 06:19:47 pm »
I've been trying to learn how the user-defined item data works by checking how other users' projects. I get the idea due to how similar the code is to custom shots scripts, but I can't figure out what the "out" part is. I know it seems to define an area in the graphics image used for the item (just like "rect"), but I don't know what it is for.

Code: [Select]
ItemData{ id = 2 type = 2 rect = (192, 0, 208, 16) out = ( 194, 14, 205, 25) render = ALPHA }
some day i'll finally beat UFO... some day

Drake

  • *
  • LOOK AT ME
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1772 on: May 09, 2019, 08:49:30 pm »
When a normally-behaving item goes above the top of the screen there's a graphic shown that tells you the item is dropping there; in Touhou games it's a small triangular arrow. The `out` rect is for that graphic.

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

Kinedyme

  • Dream Magic - Duplex Spark!
  • Nickname: Kine
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1773 on: May 10, 2019, 01:05:09 pm »
How do non-piercing lasers for player scripts calculate their lengths to the target?
My only idea so far is to perform something like ray tracing every frame, but is there a more elegant solution?

tsunami3000

  • Touhou is cool i guess
  • Nickname: tsu
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1774 on: May 10, 2019, 01:32:05 pm »
When a normally-behaving item goes above the top of the screen there's a graphic shown that tells you the item is dropping there; in Touhou games it's a small triangular arrow. The `out` rect is for that graphic.

Gosh, it's so obvious now that you explained it. Thanks!
some day i'll finally beat UFO... some day

MakiBlank

  • Neophyte
  • Gender: Tomato
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1775 on: May 16, 2019, 10:17:38 am »
So I'm new to danmakufu and touhou in general and I've been trying to recreate Border of Wave and Particle. I have this current code setup:
Code: [Select]
task BoWaP{
if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0) {return;}
    let angleT = rand(0, 360);
    let objcount = 0;
    loop{
        loop(5){
            let obj = CreateShotA1(ObjMove_GetX(bossObj), ObjMove_GetY(bossObj), 3, angleT, 52, 5);
            angleT += 360/5;
        }
        angleT += sin(objcount) * cos(objcount) * 12;
        objcount++;
        yield;
    }
}
When I run the code through the game it appears to stack the different patterns that the bullets are producing. Is there anything I have done wrong in the code that causes this?

Gregory

  • I draw stuffs
  • Nickname: Tanky !
  • Gender: Male
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1776 on: May 17, 2019, 05:56:17 am »
So I'm new to danmakufu and touhou in general and I've been trying to recreate Border of Wave and Particle. I have this current code setup:
Code: [Select]
task BoWaP{
if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0) {return;}
    let angleT = rand(0, 360);
    let objcount = 0;
    loop{
        loop(5){
            let obj = CreateShotA1(ObjMove_GetX(bossObj), ObjMove_GetY(bossObj), 3, angleT, 52, 5);
            angleT += 360/5;
        }
        angleT += sin(objcount) * cos(objcount) * 12;
        objcount++;
        yield;
    }
}
When I run the code through the game it appears to stack the different patterns that the bullets are producing. Is there anything I have done wrong in the code that causes this?

Did you loop the BoWaP task again ? Because it worked fine on me
https://imgur.com/a/V5s2X3l

MakiBlank

  • Neophyte
  • Gender: Tomato
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1777 on: May 17, 2019, 06:45:39 am »
I dont think so, but here's my mainloop if it helps with the problem
Code: [Select]
@MainLoop{
    ObjEnemy_SetIntersectionCircleToShot(bossObj, ObjMove_GetX(bossObj), ObjMove_GetY(bossObj), 32);
    ObjEnemy_SetIntersectionCircleToPlayer(bossObj, ObjMove_GetX(bossObj), ObjMove_GetY(bossObj), 24);
if (count == 0) {
ObjMove_SetDestAtFrame(bossObj, GetCenterX(), 112, 60);
}
if(count % 30 == 0 && count >= 0){
BoWaP;
}
count++;
    yield;
}

Drake

  • *
  • LOOK AT ME
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1778 on: May 17, 2019, 06:47:41 am »
This is starting an instance of the BoWaP task every 30 frames, so yes, it's going to keep overlapping the whole thing over and over.

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

MakiBlank

  • Neophyte
  • Gender: Tomato
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1779 on: May 17, 2019, 07:11:49 am »
I just realized this. Fixed now!
I'm still pretty new to coding in general, so I sometimes forget what certain things do :P

BananaCupcakey

  • ^_^
  • Nickname: Banana
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1780 on: May 17, 2019, 11:47:08 am »
I was making the bullets to spawn bullets, it works, but the bullets also appeared on the top left of the screen.
How can I overcome this situation ?
https://pastebin.com/R82cpE05
Just keep it neutral :3

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
  • Gender: Male
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1781 on: May 17, 2019, 03:55:47 pm »
I was making the bullets to spawn bullets, it works, but the bullets also appeared on the top left of the screen.
How can I overcome this situation ?
https://pastebin.com/R82cpE05

I haven't taken a look at your code yet but I'm 100% sure it's because you're spawning bullets without checking if the parent bullet still exists.

Only spawn bullets from the parent if the parent has not been deleted.

More information: https://sparen.github.io/ph3tutorials/ph3u2l16.html

JDude :3

  • tururu
  • boy with code
  • Nickname: johnbr
  • Gender: Almost a Man
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1782 on: May 18, 2019, 02:20:14 am »
I was making the bullets to spawn bullets, it works, but the bullets also appeared on the top left of the screen.
How can I overcome this situation ?
https://pastebin.com/R82cpE05

Line 118:
let b = CreateShotA1(ObjMove_GetX(obj), ObjMove_GetY(obj), 0, obj, 318 , 7);
I suppose that instead of obj it's ObjMove_GetAngle(obj)

also Sparen is correct, you should make sure that it only shoots while the obj isn't deleted, like this code
Code: [Select]
while(!Obj_IsDeleted(obj)){
      //code here;
}
"dnh is hard" - said no one
"dnh is bullshit" - everyone making a creative pattern

Tad Marx Barba

  • Mastermind Behind the Mirror
  • Struggling with my boring life =w=
  • Nickname: Marx
  • Gender: Male
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1783 on: May 18, 2019, 11:40:50 pm »
Guys, Hello there.
How do I randomize 21 shoot tasks?

I've these bunch of code for my 21 shooting task, but I've no idea how to do that...  ???
Link to my code: Pastebin

Please, help me  :3

Drake

  • *
  • LOOK AT ME
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1784 on: Today at 03:01:07 am »
You would generate a random number and then pick based on that using a switch or a bunch of if-elses.
Code: [Select]
function rand_int(min, max){
  return floor(rand(min, max));
}

alternative(rand_int(0, 22))
case(0){
  RING_1();
  wait(32 * 7 + 60);
}case(1){
  RING_2();
  wait(32 * 13);
}case(2){
// ...
}case(21){
  Octo_Fist(fr);
  wait(fr + 1340);
}

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

Tad Marx Barba

  • Mastermind Behind the Mirror
  • Struggling with my boring life =w=
  • Nickname: Marx
  • Gender: Male
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #1785 on: Today at 03:48:54 am »
You would generate a random number and then pick based on that using a switch or a bunch of if-elses.
Thanks Drake! It works!  :3 :D
 

SMF 2.0.15 | SMF © 2017, Simple Machines
Theme based on ModernDark64 design by BlocWeb
Page created in 0.059 seconds with 41 queries.