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

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #630 on: February 27, 2013, 02:09:24 AM »
Code: [Select]
function CreateShotA2(x, y, speed, accel, maxspeed, angle, angvel, graphic, delay){
let obj = Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj, x, y);
Obj_SetSpeed(obj, speed);
ObjShot_SetGraphic(obj, graphic);
ObjShot_SetDelay(obj, delay);
shot_main();
return obj;

task shot_main(){
while((speed < maxspeed && accel > 0) || (speed > maxspeed && accel < 0)){
Obj_SetSpeed(obj, speed);
speed += accel;
Obj_SetAngle(obj, angle);
angle += angvel;
yield;
}
Obj_SetSpeed(obj, maxspeed);

while(!Obj_BeDeleted(obj)){
Obj_SetAngle(obj, angle);
angle += angvel;
yield;
}
}
}

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 #631 on: February 27, 2013, 02:16:01 AM »
It's already an object bullet, right? You can do whatever you want. Obj_Delete(obj) can be used to clear stuff.
nope, its just createshota

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #632 on: February 27, 2013, 02:17:18 AM »
nope, its just createshota

You can't add parameters to it unless you create an object bullet.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #633 on: February 27, 2013, 02:26:28 AM »
You can't add parameters to it unless you create an object bullet.
ill look at Drake's code

JCTechnic

  • Hikkikomori Jesus
  • Goran no suponsaa no teikyou de okurishimasu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #634 on: February 27, 2013, 02:58:10 AM »
Line 58:
Code: [Select]
else if
You have an error there. I think that's why it says you need a {

Also, I think the Player Shot Data needs a capital P.

#PlayerShotData

Thanks again danmakufu community, it was that damn capital P, that little rascal made me almost lose my mind!

On another note, as I now know how to make custom players and bosses,the next step is the stage, do any of you know where I can find a good stage tutorial? With calling the fairies and what not? Thanks in advance.
";" 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 #635 on: February 27, 2013, 03:16:36 AM »
Thanks again danmakufu community, it was that damn capital P, that little rascal made me almost lose my mind!

On another note, as I now know how to make custom players and bosses,the next step is the stage, do any of you know where I can find a good stage tutorial? With calling the fairies and what not? Thanks in advance.

http://dmf.shrinemaiden.org/wiki/Danmakufu_Intermediate_Tutorial#How_to_make_Stages.21

Vincent_Prismriver

  • Phantom passing by
  • Just an Italian silly guy
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #636 on: February 27, 2013, 12:05:35 PM »
EDIT: I restarted my computer. Now it works fine, I can open the program.
At least if it happens again, I'll know what to do.

But the issue about my custom player character hasn't been solved yet.
If I play a script the sprite... like... doesn't appear.
There's only the hitbox if I focus.

Code: http://pastebin.com/iCf4pxLt

Screen:

This sure is strange... the character sprite doesn't appear on the screen, but it does in the HUD (I've set the same sprite)


Actually, I've encountered this problem before, so I thought I should've added those animation lines (which were useless as a result)

Excuse me, does someone know what might be the problem? Thanks in advance.

gtbot

  • Master of ScreenSplit
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #637 on: February 27, 2013, 01:07:24 PM »
Excuse me, does someone know what might be the problem? Thanks in advance.
You didn't define any rect in your @DrawLoop? Please scroll up to see my previous post :V
You are still missing SetGraphicRect.

Vincent_Prismriver

  • Phantom passing by
  • Just an Italian silly guy
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #638 on: February 27, 2013, 01:31:16 PM »
OH MY, I'M SUCH A RETARD  :V

Everything worked fine, sorry for bothering you so much  :3

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #639 on: February 27, 2013, 02:21:00 PM »
OH MY, I'M SUCH A RETARD  :V

Everything worked fine, sorry for bothering you so much  :3
We'll forgive you! For this time. Next time you'll have to code 10000 lines of "I will carefully read the posts"



...on paper.
( Good to hear it worked out )

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #640 on: February 27, 2013, 11:17:10 PM »
Code: [Select]
function CreateShotA2(x, y, speed, accel, maxspeed, angle, angvel, graphic, delay){
   let obj = Obj_Create(OBJ_SHOT);
   Obj_SetPosition(obj, x, y);
   Obj_SetSpeed(obj, speed);
   ObjShot_SetGraphic(obj, graphic);
   ObjShot_SetDelay(obj, delay);
   shot_main();
   return obj;

   task shot_main(){
      while((speed < maxspeed && accel > 0) || (speed > maxspeed && accel < 0)){
         Obj_SetSpeed(obj, speed);
         speed += accel;
         Obj_SetAngle(obj, angle);
         angle += angvel;
         yield;
      }
      Obj_SetSpeed(obj, maxspeed);

      while(!Obj_BeDeleted(obj)){
         Obj_SetAngle(obj, angle);
         angle += angvel;
         yield;
      }
   }
}
THATS COOL AND WORKED!  :toot:

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #641 on: February 28, 2013, 12:28:09 AM »
OK~ Crash report.

Code: [Select]
#TouhouDanmakufu[Stage]
#Title[Pok?DigiDanmaku Stage 1 Easy]
#Text[Stage 1
Made by Sparen.]
#PlayLevel[Easy]
#Player[player\PDDVee\veemon.dnh]
#ScriptVersion[2]

Is there anything wrong with this heading? I specifically refer to the player call, because that seems to be what crashed Danmakufu. If there isn't something wrong, then I'll check the rest of the stage script once I start scripting the rest of the stage enemies.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #642 on: February 28, 2013, 12:32:14 AM »
OK~ Crash report.

Code: [Select]
#TouhouDanmakufu[Stage]
#Title[Pok?DigiDanmaku Stage 1 Easy]
#Text[Stage 1
Made by Sparen.]
#PlayLevel[Easy]
#Player[player\PDDVee\veemon.dnh]
#ScriptVersion[2]

Is there anything wrong with this heading? I specifically refer to the player call, because that seems to be what crashed Danmakufu. If there isn't something wrong, then I'll check the rest of the stage script once I start scripting the rest of the stage enemies.
Do you need .\ before "player\PDDVee\veemon.dnh"?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #643 on: February 28, 2013, 12:44:36 AM »
Do you need .\ before "player\PDDVee\veemon.dnh"?

I checked Luminous Dream. There was no .\

I have a feeling that it may have been something else. I'm going to retest.

Test Results: It froze upon loading Veemon, then... loaded the screen. Couldn't move. Then played music, ran through script, and then resumed normal function. I have no clue what happened. What I do know is that it didn't play the second track, and that Veemon was rendered immobile. Maybe I forgot to yield or something.

Scratch that.
Code: [Select]
  @MainLoop{
    yield; 
  }

Edit: Apparently, the freezing has nothing to do with the player script. There's a serious error somewhere. When I ran it through ReimuC, the options would rotate, then stop, then rotate, then stop. The music also refused to work correctly.

http://pastebin.com/zPbP3NsU
« Last Edit: February 28, 2013, 12:50:31 AM by Sparen »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #644 on: February 28, 2013, 06:53:09 AM »
Not quite sure. You'll need to apply trial & error by returning as much as possible to basics. Though suspecting your music.
- Disable all sfx / music (don't load/play them)
- Disable playerscript (don't load it specifically, put to FREE)
- Disable any includes if possible (no idea what FxnList does)

If that works, enable the music only and repeat.


Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #645 on: February 28, 2013, 11:13:15 PM »
Not quite sure. You'll need to apply trial & error by returning as much as possible to basics. Though suspecting your music.
- Disable all sfx / music (don't load/play them)
- Disable playerscript (don't load it specifically, put to FREE)
- Disable any includes if possible (no idea what FxnList does)

If that works, enable the music only and repeat.

Disabling the music seems to work, I think. However, the bug does not occur in TC Extra, where twice the amount of music is being loaded. I'll add stage enemies and see what happens.

FREE: Still doesn't work
Includes: Adding wait and Wait for zero enemy to the main script and elimination the include does not solve the problem. On a side note, I simple /**/ed the include. Don't know if that will actually work.

Edit: Now there are two issues: one is the music. Basically, removing the Play part stops the freezing. However, the second track never loads.
Secondly, my enemy script graphic refuses to work correctly, and basically... duplicates the image 60000 times. Don't know what to do.

http://www.mediafire.com/?m7s4ahjqsbht1

Current version (0.02) can be found above. Any and all bugfix suggestions will be greatly appreciated.
I apologize in advance for the music size. However, it's sort of important to have the music because that's one of the problems.
« Last Edit: March 01, 2013, 12:17:00 AM by Sparen »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #646 on: March 01, 2013, 08:39:18 AM »
It isn't about the number of songs loaded, it is about the song itself being loaded or played. Just as some OGG music files can cause crashes/strange things, you might want to verify. If your script runs fine without music then you need to trial & error down to which music/wav/sfx file is the culprit. I think that is quite obvious now.

I cannot download files (especially large ones). Please post pastebin of your issue with the graphic duplication. Sounds pretty much as something you are looping and constantly creating the object/effect.


Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #647 on: March 01, 2013, 01:04:13 PM »
i've always love Shou's spellcard background,but i don't know how to extract it.anyone wanna help ?

gtbot

  • Master of ScreenSplit
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #648 on: March 01, 2013, 01:05:19 PM »
http://pastebin.com/YueYSbNm
I narrowed down both issues to both songs (when I changed both there were no freezes) so you may want to change them or lower their file size.
The sprite error seems to come from this particular code:
Code: [Select]
    if(GetAngle>315&&GetAngle<=45){SetGraphicRect(61, 16, 79, 42);} //Rt
    if(GetAngle>45&&GetAngle<=135){SetGraphicRect(19, 17, 41, 41);} //Down
    if(GetAngle>135&&GetAngle<=225){SetGraphicRect(81, 16, 99, 42);}//Left
    if(GetAngle>225&&GetAngle<=315){SetGraphicRect(40, 16, 58, 39);}//Up
Upon removing all SetGraphicRects ifs and leaving just one without an if, it seems to work fine, so I'm led to believe its this. I'm not familiar with how GetAngle works (ph3 confused me), so I'm not sure what the solution would be.

 Also another thing, you are setting the sprite path to what appears to be a cutin instead of the actual sprite.

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #649 on: March 01, 2013, 02:12:17 PM »
umm... i mean i'll save it as a picture

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #650 on: March 02, 2013, 12:49:46 AM »
i've always love Shou's spellcard background,but i don't know how to extract it.anyone wanna help ?

Go to Touhou Projects under this board and go to Drake's page.

http://pastebin.com/YueYSbNm
I narrowed down both issues to both songs (when I changed both there were no freezes) so you may want to change them or lower their file size.
The sprite error seems to come from this particular code:
Code: [Select]
    if(GetAngle>315&&GetAngle<=45){SetGraphicRect(61, 16, 79, 42);} //Rt
    if(GetAngle>45&&GetAngle<=135){SetGraphicRect(19, 17, 41, 41);} //Down
    if(GetAngle>135&&GetAngle<=225){SetGraphicRect(81, 16, 99, 42);}//Left
    if(GetAngle>225&&GetAngle<=315){SetGraphicRect(40, 16, 58, 39);}//Up
Upon removing all SetGraphicRects ifs and leaving just one without an if, it seems to work fine, so I'm led to believe its this. I'm not familiar with how GetAngle works (ph3 confused me), so I'm not sure what the solution would be.

 Also another thing, you are setting the sprite path to what appears to be a cutin instead of the actual sprite.

Basically, I'm assuming that Danmakufu requires a SetGraphicRect, so... it just basically failed when there wasn't a guaranteed one. In that case, I'll try it with *ugh* a long series of if else statements.
« Last Edit: March 02, 2013, 12:51:45 AM by Sparen »

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #651 on: March 02, 2013, 01:08:05 AM »
Hoe do i make the timeout sound effect when there is10 seconds left?
would it be like if timer = 10 playse(gjffgc):?
If so, where woulld i put it?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #652 on: March 02, 2013, 01:25:24 AM »
Hoe do i make the timeout sound effect when there is10 seconds left?
would it be like if timer = 10 playse(gjffgc):?
If so, where woulld i put it?

I would put it in MainLoop because that's how I run things. If you decide to do it, you'd use a built in function like get time or something, and you'd insert it before yield;

For my problem: changing music to .mp3 did not solve anything, and the lag has not decreased. Is this a problem of too many directories, or is it something else? Also, the yield; in the main loop seems to not work, which is a terrifying prospect. Also, even with the decreased file size for .mp3 files, it still refuses to load the second track. The bug has not occurred with Suiroga's stage, which is worrisome since I have 50 MB of music loaded there (perfectly fine).

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #653 on: March 02, 2013, 02:23:01 AM »
I'm not going to bother with the rest of the issues, but notably (GetAngle>315&&GetAngle<=45) is an impossible condition.

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 #654 on: March 02, 2013, 02:44:59 AM »
I'm not going to bother with the rest of the issues, but notably (GetAngle>315&&GetAngle<=45) is an impossible condition.

That part has been changed.

Update: The stage enemy graphics problem is FIXED
Code: [Select]
    SetGraphicRect(19, 17, 41, 41); //Down. Default
    if(GetAngle>-45&&GetAngle<=45){SetGraphicRect(64, 16, 82, 42);} //Rt
    if(GetAngle>135&&GetAngle<=225){SetGraphicRect(84, 16, 102, 42);}//Left
    if(GetAngle>225&&GetAngle<=315){SetGraphicRect(40, 16, 61, 44);}//Up

The only remaining issue as of right now is the issue of the music and the fact that using wait() doesn't allow the player to move.

EDIT:

It is the music. I swapped in Suiroga's music and it worked perfectly fine. In other words... I now need to find working versions of every single track. I'm going to post a request list on my project page.

Edit: It seems that Danmakufu could handle an export of ZUN's work, but couldn't handle something recorded from system audio. Are there any specifications on the types of music Danmakufu can load? It wouldn't run a certain .mp3 track, and my own piece froze it. I really need to find out what's going on and why it doesn't work. The main issue is that Suiroga's music works, but the current music doesn't for some unknown reason.
« Last Edit: March 02, 2013, 03:11:17 AM by Sparen »

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #655 on: March 02, 2013, 05:10:00 PM »
http://pastebin.com/dh3TmXTH
Why are there like 8 layers of bullets? xD
 

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #656 on: March 02, 2013, 05:11:33 PM »
http://pastebin.com/dh3TmXTH
Why are there like 8 layers of bullets? xD

Please elaborate on what exactly is going wrong.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #657 on: March 02, 2013, 05:18:19 PM »
Please elaborate on what exactly is going wrong.
OK,
The bullets look weird so when I graze ONE bullet my graze goes up EIGHT.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #658 on: March 02, 2013, 05:59:34 PM »
OK,
The bullets look weird so when I graze ONE bullet my graze goes up EIGHT.

You just happened to spawn 8 bullets there. Check loops, check other stuff, and check... yeah.

Task Fire:
Code: [Select]
                ang+=5000/5;
                dir+=5000/5;
What is this supposed to accomplish?

OK. So... a lot of your bullets overlap because you coded it that way. When you create two bullets with the same parameters, yeah...

Basically, not every bullet = 8 bullets. Just a few. However, rectifying the issue isn' practical because your script depends on the layout of bullets and angle incrementations that you have in place.

I have an error message that needs decoding.

Basically, it occurred in my Stage script and then crashed. I didn't change anything, so...
« Last Edit: March 02, 2013, 06:04:44 PM by Sparen »

Maths ~Angelic Version~

  • Aspiring Mathematician of Brilliant Laziness
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #659 on: March 02, 2013, 06:26:51 PM »
Well, I can try to help you with "firec" (aimed light blue bullets):
Change line 91 to
Code: [Select]
                while(x<9){and change line 112 to
Code: [Select]
                dir+=360/9;
If you want to fire a circle of nine bullets, the best way is simply
Code: [Select]
let dir=0;
loop( 9)
{
CreateShot01(GetX, GetY, 4, dir, AQUA04,0);
dir+=360/9;
x++;
}
Note: I only put the space in front of the first nine to prevent it from becoming "loop(9)".
This fires the first bullet at 0 degrees, the next at 40 degrees, then 80, 120 etc.
loop(n){stuff;} just runs "stuff" n times without requiring you to define a variable. I used to prefer while loops for making circles, but I have switched to the "standard" loop. I find it easier to use.
A full circle is 360 degrees, hence the number 360. If you use that number (or 180 for semicircles, 90 for one quarter of a circle etc) instead of a weird number like "5000/5", it's much easier to see what you want to do.
I highly recommend writing "360/9" even though it's easy to see that 360/9=40. If you write "40", others will look at your code and wonder where the strange number 40 came from. Also, if you want to fire n bullets and n is a variable, you have no choice but to write "360/n" anyway.