Author Topic: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m [Closed, read last post!]  (Read 185534 times)

Lunarethic

  • Local Trashy Edgelord
  • *
  • I can cut people with all this edge
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #630 on: January 02, 2014, 05:34:27 PM »
Sparen asked me to delay nonspell to spell so that I wouldnt cheapshot people to oblivion trying to POC when I add items

So, can you use wait function on plural scripts?
Or a better would be
How does one delay a boss spell?

To clarify my question, I want the boss to wait like x frames to just do nothing and let the player POC ( by do nothing , I mean nothing , not even the cutin will showup )
Putting a wait command isn't helping me either so I'm confused
いつもニコニコあなたの隣に這いよる!生放送!は好き。月です~す。略してニコニャル
Learned how to use a custom shotsheet : 12/28/13 *clapclapclap*
東方謎佚光 ~ Dimensional Light Abscence Work In Progress Touhou Fangame

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #631 on: January 02, 2014, 05:43:35 PM »
To clarify my question, I want the boss to wait like x frames to just do nothing and let the player POC ( by do nothing , I mean nothing , not even the cutin will showup )
Putting a wait command isn't helping me either so I'm confused

You could try doing it the way I did with my Mokou Script and toss away the plural scripts altogether.
A nice alternative that will give you more level of control is simply making the boss scripts standalone child scripts altogether. You can sequentially iterate through them using a centralized stage script that will check for flags in commondata to spawn the next boss.

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #632 on: January 02, 2014, 06:35:30 PM »
There is the workaround way of stopping the boos for a while to POC. Of course, there should be easier ways to do this, but I can only think of this one method right now.
You can always just create another singular script that has nothing in it. Set the boss's/familiar's health to 1, make him/her invincible and somehow mess with it so that the next attack will come shortly after this decoy script. Either you can set the timer to however long you want this break to be or you can break the script,
Spoiler:
I think there's a break function that ends a task,
after a certain amount of time.
Currently a normal player

Shadow

  • Forever waiting for tomorrow
  • ...
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #633 on: January 02, 2014, 07:06:39 PM »
It is important to remember that only SetScore will make it so Danmakufu recognizes the script as a Spell Card. If you wanted to delay a nonspell, you should just make it so the boss does not instantly begin firing bullets by making your MainTask (or similar equivalents, depending on your scripting style) wait "x" frames. If you wanted to delay a Spell Card, the principle would be the same, except you would call SetScore plus whatever cut-in function you are using inside a task which waits for "x" frames as opposed to immediately calling them inside @Initialize.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #634 on: January 02, 2014, 10:38:19 PM »
To delay the firing of bullets, do this:

task MainTask{
wait(120);
//do stuff
}

That's all you need to do... Or set your counting variable to -90 or something and make sure bullets are only spawned after count >= 0

Lunarethic

  • Local Trashy Edgelord
  • *
  • I can cut people with all this edge
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #635 on: January 03, 2014, 05:21:56 AM »
Thanks i was able to delay it ^^
oh and i was making my stage and this is the first time im doing an enemy
so i have this code
and when i play my its erroring my mainTask o.O and i know i have the correct number of brackets , correct spelling , case sensitivity , its just erroring my mainTask?  :ohdear:
and
if the things i type in the stage script is the problem,heres what i typed in
Code: [Select]
CreateEnemyFromFile(GetCurrentScriptDirectory~"enemies/blue fairy.txt",GetCenterX,GetCenterY,0,0,0);
いつもニコニコあなたの隣に這いよる!生放送!は好き。月です~す。略してニコニャル
Learned how to use a custom shotsheet : 12/28/13 *clapclapclap*
東方謎佚光 ~ Dimensional Light Abscence Work In Progress Touhou Fangame

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #636 on: January 03, 2014, 06:22:59 AM »
I'm drawing a blank too, the only error I found was an extra ending bracket after drawloop, around line 73.
Also, test the enemy on its own to see where the problem is.
Currently a normal player

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #637 on: January 03, 2014, 06:47:35 AM »
Thanks i was able to delay it ^^
oh and i was making my stage and this is the first time im doing an enemy
so i have this code
and when i play my its erroring my mainTask o.O and i know i have the correct number of brackets , correct spelling , case sensitivity , its just erroring my mainTask?  :ohdear:
and
if the things i type in the stage script is the problem,heres what i typed in
Code: [Select]
CreateEnemyFromFile(GetCurrentScriptDirectory~"enemies/blue fairy.txt",GetCenterX,GetCenterY,0,0,0);
I'm drawing a blank too, the only error I found was an extra ending bracket after drawloop, around line 73.
Also, test the enemy on its own to see where the problem is.
Yea, @DrawLoop has too many. Line 78 or 80 one needs to go.

Also where is the wait() function... How the hell did you earlier managed to delay it when you're clueless about this piece of code?
« Last Edit: January 03, 2014, 06:49:50 AM by Helepolis »

Lunarethic

  • Local Trashy Edgelord
  • *
  • I can cut people with all this edge
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #638 on: January 03, 2014, 06:53:30 AM »
Hmm i guess i miscounted the number of brackets there
but....
holy fuck I.........ok....now I feel stoopid......i dint even realize that i wrote a wait function without writing a wait function.......anyways....thanks Hele....ill go sit in the corner and code some more....
いつもニコニコあなたの隣に這いよる!生放送!は好き。月です~す。略してニコニャル
Learned how to use a custom shotsheet : 12/28/13 *clapclapclap*
東方謎佚光 ~ Dimensional Light Abscence Work In Progress Touhou Fangame

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #639 on: January 03, 2014, 07:00:36 AM »
Also it's @BackGround, not @Background

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 7 ※ for Danmakufu version 0.12m
« Reply #640 on: January 03, 2014, 03:13:01 PM »
Also it's @BackGround, not @Background

Adding onto this, the @BackGround will only work for spells (use SetScore) and Stages. It won't be read inside a non spell or an enemy script unless you configure it to be run.

SilentYukiro

  • Silent Soul of the Electronic Skies
  • Clearly a Satori lover :3
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #641 on: January 18, 2014, 05:59:26 AM »
I know this is a novice problem and all and I rarely encounter this, but this keeps bugging me and my progress  :ohdear:




Here's the image of the simple moving animation of Remi, seems normal right? But after about 10 or 20 frames or so, this what happens:




This also happened to my Byakuren Script when it moves, but when the boss is just in Idle mode, it seems perfectly fine. And oh, another note:
*When I did a trial on removing the background or putting it in my non-spell script, the animation seems to be fine.




Here's the animation code:
Code: [Select]
//////////////////////////////////////////
///////Remilia Animations/////////////////
//////////////////////////////////////////

#include_function ".\System\variables.txt"
#include_function ".\System\functions.txt"

function RemiAnimations{
if(int(GetSpeedX()) == 0){
SetGraphicRect(0,0,64,83);
f2=0;
}

if(int(GetSpeedX()) > 0){
if(f2<10){SetGraphicRect(0,0,64,83);}
if(f2>=10 && f2<20){SetGraphicRect(64,0,128,83);}
if(f2>=20 && f2<30){SetGraphicRect(128,0,192,83);}
if(f2>=30 && f2<40){SetGraphicRect(64,0,128,83);}
f2++;
}

if(int(GetSpeedX()) < 0){
SetGraphicAngle(180,0,0);
if(f2<10){SetGraphicRect(0,0,64,83);}
if(f2>=10 && f2<20){SetGraphicRect(64,0,128,83);}
if(f2>=20 && f2<30){SetGraphicRect(128,0,192,83);}
if(f2>=30 && f2<40){SetGraphicRect(64,0,128,83);}
f2++;
}
DrawGraphic(GetX, GetY);
}



//////////////////////////////////////////
///////Remilia Backgrounds////////////////
//////////////////////////////////////////

function Backgrounds{
SetTexture(remiBG);
SetRenderState(ALPHA);
SetAlpha(op0);
SetGraphicRect(0,0,256,256);
SetGraphicScale(2.2,2.2);
SetGraphicAngle(0,0,rotate);
DrawGraphic(GetCenterX,GetCenterY);

rotate +=0.35;

if(op0<250){
op0+=250/60;
}
}

I thoroughly checked every coordinates in the rects and in the image, every coordinates seems to be in logic to the image but...  ???


I'll attach the files if you need more info on this. I added the spell script and the non-spell script in case if it is needed.
« Last Edit: January 18, 2014, 06:03:11 AM by SilentYukiro »
"UNYUUU?"

Music is the essence of my soul.
Planned Fan-game: Touhou: Mad Tengu ~ Hellic Memories

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #642 on: January 18, 2014, 06:27:04 AM »
You have no case for f2 >= 40, so your Backgrounds routine sets the drawing rect to 256x256, and in @DrawLoop no other rect is specified, so it stays 256x256.

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

SilentYukiro

  • Silent Soul of the Electronic Skies
  • Clearly a Satori lover :3
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #643 on: January 18, 2014, 06:44:21 AM »
Crap, I mistakenly posted my 3rd or 4th edit of the animations.


Sorry, my bad.  :ohdear:
Here's the original source code for the animations:


Code: [Select]
//////////////////////////////////////////
///////Remilia Animations/////////////////
//////////////////////////////////////////


#include_function ".\System\variables.txt"
#include_function ".\System\functions.txt"


function RemiAnimations{
if(int(GetSpeedX()) == 0){
SetGraphicRect(0,0,64,83);
f2=0;
}


if(int(GetSpeedX()) > 0){
if(f2<10){SetGraphicRect(0,0,64,83);}
if(f2>=10 && f2<30){SetGraphicRect(64,0,128,83);}
if(f2>=30 && f2<50){SetGraphicRect(128,0,192,83);}
if(f2>=50 && f2<60){SetGraphicRect(64,0,128,83);}
f2++;
}


if(int(GetSpeedX()) < 0){
SetGraphicAngle(180,0,0);
if(f2<10){SetGraphicRect(0,0,64,83);}
if(f2>=10 && f2<30){SetGraphicRect(64,0,128,83);}
if(f2>=30 && f2<50){SetGraphicRect(128,0,192,83);}
if(f2>=50 && f2<60){SetGraphicRect(64,0,128,83);}
f2++;
}
DrawGraphic(GetX, GetY);}

This code still shows the same animation problems, a friend of mine told me a solution *refer to the one I posted before* and somehow shows the same results.


BUT.... I tried to create a condition for the variable f2. Here's the solution that I committed:
Code: [Select]
if(f2 == 60){
      f2 = 0;
   }


When f2 reached the value of 60, it resets back to zero which will also lead to go back to Idle mode (I think?  :wat: )

Tested it a few times, and it seems it remedies the problem that I had with the movement animations.  Thanks for reminding me about the missing conditions for f2>=40, something was odd when I re-check the code that I posted before.
"UNYUUU?"

Music is the essence of my soul.
Planned Fan-game: Touhou: Mad Tengu ~ Hellic Memories

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #644 on: January 18, 2014, 08:43:27 AM »
You should approach your code with a logical view and note the variable f2 on how it behaves. That way it makes more sense than just blindly copy/pasting and then trying to figure what went wrong.

Take a look at your own code: if(f2>=50 && f2<60){SetGraphicRect(64,0,128,83);}. This means that "As long f2 is larger than 50 AND f2 is smaller than 60 >> show this graphic"

Ask yourself the logical question, what happens if f2 becomes exactly 60? Scanning your code, it becomes nothing. The program doesn't know what to do with it and therefore applies what Drake said. Get it? This is logic and there is no other reason to it. So you need to tell the program to do something when f2 becomes 60 or more.

This code:
Code: [Select]
if(f2 == 60){  f2 = 0;  }Your friend suggested works but is not how it should be for animating a left or right movement. I don't understand why your friend actually didn't bother explaining it.
What this does is simply reset the f2 variable back to zero once it reaches 60. Because f2 became zero, if(f2<10){SetGraphicRect(0,0,64,83);}  will trigger and display your first sprite in your animation range. "But this works" is what you might say, yes but not as intended. Because Remilia will now be looping her animation range while she keeps moving left or right. It looks as if she is humping herself.

What you want is that the animation runs, then the last sprite (fully bend to the right/left) will be displaying as long as Remilia is moving. That is why in my own tutorial, for the last sprite I put: 
Code: [Select]
if(f2>=50){SetGraphicRect(0,0,64,83);}What this does it properly run through the first 3 sprites then when f2 is 50 or bigger, it will keep displaying her last sprite. No more humping odd looking animation. So how does this reset itself? Well take a look at your own code, you typed it yourself (or copy pasted it).
Code: [Select]
if(int(GetSpeedX()) == 0){
SetGraphicRect(0,0,64,83);
f2=0;
}
Well bloody vampire sucking Remilia, would you look at that. f2 becomes zero and stays zero as long as she doesn't moves. Isn't that great?

Expert suggestion: It would be even more beautiful for you if Remilia didn't suddenly jumped to her idle animation instantly (which happens now) but first wind down on her movement animation. But that is something for the eye to make things look nicer and smoother. Perhaps a future to-do for you.

Hope you learned something about your own code now. Because your friend forgot to explain it to you.

SilentYukiro

  • Silent Soul of the Electronic Skies
  • Clearly a Satori lover :3
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #645 on: January 18, 2014, 11:27:02 AM »
Thanks for the tip Hele-san, sometimes I tend to forget the simplest things in programming logic *programmer problems*

that keeps happening to me no matter what programming language i use and practice on.

I'll keep that tip in mind.
"UNYUUU?"

Music is the essence of my soul.
Planned Fan-game: Touhou: Mad Tengu ~ Hellic Memories

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #646 on: January 22, 2014, 03:38:54 PM »
Well, Player Scripting is kind of hard...

What is wrong with this script? Nothing shows up... The script does run in the game and crashes nothing, but no bullets, no Animation, no bomb, no anything...

Small Teaser of my upcoming project~

No need to call me Teff007. Teff will do just as well~

Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #647 on: January 22, 2014, 06:58:18 PM »
First thing's first, it is never a good idea to just type out a whole script without testing it regularly. You get a situation like this where you've typed out a bunch of stuff but can't even identify where a problem would be or when it started happening, and it's a lot more difficult to fix. Not only that, but even if you fix it, there's no telling whether or not there will be more problems after that. Of course you'll find this hard. Always build in increments.

Comment out basically everything in the script except declaring your player graphic, loading it in @Init, and doing some very simple drawing in @DrawLoop. No animation logic, just draw one image on your position. Get that to work, and slowly start uncommenting things from there to find out where something is broken.

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

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #648 on: January 22, 2014, 10:27:31 PM »
Fun thing is that actually this script I just made a clean version of a older one I had. I don't get why it doesn't work, since the other one works just as fine.

But yeah, I'm kind of rusted regarding programming, so I need to come back into the scene again. I think the problem will be something really simple and here I am making a great fuss about it...
Small Teaser of my upcoming project~

No need to call me Teff007. Teff will do just as well~

Monkeypro257

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #649 on: February 06, 2014, 03:56:18 AM »
I've downloaded The Last Comer onto my Danmakufu script folder, but when I start danmakufu I can't find a way to access it. Am I suppose to check something inside the script folder?

KuroArashi100

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #650 on: February 06, 2014, 06:23:02 AM »
The Last Comer already comes with the Danmakufu files IIRC, so you need to run the .exe file inside with applocale instead of putting it inside your Danmakufu script folder.

Monkeypro257

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #651 on: February 06, 2014, 07:14:43 AM »
The Last Comer already comes with the Danmakufu files IIRC, so you need to run the .exe file inside with applocale instead of putting it inside your Danmakufu script folder.
I'm still not sure what you mean  ??? (I tried, but I only ended of with crashes and how it started.)

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #652 on: February 06, 2014, 07:54:53 AM »
It means that the game you downloaded comes with the full danmakufu folder, including EXE file. This means you shouldn't move any files from the download around into your own Danmakufu folder(s). Instead, you should extract the zip/rar and run the EXE.

Edit:
Scrap that, I downloaded  the game and it doesn't comes with its own EXE folder at all. The readme says to place it inside Script folder. Make sure you use AppLocale to run the game.
« Last Edit: February 06, 2014, 08:17:01 AM by Helepolis »

Monkeypro257

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #653 on: February 06, 2014, 08:06:34 AM »
It didn't have danmakufu with it, just The Last Comer file.

SilentYukiro

  • Silent Soul of the Electronic Skies
  • Clearly a Satori lover :3
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #654 on: February 06, 2014, 08:12:55 AM »
Since I've been exploring effect objects now, and got enough knowledge for it but there is just one thing that I don't know. Well, how do you add collisions to effect objects?


I've been trying to create Utsuho's (Okuu's) Fireballs in her 2nd last spell (the one with 2 giant fireballs). I almost got the results that I want (but not very close to the original).

Here's the code.

And here's an image preview:


Any suggestions or tips to make it like the original? And is using EffectObjects better or should I turn it into an Shot Object?  :wat:

Note: I did make the fireballs spin, I just want to xDDD
"UNYUUU?"

Music is the essence of my soul.
Planned Fan-game: Touhou: Mad Tengu ~ Hellic Memories

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #655 on: February 06, 2014, 08:17:41 AM »
It didn't have danmakufu with it, just The Last Comer file.
Yea, it just contains the folder. See my edit above. Are you using AppLocale?

Since I've been exploring effect objects now, and got enough knowledge for it but there is just one thing that I don't know. Well, how do you add collisions to effect objects?


I've been trying to create Utsuho's (Okuu's) Fireballs in her 2nd last spell (the one with 2 giant fireballs). I almost got the results that I want (but not very close to the original).

Here's the code.

And here's an image preview:


Any suggestions or tips to make it like the original? And is using EffectObjects better or should I turn it into an Shot Object?  :wat:

Note: I did make the fireballs spin, I just want to xDDD
Original used 2 effect objects to create the blazing sun "shot". I think you can keep it perfectly as an effect object, because you'll have easier time to play around with it. And (AFAIK) you'll need to write your own "collision" code since effect objects are square drawn (if you use the simply 4 point vertex). I think a simple trig to detect whether the playerX/Y is within the radius of the "collision" of the sun should trigger a pichuun.
« Last Edit: February 06, 2014, 08:20:31 AM by Helepolis »

SilentYukiro

  • Silent Soul of the Electronic Skies
  • Clearly a Satori lover :3
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #656 on: February 06, 2014, 08:24:52 AM »
And (AFAIK) you'll need to write your own "collision" code since effect objects are square drawn (if you use the simply 4 point vertex). I think a simple trig to detect whether the playerX/Y is within the radius of the "collision" of the sun should trigger a pichuun.

I'm having ideas right now to maybe create 2 dummy scripts that will hold the collisions for the fireballs, and manipulating the collision radius of each dummy scripts. I don't know if that will do the trick.

Not a very bright idea of mine but will that suffice? :ohdear:
"UNYUUU?"

Music is the essence of my soul.
Planned Fan-game: Touhou: Mad Tengu ~ Hellic Memories

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #657 on: February 06, 2014, 08:27:43 AM »
@ Silent, Don't see the reason for the dummy scripts. You can write the collision code inside the effect object while(!Be_Deleted) { } and be done with it in my opinion. And why 2 dummy scripts? The suns have 2 effect objects in ZUN's example because the "brighter" part is the actual hitbox, so you can graze them a little. (Bit comparable to the bullet bubbles).

@ Reptile, I noticed that when you select STAGE, the 2nd and 3rd option are not selectable because they require "Story line". It seems the author preprogrammed them in but you will need the "files" to run them. The first option runs fine. I noticed on the author's website he is offering more downloads for the same game (not version changes). (This if my Japanese isn't failing me)


Drake

  • *
Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #658 on: February 06, 2014, 08:32:07 AM »
Using SetCollisionB() works just as well and triggers a hit rather than killing the player, which people often erroneously do when trying to do manual collision. Obj_SetCollisionToPlayer() also works in some situations but the lack of flexibility is annoying.

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

Monkeypro257

Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
« Reply #659 on: February 06, 2014, 08:48:32 AM »
@ Reptile, I noticed that when you select STAGE, the 2nd and 3rd option are not selectable because they require "Story line". It seems the author preprogrammed them in but you will need the "files" to run them. The first option runs fine. I noticed on the author's website he is offering more downloads for the same game (not version changes). (This if my Japanese isn't failing me)

So do you have any recommendations (links) since I can't select anything for The Last Comer in "Stages" or in "Directory"  on Danmakufu? (Yes, I'm using AppLocal like usual)