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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #450 on: January 20, 2013, 01:40:07 AM »
I've ended up with the same issue as LavaLake regarding stage enemies not being deleted upon exiting the screen.

My proof came when I had a WaitForZeroEnemy that never came and sound effects constantly repeating. Also, for testing the boundaries, do you use config.exe?

Here is my enemy script. (only important parts)
FYI: I never tested this particular one b/c it never appeared. However, I copied and pasted an earlier enemy script that shared the problem and just added the movement and different bullets.
Code: [Select]
script_enemy_main{
  //vars
  @Initialize{
    LoadGraphic(yrm);
    LoadUserShotData(ZUNbullet);
    SetLife(500);
    LoadSE(bullet);
  }
  @MainLoop{
    SetCollisionA(GetX, GetY, 32);
    SetCollisionB(GetX, GetY, 24);
    SetMovePosition01(GetArgument, GetCenterY - 20, 4)
    if(count > 150 && count % 30 == 0){
      //bullet data
      PlaySE(bullet);
    }
    count++;
    yield;
  }
  @DrawLoop{
    SetTexture(yrm);
    DrawGraphic(GetX,GetY);
  }
  @Finalize{
  //item
  }
}
« Last Edit: January 20, 2013, 02:52:32 PM by Sparen »

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #451 on: January 20, 2013, 04:28:54 AM »
For some reason I was thinking they would delete like shots if they went enough off screen. Hrm. In any case,
Code: [Select]
function CheckBoundaries(l, r, t, b){
if(GetX < l || GetX > r || GetY < t || GetY > b){
VanishEnemy;
}
}

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 #452 on: January 20, 2013, 02:45:00 PM »
For some reason I was thinking they would delete like shots if they went enough off screen. Hrm. In any case,
Code: [Select]
function CheckBoundaries(l, r, t, b){
if(GetX < l || GetX > r || GetY < t || GetY > b){
VanishEnemy;
}
}

That's an extremely roundabout method. However, when I look at other stage scripts, they seen to not have the error. Well, thank you anyway. I'll see if it works.
P.S. Would you insert GetClipM(in/ax)(X/Y) into the function?

Edit: Shockman's stage does not even delete the enemies in the enemy script. The Last Comer uses the function that you just posted above (a variation) and something that I cannot find the meaning of (it's a boolean called enmfin). THe SA Phantasm uses vanish time.
« Last Edit: January 20, 2013, 02:52:07 PM by Sparen »

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #453 on: January 20, 2013, 11:11:09 PM »
You wouldn't use GetClips. Clip distance is pretty short and in most cases you want the enemies to start behind the clip distance.

The best method is probably having the enemy delete after a certain amount of time since it uses almost no extra processing. But you can't really generalize something like that; you have to cater it specifically to the stage and enemy, so it's slightly more difficult to implement. At least if you set boundaries you can just give it to every enemy and call it a day.
Also, Shockman does use a deletion timer, you weren't looking hard enough :P

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 #454 on: January 20, 2013, 11:56:28 PM »
When I try to create an object bullet, it freezes.:wat: Wat do I do to fix it?

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #455 on: January 21, 2013, 12:13:38 AM »
put your script on pastebin and post the pastebin link here so we can see what you're talking about

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 #456 on: January 21, 2013, 01:31:10 AM »
Well, the stage enemy fix is done. I decided that I'd alternate between the two methods depending on what was needed, and the stage script now runs almost-perfectly.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #457 on: January 21, 2013, 04:25:42 PM »
New question about stage scripts:
Code: [Select]
  task Stage{
    wait(1); //Required to be here, greater than 0.
    PlayMusic(music1);
    CreateEnemyBossFromFile(section1, GetCenterX, 0, 1.4, 90, 0);
    WaitForZeroEnemy; //MANDATORY or the rest of the code will never be executed!!!
    wait(60);
    CreateEnemyBossFromFile(section2, GetCenterX, 0, 1.4, 90, 0);
    WaitForZeroEnemy;
    FadeOutMusic(music1, 30); //3 seconds to fade out
    wait(120);
    Stage1;
    wait(120);
    PlayMusic(music1);
    CreateEnemyBossFromFile(section4, GetCenterX, 0, 1.4, 90, 0);
    WaitForZeroEnemy;
    wait(180);
    Clear;
  }

Basically, the second PLayMusic(music1) does not work and the music never plays. Is there a way to get the music to play other than loading it as a separate music file?

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #458 on: January 21, 2013, 06:26:02 PM »
put your script on pastebin and post the pastebin link here so we can see what you're talking about
http://pastebin.com/4apkSg51 <---Everything after finalize
( I'm really bad at this )

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #459 on: January 21, 2013, 06:42:15 PM »
http://pastebin.com/4apkSg51 <---Everything after finalize
( I'm really bad at this )

Please specify:
1)When does it freeze? Does it freeze immediately upon starting the script? Is there an error message? Please post the entire script, not just what is after @Finalize. How you call mainTask is also important (if you call it during @MainLoop, I suspect overflow to the point of crashing or maybe even infinite recursion; I haven't looked at the code very carefully), and knowing about how you call the tasks may result in a faster understanding of the problem.
2) What kind of script is this? Stage enemy? Boss? (I assume boss)

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #460 on: January 21, 2013, 06:50:36 PM »
Please specify:
1)When does it freeze? Does it freeze immediately upon starting the script? Is there an error message? Please post the entire script, not just what is after @Finalize. How you call mainTask is also important (if you call it during @MainLoop, I suspect overflow to the point of crashing or maybe even infinite recursion; I haven't looked at the code very carefully), and knowing about how you call the tasks may result in a faster understanding of the problem.
2) What kind of script is this? Stage enemy? Boss? (I assume boss)
Sorry, entire code--->http://pastebin.com/RMjst9Py
It freezes when I start playing it, there is no error message, and it's a boss script.

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #461 on: January 21, 2013, 07:01:01 PM »
Qwerty: Your #TouhouDanmakufu needs a [Single], assuming it's a single pattern. That would fix the crash probably, but it would still error.

Firstly, you don't need to put SetMovePosition inside the loop. As it is, it's running SetMovePosition every frame which is sort of redundant if the boss is already at that position. It wouldn't cause an error, but you only need to call it once. while(Obj_BeDeleted(obj)==false){  yield;  } is redundant too. It won't do anything extra besides extra empty processing.

task fire(GetEnemyX, GetEnemyY, 2, GetAngleToPlayer): You do not put your parameters in the function declaration, you put them when you call the function. But considering you put the exact same things (GetAngleToPlayer etc) in the function itself rather than using any actual parameters, you don't even need any parameters for the function.

Here is that last part fixed: http://pastebin.com/w4H6Uv9H


Sparen: You have to Delete and reload.
« Last Edit: January 21, 2013, 07:03:54 PM by Drake »

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 #462 on: January 21, 2013, 07:28:09 PM »
Sparen: You have to Delete and reload.

You mean DeleteMusic(music1) INSIDE the task stage? (see asterisks)
Code: [Select]
task Stage{
    wait(1); //Required to be here, greater than 0.
    PlayMusic(music1);
    CreateEnemyBossFromFile(section1, GetCenterX, 0, 1.4, 90, 0);
    WaitForZeroEnemy; //MANDATORY or the rest of the code will never be executed!!!
    wait(60);
    CreateEnemyBossFromFile(section2, GetCenterX, 0, 1.4, 90, 0);
    WaitForZeroEnemy;
    FadeOutMusic(music1, 30); //3 seconds to fade out
    wait(120);
    *DeleteMusic(music1);
    Stage1;
    *LoadMusic(music1);
    wait(120);
    PlayMusic(music1);
    CreateEnemyBossFromFile(section4, GetCenterX, 0, 1.4, 90, 0);
    WaitForZeroEnemy;
    wait(180);
    Clear;
  }

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #463 on: January 21, 2013, 07:52:11 PM »
Qwerty: Your #TouhouDanmakufu needs a [Single], assuming it's a single pattern. That would fix the crash probably, but it would still error.

Firstly, you don't need to put SetMovePosition inside the loop. As it is, it's running SetMovePosition every frame which is sort of redundant if the boss is already at that position. It wouldn't cause an error, but you only need to call it once. while(Obj_BeDeleted(obj)==false){  yield;  } is redundant too. It won't do anything extra besides extra empty processing.

task fire(GetEnemyX, GetEnemyY, 2, GetAngleToPlayer): You do not put your parameters in the function declaration, you put them when you call the function. But considering you put the exact same things (GetAngleToPlayer etc) in the function itself rather than using any actual parameters, you don't even need any parameters for the function.

Here is that last part fixed: http://pastebin.com/w4H6Uv9H

Sparen: You have to Delete and reload.
Thank You! :)

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #464 on: January 21, 2013, 10:05:49 PM »
You mean DeleteMusic(music1) INSIDE the task stage?
...Yes. If you had time to write that out did you not have time to test it?

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 #465 on: January 21, 2013, 10:12:04 PM »
Just wanted to confirm beforehand because I though that you could only use DeleteXYZ in @Finalize and LoadXYZ only in @Initialize.

Anyway, it worked.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #466 on: January 21, 2013, 11:34:30 PM »
Back to an older question that I thought was solved until I found an exception.
Code: [Select]
task checkdeath{ //Added Jan 9 and removed stuff from Missed
    loop{
      if(OnMissed){
        loop(GetRebirthFrame){ //Orig: GetRebirthFrame+60. @Missed runs 75 times.
  if(IsLastSpell){LS = 1;} //To keep your Veetype
  yield;
}
        if(LS==0){
  veetype = 0;
          SetSpeed(3.5,1);
          }
        LS = 0;
      }yield;}}
The code is supposed to preserve veetype if you death bomb. LS == 0 refers to a normal death, LS == 1 refers to a death bomb. If you die normally, you technically should return to veetype = 0. but that apparently doesn't happen. The code is called in @Initialize and is set in an infinite loop (without building the stack). I collapsed parts of the task that aren't important.

Basically, I want to find out why either
Code: [Select]
if(IsLastSpell){LS = 1;} or
Code: [Select]
if(LS==0){veetype = 0; SetSpeed(3.5,1);} doesn't work.
« Last Edit: January 21, 2013, 11:36:08 PM by Sparen »

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #467 on: January 22, 2013, 12:04:01 AM »
This question isn't much of a problem, more of a "how to" question.  :3
What I want to know is how do I insert a custom STG Frame in danmakufu. This might seem like a lot for a question though. Or you can just give me a script that tells danmakufu to insert an STG Frame.
I have many danmakufu games but I can't find the scripts containing the STG Frames. This would help a lot to me. Hopefully this is not too much trouble.  :ohdear:
Currently a normal player

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #468 on: January 22, 2013, 12:13:55 AM »
@Lavalake: http://www.bulletforge.org/u/shockman/p/mima-boss-battle/v/12
It's the featured project on BulletForge. XD.

The below is the frame task from Shockman's script. You should be able to understand most of it; otherwise you can look at the Danmakufu Wiki's function list.
Code: [Select]
task stgframe{
let obj=Obj_Create(OBJ_EFFECT);
Obj_SetX(obj,0);
Obj_SetY(obj,0);
ObjEffect_SetLayer(obj,8);
ObjEffect_SetRenderState(obj,ALPHA);
ObjEffect_SetTexture(obj,frame);
ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLEFAN);
ObjEffect_SetScale(obj,1,1);
ObjEffect_SetAngle(obj,0,0,0);
ObjEffect_CreateVertex(obj,4);
ObjEffect_SetVertexUV(obj,0,0,0);
ObjEffect_SetVertexUV(obj,1,640,0);
ObjEffect_SetVertexUV(obj,2,640,480);
ObjEffect_SetVertexUV(obj,3,0,480);
ObjEffect_SetVertexXY(obj,0,0,0);
ObjEffect_SetVertexXY(obj,1,640,0);
ObjEffect_SetVertexXY(obj,2,640,480);
ObjEffect_SetVertexXY(obj,3,0,480);
yield;}
Basically, you have a frame matching Danmakufu's window coordinates, with a massive empty transparent space where the action takes place, and you just run the task in @DrawLoop.

Hope it helps.
« Last Edit: January 22, 2013, 12:18:56 AM by Sparen »

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #469 on: January 22, 2013, 02:07:26 AM »
I'm having trouble with the stage and familiar part...I create 2 familiars for the stage and when I shoot one, the picture of the other one goes away, but is still there.

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #470 on: January 22, 2013, 03:55:27 AM »
I'm having trouble with the stage and familiar part...I create 2 familiars for the stage and when I shoot one, the picture of the other one goes away, but is still there.
Ahh. I had this similar question a while ago.
Did you put "DeleteGraphic" in Finalize?
You shouldn't do that if you have multiple of the same enemies since it just makes the graphics disappear until another "LoadGraphic" activates. But by then, most of the familiars' scripts will have bypassed the "LoadGraphic" in their scripts.
In short, don't DeleteGraphic when your making familiars for a stage. :3
Currently a normal player

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #471 on: January 22, 2013, 11:17:33 PM »
Ahh. I had this similar question a while ago.
Did you put "DeleteGraphic" in Finalize?
You shouldn't do that if you have multiple of the same enemies since it just makes the graphics disappear until another "LoadGraphic" activates. But by then, most of the familiars' scripts will have bypassed the "LoadGraphic" in their scripts.
In short, don't DeleteGraphic when your making familiars for a stage. :3c
Thanks! :D I read the message after I figured it out though xD
Anyway, do you know how to make my familiars shoot?  :)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #472 on: January 22, 2013, 11:45:54 PM »
Thanks! :D I read the message after I figured it out though xD
Anyway, do you know how to make my familiars shoot?  :)

In the while(!Obj_BeDeleted) statement, add whatever you need.

Obj_GetX(obj)
Obj_GetY(obj)
Obj_GetAngle(obj)

etc. will help you do what you need to do.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #473 on: January 23, 2013, 12:05:08 AM »
In the while(!Obj_BeDeleted) statement, add whatever you need.

Obj_GetX(obj)
Obj_GetY(obj)
Obj_GetAngle(obj)

etc. will help you do what you need to do.
I'm a little confused, are we talking about object bullets or familiars?  ???

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #474 on: January 23, 2013, 12:24:14 AM »
Thanks! :D I read the message after I figured it out though xD
Anyway, do you know how to make my familiars shoot?  :)

Basically, bosses are like the main familiars of each stage. If you know how to shoot with bosses, familiars would be easy to script.
So you can just use CreateShot01, Object bullets, etc.
Unless you're talking about Player Familiars(The ones for a player script.)? Those are more complex with scripting.
Currently a normal player

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #475 on: January 23, 2013, 12:31:18 AM »
Basically, bosses are like the main familiars of each stage. If you know how to shoot with bosses, familiars would be easy to script.
So you can just use CreateShot01, Object bullets, etc.
Unless you're talking about Player Familiars(The ones for a player script.)? Those are more complex with scripting.
Tried that and it either freezes or doesnt shoot bullets. No it isn't a Player Familiar either.
« Last Edit: January 23, 2013, 12:48:31 AM by Qwertyzxcv »

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #476 on: January 23, 2013, 01:18:12 AM »
Hmm. Can you post the script on pastebin.  :3 I need to find what the matter is in the script.
Currently a normal player

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #477 on: January 23, 2013, 01:23:04 AM »
I'm a little confused, are we talking about object bullets or familiars?  ???

I did not know if you were using object familiars or if you were using familiars that were loaded like stage enemies. I assume now that you are using the latter, in which case you run the script like a normal enemy or boss attack. Fill in your variables, then fill in MainLoop or whatever tasks you are going to be using.

And yes; definitely post the code so that we have an idea of what is going on.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #478 on: January 23, 2013, 01:27:30 AM »
Hmm. Can you post the script on pastebin.  :3c I need to find what the matter is in the script.
Familiar: http://pastebin.com/yv6DqJg3
Stage: http://pastebin.com/cnEvevGW
 

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #479 on: January 23, 2013, 01:42:43 AM »
Familiar: http://pastebin.com/yv6DqJg3
Stage: http://pastebin.com/cnEvevGW

You never called MainTask in @Initialize of your familiar script. That's why it doesn't shoot. Also, a speed of 7, along with 12 bullets per second, is extremely hard to dodge is you aren't streaming or if there are other bullets.
« Last Edit: January 23, 2013, 01:44:24 AM by Sparen »