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

JCTechnic

  • Hikkikomori Jesus
  • Goran no suponsaa no teikyou de okurishimasu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #570 on: February 21, 2013, 03:31:38 PM »
Honing bullet: Create an object bullet that, while a certain variable is a certain number, sets Obj_SetAngle to GetAngleToPlayer. If you want it to hone infinitely, then just say GetAngleToPlayer every frame.

I never actually used the Obj_Create, but I found a code for Homing bullet in the Touhou Wikia,
http://touhou.wikia.com/wiki/Touhou_Danmakufu:_Object_Bullets

When I use it in the script the bullets only go down (90 degree, the starting angle of the bullets).
Is there anything I need to add to the code?
";" 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.

Maths ~Angelic Version~

  • Aspiring Mathematician of Brilliant Laziness
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #571 on: February 21, 2013, 04:41:40 PM »
I never actually used the Obj_Create, but I found a code for Homing bullet in the Touhou Wikia,
http://en.touhouwiki.net/wiki/Touhou_Danmakufu:_Object_Bullets

When I use it in the script the bullets only go down (90 degree, the starting angle of the bullets).
Is there anything I need to add to the code?
Do you have a yield in your @MainLoop?

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #572 on: February 21, 2013, 10:52:05 PM »
Code: [Select]
let count = 0;
//Obj declarations
while(!ObjBeDeleted(obj)){
count++;
if(count%20<10){Obj_SetAngle(obj, Obj_GetAngle(obj)+1);}else{Obj_SetAngle(obj, Obj_GetAngle(obj)-1);}
}

Tweak it for your own purposes, and experiment. Maybe you'll want to put a % 2 limit or something.
It froze  ???

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #573 on: February 21, 2013, 10:56:33 PM »
It froze  ???
You need a yield inside the loop. Or else it freezes/crashes.

let count = 0;
//Obj declarations
while(!ObjBeDeleted(obj)){
                count++;
                if(count%20<10){Obj_SetAngle(obj, Obj_GetAngle(obj)+1);}else{Obj_SetAngle(obj, Obj_GetAngle(obj)-1); }
                yield;
}
Currently a normal player

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #574 on: February 21, 2013, 11:00:31 PM »
You need a yield inside the loop. Or else it freezes/crashes.

let count = 0;
//Obj declarations
while(!ObjBeDeleted(obj)){
                count++;
                if(count%20<10){Obj_SetAngle(obj, Obj_GetAngle(obj)+1);}else{Obj_SetAngle(obj, Obj_GetAngle(obj)-1); }
                yield;
}
I was thinking the it should be there...THANKS  :)

Edit:
weird...it still freezes
« Last Edit: February 22, 2013, 06:34:39 AM by Helepolis »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #575 on: February 22, 2013, 02:14:37 AM »
weird...it still freezes

Please submit code. All of it. There may be problems with MainLoop or elsewhere.

JCTechnic

  • Hikkikomori Jesus
  • Goran no suponsaa no teikyou de okurishimasu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #576 on: February 22, 2013, 05:03:33 AM »
Do you have a yield in your @MainLoop?

Tried it now adding the yield and it works perfectly. Thank you.
";" 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.

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #577 on: February 22, 2013, 09:19:18 AM »
Tried it now adding the yield and it works perfectly. Thank you.

Haha, I remember when I had the same problem. Oh, those were the days...

JCTechnic

  • Hikkikomori Jesus
  • Goran no suponsaa no teikyou de okurishimasu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #578 on: February 22, 2013, 05:05:03 PM »
Haha, I remember when I had the same problem. Oh, those were the days...

I'm only just starting out so I'm prone to get lots of errors xD, I have another one now, for some reason when I create an object for player bullets they won't show up, everything works perfectly except the bullet actually appearing. maybe it's because my bullet has (0,0,4,40).
";" 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.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #579 on: February 22, 2013, 09:24:39 PM »
Ok, I haz another question...
How do I connect stages together:
Like so:
Stage 5 + Boss
Score
Stage 6 + Boss
All Clear Score

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #580 on: February 22, 2013, 09:44:46 PM »
Ok, I haz another question...
How do I connect stages together:
Like so:
Stage 5 + Boss
Score
Stage 6 + Boss
All Clear Score

Depends on how you want to do it.

For my next project, I'll use the following method: First create the stage, then copy it and rename that one as a function. Then, in your master script, use #include_function and execute the function.

See Luminous Dream.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #581 on: February 22, 2013, 11:21:27 PM »
OK.

Besides the Seiga bullet hitbox issue that I have yet to resolve, the cutin issue's cause has been discovered.

Basically, my background is being drawn OVER the cut in.

Is there any way to rectify this? The background stuff is in DrawLoop.

Edit: Seigabullet issue has been fixed (and has caused a smaller, but less problematic issue which I can hopefully ignore).
« Last Edit: February 23, 2013, 01:02:16 AM by Sparen »

Ozzy

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #582 on: February 23, 2013, 04:00:32 PM »
OK.

Besides the Seiga bullet hitbox issue that I have yet to resolve, the cutin issue's cause has been discovered.

Basically, my background is being drawn OVER the cut in.

Is there any way to rectify this? The background stuff is in DrawLoop.

Edit: Seigabullet issue has been fixed (and has caused a smaller, but less problematic issue which I can hopefully ignore).
What layer is the cut in image being drawn on?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #583 on: February 23, 2013, 04:13:13 PM »
What layer is the cut in image being drawn on?

The default layer for the CutIn function. I don't know the specific layer. It'd be extremely helpful if I could dump the background to a lower layer though.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #584 on: February 23, 2013, 07:47:16 PM »
Please submit code. All of it. There may be problems with MainLoop or elsewhere.
Aain, missig lettrs  >:(
Ok, sorry fordoig this late:
http://pastebin.com/TU02HsAz

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #585 on: February 23, 2013, 08:15:20 PM »
Aain, missig lettrs  >:(
Ok, sorry fordoig this late:
http://pastebin.com/TU02HsAz

You have so much unnecessary space and such disorganized open/close {} that it's hard to read your code.
Also, you forgot to use Obj_Delete (obj) after the bullet bounces. If you do not delete it, it will repeat the procedure every frame and will crash Danmakufu via overload.
« Last Edit: February 23, 2013, 08:16:53 PM by Sparen »

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #586 on: February 23, 2013, 11:40:06 PM »
You have so much unnecessary space and such disorganized open/close {} that it's hard to read your code.
Also, you forgot to use Obj_Delete (obj) after the bullet bounces. If you do not delete it, it will repeat the procedure every frame and will crash Danmakufu via overload.
Pastebin messed up my code for some reason, it put a bunch of spaces.
Anyway about the fix, I did that and it didn't work.
I went to windowed mode to see the error and apparently it has to do with the thing you gave me for curving bullets.

gtbot

  • Master of ScreenSplit
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #587 on: February 23, 2013, 11:51:19 PM »
Pastebin messed up my code for some reason, it put a bunch of spaces.
Anyway about the fix, I did that and it didn't work.
I went to windowed mode to see the error and apparently it has to do with the thing you gave me for curving bullets.

I thought that might've just a pasting error, since you previously didn't specify that it gave an error window or when it crashed. An error is coming up because there's an unexpected bracket on line 149, 20[<10. Remove the bracket.
« Last Edit: February 23, 2013, 11:57:47 PM by gtbot »

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #588 on: February 24, 2013, 12:30:44 AM »
I thought that might've just a pasting error, since you previously didn't specify that it gave an error window or when it crashed. An error is coming up because there's an unexpected bracket on line 149, 20[<10. Remove the bracket.
If this works, i'm thanking you in advance c:

Ozzy

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #589 on: February 24, 2013, 05:54:48 AM »
The default layer for the CutIn function. I don't know the specific layer. It'd be extremely helpful if I could dump the background to a lower layer though.
Right, I don't know why I didn't notice before. The default layer for CutIn is drawn under @DrawLoop. Is there a reason you didn't put the background inside of @BackGround?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #590 on: February 24, 2013, 02:27:00 PM »
Right, I don't know why I didn't notice before. The default layer for CutIn is drawn under @DrawLoop. Is there a reason you didn't put the background inside of @BackGround?

It's not a stage script, so @Background is ignored by Danmakufu. I tried it and it turns out that @Background wasn't read at all. Perhaps I should just leave it as #Touhou Danmakufu and not put [Single] afterwards.  I don't know if that'll work though.

Ozzy

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #591 on: February 24, 2013, 05:42:54 PM »
It's not a stage script, so @Background is ignored by Danmakufu. I tried it and it turns out that @Background wasn't read at all. Perhaps I should just leave it as #Touhou Danmakufu and not put [Single] afterwards.  I don't know if that'll work though.
Wait, what kind of script is it anyway? If it's a spellcard then @BackGround should be running. If not than the only way to do a proper background with a single nonspell is with #BackGround or something like that. I've never really used it myself. The best way to get a background on nonspells is to run them in a stage that has the background you want. But if you want it to be playable in Singles with the background you've going to probably have to use #BackGround or make your own cut in so it's on a higher layer than @DrawLoop or something.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #592 on: February 24, 2013, 06:58:50 PM »
Wait, what kind of script is it anyway? If it's a spellcard then @BackGround should be running. If not than the only way to do a proper background with a single nonspell is with #BackGround or something like that. I've never really used it myself. The best way to get a background on nonspells is to run them in a stage that has the background you want. But if you want it to be playable in Singles with the background you've going to probably have to use #BackGround or make your own cut in so it's on a higher layer than @DrawLoop or something.

Would @Background work if you left out the [Single] or [Plural]?

I'm planning to check, but... yeah. Using #Background poses a heap of problems because I actually have a background and a floating background, so it isn't possible for me to use #Background without dumping the floating one.

Oh yeah, and I'm using cutin, not CutIn. I don't remember who made it, and I certainly don't know how to put the cutin on a higher layer yet, although it's in either the function list or one of the tutorials. I'll see if I can tweak it for my purposes.

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #593 on: February 24, 2013, 09:36:00 PM »
Would @Background work if you left out the [Single] or [Plural]?

I'm planning to check, but... yeah. Using #Background poses a heap of problems because I actually have a background and a floating background, so it isn't possible for me to use #Background without dumping the floating one.

Oh yeah, and I'm using cutin, not CutIn. I don't remember who made it, and I certainly don't know how to put the cutin on a higher layer yet, although it's in either the function list or one of the tutorials. I'll see if I can tweak it for my purposes.
You mean the MoF/SA/UFO cutin? Because that function was made by Helepolis.
And I've never put [Single] after #TouhouDanmakufu. But @BackGround still runs for me.
You can just make the background at the zero layer. But the floating BG is a problem, since the Cutins are at layer 1(For the Helepolis cutin.) But that can be solved for just going into the function script and changing what layer the cutin is made on to 2.
Code: [Select]
ObjEffect_SetLayer(obj,1);
To
Code: [Select]
ObjEffect_SetLayer(obj,2);
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 #594 on: February 24, 2013, 10:26:52 PM »
New question regarding #include_function.

Basically, I have a directory called script. Inside the script directory, I have scripts. Outside of it, I have my function stuff. How would I do an include_function?

    #include_function "..\FxnList.txt"

Will fail with this:
[attach=1]

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #595 on: February 24, 2013, 11:33:02 PM »
Sparen, your BG code will definitely be ignored if you're putting it in @Background and not @BackGround. If you don't call SetScore(), which identifies a script as a spell card, @BackGround will also not run. (Of course this makes some sense in the context of a stage since a noncard background should be the stage background, but the score flag handling everything internally is a pretty awful way to handle things.)

As for this one, what is actually in your FxnList? It looks like you're trying to include one script that includes other scripts.

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 #596 on: February 24, 2013, 11:40:02 PM »
As for this one, what is actually in your FxnList? It looks like you're trying to include one script that includes other scripts.

Wait, WaitforZeroEnemy, GetDistance, IsSameAngle, sec, scs, etc.

Or is the problem the fact that it starts with a comment?
Code: [Select]
//General Functions

  function wait(let frames){
    loop(frames){yield;}
  }
  function WaitForZeroEnemy{
    while(GetEnemyNum != 0){yield;}
  }

    function Obj_GetAngleToPlayer(obj){
      return Obj_GetAngleToPoint(obj,GetPlayerX,GetPlayerY)
    }
    function Obj_GetAngleToPoint(obj,tarX,tarY){
      if(Obj_GetX(obj) > tarX){
        return 180 - atan2((|Obj_GetY(obj)-tarY|),(| Obj_GetX(obj)-tarX |));
      }
    return atan2((|Obj_GetY(obj)-tarY|),(| Obj_GetX(obj)-tarX |));
    }

function GetPreviousScriptDirectory(){
  let current = GetCurrentScriptDirectory();
  current = erase(current, length(current)-1);
  while(current[length(current)-1] != '\'){
    current = erase(current, length(current)-1);
  }
  return current;
}

Oh, and thanks for the @BackGround info. I've been able to restore function_cutin to its original state now that spell cutins work properly, as does the stage  background. Only one more spell before I get into the pre-boss section... and have to deal with finding a working Akyu sprite. (making my own would be painful considering how poorly my pixel art is right now).
« Last Edit: February 24, 2013, 11:57:05 PM by Sparen »

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #597 on: February 25, 2013, 12:19:47 AM »
Well, your error doesn't say that FxnList is unable to be found, but that function_cutin isn't able to be found. I assumed you called more includes inside FxnList because your error has nothing to do with it. The problem is where you're putting/reading function_cutin, but you just said it works, so...

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 #598 on: February 25, 2013, 12:27:29 AM »
Well, your error doesn't say that FxnList is unable to be found, but that function_cutin isn't able to be found. I assumed you called more includes inside FxnList because your error has nothing to do with it. The problem is where you're putting/reading function_cutin, but you just said it works, so...

Function_cutin works with Suiroga's TC Extra Stage.

The error message I posted was for another project. A completely different project that hasn't gotten off of the ground yet. In other words, the bug regarding function_cutin still exists. Just in a different project. But it's ... UGH.

I'm just going to attached the bug game and... yeah. There's a Directory Navigation file that shows what's in what.

The attachment should clarify everything. This is going to be my first attempt at creating an entire game, and I really didn't want to have to dump everything into a single folder and have to search for stuff. The only file that should be run is the test file, which is a spell (it was meant to test SFX, but it picked up on an equally infuriating error). The two template scripts are just templates for when I actually start the project in about a month.
« Last Edit: February 25, 2013, 12:29:31 AM by Sparen »

gtbot

  • Master of ScreenSplit
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #599 on: February 25, 2013, 05:51:19 AM »
I'm just going to attached the bug game and... yeah. There's a Directory Navigation file that shows what's in what.
Within the test.txt file, you must put the '.\' before the '..\' so that Danmakufu knows to begin its directory within the script's location before moving up tiers. The fix is simple:
Code: [Select]
    #include_function ".\..\function_cutin.txt";
    #include_function ".\..\FxnList.txt"