Maidens of the Kaleidoscope

~Hakurei Shrine~ => Rika and Nitori's Garage Experiments => Topic started by: Drake on June 06, 2013, 11:12:58 PM

Title: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m [Closed, read last post!]
Post by: Drake on June 06, 2013, 11:12:58 PM
Thread 6: http://www.shrinemaiden.org/forum/index.php/topic,12397.0.html

Ask all Danmakufu 0.12m related questions in here.


Please read the Information sticky (http://www.shrinemaiden.org/forum/index.php/topic,6181.0.html) before posting.
In particular, the various 0.12 tutorials (http://www.shrinemaiden.org/forum/index.php/topic,6181.msg345023.html#msg345023) should be helpful.


Please use pastebin.com (http://pastebin.com) for large blocks of code.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on June 08, 2013, 03:39:06 AM
How do I create bullets that start in a circle, and then all go aimed to the player? Like Cirno in EoSD.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: LadyScarlet on June 08, 2013, 03:53:44 AM
I reinstalled Windows 7 recently, and now I can't run Danmakufu. It crashes whenever I open it up. I've set my computer's locale to Japanese and AppLocale installation failed. Help?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on June 08, 2013, 04:01:14 AM
How do I create bullets that start in a circle, and then all go aimed to the player? Like Cirno.
You only need to manipulate CreateShotA(). You set the bullets up first at the boss position, then at 0 frames you fire them at equal speed and increasing angles to fire them in a circle. At 60 frames (or whatever) you change the speed to 0. At 120 frames you change the speed again, and fire them at the player using some standard aiming. I guess the problem is that you need to know where the bullets will stop in order to measure their position, but that's easily done with the same trigonometry you'd use to spawn the bullets in a circle:
x + speed*cos(angle) and y + speed*sin(angle).
Aiming them at the player you could do with atan2() like atan2(y + speed1*sin(angle) - GetPlayerY, x + speed1*cos(angle) - GetPlayerX).

I reinstalled Windows 7 recently, and now I can't run Danmakufu. It crashes whenever I open it up. I've set my computer's locale to Japanese and AppLocale installation failed. Help?
Did the AppLocale installation fail with "There is a problem with this Windows Installer package"? Did you read this thread (http://www.shrinemaiden.org/forum/index.php/topic,4138.0.html) (linked in the information sticky)? Does DNH crash simply on startup without any message? Please use a bit more detail when asking for technical help.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on June 08, 2013, 04:52:33 AM
How do I create bullets that start in a circle, and then all go aimed to the player? Like Cirno.
You can do what Drake said or use Object bullets which I use.
First spawn the bullets in a circle, which should be the easy part.
In the object bullet task, after a certain amount of time, you should let the bullet stop, usually I use the following to make it smoother:
Code: [Select]
loop(20){ Obj_SetSpeed(obj, Obj_GetSpeed(obj) - 0.1); yield; }Of course this is if the bullets are going at a speed of 2. Change as you need.
Then make the bullet wait another moment and in the moment, change the angle to atan2(Obj_GetY(obj) - GetPlayerY, Obj_GetX(obj) - GetPlayerX );
After that, just add velocity to the bullet and all the bullets should go to the player.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on June 08, 2013, 12:26:01 PM
Qwerty: You really need to explain in more detail what you are trying to do. Cirno has been a boss in 4+ Touhou games.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on June 09, 2013, 12:36:15 AM
EoSD Cirno's opener.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Maths ~Angelic Version~ on June 09, 2013, 09:23:26 AM
How do I create bullets that start in a circle, and then all go aimed to the player? Like Cirno in EoSD.
I assume you mean EoSD Cirno's opener, as Drake said.
Helepolis recreates something similar to it in one of his tutorials (http://www.youtube.com/watch?v=fMBudAKGSlE#t=3m14s).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on June 09, 2013, 11:05:28 AM
Sometimes I wonder why noone uses this method:
Code: [Select]
SetShotDirectionType(PLAYER);
//SetShotDataA code, just set the angle to 0 for the phase to aim at the player.
SetShotDirectionType(ABSOLUTE); //Reset the angle system back to not cause errors later on.
FireShot(ID);
Simple and seems to work fine. This would also apply to using addshot to spawn new bullets aiming at the player from practically any position.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on June 09, 2013, 12:08:50 PM
As far as I know, that one doesn't work when the bullet is not spawned from 0,0 coordinates, which is why you need to use atan2 in order to get the correct angle from bullet to player.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on June 09, 2013, 12:14:32 PM
As far as I know, that one doesn't work when the bullet is not spawned from 0,0 coordinates, which is why you need to use atan2 in order to get the correct angle from bullet to player.
Strange, I have used that method with many different positions and angles and it always worked. On the wiki it says enemy-to-player, but from my tests it seems to work from any position. I may be wrong though.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on June 09, 2013, 03:29:22 PM
Sorry for the late reply, but I have it like this:
Code: [Select]

     while(!Obj_BeDeleted(obj)){
      loop(20){Obj_SetSpeed(obj, Obj_GetSpeed(obj) - 0.1); wait(1);}
      wait(20);
      Obj_SetAngle(obj,atan2(Obj_GetY(obj) - GetPlayerY, Obj_GetX(obj) - GetPlayerX));
      Obj_SetSpeed(obj,3);
     wait(9999999);
   }
Is there something wrong here?
Entire code:
http://pastebin.com/RhmB1Awf (http://pastebin.com/RhmB1Awf)
The bullets are aimed away from the player.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on June 09, 2013, 03:36:21 PM
What.
You're using a while loop for looping action while it's not deleted.
You're yielding everywhere.
Try this instead:
Code: [Select]
     let timer = 0;
     while(!Obj_BeDeleted(obj)){
      if(Obj_GetSpeed(obj)==Minspeed){timer++;} //FIXED

      if(Obj_GetSpeed(obj)>Minspeed && timer==0){Obj_SetSpeed(obj, Obj_GetSpeed(obj) - 0.1);} //FIXED

      if(timer==20){
      Obj_SetAngle(obj,atan2(Obj_GetY(obj) - GetPlayerY, Obj_GetX(obj) - GetPlayerX));
      Obj_SetSpeed(obj,3);}

      yield;
   }
This would atleast be more flexible and work better.

Other than that:
dir+=12.25;
Would be causing a bracket error.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Fujiwara no Mokou on June 09, 2013, 05:23:38 PM
I haven't seen this mentioned, so I think I'll add it.
If you make the deceleration linear, it might not come off as very natural. Another option you can take is have the object slow down gradually as it approaches a certain distance.
Here is some pseudocode I haven't tested yet. It's just to throw an idea.

Code: [Select]
let weight = 32;
let speed = 2;
let distance = 50;
let looper = true;

Obj_SetSpeed( obj, speed );
while( looper && !Obj_BeDeleted( obj ) )
{
    if( distance < weight ){
    Obj_SetSpeed( obj, distance / weight * speed );
    yield;
    }
    distance = distance - Obj_GetSpeed( obj );
    if( Obj_GetSpeed( obj ) < 0.5 ){
    looper = false;
    }
}
Obj_SetSpeed( obj, speed );
Obj_SetAngle( obj, atan2( Obj_GetY( obj ) - GetPlayerY(), Obj_GetX( obj ) - GetPlayerX() ) );
while( !Obj_BeDeleted( obj ) )
{
    yield;
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on June 09, 2013, 05:50:58 PM
Thanks all for the suggestions.
Now I have the decceleration all good, but I'm still having problems with the aiming at the player...it's aiming away from the player.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on June 09, 2013, 06:30:36 PM
Thanks all for the suggestions.
Now I have the decceleration all good, but I'm still having problems with the aiming at the player...it's aiming away from the player.

Code. Please show us the infected code.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on June 09, 2013, 06:46:09 PM
Code. Please show us the infected code.
I did.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on June 09, 2013, 06:53:28 PM
Thanks all for the suggestions.
Now I have the decceleration all good, but I'm still having problems with the aiming at the player...it's aiming away from the player.
What do you mean? If you mean 180 degrees away from the bossplayer, why not just either:
- put +180 degrees to the atan value in obj_setangle.
- switch the getplayercoordinate functions and Obj_getcoordinate functions around in the atan function.

Whoops, typo.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on June 10, 2013, 01:14:06 AM
What do you mean? If you mean 180 degrees away from the boss, why not just either:
- put +180 degrees to the atan value in obj_setangle.
- switch the getplayercoordinate functions and Obj_getcoordinate functions around in the atan function.
It's aiming 180 degrees away from the player.

Like this?
Code: [Select]
      Obj_SetAngle(obj,atan2(Obj_GetY(obj) - GetPlayerY, Obj_GetX(obj) - GetPlayerX)-180);

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on June 10, 2013, 01:34:04 AM
Yeah that would work. Obj_SetAngle(obj, atan2(GetPlayerY - Obj_GetY(obj), GetPlayerX - Obj_GetX(obj))) should suffice as well.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on June 10, 2013, 02:46:54 PM
It worked! C: Thanks all!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on June 15, 2013, 08:25:41 PM
A not-so-quick question!

Basically, I SetCommonData("Boss", 0); in an enemy script. After that, there is a cutin function (Hele's, altered), and an Enemy Setup task.

The enemy setup task, when using GetCommonData("Boss") successfully returns 0.
The cutin task, on the other hand, states that variables of different types are being compared. The error goes away when I change the comparison value to a string. Of course, that's not the value I want to compare to, and so the default goes instead of what I want.

Help?

Cutin:
Code: [Select]
let CSD = GetCurrentScriptDirectory;
    let textdata = CSD ~ ".\..\system\spellcardanm.png";
    if(GetCommonData("Boss")==0 || GetCommonData("Boss")==1 || GetCommonData("Boss")==6){ //Yellow. Pi, Pika, Jolt
      textdata = CSD ~ ".\..\system\ExAttackYellow.png";
    }
Enemy Setup:
Code: [Select]
  if(GetCommonData("Boss")==0 || GetCommonData("Boss")==1 || GetCommonData("Boss")==6){ //Yellow. Pi, Pika, Jolt
    ascent(i in 0..4){ObjEffect_SetVertexColor(objCirc, i, 150, 255, 255, 255);}
  }
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: RegretDesi on June 18, 2013, 06:24:40 AM
I'm planning to make a Touhou fangame called Touhou Kekkannetsu ~ Caliginous Anomaly. The only problem is, I can't get Danmakufu to work correctly, and I don't know any other programs that will help. If I get far enough in the project, I'll release a demo for you.  :V  If anyone could give me some help, either with Danmakufu or finding another program, that would be great.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SacredWind on June 18, 2013, 06:56:03 AM
You need to run Danmakufu with either Japanese locale or Applocale.

(if you already have did that, then post a pic of the error message)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on June 18, 2013, 01:20:15 PM
More information about my bug: It only occurs when using Spell Practice. It does not occur when the spell is read from a Plural file or Stage file.

EDIT: Bug fixed

So apparently, if you use CommonData, the initial value of any CommonData is set to a string.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on June 18, 2013, 06:49:17 PM
Why not use GetCommonDataDefault(), or set defaults to all of your common data on initialization?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on June 18, 2013, 07:09:37 PM
How do I make custom STG Frames?

Like CtC's STG Frame.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on June 18, 2013, 07:24:08 PM
-Make image
-Name it STG_Frame.png
-Make an img folder in the DNH root folder
-Plop image in folder

Or you can make an effect and draw it every frame but bleh.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on June 18, 2013, 10:44:26 PM
How do I make custom STG Frames?

Like CtC's STG Frame.

640*480. If 0.12m, black will be treated as transparent, so make sure that you leave the playing field open or black.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on June 19, 2013, 05:52:32 PM
Thanks Sparen and Drake!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on June 19, 2013, 08:11:57 PM
You're very welcome.

Also: Drake, you may want to directly link the list of tutorials to the first post.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on June 20, 2013, 01:19:07 AM
good idea
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on June 25, 2013, 11:08:21 AM
I was following Helepolis tutorial on animating bosses, and I think that I copied everything correctly.
However, everytime Cirno moves, the picture duplicates over the whole screen.
What causes this? And in his tutorial, he remedied this by changing a few lines.
However, when I change these lines, it keeps happening.
I posted it on pastebin so if anyone wants to look at it and tell me what I'm doing wrong, I would be very grateful.
http://pastebin.com/3b2JLug1
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on June 25, 2013, 12:52:11 PM
I was following Helepolis tutorial on animating bosses, and I think that I copied everything correctly.
However, everytime Cirno moves, the picture duplicates over the whole screen.
What causes this? And in his tutorial, he remedied this by changing a few lines.
However, when I change these lines, it keeps happening.
I posted it on pastebin so if anyone wants to look at it and tell me what I'm doing wrong, I would be very grateful.
http://pastebin.com/3b2JLug1

First, set a default SetGraphicRect. I had this problem before.

I don't actually know if it'll work, but adding a default SetGraphicRect outside the if statements makes it easier to debug anyway.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on June 25, 2013, 02:16:27 PM
That made it work correctly.
Thanks a lot!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on June 25, 2013, 02:47:13 PM
You're welcome.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on June 26, 2013, 11:35:35 PM
http://pastebin.com/FTLerGzr (http://pastebin.com/FTLerGzr)
This code gives me an error message that says: "wait,(Japanese stuff)"
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on June 26, 2013, 11:52:42 PM
http://pastebin.com/FTLerGzr (http://pastebin.com/FTLerGzr)
This code gives me an error message that says: "wait,(Japanese stuff)"

Your code was very messy so I had to spend a few minutes tabbing everything properly... ^^; You had several mismatched brackets throughout the script, one of them which actually closed script_enemy_main after a wait call, which caused the wait function to appear as undefined for Danmakufu. Either way, this should work: http://pastebin.com/GXvLUa0B
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on June 27, 2013, 12:01:05 AM
Your code was very messy so I had to spend a few minutes tabbing everything properly... ^^; You had several mismatched brackets throughout the script, one of them which actually closed script_enemy_main after a wait call, which caused the wait function to appear as undefined for Danmakufu. Either way, this should work: http://pastebin.com/GXvLUa0B (http://pastebin.com/GXvLUa0B)
Oops, thank you! C:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on June 27, 2013, 12:47:21 AM
Qwerty: This exists for a reason: https://sites.google.com/site/sparensdanmakufututorials/dnh-0-12m-tutorials-part-3/014-intro-to-danmakufu-part-4 (https://sites.google.com/site/sparensdanmakufututorials/dnh-0-12m-tutorials-part-3/014-intro-to-danmakufu-part-4)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on June 27, 2013, 02:33:32 AM
Qwerty: This exists for a reason: https://sites.google.com/site/sparensdanmakufututorials/dnh-0-12m-tutorials-part-3/014-intro-to-danmakufu-part-4 (https://sites.google.com/site/sparensdanmakufututorials/dnh-0-12m-tutorials-part-3/014-intro-to-danmakufu-part-4)
I knew what the error meant, and I checked it over but could'nt find where the extra bracket was
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on June 27, 2013, 05:47:45 AM
I knew what the error meant, and I checked it over but could'nt find where the extra bracket was
Is there a line message? Usually you get a line message when it throws you an error with ) or }. (Unless it is a Script_enemy_main) . Try to keep that in mind when you run into such errors again.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on June 27, 2013, 08:34:26 AM
How do I make CreateLaserA shots disappear?
I was making a spellcard with bullets coming in from the side using CreateShot01, which works like I wanted to,
and a with a laser fired every 1.5 second to force people to move instead of only dodging up/down.
However, currently I'm getting sniped by lasers that won't disappear trapping me.
The code for @MainLoop currently looks like this:
Code: [Select]
@MainLoop{
SetCollisionA(GetX,GetY,32);
SetCollisionB(GetX,GetY,16);


if(time==90){
CreateLaserA(1,GetEnemyX,GetEnemyY,500,20,BLUE01,60);
SetLaserDataA(1,0,GetAngleToPlayer,0,0,0,0);
FireShot(1);
time = 0;
yield;
}

time++;

yield;
}

So how do I make it disappear after a while?
I've already tried making it shrink, but then it appears on the other side, which looks pretty ugly.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on June 27, 2013, 09:12:09 AM
Ah, you have to use SetShotKillTime for that (if I am not mistaken)~
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on June 27, 2013, 09:23:36 AM
Warning - while you were reading a new reply has been posted. You may wish to review your post.

Shadow is correct.

Mandatory, It is all written on the wiki as well you know, for controlling most things. http://dmf.shrinemaiden.org/wiki/Bullet_Control_Functions_%280.12m%29#SetShotKillTime



Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on June 27, 2013, 11:14:38 AM

Ah, you have to use SetShotKillTime for that (if I am not mistaken)~

Thanks for helping! It works now.


Mandatory, It is all written on the wiki as well you know, for controlling most things. http://dmf.shrinemaiden.org/wiki/Bullet_Control_Functions_%280.12m%29#SetShotKillTime


I am currently still figuring out how exactly Danmakufu works. (If I spawn a circle of bullets with CreateShotA what happens if I put a yield; at different places? etc.)
Because the bullets always left the screen , I didn't use it, and I didn't remember it.
When I looked at the wiki, I kept looking at the Create- and SetShotData parts, and there being another function made for that completely slipped my mind.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on June 27, 2013, 01:00:32 PM
In that case welcome :)

In that case, keep in mind that Yield won't stop your bullets. Actually it has nothing to do with the bullets. Yield is used when you're using tasks and functions. You can read about these more in the tutorials in the great information thread: http://www.shrinemaiden.org/forum/index.php/topic,6181.0.html

Lots of useful info in there from tutorials to explanations to examples. Logically, if you have questions: feel free to ask them here.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on June 29, 2013, 02:49:59 PM

In that case, keep in mind that Yield won't stop your bullets. Actually it has nothing to do with the bullets. Yield is used when you're using tasks and functions.


In this example, I was using the script you made in the video tutorial about CreateShotA bullets, where putting Yield in different places would spawn the bullets all at once or one by one.

Also I have another question:
I was trying to make a lookalike spellcard to Yamame's Miasma Sign "Filled Miasma".
I made a spiral that expands slowly like in her spellcard, and it stops once it has reached a certain size, but my question is:
How do I delay the bullets from firing so I can fire them closer to each other?
My current code is the following:
Code: [Select]
task fire{
let dir = 0;

loop{
dir+=360/rand(20,50);
radius+=0.15;
CreateShotA(1,GetEnemyX+radius*cos(dir),GetEnemyY+radius*sin(dir),30);
SetShotDataA(1,0,0,dir,0,0,0,BLUE12);
SetShotDataA(1,270,3,dir,0,0,2,BLUE12);
FireShot(1);
yield;

}

}
radius is defined at the start of the script, because it is reset in @MainLoop.
So is there any way to delay the earlier created shots from firing until the later ones are created?
EDIT: Other than making two different CreateShotA's which start moving at different times?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on June 29, 2013, 05:19:46 PM
I usually like to create a variable called delay.
The delay should start at the very high number, and should decrease by the value of the waits. Since you seem to only have a yield, it should decrease by one after each loop.
But the variable should only have about 30~60 frames left after spawning the last bullet.
The variable should be placed in the second SetPositionA, on the frames to activate.
And shouldn't you stop the spawning at one point, they look like it goes on forever with the infinite loop.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on June 29, 2013, 09:11:11 PM
So this delay variable should be equal to something like spawning time+some extra time?
I haven't read/watched more than some of Helepolis's videos and the basic tutorial.
Tasks weren't featured in them, but I did notice, that if I put a number in the loop, it would only execute once.
And since I currently don't know enough about writing scripts to change this, I just keep it like this because it works.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on June 29, 2013, 09:23:57 PM
The delay variable should be this:
(Bullets*[Value of the waiting])+(30~60) = Delay value
It basically is like a formula.
So, if I had 20 bullets with a 5 frame waiting in between each bullet, and I want to wait 30 frames after the last bullet is spawned, before making them move, the formula is now:
(20*5)+30=130 frames

Putting a number in parentheses after a loop makes that loop activate that number of times.
Code: [Select]
loop(20){Loops the code inside 20 times, before moving on.
Code: [Select]
loop{This makes the loop infinite and it will never move on unless the script has ended.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on June 30, 2013, 03:16:58 PM
So this delay variable should be equal to something like spawning time+some extra time?
I haven't read/watched more than some of Helepolis's videos and the basic tutorial.
Tasks weren't featured in them, but I did notice, that if I put a number in the loop, it would only execute once.
And since I currently don't know enough about writing scripts to change this, I just keep it like this because it works.
You should remember that the @MainLoop style scripting and task-based scripting are two different things. My video tutorials specifically approach the task-based method. From your first post on this page (http://www.shrinemaiden.org/forum/index.php/topic,14911.msg991235.html#msg991235), I assumed you were @MainLoop style scripting.

You should first decide for yourself which method you want to apply because based on that we can easier help you out achieving things. Right now it looks like you're a bouncing ball, approaching things randomly.

Edit:
Example of showing two styles roughly. I know there are better examples for MainLoop but this is at most basic beginner level.
Code: [Select]
let frame = 0;

@MainLoop {
if(frame == 60) { CreateShot01(etc...); } // if frame has reached 60, fire.
frame++; // keep increasing frame by 1 each loop
if(frame == 60) { frame = 0; } // if frame has reached 60, reset it to 0.
}

MainLoop style scripting
-------------------------------------------------------------------------------------------
Task-based scripting

@Initialize {
fire; // launch task fire.
}

@MainLoop {
yield; // required to make the engine "look for" other tasks to perform
}

function wait(w) { loop(w) { yield; } } // a function to "hold" the task/action.

task fire {
loop {
CreateShot01(etc...); // fire
wait(60); // "hold" for 60 frames (1second) before looping.
}
}

The above does require "sense" of understanding what is going on. Just adapting a style isn't enough if you don't understand why you would pick or do it like this. While tasking method looks overwhelming, personally, I find it more flexible and keeping the overview.

Function wait is nothing more than a "tool" to provide a number for the number of frames you want to "delay/hold" something. You're telling the engine to stop that specific task/action for x-number of frames. 60 frames equals 1 second if your game runs stable. You could do wait(120); for shooting every 2 seconds. You could do wait(30); for firing every 0.5 seconds.

You spoke of "firing everything at once" and "firing one by one". Let me show you simple example of this in tasking method.

Code: [Select]
task fire {
loop(10) {
CreateShot01(etc...);
}
}

task fire {
loop(10) {
CreateShot01(etc...);
wait(10);
}
}

See the difference? In the first one all bullets are fire immediately, making it look as if it is only one bullet. False, there are 10 bullets but just on top of each other because we provided no delay. Second one, however, has wait(10) added, meaning it will play the loop 10x with with a 10-frame delay. Now we can clearly note the loop being executed 10x.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on June 30, 2013, 05:57:52 PM
Pretty much what Hele said and personally, tasking is most flexible.

To do the delay for setshotdata, you would either use a variable for the bullet loop which resets once the loop ends or, as I would do, utilize the variable that comes with using ascent loops. For the delay value, a set value decreasing after each shot would do the trick. If the decreasing value is equal to the delay between each shot, they would all activate at once. Example:
Code: [Select]
task fire{
loop{
wait(200);
ascent(var in 0..20){
wait(3);
ascent(i in 0..4){
//setshotdata code using something like;
//100-var*3 for the activation time
}}

}}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on June 30, 2013, 07:47:31 PM
Thanks for the help with the bullet delaying!
I'm still trying to get used to Danmakufu, (and I have, except for some very simple  visual basic scripts, no experience with programming languages)
so every bit of help is greatly appreciated.
In the same way, I'm still trying out both methods of scripting, and I haven't really chosen for one of them yet.
For instance, the only spellcard I have currently tried to make, uses both methods:

http://pastebin.com/CegDWB41

For some reason, when I wanted to change something, the bullets that should show up at the sides didn't appear.(These where scripted in the fire task)
I wasn't able of making a spellcard from scratch, so a lot of the code is copied from Helepolis's video tutorials.
I cannot figure out what causes the bullets not to appear, so could anyone help me with this?
Also I'm sorry for asking so many questions, of which at least one could have been solved with a little more thinking from me instead of asking for help relatively quickly.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on June 30, 2013, 08:15:30 PM
That would be because there is no yield in your MainLoop, there. Remember that tasking requires for a yield to exist there, otherwise nothing will work correctly~
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on June 30, 2013, 08:16:01 PM
That would be because there is no yield in your MainLoop, there. Remember that tasking requires for a yield to exist there, otherwise nothing will work correctly~

More specifically, no tasks will work if there is no yield; in @MainLoop
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: ScarletKing on July 12, 2013, 01:54:57 AM
http://pastebin.com/b8dshugx

based on that script, after the bullet make a rotation and go in again.. how to make the bullet multiplicate itself ?

Thank You
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Validon98 on July 12, 2013, 03:18:14 AM
I'm not a mod or anything, but, uh, wrong subforum. You'd want to ask in Rika and Nitori's Garage Experiments. They have a thread for questions on Danmakufu.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TresserT on July 12, 2013, 07:16:47 PM
Hi. I'm Tres.

I can load danmakufu and play scripts without problems, but whenever I complete a script the system will crash. I've never used v 0.12 very extensively, but I'm pretty sure this isn't supposed to happen. The system will crash after I beat a spell card, die, or whenever a coding error occurs. Any time I would normally be redirected to the script choice page (at least, I assume that's where I'd be redirected. That's how it works in ph3 ^^). I'm running the latest version of 0.12 (東方弾幕風 v0.12m(約4000kB)) using Applocale. The problem occurs with every script I've tried, including the built in ones (Ex Rumia). With plural scripts, I can complete individual spellcards but the system crashes once the entire script is complete. I've tried re-downloading danmakufu from a different source, but that doesn't seem to help either.

Any help would be much appreciated. Thank you in advance.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on July 12, 2013, 08:19:30 PM
http://pastebin.com/b8dshugx

based on that script, after the bullet make a rotation and go in again.. how to make the bullet multiplicate itself ?

Thank You

Short answer: create another ID bullet with CreateShotA and then use AddShot to fire it with the ID1 bullet.

Yes, this should be moved to the danmakufu 0.12m ask thread on rika nitoris. Answers won't really be found here, but in the ask thread there's lots of people willing to help with questions about scripting.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: メイフィールド on July 12, 2013, 08:20:49 PM
Hi. I'm Tres.

I can load danmakufu and play scripts without problems, but whenever I complete a script the system will crash. I've never used v 0.12 very extensively, but I'm pretty sure this isn't supposed to happen. The system will crash after I beat a spell card, die, or whenever a coding error occurs. Any time I would normally be redirected to the script choice page (at least, I assume that's where I'd be redirected. That's how it works in ph3 ^^). I'm running the latest version of 0.12 (東方弾幕風 v0.12m(約4000kB)) using Applocale. The problem occurs with every script I've tried, including the built in ones (Ex Rumia). With plural scripts, I can complete individual spellcards but the system crashes once the entire script is complete. I've tried re-downloading danmakufu from a different source, but that doesn't seem to help either.

Any help would be much appreciated. Thank you in advance.

Does the message appear thet touhou danmakufu crashed and have to be closed ,
or does an intern message of danmakufu appear (which would be strange)?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on July 12, 2013, 09:09:51 PM
TresserT:

Operating System:
RAM and RAM Type:
Microprocessor:

Also, does it give a crash message when crashing?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TresserT on July 12, 2013, 09:41:16 PM
Operating System: Microsoft Windows XP
RAM: 1014
RAM Type: DDR2
Microprocessor:  Intel Pentium 4 521

I get a generic Microsoft crash report window. The error report thing.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 12, 2013, 10:01:36 PM
I am not quite sure Sparen why you're asking system hardware, since he is getting software crash related to Danmakufu. He is also capable of actually playing the game so even more odd reason to involve hardware here yet.

Either way TresserT, assuming you are using AppLocal when playing? The common display upon completing spellcard/plural or what ever is "Save replay yes/no" or message saying no replay can be saved. Almost sounds like your game is choking somewhere here. I also assume you're seeing the boss explode/disappear and right after that before the classic "zoom out" effect you get the crash?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TresserT on July 12, 2013, 10:26:29 PM
I am using AppLocale and I made sure the settings match those in the AppLocale configuration thread.

What you say is exactly what's happening. The boss explodes, but I don't get any further than that. I don't get to the "Save replay" or anything. I can get back to the main screen if I pause and hit the main menu option, but finishing the script kills it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on July 12, 2013, 10:31:03 PM
I asked about system hardware b/c of RAM. Then again, it's only been a problem for a few people, but lack of ram has been the cause for DNH crashing for a number of people I know.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 13, 2013, 02:15:10 AM
I am using AppLocale and I made sure the settings match those in the AppLocale configuration thread.

What you say is exactly what's happening. The boss explodes, but I don't get any further than that. I don't get to the "Save replay" or anything. I can get back to the main screen if I pause and hit the main menu option, but finishing the script kills it.
Right, now that is what I was afraid of. We narrowed it down to the location of crash though what would make it crash at exactly that moment? I removed few system files from dnh root outside to see if there were any dependants, but none I could detect. You also mentioned you redownloaded Danmakufu so we can assume your archive is ok as well?

Do you have the possibility to run your current Danmakufu on a different computer/laptop? That way we can perhaps discover whether it is truly dnh or your system.


Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TresserT on July 13, 2013, 04:24:18 AM
Hm... I have another computer I can use, but it'll take about a week before I have access to it. So I guess I'll just work around it for now, then ask again later. Thanks.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 13, 2013, 08:43:31 AM
Hm... I have another computer I can use, but it'll take about a week before I have access to it. So I guess I'll just work around it for now, then ask again later. Thanks.
Week to access? Sounds almost like it is not your computer but at school or something :V

All right, well please have us informed how that worked out. Because this is though a very odd error we've been hearing about first time I think. So would be good source as troubleshooting for the future.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on July 13, 2013, 09:25:11 AM
Maybe, they on vacation, brought a laptop and left a computer at home. I'm doing that right now.
But, hearing this problem, I feel like I've dealt with this before. Not sure if I know how to solve it though.  :V
Have you tried to change your computer's locale to Japanese? Applocale can cause some problems. I changed my whole computer to Japanese, but only because Applocale wouldn't load anymore. It loaded nothing.
Switching your computer's locale, doesn't make a big difference. You can still browse the internet and play games in English.
If this doesn't work, it sounds like the explosion is causing the problem. Maybe too much processing power needed for that?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TresserT on July 13, 2013, 06:40:34 PM
Setting system to Japanese didn't help. I don't know enough about the system to say whether or not it's the explosion causing the problem, but I will say that the explosion animation is always completed before the crash error. Um... there's something else but I don't know how to describe it. So I'll just post a screenshot.
(http://i.imgur.com/gy0gd15.png)
The character sprite and items remain on screen, but the background disappears and is replaced with the same pattern as the side...menu...thing.

I'd like to note that I've never used this version of danmakufu, so I don't know what's the norm and what's actually part of the problem. I can only judge based on what I know ph3 does.  :blush:  And it's my cousin's computer that I'll be able to get to in a week, just in case you were wondering.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 13, 2013, 10:27:16 PM
I'd like to note that I've never used this version of danmakufu,
You have the latest version, shouldn't be the issue. That is the background for the save/ending screen if I am not mistaking.

Are you able to upload your package of 0.12m as it is to us? Just curious to test out on my computer.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on July 15, 2013, 06:46:56 PM
I have a few more questions because I suck at figuring things out. :V

What is the difference between
 
Code: [Select]
loop{
               loop(number){

               }

}
and
Code: [Select]
loop{
              while(x<number){

              }

}
?

How do I make aimed lines of bullets like Mokou fires (from herself) in "Hourai Doll"?

Can if statements be used inside Object Bullets?

How can I make a spellcard more difficult as time passes? (Like most survival cards)

Also, the 0.12 version of Danmakufu downloaded from the link on the Danmakufu wiki crashes as soon as I start it up.(while using applocale)
I'm currently using the version that I found in CtC's data files which works fine, but is there a fix for this? (This question probably has been asked before, but I can't find anything).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on July 15, 2013, 07:37:51 PM
*text*
1. The first one just repeats the action inside the brackets the number of times defined as "number".

The second one repeats the action as long as the variable x is lower than the variable "number".

BONUS: (:V) ascent(x in 0..5){  }
Repeats the action in the brackets, in this case (5-0=5) times. A variable is created as the ascent loop starts with the name "x" which gets the values 0, 1, 2, 3 and 4 (in this case when we got "0..5") for each time it repeats. The variable only exists inside the ascent loop.

2. If you use task, use the wait function as well
( function wait(w){loop(w){yield;}} )
Create a variable called setangle or something and do something like this in your task:
Code: [Select]
wait(180); //3 seconds.
setangle = GetAngleToPlayer;
loop(10){ //10-bullet line
//Insert bullet code here.
//Use setangle as the angle.
wait(3);
//smaller delay of 3 frames
//between each bullet.
}

3. Yes, I don't see why not.

4. I would use a task which yields; as long as the timer is too high. Once it goes past the yielding "while" loop, you can set a variable named phase1, phase2 etc. from false to true or 0 to 1. Once this variable becomes true or 1, the task used to fire bullets could be more difficult.

5. Never happened to me. ???
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 15, 2013, 07:50:43 PM
I noticed that all fangames from Danmakufu(or atleast the ones I've seen) operate like a official Touhou game, a menu screen, difficulty select, story, ect..., and with games like MPP the danmakufu part (where you select the scripts) is gone.

I want my project like that but I've been working with Danmakufu for only a few days now so I have no knowledge of how to create menu screens and transitions for stages. Can anyone help me on doing so?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: gtbot on July 15, 2013, 08:40:31 PM
and with games like MPP the danmakufu part (where you select the scripts) is gone.
This is a feature of ph3, where with a definition file, you can make danmakufu run a package script immediately upon startup, along with setting the name and size of the window.

Since you just started a few days ago, perhaps it is not best to jump straight into making a full game, but to instead start small, with a Single script or Plural.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 15, 2013, 08:49:27 PM
Another one who wants to create a fangame? I feel the same. I'm currently working in the characters (I just have the Stage 1 boss :V).

To make a fangame, you shouldn't go inmediately to the "eye'm gonna create dem menuz and stagez!" part. You should start by reading every tutorial (Basics to learn to make spellcards and learn about bullet and laser types, Intermediate to learn about complex patterns, boss fights, stages, boss movement and MP3 files, Advanced to learn stuff I can't figure out, such as libraries and other things)

The guys who made fangames such as Last Comer and Mystical Power Plant didn't start magically by making menus, they started like everyone. Reading tutorials, trying tutorials by themselves.

You'll need to learn lots of Danmakufu before going to menu screens and stages.

That's all I had to say.

PS: I can't find a menu screen script right now... nor a stage transition one. I'll have to search further.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 15, 2013, 09:01:43 PM
I cannot agree more with gtbot and Yamamoto. It is never wrong to set a goal such as a fan game, but remember to work towards it. I myself started with simple Marisa spell card imitations, into a plural script, into a single boss fight and now working on my own fangame for ages. Step by step, that is my advice  :)

There is nothing wrong experimenting time to time with menus, even if you don't have your full game yet. Exploring all the functions and tricks is the path of learning. Sometimes, doing minor side-scripting can be quite refreshing before you return to your main work.

Finally, Like gtbot said, 0.12m has no menus. Menus in 0.12m are "optical illusions" by using effect objects to give you the impression of a full menu. This requires some clever scripting and effect object usage. (See CtC or other large completed games like Puremrz / Azure's work). Only ph3 gives you the advantage of menus such as the original games. If you really want to benefit of these advantages, and are relatively new to Danmakufu I would suggest ph3 over 0.12m. We might be lacking tutorials right now, but we have good number of community members who are quite experienced in ph3. Also roughly the structures are similar in their use.

If you study objects, tasking, functions and micro-threads from the 0.12m tutorials, you'll have a good base and kick start for Ph3.



Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 15, 2013, 09:06:48 PM
Another one who wants to create a fangame? I feel the same. I'm currently working in the characters (I just have the Stage 1 boss :V).

To make a fangame, you shouldn't go inmediately to the "eye'm gonna create dem menuz and stagez!" part. You should start by reading every tutorial (Basics to learn to make spellcards and learn about bullet and laser types, Intermediate to learn about complex patterns, boss fights, stages, boss movement and MP3 files, Advanced to learn stuff I can't figure out, such as libraries and other things)

The guys who made fangames such as Last Comer and Mystical Power Plant didn't start magically by making menus, they started like everyone. Reading tutorials, trying tutorials by themselves.

You'll need to learn lots of Danmakufu before going to menu screens and stages.

That's all I had to say.

PS: I can't find a menu screen script right now... nor a stage transition one. I'll have to search further.

I know I won't be able to make a fangame right now but I like starting things from the ground up. And having a menu screen and stuff like that is like the basics to me. But yeah I've been back and forth reading the guides so I'll definitely keep going.

This is a feature of ph3, where with a definition file, you can make danmakufu run a package script immediately upon startup, along with setting the name and size of the window.

Since you just started a few days ago, perhaps it is not best to jump straight into making a full game, but to instead start small, with a Single script or Plural.

Oh so that's why it runs straight into the game.

 
I cannot agree more with gtbot and Yamamoto. It is never wrong to set a goal such as a fan game, but remember to work towards it. I myself started with simple Marisa spell card imitations, into a plural script, into a single boss fight and now working on my own fangame for ages. Step by step, that is my advice  :)

There is nothing wrong experimenting time to time with menus, even if you don't have your full game yet. Exploring all the functions and tricks is the path of learning. Sometimes, doing minor side-scripting can be quite refreshing before you return to your main work.

Finally, Like gtbot said, 0.12m has no menus. Menus in 0.12m are "optical illusions" by using effect objects to give you the impression of a full menu. This requires some clever scripting and effect object usage. (See CtC or other large completed games like Puremrz / Azure's work). Only ph3 gives you the advantage of menus such as the original games. If you really want to benefit of these advantages, and are relatively new to Danmakufu I would suggest ph3 over 0.12m. We might be lacking tutorials right now, but we have good number of community members who are quite experienced in ph3. Also roughly the structures are similar in their use.

If you study objects, tasking, functions and micro-threads from the 0.12m tutorials, you'll have a good base and kick start for Ph3.

Ok thanks.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on July 15, 2013, 09:40:16 PM
1. The first one just repeats the action inside the brackets the number of times defined as "number".

The second one repeats the action as long as the variable x is lower than the variable "number".

3. Yes, I don't see why not.

Thanks for helping!
But I guess I asked a few wrong questions wrong :(
So, let me re-ask them:
1. If using "loop(y)" and "while(x<y)"{bullet information and y++;} inside a task, is there a difference gameplay-wise?
I did know about "ascent" and "descent" loops. I also had a recent problem with a script that used them, so I'll just ask that now too :V:
Code: [Select]
task fire{
loop{
CreateShotA(0,GetEnemyX,GetEnemyY,30);
SetShotDataA(0,0,5,GetAngleToPlayer,0,0,4,231);

CreateShotA(1,GetEnemyX,GetEnemyY,30);
SetShotDataA(1,0,5,GetAngleToPlayer+45,0,0,4,231);

CreateShotA(2,GetEnemyX,GetEnemyY,30);
SetShotDataA(2,0,5,GetAngleToPlayer-45,0,0,4,231);

ascent(i in 1..25){
CreateShotA(3,GetEnemyX,GetEnemyY,15);
SetShotDataA(3,0,0,0,0,0,0,YELLOW05);
SetShotDataA(3,60,rand(1,3),rand(0,359),0,0,1,177);

CreateShotA(4,GetEnemyX,GetEnemyY,15);
SetShotDataA(4,0,0,0,0,0,0,YELLOW05);
SetShotDataA(4,60,rand(1,3),rand(0,359),0,0,1,177);

CreateShotA(5,GetEnemyX,GetEnemyY,15);
SetShotDataA(5,0,0,0,0,0,0,YELLOW05);
SetShotDataA(5,60,rand(1,3),rand(0,359),0,0,1,177);

AddShot(i*2.88,0,3,0);
AddShot(i*2.88,1,4,0);
AddShot(i*2.88,2,5,0);
}

FireShot(0);
FireShot(1);
FireShot(2);

wait(60);
}
}
The nonspell is supposed to fire three bullets at the player and 2 at the sides, which leave dot bullets behind, which scatter randomly after a short wait.
The dot bullets spawn starting from the right bottom corner, and I don't know what I did wrong, so can somebody help me with this?

3. What I did wrong, is that I assumed that you knew what exactly was going on in the script. Since you haven't seen it, you probably don't know. Unless you have acces to my computer of course. :)
The code that I used was this:
Code: [Select]
task  (parameters)
obj bullet
while(!Obj_BeDeleted){
code telling the bullet to move up and then go down starting at the bottom of the screen.
}
if (Obj_GetY == GetClipMaxY){
Obj_SetSpeed(obj,0);
}
But when I tested it, the bullets would disappear from the bottom of the screen.
In this example, I could did it by calculating the distance to the bottom of the screen(the bullets always were in the same place)
And timing it the right way. But when ? tried it using if statements, it didn't work.

EDIT:
If I want to play music in plural scripts, do I just put the bgm for each spellcard at the beginning?
And do I need to do it for each spellcard? And does it matter if you do one with Load/PlayMusic and the other with #BGM[]?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on July 15, 2013, 11:57:33 PM
1. Dependant on what you do with x and y. I'm not quite sure what you want here.

2. It seems like you have put getenemyX/Y for the IDshots which are the "trailbullets". To not cause problems, they should just have x and y positions as 0 and 0.
I don't really see either why you would manually create 3 mastershots when you could use another ascentloop which loops everything 3 times and just put the angle as something like GetAngleToPlayer+l*45 if we would have an ascentloop like ascent (l in -1..2){ }

3. I can see 3 errors in your script:
- The "if" code is outside of the while loop, so it won't work.
- The bullet ID is missing here (?)
- Obviously, bullets moving downwards with a speed higher than 1 would have a high chance of not being detected at GetClipMaxY as the bullet would skip over it. Using if(Obj_GetY(ID)>=GetClipMaxY) would probably fix this.

4. I'm not too sure, but I think #BGM is only active when you start the script. So for a plural, it would probably be best to use the #BGM in the plural file for what you want to play at the beginning and use Load/PlayBGM for if you want to change the music in the middle of the plural script. The #BGM in the spellcard files probably won't affect the plural scripts music.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 16, 2013, 06:43:51 PM
I'm working in a little script, but the Event won't load.
http://pastebin.com/wFkR8bjV (http://pastebin.com/wFkR8bjV)

What's wrong?

yes, my script features Keanu Reeves :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 16, 2013, 09:20:55 PM
I'm working in a little script, but the Event won't load.
http://pastebin.com/wFkR8bjV (http://pastebin.com/wFkR8bjV)

What's wrong?

yes, my script features Keanu Reeves :V
Hard to tell, we cannot see your event script, since you're loading it from a file. Can you pastebin that as well please? Also please specify what you mean with "Not loading", I assume nothing happens at all and the boss goes straight to shooting/main script? Errors?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 16, 2013, 09:28:15 PM
http://pastebin.com/wRRz0Ls6 (http://pastebin.com/wRRz0Ls6)

I think there's something wrong but I can't figure out what.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on July 16, 2013, 09:40:31 PM
http://pastebin.com/wRRz0Ls6 (http://pastebin.com/wRRz0Ls6)

I think there's something wrong but I can't figure out what.

The following lines are missing semicolons:

16, 24, 30

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 16, 2013, 09:47:41 PM
D'oh.

Thanks.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 16, 2013, 09:48:46 PM
There is all sorts of things wrong with your script. CreateEventFromScript is wrong declared. You're calling an event, you need to nest the event script inside your spell card/boss. I don't remember EventFromFile existing.

Like Sparen pointed out, you're missing semicolons. But also a critical  } in your event script (closing the actual event).

Edit: You're also having lots of colons, instead of semicolons to close each line. Please run over them carefully. 

This is working: http://pastebin.com/Wu6HgNGk  (fixed version so you can compare. IMO, don't just copy/paste it over but try to solve your own errors first and compare)

Edit 2: Also next time please clarify what you're exactly experiencing. The script threw an obvious error. It is really hard to help you if you don't specify exactly what is going on. Just posting script -> "It doesn't work" isn't helping us either =/

Edit 3: (so many edits). With a small talk on IRC regarding Event scripts (Thanks KimoKeine) . Yes, you can separate them from your script but you need to #include the script in order to make Danmakufu recognize it.

Code: [Select]
#include_script "script\Yamamotos\talk.txt"
@Initialize {
CreateEventFromScript("test");
}

With this method, you don't have to nest your event in one file. You could also put multiple events as far as I know in talk.txt and call them by their respective names. As long as you include the script, all is fine.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 16, 2013, 10:07:27 PM
Thanks Helepolis.

I'll try not just to copypaste the next time.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TresserT on July 17, 2013, 06:18:50 AM
Okay, I tried danmakufu on my cousin's computer and I'm still getting the exact same problem.
Here (http://www.mediafire.com/download/9sbyj3gxnwhsb3b/th_dnh.zip) is the .rar I'm getting it from, the same one from the wiki. Any help would be appreciated. Thank you!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on July 17, 2013, 06:42:19 AM
Missing a config.dat file. Just run config.exe and hit OK. Should be good after that.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 17, 2013, 06:44:22 AM
Odd, ran here with AppLocal on my laptop -> Exrumia boss -> Boss dies -> Clear shows -> no errors/crashes. No matter which script I select/player.

Drake could be right, try to spawn a config first and retry.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 17, 2013, 05:17:11 PM
I noticed that the spell card bonus never matches what I put in the script. If I put SetScore(1);  in Danmakufu the bonus will be 2 points.

I want the score to be 1,100,000 but it always end up being alot more than that.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TresserT on July 17, 2013, 06:47:05 PM
Missing a config.dat file. Just run config.exe and hit OK. Should be good after that.

Well don't I feel dumb. That fixed it, many, many thanks.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 17, 2013, 07:30:10 PM
Also, how would I make an attack in which bullets come from all sides of the screen?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 17, 2013, 07:54:00 PM
Also, how would I make an attack in which bullets come from all sides of the screen?
I am not sure about your previous question, but to realise this you might want to first decide how many bullets you want to spawn. Like if you have 10 bullets from each side, you need to take the maximum distance on each side. First create a loop to cycle 10x through the bullets then use GetClipMaX or Y and divide that by 10 so you get an even distributed bullet range. Spawn each bullet with the offset you calculated.

Something like (hope I am correct):
Code: [Select]
task fromAllSides {
let i = 0;
let maxbullets = 10; // var for maximum bulletd
let offsetY = GetClipMaxY/maxbullets; // this is offset for the left and right side of the field.

// ok we got our offset, time to try this out
while (i < maxbullets ) {

// we multiply i by the offset so the first bullet will spawn 0, because 0 x offset = 0. 1xoffset = ... etc
CreateShot01(GetClipMinX,i*offsetY,.........);
i++;
}
}

You code the same for the other three sides as well, but might need to calculate the top/bottom separate. If you increase the bullet count, it will divide it equally again along the sides because of our handy offsetY/maxbullets variable.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 17, 2013, 10:21:12 PM
Thanks it works, though I can't get it to spawn from the right and bottom, but it doesn't matter for what I'm doing.


That's 3 cards down and I guess I'll do two more and upload them here.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on July 19, 2013, 06:29:55 AM
Code: [Select]
task fromAllSides {
let i = 0;
let maxbullets = 10; // var for maximum bulletd
let offsetY = GetClipMaxY/maxbullets; // this is offset for the left and right side of the field.

// ok we got our offset, time to try this out
while (i <[b]=[/b] maxbullets ) {

// we multiply i by the offset so the first bullet will spawn 0, because 0 x offset = 0. 1xoffset = ... etc
CreateShot01(GetClipMinX,i*offsetY,.........);
i++;
}
}
I'm guessing, adding the extra "=" will help solve the bottom right problem.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 19, 2013, 10:17:42 AM
I'm guessing, adding the extra "=" will help solve the bottom right problem.
I read his post more like as "I cannot manage to spawn it from the floor and right wall". Though you are correct, the <= is required in there.

Also, I intentionally left out the information for spawning the other sides of the player field, so people do not rely too much on copy/pasting (unless they already written the code and it is wrong). Basically with the example I gave, one can easily adapt it to all sides of the field.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 19, 2013, 07:09:13 PM
Thanks guys. I have a two more questions.

1: Do spell card backgrounds reduce the quality of the graphics? I noticed my boss as well as any graphical art loaded looks really bad but non spells look fine.

2: I'm having trouble getting Events to show the pictures. I loaded them and all of the directories are correct as well as everything else but still nothing.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on July 19, 2013, 07:19:55 PM
Thanks guys. I have a two more questions.

1: Do spell card backgrounds reduce the quality of the graphics? I noticed my boss as well as any graphical art loaded looks really bad but non spells look fine.

2: I'm having trouble getting Events to show the pictures. I loaded them and all of the directories are correct as well as everything else but still nothing.

1) If you change the scale/alpha, etc. then it will change the image quality. Using pure black (0,0,0) in an image will cause that to be rendered as transparent.
2) Did you use SetChar? Example below.
Code: [Select]
@MainLoop{
  SetStep(0);
  SetChar(LEFT, veemon);
  SetGraphicRect(LEFT, 90, 75, 360, 360);
  SetChar(RIGHT, eevee);
  SetGraphicRect(RIGHT, 0, 0, 195, 242);
  MoveChar(LEFT, FRONT);
//etc.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 19, 2013, 07:33:38 PM
1) If you change the scale/alpha, etc. then it will change the image quality. Using pure black (0,0,0) in an image will cause that to be rendered as transparent.
2) Did you use SetChar? Example below.

1:I found out that drawing text on the screen causes everything to look bad (except bullets). I removed the text and it looks better now.

2: Yeah I'm using the example code from the wiki


Code: [Select]
    @MainLoop{
     SetChar(LEFT, "Reimu1");                 //Set the player's character on the left side, with the graphic you've told it to display.
    SetGraphicRect(LEFT, 0, 0, 256, 320);           //The region you're displaying of the graphic for the player character, just like SetGraphicRect.
    MoveChar(LEFT, BACK);                             //Move the player's character into the background, to show she is not speaking.
    SetChar(RIGHT, "Koishi1");                //Set the boss' picture on the right side of the screen.
    SetGraphicRect(RIGHT, 2, 5, 256, 320);           //Set the boundry of the picture you want displayed.
    MoveChar(RIGHT, FRONT);                          //Move the boss' image to the front to show that she is speaking.
    TextOutA("text");           //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
    MoveChar(RIGHT, BACK);                           //Move the boss to the background, then...
    MoveChar(LEFT, FRONT);                           //Move the player forward, to show that she will now speak.
    TextOutA("text");
    TextOutA("text");                      //What the player will be speaking.
    End;           //This ends the event.
    }
     
     @Finalize{
     // [delete all your graphics here]
     }
    }
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on July 19, 2013, 08:25:29 PM
Are you sure you got the file extensions and filepath correct? If the event script is in a subdirectory, then you might need to use .\..\
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 19, 2013, 08:39:58 PM
1. 0,0,0 (AKA pure black) will show that parts to be transparent so you should use 1,1,1.

2. You could post your entire code (from 'script_event bleh' to @Finalize) so we can see what's wrong.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 19, 2013, 08:49:38 PM
Here's the full script.

http://pastebin.com/KH4B3PAN
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 19, 2013, 08:55:39 PM
The whole "Reimu1" (basically all the "let blehblehbleh = csd = blehlehbleh.png" thing) goes on "script_event name", not in Initialize.

Also you could put "let CSD = GetCurrentScriptDirectory;" on "script_event name". It works for me.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on July 19, 2013, 09:14:41 PM
Code: [Select]
     // [Load all your graphics and foolishness here]
     let Reimu1 = GetCurrentScriptDirectory~"Reimu Pic1.png";
     let Koishi1 = "\script\Koishi\Koishi Pic1.png;";
     let Reimu2 = ".\Reimu Pic2.png";
     let Koishi2 = ".\Koishi Pic2.png;";

Please read Helepolis's Understanding Paths and Directories Tutorial.
http://www.shrinemaiden.org/forum/index.php/topic,4752.0.html (http://www.shrinemaiden.org/forum/index.php/topic,4752.0.html)

Your filepaths should use GetCurrentScriptDirectory for Koishi 1, Reimu2, etc.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 19, 2013, 09:27:15 PM
Alright I moved and changed everything to Get CurrentScriptDirectory but still they won't show up.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 19, 2013, 09:29:24 PM
1:I found out that drawing text on the screen causes everything to look bad (except bullets). I removed the text and it looks better now.
This is what I noticed as well in some of my games, is it due to DrawText? I need to check that then because some of my cards are also suffering from this. Looks pretty ugly indeed.

Alright I moved and changed everything to Get CurrentScriptDirectory but still they won't show up.
Post latest code please. I sense you're still missing something.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 19, 2013, 09:36:10 PM

http://pastebin.com/4WpfY1vj
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 19, 2013, 09:39:02 PM
http://pastebin.com/4WpfY1vj
Ok where are your images located for the event. Inside scripts folder? Or your own personal folder i.e:  scriptsInfinitewave 

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 19, 2013, 09:41:10 PM
Here's your edit.

pastebin blehblehbleh (http://pastebin.com/nZCb4ANW)

At least i tried.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 19, 2013, 09:43:22 PM
Here's your edit.

pastebin blehblehbleh (http://pastebin.com/AZjCR5WY)

let CSD = GetCurrentScriptDirectory; plz
I am sorry to say Yamamoto. What you're doing is redundant. you're creating a variable called CSD and storing inside it GetCurrentScriptDirectory. However, you never use CSD. So there is no use in declaring a variable called CSD if you're not going to use it. Proper way should be:
Code: [Select]
let CSD = GetCurrentScriptDirectory;
let Reimu1 = CSD ~ "Reimu Pic1.png";
let Koishi1 = CSD ~ "Koishi Pic1.png";
let Reimu2 = CSD ~ "Reimu Pic2.png";
let Koishi2 = CSD ~ "Koishi Pic2.png";
However this is not Infinite's problem I am sensing. Awaiting the reply on folder structure from him/her.

Edit
I found your possible error (unsure). Remove spaces from the file names.  "Reimu Pic1.png"; -> turn it into  "ReimuPic1.png"; Did a quick test with my own boss by adding space in the code and in the file name. Danmakufu doesn't likes this for some reason. Logically, don't forget to rename your actual files as well.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 19, 2013, 09:47:55 PM
At least I tried to do something  :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 19, 2013, 09:49:35 PM
At least I tried to do something  :V
And by that, we keep on learning :)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 19, 2013, 09:53:57 PM
Ok where are your images located for the event. Inside scripts folder? Or your own personal folder i.e:  scripts\Infinitewave\

"script\Koishi\" that's where everything is stored, graphics, music, and sound effects. I cram everything into the script folder for the sake of having everything together.

I also tried renaming the files without using spaces, that didn't work either.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 19, 2013, 10:07:55 PM
"script\Koishi\" that's where everything is stored, graphics, music, and sound effects. I cram everything into the script folder for the sake of having everything together.

I also tried renaming the files without using spaces, that didn't work either.
Assuming your txt files are also inside Koishi, the code should be correct. Cannot see what is going wrong here. I am currently also scratching my head in confusion.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 19, 2013, 10:20:31 PM
Assuming your txt files are also inside Koishi, the code should be correct. Cannot see what is going wrong here. I am currently also scratching my head in confusion.

I can give you the game itself. I uploaded it earlier today. But sadly I'm on mobile data and ran out of 4g for the month. It would be too slow to upload with the changes I just applied. Since then.

http://www.mediafire.com/download/fuf11sgu52pr545/Koishi's_Fun_Time_fixed.7z
   
I was planning on making a thread about it so I can get some feedback on it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 20, 2013, 07:33:30 AM
I can give you the game itself. I uploaded it earlier today. But sadly I'm on mobile data and ran out of 4g for the month. It would be too slow to upload with the changes I just applied. Since then.

http://www.mediafire.com/download/fuf11sgu52pr545/Koishi's_Fun_Time_fixed.7z
   
I was planning on making a thread about it so I can get some feedback on it.
Thanks, let me look into this because I am really confused about it all.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Blargel on July 20, 2013, 09:09:13 AM
Oh hi.

I fixed your "Stage Koi.txt" for you. (http://pastebin.com/q9ySZxmU)

And now I disappear again.

EDIT: I should probably explain what the problems were:
1.) You should use GetCurrentScriptDirectory whenever possible. Using a period to indicate current directory is buggy for some reason.
2.) You were putting a string rather than the variable for the SetChar function.
3.) When I changed it to the variable, it wasn't found because you were declaring them in @Intialize, making them scoped only for @Initialize. Moving them out of the any of the blocks fixed that.
4.) There was a semicolon after .png for Koishi1.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 20, 2013, 02:27:33 PM
Oh hi.

I fixed your "Stage Koi.txt" for you. (http://pastebin.com/q9ySZxmU)

And now I disappear again.

EDIT: I should probably explain what the problems were:
1.) You should use GetCurrentScriptDirectory whenever possible. Using a period to indicate current directory is buggy for some reason.
2.) You were putting a string rather than the variable for the SetChar function.
3.) When I changed it to the variable, it wasn't found because you were declaring them in @Intialize, making them scoped only for @Initialize. Moving them out of the any of the blocks fixed that.
4.) There was a semicolon after .png for Koishi1.

I knew it was going to be something derpy. Thanks Blargel.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 20, 2013, 06:31:43 PM
How do I animate bosses?

I haven't found any tutorial yet.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on July 20, 2013, 07:52:02 PM
How do I animate bosses?

I haven't found any tutorial yet.
Helopolis has a video tutorial on YouTube of how to c:
http://youtu.be/JUj6xG79-TY
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 22, 2013, 07:30:48 PM
Anyone know how to make familiars for Marisa and have them orbit her. (Or move in a circle period)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on July 22, 2013, 07:39:36 PM
Anyone know how to make familiars for Marisa and have them orbit her. (Or move in a circle period)
http://www.youtube.com/watch?v=q6JxONhPhIQ (http://www.youtube.com/watch?v=q6JxONhPhIQ)
At around 4:20 it shows how.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 22, 2013, 08:57:48 PM
Anyone know how to make familiars for Marisa and have them orbit her. (Or move in a circle period)
Since you're pretty familiar with scripting (what I noticed). In the mainLoop of the familiars or a separate movement task which loops you can use either SetX/Y or SetMovePosition. Both achieve similar purpose, but difference in smoothness.

Code: [Select]
let dir = 0;
let r = <radius>

SetX(GetEnemyX+r*cos(dir));
SetY(GetEnemyY+r*sin(dir)); 
dir++;                  // or dir+=2; for faster speed etc

Where r = radius from the boss. Where dir = the speed in which the familiar revolves around the boss. This is pretty static movement.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 22, 2013, 11:01:29 PM
Since you're pretty familiar with scripting (what I noticed). In the mainLoop of the familiars or a separate movement task which loops you can use either SetX/Y or SetMovePosition. Both achieve similar purpose, but difference in smoothness.

Code: [Select]
let dir = 0;
let r = <radius>

SetX(GetEnemyX+r*cos(dir));
SetY(GetEnemyY+r*sin(dir)); 
dir++;                  // or dir+=2; for faster speed etc

Where r = radius from the boss. Where dir = the speed in which the familiar revolves around the boss. This is pretty static movement.

Thank you, I watched your video. Personally I like to keep Familiars and stuff like that out of the main boss script. It makes it easier for me to find stuff(and makes it less likely for Danmakufu to give errors :V).

Anyway, I move on to my fourth boss battle. (I look back and notice how a week ago I had no knowledge of makufu, now I'm done with three bosses)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on July 23, 2013, 02:28:19 AM
Is there a function that ends a spellcard and goes back to the directory thing immediately? I couldn't find one on the functions list.
I need it for a menu I'm making.
 :)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 23, 2013, 06:03:27 AM
Is there a function that ends a spellcard and goes back to the directory thing immediately? I couldn't find one on the functions list.
I need it for a menu I'm making.
 :)
Go back to the directory thing immediately? Not sure what you mean here. There is only 'End' for spell cards available. Edit: End is only for player bombs I noticed.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on July 23, 2013, 05:30:09 PM
Go back to the directory thing immediately? Not sure what you mean here. There is only 'End' for spell cards available. Edit: End is only for player bombs I noticed.
Go right to the folder where the spell/nonspell was in. Isn't there an end for stages too? Or Clear;?
So I tried to move my menu to a stage and I don't know how to do DrawText, I tried putting it in DrawLoop but nothing showed up :C
This is the code if needed: http://pastebin.com/bWdjgpib (http://pastebin.com/bWdjgpib)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 23, 2013, 05:43:19 PM
You're trying to make a menu?

In that case, that's not how you make a menu. By now, there isn't any tutorial to make custom menus, but Danmakufu Gods (Helepolis, Drake, Blargel) can help you.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on July 23, 2013, 05:47:12 PM
You're trying to make a menu?

In that case, that's not how you make a menu. By now, there isn't any tutorial to make custom menus, but Danmakufu Gods (Helepolis, Drake, Blargel) can help you.
I saw a tutorial and it worked in a spellcard, It's not how I make a menu? oh :(
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 23, 2013, 05:59:42 PM
To make a menu you actually have to know very well how to use "ObjEffect", a bunch of advanced functions, and of course, "KeyState", "KeyPush", so when you press Down it goes from "Start Game" to "Extra Mode" and vice versa.

If you don't believe me, look at Juuni Jumon's (puremz's Touhou-ish game) was made. (http://pastebin.com/nRw4aMVy)

It's harder than it looks.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on July 23, 2013, 06:18:12 PM
To make a menu you actually have to know very well how to use "ObjEffect", a bunch of advanced functions, and of course, "KeyState", "KeyPush", so when you press Down it goes from "Start Game" to "Extra Mode" and vice versa.

If you don't believe me, look at Juuni Jumon's (puremz's Touhou-ish game) was made. (http://pastebin.com/nRw4aMVy)

It's harder than it looks.
I know how to use keypush and objeffect, I already used keypush somewhere in the menu.
If I replace the DrawTexts with effectobjects, will it show up in the stage?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 23, 2013, 06:29:08 PM
Yes, but you have to do it in another script in which you don't have to write "#TouhouDanmakufu blehblehbleh, @script_enemy main blehblehbleh".. You start with "if(time==0){", then "BGbleh("script\images\whatever\bleh.png");", "SetCommonData("blehblehbleh", number);" and the whole ObjEffect and KeyPush thing.

I'd suggest you to download "Juuni Jumon - Summer Interlude" and see how puremz made the whole game. It's really interesting, both for beginners and experts.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on July 23, 2013, 07:12:41 PM
I didn't have an internet connection for a few days, so I wasn't able to thank Dark for answering my questions so I'll do that now. :V
Also, even more questions:

How do I keep the same angle using AddShot?
Without storing the angle in a variable?

While using Helepolis's shot data script, I noticed that if I changed a bullet from a bubble to another bullet, it would continue to spin. Is there any way to fix this? Apart from setting the bubble spinning to 0?

Also, slighty offtopic, how does everyone keep on thinking of new and innovative patterns? I am almost finished with my first plural script, "extra boss style" so that's 8 nonspells + 10 spellcards... and I'm going mad with the slow pace of work, which mostly goes like:
Must think of spellcard ideas>many hours later>YES! I'VE GOT SOMETHING!>runs into unexpected problem>ragequits/finds another way/is unhappy with result and restarts.

So, those are my current questions that keep bugging me. I hope somebody wants to answer some questions so I can go think up even more .:V
I am however, still on holiday, and most harbors don't have very good internet connection, so I don't know if I can answer really quickly.

Yet another insanely long amount of text that nobody wants to read through. I'm sorry for that, but I am completely unable to keep ANY, no matter what kind of message short.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on July 23, 2013, 09:03:44 PM
>some text<
:3
1. If you mean relative to the master bullet, well, math. For example, if you shoot 10 bullets with the angle i*360/10 where each bullet curves by 2 each frame, you could use something like
i*360/10+(frames*2) as the angle for the slaveshot. This may get complicated, especially if the bullets stop or start curving at different intervals, so I would suggest to use object bullets which are more flexible and easier to use, especially when trying to do things like this.

2. Probably not, unless you fake it (using strange object bullet coding) or just spawn a new bullet with 0 delay at the master bullet.

3. One way could be to: Study character (optional) > Find a theme for the patterns > Look in book/info site for inspiration > picture it in danmaku > start the programming.
For nonspells it often goes like: Find a theme > make something similair (but still abit different ofc) for each nonspell.
Coming up with innovative pattterns takes a while, similair to danmakufu. The more innovative pattern, the longer it takes to figure out and make.
Super-lazy tactic I abused; make a STG pattern from the fighting game patterns :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on July 23, 2013, 09:38:17 PM
Yes, but you have to do it in another script in which you don't have to write "#TouhouDanmakufu blehblehbleh, @script_enemy main blehblehbleh".. You start with "if(time==0){", then "BGbleh("script\images\whatever\bleh.png");", "SetCommonData("blehblehbleh", number);" and the whole ObjEffect and KeyPush thing.

I'd suggest you to download "Juuni Jumon - Summer Interlude" and see how puremz made the whole game. It's really interesting, both for beginners and experts.
I'm kind of confused, I have one script for one menu, another script for another menu, etc. and a main script for all the menus?
Or one script for the entire menu?
Sorry, I downloaded the game but couldn't find the menu folder.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 23, 2013, 09:46:39 PM
The menu script?

Easy to find. Juuni Jumon - Summer Interlude > script > Functions > Main Menu > Main Screen (which is the menu).

In that folder there is interesting stuff too.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on July 23, 2013, 09:51:57 PM
The menu script?

Easy to find. Juuni Jumon - Summer Interlude > script > Functions > Main Menu > Main Screen (which is the menu).

In that folder there is interesting stuff too.
Whoops didn't see that  :derp:  Thanks! This will help C:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on July 24, 2013, 02:09:41 AM
Also, slighty offtopic, how does everyone keep on thinking of new and innovative patterns? I am almost finished with my first plural script, "extra boss style" so that's 8 nonspells + 10 spellcards... and I'm going mad with the slow pace of work, which mostly goes like:
Must think of spellcard ideas>many hours later>YES! I'VE GOT SOMETHING!>runs into unexpected problem>ragequits/finds another way/is unhappy with result and restarts.
I like to brainstorm before falling asleep. Picturing the danmaku makes it so much easier.

I once had a Remilia type card that I wanted to make. It was similar to Curse Sign "Tepes Vision" of Concealed the Conclusion.
Except I wanted the bullets to come out from the boss in a circle, and then spawn slave bullets which change angles as they spawn making a wave pattern.
I wanted the slave bullets to start at 0 velocity, and wait. After all the bullets are spawned, all the slave bullets well increase velocity at the same time and create like a loop/wave pattern.

It took about a month to figure it out since there were so many problems.
My point of this story is to never give up on your spellcards. Hold on to any of your good ideas.
As for nonspells? They are repetitive. Any bad spellcard idea can count as a nonspell.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on July 24, 2013, 05:52:08 PM
I have another question:
I have this thing with a stage, nonspells, and spells, but the background only shows up in the spells.
Stage code: [size=78%]http://pastebin.com/Jt8KKLSh (http://pastebin.com/Jt8KKLSh)[/size]
A nonspell code: [/size][size=78%]http://pastebin.com/iE09EuBU (http://pastebin.com/iE09EuBU)[/size]
A spell code: [/size][size=78%]http://pastebin.com/X3Yx8PJX (http://pastebin.com/X3Yx8PJX)[/size]
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 24, 2013, 06:13:16 PM
I can't find the error, but ...

DeleteGraphic(bg);
}}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on July 24, 2013, 06:16:07 PM
I can't find the error, but ...

DeleteGraphic(bg);
}}
Oh I forgot to put that on a seperate line, that's supposed to be there I think.
Edit: It didn't work with other images either.
Also another time I did a background on a non-spell and it showed up. But I don't know why this won't work...
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on July 24, 2013, 09:25:14 PM
Qwerty: Backgrounds do not work on Nonspells unless SetScore has been used or the nonspell is part of a stage, in which case the nonspell adapts the stage's background.

Also, you're on LOCAA. There are tons of people you can ask if you need immediate attention.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on July 24, 2013, 09:29:38 PM
Qwerty: Backgrounds do not work on Nonspells unless SetScore has been used or the nonspell is part of a stage, in which case the nonspell adapts the stage's background.

Also, you're on LOCAA. There are tons of people you can ask if you need immediate attention.
Really? But Non-Spells don't have score bonuses. :C


Ok I'll ask on LoCAA too.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 24, 2013, 11:11:52 PM
Anyone know how to make an attack like Flandre's "Kagome Kagome" card? The one that create bullets in a square all over the screen and she shoots bubbles that cause the bullets to move.

I also want to know how to make Cheeto Lasers. :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 25, 2013, 09:04:07 AM
I think you need Effect Objects to make an attack like Kagome Kagome.

And Cheeto Lasers weren't the same as Curvy Lazarz?  :getdown:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 25, 2013, 10:48:27 AM
Never played EoSD Flandre, so had to check it out on youtube. I noticed this is similar to Buddha's Bowl from Kaguya in IN.

Those are not effect objects, but heavily behaving object bullets. Basically what happens is the bubble bullets collide with the round bullets and are indeed pushed away. What you need to do is make the round bullets listen to collision in their "while" loop and adjust their angle based on the direction the bubble collides. Unfortunately, I am not a math god to exactly script this, sensing trig is required here. I can only tell you what I see and is required in terms of mechanics.

Make sure the bullets listen only once to the collision, otherwise they will keep changing their angle as the bubble flies through. Since the bubble's velocity is higher than the accelerating round ones.

Good luck.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on July 25, 2013, 11:40:52 AM
I think you need Effect Objects to make an attack like Kagome Kagome.

And Cheeto Lasers weren't the same as Curvy Lazarz?  :getdown:
Cheeto Lasers, to me, looks like just a large amount of round bullets. Kind of like Seiga's rows of bullets.
Curvy lasers are kind of the same, but seems more like bended vertexes.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 25, 2013, 01:44:55 PM
Never played EoSD Flandre, so had to check it out on youtube. I noticed this is similar to Buddha's Bowl from Kaguya in IN.

Those are not effect objects, but heavily behaving object bullets. Basically what happens is the bubble bullets collide with the round bullets and are indeed pushed away. What you need to do is make the round bullets listen to collision in their "while" loop and adjust their angle based on the direction the bubble collides. Unfortunately, I am not a math god to exactly script this, sensing trig is required here. I can only tell you what I see and is required in terms of mechanics.

Make sure the bullets listen only once to the collision, otherwise they will keep changing their angle as the bubble flies through. Since the bubble's velocity is higher than the accelerating round ones.

Good luck.

Thanks, I'm no math wiz either so it'll take sometime for me to make. How would I spread the round bullets across the screen? Is it something similar to the other code you gave me?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 25, 2013, 03:44:44 PM
You mean the bullets from all sides code you asked page or 2 ago? Yes, correct. You could use that and use a randomized offset to spawn at different heights/locations as it seems Flandre does the same.

For the bubble and round bullets you'll need to use Obj_SetCollisionToObject(obj,true); to perform collision checking then use Collision_Obj_Obj   ( http://dmf.shrinemaiden.org/wiki/Mathematical_or_Information_Functions_%280.12m%29#Collision_Obj_Obj ) to perform the behaviour.

Something I myself haven't used it yet.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on July 25, 2013, 04:51:37 PM
The tactic I used for Obj_Collision with two types of bullets is to first create an object array for one type (a global one): let objarr = [];
Then in 1 of the object bullets you add each spawned bullet to the array, for example:
Code: [Select]
     task FireBullet(speed,angle){
     ID1 = Obj_Create(OBJ_SHOT);
     objarr = objarr~[ID1];   //Add the object to the global array.
Then at the end of the same obj bullet (after the while(!Obj_BeDeleted(ID1)) of the bullets last bracket):
Code: [Select]
    ascent(i in 0..length(objarr)){ //Go through all objects and remove self
        if(objarr[i] == ID1){
objarr = erase(objarr,i);
break;
}
        }
To delete the bullet from the array when it is deleted from the gamescreen to avoid getting infinite items in the array.
In both obj bullets used, set them to have obj collision, for example:
Code: [Select]
Obj_SetCollisionToObject(ID1,true);
Obj_SetCollisionToObject(ID2,true);
In each respective obj bullet task.

Then simply, in the task of the bullet type which isn't in the array;
Code: [Select]
     while(!Obj_BeDeleted(ID2)){
   
     ascent(i in 0..length(objarr)){ //Go through all objects
     if(Collision_Obj_Obj(ID2,objarr[i])){
     //do stuff on collision.
     }}

    }
Done!
(Note: tutorial is pretty much taken from OnTheNet. The whole script I made using this tactic: http://pastebin.com/UP6SrKjX (http://pastebin.com/UP6SrKjX))
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 25, 2013, 07:32:33 PM
The tactic I used for Obj_Collision with two types of bullets is to first create an object array for one type (a global one): let objarr = [];
Then in 1 of the object bullets you add each spawned bullet to the array, for example:

Done!
(Note: tutorial is pretty much taken from OnTheNet. The whole script I made using this tactic: http://pastebin.com/UP6SrKjX (http://pastebin.com/UP6SrKjX))

Uh, it's not working. This is what google translates the error to.
Quote
An attempt was made to use a variable that once do not even assignment (line 2660)
Code: [Select]
let objarr = objarr~[ID1];
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on July 25, 2013, 09:20:51 PM
Code: [Select]
let objarr = objarr~[ID1];
Why are you using let?
I don't think that's possible, since ~["item"] is just a way to add an item to the array pool.

Basics of arrays can be read at the tutorial:
http://dmf.shrinemaiden.org/wiki/Danmakufu_Basics_Tutorial (http://dmf.shrinemaiden.org/wiki/Danmakufu_Basics_Tutorial)

But, Drake is right. Obj_collision can be used for some stuff, but in this case, it is kind of unnecessary and it will probably be alot simpler to do it by distance and set the bullet angles from the way everything is set up. (Not saying my version is that good either, it's just the first one I got to work properly with bullet collision and everything.)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on July 25, 2013, 09:21:04 PM
You didn't instantiate the variable beforehand. How are you supposed to append [ID1] to objarr if objarr doesn't exist? EDIT: Darkness: not a function

also this method is super gross and nasty

One important thing is that Kagome Kagome doesn't actually perform any object collision. All it does is keep note of the angle and position the bubbles are fired at, and then the individual bullets start moving if they're somewhat in line with that, after a certain amount of time dependent on how far the bullets are from Flandre.

This is also how I would recommend scripting this behaviour. Explicit object collision isn't necessarily needed.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 25, 2013, 09:33:47 PM
Why are you using let?
I don't think that's possible, since ~["item"] is just a function to add the item to the array pool.

If I didn't put "let" in then Danmakufu would bring up another error.

One important thing is that Kagome Kagome doesn't actually perform any object collision. All it does is keep note of the angle and position the bubbles are fired at, and then the individual bullets start moving if they're somewhat in line with that, after a certain amount of time dependent on how far the bullets are from Flandre.

This is also how I would recommend scripting this behaviour. Explicit object collision isn't necessarily needed.

So create shot objects and then set their speed and angle to the bubble and fire the bubble? This is a bit confusing.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on July 25, 2013, 11:41:04 PM
You have to define objarr before you start adding things to it.

I think the problem here is that you're trying to create patterns above your level of know-how. I might be able to tell you precisely how to get my suggestion working, but that won't do you any good. It's basically fixing your bubble bullet angles beforehand, then setting up all of your movable bullets as CreateShotA bullets that only have a second SetShotData to move them if the spawn position is in line with the preset angle. The time to set the bullet to move just depends on how "close" the bullet is to the boss when firing. This way, nothing actually depends on the bubble being fired. You don't even need to fire the bubble, it's just good timing that makes the bullets move. If you don't get what I mean, then it's probably best if you didn't bother. But in my opinion it's much easier and cleaner than messing around with bullet arrays and object collision.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 26, 2013, 02:38:10 AM
Yeah, I'll just take your advice and wait until I get better.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Uzumaki_tenma on July 27, 2013, 03:04:13 AM
I have a question, I saw in some scripts about the "History" function (like Icicle Fall  (0/1) ), how can I put this function in the spellcards? I mean, I checked other scripts but those don't have info script (or is in an unknown script file contrary to .txt or .dnh)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 27, 2013, 08:42:47 AM
I have a question, I saw in some scripts about the "History" function (like Icicle Fall  (0/1) ), how can I put this function in the spellcards? I mean, I checked other scripts but those don't have info script (or is in an unknown script file contrary to .txt or .dnh)
0.12m has no such function, so you'll need to implement your own spell card history tracker using CommonData and saving CommonData so the next time you start the card/game, you can keep note of it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 27, 2013, 09:49:09 PM
Anyone know how I would make a web of lasers like what Remilia and Eirin do?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on July 27, 2013, 10:06:18 PM
Anyone know how I would make a web of lasers like what Remilia and Eirin do?
CreateLaserA.

Read the Danmakufu Basics Tutorial (http://www.shrinemaiden.org/forum/index.php/topic,30.0.html) to find more about that function
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on July 28, 2013, 01:46:10 PM
How do I find out how large each sprite is in an file with multiple sprites?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on July 28, 2013, 01:52:14 PM
Doesn't it tell you if you right-click it and show the properties, or open it with paint.
Unless you're talking about something entirely different.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on July 28, 2013, 02:17:19 PM
Guess I formulated my question wrong. 
How do I find out the coordinates of each sprite(to use with SetGraphicRect) in one image file if it has multiple sprites?
Can I do this by simply taking the length and width of the full file and dividing?

If the whole file is 256X256 pixels, and there are four sprites horizontally, and three rows vertically like this:
a b c d
e f g h
i  j  k  l

If I want to know the coordinates for sprite b, are they equal to 256/4, 0, 256/4+256/4 and 256/3?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on July 28, 2013, 02:39:50 PM
If I remember it correctly, it should be left, top, right, bottom.
That said, I would use this:
Left: ([256/4]*Order in Row)-128
Top: ([256/3]*Order in Column)-128
Right: ([256/4]*Order in Row)
Bottom: ([256/3]*Order in Column)
This should work. Although 256/3 is 85.3... pixels. Which doesn't make sense.
Unless this isn't the real image size and just an example.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on July 28, 2013, 07:22:44 PM
I believe you can find that out by dividing the length and width by the number of columns and rows respectively--the result will be the individual dimensions of each sprite. Going by your example, if the whole file is 256x256 pixels and there are three rows and four columns, then: 256 / 4 = 64 and 256 / 3 = 85.33. That said, the rect coordinates for sprite "b" would be 64, 0, 128, 85.3. As you can see, you simply have to multiply the values by an increasing factor according to where the sprite you want is located. Hope that helps~
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on July 28, 2013, 10:57:25 PM
How do you make a rotating angle move faster than 1?
I've been using Angle++;, but it only increases 1 at a time.
Is there a way to make it move faster?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on July 28, 2013, 11:18:44 PM
How do you make a rotating angle move faster than 1?
I've been using Angle++;, but it only increases 1 at a time.
Is there a way to make it move faster?

Angle+=2; will make angle increase by increments of 2.
Angle+=1.5; will make angle increase by increments of 1.5, etc.

Please refer to the tutorials.

https://sites.google.com/site/sparensdanmakufututorials/danmakufu-0-12m-tutorials/003-introduction-to-danmakufu#TOC-003-07:-Variables-Booleans-and-Math
http://dmf.shrinemaiden.org/wiki/Danmakufu_Basics_Tutorial
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on July 28, 2013, 11:51:43 PM
Thank you! :D
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on July 29, 2013, 02:05:17 PM
How are backgrounds made in nonspells?
@BackGround only works in spellcards, and #Background didn't work in my script.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 29, 2013, 02:14:38 PM
How are backgrounds made in nonspells?
@BackGround only works in spellcards, and #Background didn't work in my script.
Correct, you don't have backgrounds in nonspells unless you alter the default ones or fiddle around with effect objects. If you want backgrounds in non-spells you can script an empty stage and use the @Background routine in there.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on July 30, 2013, 05:45:29 AM
I think I've asked this question before but was never answered.
Basically, I want to fire a fast bullet every frame. They all go in the same direction.
Then, I want the stream to turn to the right one pixel every frame. This lasts for 45 frames for 45 pixels to the right.
Then it moves to the left for 90 frames. Finally it moves to the right for another 45 frames.
This procedure repeats forever.
By stream of bullets, I mean like this.
http://youtu.be/MAMMVsi89yg?t=4m8s (http://youtu.be/MAMMVsi89yg?t=4m8s)
My question is, how do
I make the turning around part smooth.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on July 30, 2013, 06:11:03 AM
You can use a sine wave to achieve the degree of smoothness you are looking for. You have to define the stream's angle as a variable which first holds a base--that is, the direction you want the stream to start from--add an amplitude to it (this would be 45), and multiply it by the sine of a counter variable which should be increased every frame. How fast the motion is performed can be controlled by multiplying the counter variable: a frequency. This explanation is a bit messy, but this code should illustrate it:

Code: [Select]
loop{
    let tiltAngle = angle+45*sin(count*freq);
    <Bullet Code>
    count++;
    yield;
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on July 30, 2013, 06:42:10 AM
I read through your message and drew a blank.
Here's the important part of my script.
Code: [Select]
if(Obj_GetSpeed(objoption)<0.01){
BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir2,71);
BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir2+45,71);
BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir2+90,71);
BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir2-45,71);
BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir2-90,71);
}
if(count<45){ dir2++; }
if(count>=45 && count<135){ dir2--; }
if(count>=135 && count<180){ dir2++; }
if(count>=180){ count=0; }
count++;
The bullets are fired from an object right when it slows down.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on July 30, 2013, 07:19:20 AM
Oh, then you just have to implement the sine wave when the condition is evaluated as true. Assuming you have an Obj_BeDeleted while loop, then:

Code: [Select]
if(Obj_GetSpeed(objoption)<0.01){
    let dir = angle+45*sin(count*freq);
    BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir,71);
    BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir+45,71);
    BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir+90,71);
    BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir-45,71);
    BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir-90,71);
    count++;
}

When the condition is evaluated as true, "count" will increase by 1 every frame and allow for the bullets' trajectories to smoothly accelerate and decelerate back and forth between the bounds of your amplitude. In this case, since you want for it to move 45 degrees towards each side, said amplitude will be 45. You can change "angle" to anywhere you want for the bullets to begin aiming at. Also, I recommend first testing the generated pattern by firing them from the enemy to begin with, if you still feel confused about how this is supposed to work.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on July 30, 2013, 10:29:51 AM
Ah. I get it. I just started playing around with the function.
Thanks for the help.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: fondue on July 30, 2013, 01:11:26 PM
Just do this:
Code: [Select]
if(Obj_GetSpeed(objoption)<0.01){
    let dir = angle+45*sin(count*freq);
ascent(i in -2..2){
    BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir+(45*i),71);
}
    count++;
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on July 30, 2013, 05:07:42 PM
I am making a spellcard with Shikieiki's laser attack. (one large laser aimed at the player, and two "wings" made up of four lasers about 70-90 degrees from the angle to the player)
I want the lasers to the side to move towards the large purple laser, and when they're close, having the lasers on the side of the player disappear, and the other lasers continue, forcing the player to move around the screen. (Shikieiki is positioned at the center of the screen.)

To accomplish this, I made a global variable called playerangle, which is set to GetAngleToPlayer everytime the purple laser is fired (the purple lasers and those to the side are in separate tasks), and then I compare it to GetAngleToPlayer inside mainloop. If it is larger/smaller, two other global variables are changed which are placed inside the SetShotKillTime's of the task of the "wings"

I have 2 problems however:
1. Sometimes the wrong set of lasers disappears (and I don't know why).
2. There will probably be a problem if the player faces to the right because of angles.

I think I remember some kind of function to change how angles are calculated on the Danmakufu wiki, but I can't remember where.
Does anybody know how to solve this?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on July 31, 2013, 04:04:34 AM
I have an attack that's not working the way I want it and it's kinda confusing why it's not.

Code: [Select]
   
CreateShotA(1,GetX,GetY,30);
SetShotDataA(1,0,2,0,0,0,1,60);
SetShotDataA(1,60,5,GetAngleToPlayer,0,0,0,60);
FireShot(1);

Now this should shoot a bullet to the right and after 60 frames turn towards the player, but instead it turns down or at an angle nowhere near the player.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on July 31, 2013, 04:59:25 AM
GetAngleToPlayer returns the angle from the boss to the player. It doesn't care about your bullet. Even if it did target the player, it would target the player when setting up the bullet to be fired, not at the 60 frame mark.

1. Sometimes the wrong set of lasers disappears (and I don't know why).
2. There will probably be a problem if the player faces to the right because of angles.
Why can't you just choose the first laser that disappears and then switch it every rotation? You don't need any sort of angle-getting from what you're describing.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on July 31, 2013, 05:04:34 AM
GetAngleToPlayer is the angle of the boss to the player, not the bullet.
Now, I don't know how to find the angle from a regular bullet to the player without having to use an object bullet.
Code: [Select]

task Bullet(x, y, v, angle, g, d) {
      let obj=Obj_Create(OBJ_SHOT);

      Obj_SetPosition(obj, x, y);
      Obj_SetAngle(obj, angle);
      Obj_SetSpeed(obj, v);
      ObjShot_SetGraphic(obj, g);
      ObjShot_SetDelay  (obj, d);
      ObjShot_SetBombResist (obj, false);

wait(60);
                Obj_SetAngle(obj, atan2(GetPlayerY - Obj_GetY(obj), GetPlayerX - Obj_GetX(obj)));
}
And then you call the task and fill out the parameters. This might seem confusing at first, but object bullets make the best attacks.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on July 31, 2013, 05:19:31 AM
A simpler method would be using SetShotDirectionType. Calling the function before defining the SetShotData and setting the new angle to 0 will automatically redirect the bullet to the player regardless of where it is. Don't forget to set it back to ABSOLUTE afterwards, that is~

Code: [Select]
CreateShotA(1,GetX,GetY,30);
SetShotDataA(1,0,2,0,0,0,1,60);
SetShotDirectionType(PLAYER);
SetShotDataA(1,60,5,0,0,0,0,60);
SetShotDirectionType(ABSOLUTE);
FireShot(1);
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 31, 2013, 06:30:43 AM
Except GetAngleToPlayer and ShotDirection only work if the bullet is actually spawned at it's 0,0 coordinates aka the exact point where it is spawned. If you use it for example at the boss' location with an offset it will simply not 'home in' on the player. Atan2 is more secure in such cases.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on July 31, 2013, 07:30:35 AM
I seem to have a really minor problem.
Code: [Select]
while(!Obj_BeDeleted(objoption) && type=="two"){
Obj_SetAngle(objoption,Obj_GetAngle(objoption) + angle);
Obj_SetPosition(objoption,Obj_GetX(objoption),Obj_GetY(objoption));
ObjEffect_SetAngle(objoption,0,0,spin);
spin+=3;
if(spin>=1675 && Obj_GetSpeed(objoption)<1){ Obj_SetSpeed(objoption,Obj_GetSpeed(objoption) + 0.01); }
if(Obj_GetX(objoption) > GetClipMaxX+10 || Obj_GetX(objoption) < GetClipMinX-10 || Obj_GetY(objoption) > GetClipMaxY+10 || Obj_GetY(objoption) < GetClipMinY-10){
Obj_Delete(objoption);
}
if(Obj_GetSpeed(objoption)>0 && count==0){ Obj_SetSpeed(objoption,Obj_GetSpeed(objoption) - 0.01); }
if(Obj_GetSpeed(objoption)<0.01){
    let dir3 = dir2+45*sin(count*1);
    BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir3,71);
    BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir3+45,71);
    BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir3+90,71);
    BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir3-45,71);
    BulletA(Obj_GetX(objoption),Obj_GetY(objoption),6,dir3-90,71);
    count++;
}
yield;
}
Small enough to be in a post?

Well, the problem is that, after the bullet leaves the battle field and is deleted, two bullets fire from [0,0]
One goes 22.5 degrees, and one goes 67.5 degrees. Approximately.
How do I omit it?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Arcorann on July 31, 2013, 07:52:57 AM
Well, the problem is that, after the bullet leaves the battle field and is deleted, two bullets fire from [0,0]
One goes 22.5 degrees, and one goes 67.5 degrees. Approximately.
How do I omit it?
You're firing bullets after deleting the object bullet. Putting the if(Obj_GetSpeed(objoption)>0 && count==0) and if(Obj_GetSpeed(objoption)<0.01) blocks inside an else block should fix this.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on July 31, 2013, 07:58:42 AM
Ah, don't mind my problem.
I solved it by putting the statement that deletes the object after the firing bullets statement.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on July 31, 2013, 08:18:52 AM
Why can't you just choose the first laser that disappears and then switch it every rotation? You don't need any sort of angle-getting from what you're describing.

Because then the player would be crushed between the large purple laser and the set of lasers on the side of the player if they choose the wrong one.
But if you use angles, this shouldn't happen because the lasers on the side of the player should disappear.
But sometimes the wrong laser disappears, and the player is crushed anyway.
So I would like to know if there is a way to change this or if I should just use what you said and remove the big laser in the middle much earlier.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: pogisanpolo on July 31, 2013, 01:46:33 PM
Hello everyone. I'm a bit new to this board and English is not my native language so bear with me.

Me and a friend of mine are planning to use this program for our game dev thesis and we're complete newbies to this program so we're going through the tutorials right now. Our current plan is a purely evasion-based game so for starters, we've planned on setting ForbidShot to true and ForbidBomb to true.

We're planning to use our own scoring system and I'm wondering what's the best way to do this. Right now, I'm thinking of using the AddScore function along the lines like the snippet below. The idea is:


Code: [Select]
//this will be called each second.
sub updateScore
{
//base score value. Can be anything really.
let baseScore = 500;

//gets the distance between player and boss and uses it as a modifier.
let distance = ((GetEnemyX - GetPlayerX)^2 - (GetEnemyY - GetPlayerY)^2)^0.5;

let addScore = 500*(1/distance);

AddScore(addScore);
}


However i think there's a better way to do this. As for grazing, I think we'll be adding the bonus due to graze by the end of the stage.

Edit: I just realized I botched the formula. fixed it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: junior8858 on July 31, 2013, 04:24:40 PM
How to make laser move vertical with laserA?
if Using that is impossible laserA, then how?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on August 01, 2013, 01:34:17 AM
How to make laser move vertical with laserA?
if Using that is impossible laserA, then how?

What exactly do you mean by this? You can move the base of the laser, if that's what you mean, but your question is not very clear. Do you want a static layer, a curvy laser, or a laser that has a predefined start and end?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: junior8858 on August 01, 2013, 04:58:37 AM
There are 7 parameter for SetLaserDataA, and the sixth one is to make the base move right and left.
My question is : Is moving the laser's base vertically(up and down)possible with only laserA? possible with only laserA?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 01, 2013, 11:00:17 AM
That is not entirely correct; the sixth option is movement speed.
If you enter 0 as the seventh option (movement angle) and a number larger than 0 in the sixth one, the laser will move to the right.
If you want to move the laser somewhere else, just change the angle.

/////////////////////////////////////////

Another question:

Code: [Select]
task Laser(x,y,velocity,angle,length,width,graphic,delay){
let obj = Obj_Create(OBJ_LASER);

Obj_SetPosition(obj,x,y);
Obj_SetSpeed(obj,velocity);
Obj_SetAngle(obj,angle);
ObjLaser_SetLength(obj,length);
ObjLaser_SetWidth(obj,width);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);
ObjLaser_SetSource(obj,false);
ObjShot_SetBombResist(obj,true);

wait(199);
loop(30){
CreateShotA(0,ObjLaser_GetEndX(obj),ObjLaser_GetEndY(obj),10);
SetShotDataA_XY(0,0,rand(-1,1),rand(-2,0.5),0,0.01,0,3,237);
FireShot(0);
}
yield;
Obj_Delete(obj);
}

For some reason, when I fire this bullet it won't move; it just stays where it was fired.
How do I solve this?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on August 03, 2013, 05:55:39 PM
Object Lasers do not move. You can manually change the source point or use Object Sinuate Lasers (curvy lasers)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on August 04, 2013, 04:09:53 PM
Is there a tutorial for animating bosses?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 04, 2013, 04:16:44 PM
This is the animation script and it's pretty easy to use.

http://www.shrinemaiden.org/forum/index.php/topic,4711.0.html
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on August 04, 2013, 09:29:08 PM
Is there something that gets whether the boss is being damaged at the moment?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 04, 2013, 11:12:12 PM
Is there a tutorial for animating bosses?
Animating a sprite is just the selection of image coordinates based on whatever logical clauses you want it to depend on. Commonly, you ask if the boss is moving to the left, to the right, or isn't moving horizontally. For each of those situations you then ask a counter (that counts frames or intervals of frames) what it's currently at, and you fix the appropriate LTRB coordinates.

Or you could structure it differently. The main point is that you're running through some sort of decision tree based on how you want to animate, and select image coordinates accordingly.

Is there something that gets whether the boss is being damaged at the moment?
The most reliable method is just to know what the enemy's life was the previous frame, and compare to what it is now.
What are you going to use this for? In a lot of cases it might be better for your condition to be something else entirely.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on August 05, 2013, 12:40:50 AM
The most reliable method is just to know what the enemy's life was the previous frame, and compare to what it is now.
What are you going to use this for? In a lot of cases it might be better for your condition to be something else entirely.
I need it for the damage sound effect for when the boss is almost dead.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 05, 2013, 02:22:14 AM
Then yeah what I recommended should be enough. Save the boss HP in a variable, after few frames check current HP against it, if less play sound, and reset the variable to the current HP.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 05, 2013, 02:49:06 AM
Can someone show me how to create shots like the ShootShape function but instead of the bullets moving at their own angle I want the bullets to stay together and move in one angle together.

Like if I wanted to shoot a triangle at the player or something similar to Nue's 12-8 spell card in Double Spoiler.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 05, 2013, 03:29:27 AM
Just change the angle the bullets shoot at? If you're copying the ShootShape function, it just uses CreateShot01(), and the firing angle of each bullet has nothing to do with keeping the overall pattern intact.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 05, 2013, 04:04:21 AM
Yes but what I'm trying to do is shoot the entire shape at an angle while keeping its shape. If I want to shoot a triangle shootshape shoots a triangle from the boss in which all sides move away from each other, but I want them to move together.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Arcorann on August 05, 2013, 04:18:49 AM
Replace every angle inside a SetAngle or CreateShot** with your input angle, e.g. Obj_SetAngle(obj, angle+i*(360/corners)); --> Obj_SetAngle(obj, angle). Then all the bullets will move in the same direction.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 05, 2013, 04:54:08 AM
Yes but what I'm trying to do is shoot the entire shape at an angle while keeping its shape. If I want to shoot a triangle shootshape shoots a triangle from the boss in which all sides move away from each other, but I want them to move together.
And I literally just told you how to do that.
Code: [Select]
function ShootShape(spawnX, spawnY, v, angle, num, bside, graphic, delay) {
ascent(i in 0..num) {
let sx = spawnX+cos(angle+i*360/num); let sy = spawnY+sin(angle+i*360/num); let sxN = spawnX+cos(angle+(i+1)*360/num); let syN = spawnY+sin(angle+(i+1)*360/num);
CreateShot01(spawnX, spawnY, v*(((sx-spawnX)^2+(sy-spawnY)^2)^0.5), atan2(sy-spawnY,sx-spawnX), graphic, delay);
ascent(j in 0..bside) {
let toAngle = atan2(syN-sy,sxN-sx); let toDist = (((sxN-sx)^2+(syN-sy)^2)^0.5); let sx2 = sx+toDist/bside*j*cos(toAngle); let sy2 = sy+toDist/bside*j*sin(toAngle);
CreateShot01(spawnX, spawnY, v*(((sx2-spawnX)^2+(sy2-spawnY)^2)^0.5), atan2(sy2-spawnY,sx2-spawnX), graphic, delay);
}
}
}
You're looking at this, right? See the CreateShot01s there? The fourth parameter is the bullet's firing angle, as always. atan2(sy2-spawnY,sx2-spawnX) as an angle just means "fire away from the center". Change it to something else and you're good.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 05, 2013, 02:19:34 PM
I've tried doing that and all it does is break the shape. Changing either of the CreateShot01's angle makes everything shoot like a normal bullet but all of the bullets are stacked on top of each other.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on August 05, 2013, 03:10:35 PM
Ok.  I may be asking a(nother) noobish question but how to do you make shots launch from the shots current location using AddShot?  When I use it, it just spawns from the boss.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 05, 2013, 03:59:18 PM
Enter 0,0 for the coordinates.

Something like:
Code: [Select]
task fire{
loop{
CreateShotA(0,GetEnemyX,GetEnemyY,30);
SetShotDataA(0,0,1,GetAngleToPlayer,0,0,0,RED01);

CreateShotA(1,0,0,0)
SetShotDataA(1,0,1,GetAngleToPlayer+90,0,0,YELLOW01);

AddShot(60,0,1,0);

FireShot(0);
wait(120);
}
}

Will fire a bullet at the player, and after 60 frames a bullet will be spawned from the other bullet's face going 90 degrees to the left of the player.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on August 05, 2013, 05:37:28 PM
Oh.  OK!   :)  Thank you!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 06, 2013, 07:23:21 AM
I've tried doing that and all it does is break the shape. Changing either of the CreateShot01's angle makes everything shoot like a normal bullet but all of the bullets are stacked on top of each other.
My bad, I misread how the function was written. I would have implemented it in a different way, so I thought it did what I would have made it do.
The function expands by precalculating each bullet's speed so that it turns out in the right shape. I would have given it an initial size that fits the shape and updates the bullet's positions manually to expand.
This is really really crude because I can't be bothered to change it properly but should pretty much work fine.
Code: [Select]
function ShootShape(spawnX, spawnY, size, v, angle, num, bside, graphic, delay) {
ascent(i in 0..num) {
let sx = spawnX+cos(angle+i*360/num);
let sy = spawnY+sin(angle+i*360/num);
let sxN = spawnX+cos(angle+(i+1)*360/num);
let syN = spawnY+sin(angle+(i+1)*360/num);
let a = atan2(sy-spawnY,sx-spawnX);
CreateShot01(spawnX+cos(angle+i*360/num)*size*(((sx-spawnX)^2+(sy-spawnY)^2)^0.5), spawnY+sin(angle+i*360/num)*size*(((sx-spawnX)^2+(sy-spawnY)^2)^0.5), v, angle, graphic, delay);
ascent(j in 0..bside) {
let toAngle = atan2(syN-sy,sxN-sx);
let toDist = (((sxN-sx)^2+(syN-sy)^2)^0.5);
let sx2 = sx+toDist/bside*j*cos(toAngle);
let sy2 = sy+toDist/bside*j*sin(toAngle);
CreateShot01(spawnX+cos(atan2(sy2-spawnY,sx2-spawnX))*size*(((sx2-spawnX)^2+(sy2-spawnY)^2)^0.5), spawnY+sin(atan2(sy2-spawnY,sx2-spawnX))*size*(((sx2-spawnX)^2+(sy2-spawnY)^2)^0.5), v, angle, graphic, delay);
}
}
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 06, 2013, 04:38:55 PM
Thank you, it works perfectly.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 08, 2013, 12:18:26 PM
Is it possible to make a bullet home in on the player while curving?
 Example:
A bullet is fired from an enemy at the top middle of the screen at 0 degrees.(something like GetCenterX,GetCenterY-120)
I want it to curve towards the player, in a way that it has an angle of ~180 degrees when it arrives at the location of the player.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 09, 2013, 12:08:42 AM
For sure, but how you do it depends on how you want the bullet to move on the way there. The common thing people do is to move the bullet at some constant velocity, fire it at some angle, and then each frame or so ask the bullet for its angle to the player (using the usual atan2 parameters). If the bullet's angle is less than that, increase its angle by some fixed amount. If it's more, decrease its angle by some amount.
This is the general behaviour of patterns like Shinki's curvy toothpaste lasers, where you limit the accuracy of the homing in order to let the player dodge at the last moments.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 09, 2013, 09:09:16 AM
Thank you, that almost works as intended.

The problem is that the bullets fired on the right side will curve upwards instead of towards the player.
Is there anyway to change this so that they will curve the right way?
My current code is this:

Code: [Select]
task fire{
loop{
PlaySE(shot0);
ascent(angle in 0..17){
curve(GetEnemyX,GetEnemyY,3,90+22.5*angle,249,10);
}
wait(120);
}
}

task curve(x,y,velocity,angle,graphic,delay){
let obj = Obj_Create(OBJ_SHOT);

Obj_SetPosition(obj,x,y);
Obj_SetSpeed(obj,velocity);
Obj_SetAngle(obj,angle);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);
ObjShot_SetBombResist(obj,true);

while(!Obj_BeDeleted(obj)){
let playerangle = atan2(GetPlayerY-Obj_GetY(obj),GetPlayerX-Obj_GetX(obj));

if(Obj_GetAngle(obj)>playerangle){
Obj_SetAngle(obj,Obj_GetAngle(obj)-1);
}

if(Obj_GetAngle(obj)<playerangle){
Obj_SetAngle(obj,Obj_GetAngle(obj)+1);
}
yield;
}
}

The other way I could think of was using a familiar with the graphic of a bullet and use SetMovePositionHermite, but I couldn't find out how large the hitboxes of bullets are so that wouldn't work either.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on August 09, 2013, 01:27:20 PM
The problem is that the bullets fired on the right side will curve upwards instead of towards the player.
Is there anyway to change this so that they will curve the right way?
You have to convert the angle to an angle between 0 and 360 and then check if the first angle is 180 or -180 degrees off compared to the other angle. Here are the functions that are used for this, if you want to study them or something. http://pastebin.com/Z2SEMN5E (http://pastebin.com/Z2SEMN5E)
( Credit goes to Blargel for making most of this. I just put it all together. )
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 09, 2013, 01:59:56 PM
Okay, thank you!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on August 09, 2013, 11:42:13 PM
So I'm trying to make a player script but when I bomb it crashes at the end. D:
Code for bomb: http://pastebin.com/F4JyQZvt (http://pastebin.com/F4JyQZvt)
And on that topic, is there a way to remove the time stop at the beginning of a bomb?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 10, 2013, 03:33:46 AM
http://pastebin.com/Z2SEMN5E (http://pastebin.com/Z2SEMN5E)
Code: [Select]
function amod(a){ return (a+360)%360; }
screw ifs and long function names


So I'm trying to make a player script but when I bomb it crashes at the end. D:
Code for bomb: http://pastebin.com/F4JyQZvt (http://pastebin.com/F4JyQZvt)
And on that topic, is there a way to remove the time stop at the beginning of a bomb?
? The pause is part of the Cutin function, so if you're using it, stop.
? Your type if-chain probably should be a series of if-elseif-else rather than lots of ifs and then one else (?)
? You're missing the end part of your spell script; there aren't any routines or anywhere that calls run().

? Obj_SetAlpha() doesn't work for effect or spell objects. Use this and modify for extra vertices if needed:
Code: [Select]
function ObjEffect_SetAlpha(obj, a){
    ascent(i in 0..4){ ObjEffect_SetVertexColor(obj, i, a, 255, 255, 255); }
}

? You do that silly thing where you try and use XYs to set the bullet's render coordinates on the screen itself. It's much less confusing if you just set the XYs relative to the object position, and set the object position separately. It's how you're meant to do it.
Code: [Select]
//only once
ObjEffect_SetVertexXY(objamulet,0, -27.5, -27.5);  //size is 45x45 right
ObjEffect_SetVertexXY(objamulet,1, 27.5, -27.5);
ObjEffect_SetVertexXY(objamulet,2, 27.5, 27.5);
ObjEffect_SetVertexXY(objamulet,3, -27.5, 27.5);

//per frame
Obj_SetPosition(objamulet, amuletxpos, amuletypos);
ObjEffect_SetAngle(objamulet, 0, 0, amuletangle);
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on August 10, 2013, 06:18:26 PM
Thanks that helped a lot! :D
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 11, 2013, 03:35:02 PM
Anyone know how to stop the game from using the fancy little explosion? I'm trying to create a stage (for a full game) and I'm getting the bosses together and the midbosses will call a fake spell card similar to what you would do if you wanted a dialog scene before a boss battle, but when the boss leaves you can still see the white explosion in the background.

Nvm, I figured it out. However, for some weird reason, the boss leaves a gray point item.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on August 11, 2013, 10:36:31 PM
Wait how did you do that
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Chau on August 11, 2013, 10:56:34 PM
I think I stumbled upon a silly problem that seems to have a simple solution, but I can't find it :(

I want to concatenate a number to a string, like "A"~2~"B" should have "A2B" as a result. But when I convert 2 to a string and concatenate these strings, it ends up being "A2.00000B".
My (temporary) solution so far is to treat the "2.00000" as an array and take the first element of it (which is a character, I think?) and convert it to a 1-character-string because attaching a single character brings up an error message.

Now the result looks like this:
Code: [Select]
"A"~ToString(ToString(2)[0])~"B"This looks really silly, so I think there has to be a better solution, right? :ohdear:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Nuclear Cheese on August 12, 2013, 02:04:41 AM
I think I stumbled upon a silly problem that seems to have a simple solution, but I can't find it :(

I want to concatenate a number to a string, like "A"~2~"B" should have "A2B" as a result. But when I convert 2 to a string and concatenate these strings, it ends up being "A2.00000B".
My (temporary) solution so far is to treat the "2.00000" as an array and take the first element of it (which is a character, I think?) and convert it to a 1-character-string because attaching a single character brings up an error message.

Now the result looks like this:
Code: [Select]
"A"~ToString(ToString(2)[0])~"B"This looks really silly, so I think there has to be a better solution, right? :ohdear:

If I'm not mistaken, Danmakufu stores all numbers as floating point numbers (as opposed to integers, they can have fractional parts).  So here it's just trying to give you as much precision as it can.  Unfortunately, it doesn't seem there's a way to tell Danmakufu you only want the integer part, so you'll have to improvise.

Your code as given works fine as long as your number remains in the range of 0 .. 9.  It'll start not working if you get to 10 or above or go negative, though.  A more thorough solution would look something like this:

Code: [Select]
function Get_Integer_String(number)
{
  // Get the full string
  result = ToString(number);

  new_result = "";
  for (i = 0; i < length(result); i++)
  {
    if (result[i] == ".")
    {
      // break out of the loop.  I forget - does Danmakufu actually have this? :V
      // if it doesn't, you'll have to use a flag to break out of the loop or something.
      break;
    }
    else
    {
      new_result = new_result + result[i];
    }
  }
  return new_result;
}
(usual disclaimer: pseudo-code, may not work perfectly in DMF without modification)

The above code gets the string, then loops through the string looking for the decimal point.  It copies over the string's contents until it finds the decimal point, at which point it stops and returns the copy (which only contains digits before the decimal point).  As long as DMF doesn't return a string in scientific notation (such as "2.4E10") this should work.  You might be able to get more clever with DMF's array functions, but at the very least this should do the trick.

Hope this helps!
/me returns to being a lurking ghost.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 12, 2013, 02:31:23 AM
Code: [Select]
function itoa(i){
let a = ToString(i);
return a[0..length(a)-7];
}

Just for your information, the solution you intended would have been fine (although single-digit) as "A"~[ToString(2)[0]]~"B" because danmakufu strings are just character arrays. As such, you can't concatenate a character to a string for the same reason you can't do [1,2,3] ~ 4; 4 isn't an array of the same dimension. Putting a character in an array will fix it because then it's just a 1-length string.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 12, 2013, 02:39:27 AM
Wait how did you do that

Make a empty non spell, set the life to 1(this gives the illusion that the spell doesn't exist), tell the boss to move off screen, then put something like
Code: [Select]
if(frame==50){
VanishEnemy;
}

That will delete the boss without any special effects.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on August 12, 2013, 06:44:09 PM
How do I merge bullets into another bullets?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 12, 2013, 08:29:01 PM
Delete one of the bullets and change the other if required?

EDIT: Just to note, both the (-180,180) angle problem (http://www.shrinemaiden.org/forum/index.php/topic,14911.msg1005469.html#msg1005469) and the number toString problem (http://www.shrinemaiden.org/forum/index.php/topic,14911.msg1006052.html#msg1006052) are not an issue in ph3. -179%360 == 181 and -1%360 == 359 and so on (you have a modc() function that lets you keep the negative-number behaviour), and the atoi() function I wrote above is already present in ph3.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 14, 2013, 02:08:47 PM
How do you make a variable move between certain limits?
I want bullets to spawn at a certain Y value starting at one side and moving over to the other, then wait for a few seconds, and then the same in the other direction, but I can't find out what I'm doing wrong.
Here's the code if that helps:
Code: [Select]
task fire{
loop{
loop(25){
CreateShotA(0,GetCenterX+x+rand(-4,4),GetCenterY-80,10);
SetShotDataA_XY(0,0,0,rand(-1,-2),0,0.01,0,3,44);

FireShot(0);

if(x>=-208 && x<208){
x+=16;
}
if(x<=208 && x>-208){
x-=16;
}

wait(10);
}
wait(120);
}
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on August 14, 2013, 03:11:30 PM
The problem is that both if statements are true so they move, and move back in one loop.
Code: [Select]
task fire{
                let count = 0;
loop{
loop(25){
CreateShotA(0,GetCenterX+x+rand(-4,4),GetCenterY-80,10);
SetShotDataA_XY(0,0,0,rand(-1,-2),0,0.01,0,3,44);

FireShot(0);

if(x>=-208 && x<208 && count%2==0){
x+=16;
}
if(x<=208 && x>-208 && count%2==1){
x-=16;
}

wait(10);
}
                        count++;
wait(120);
}
}
This should work.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 14, 2013, 04:58:16 PM
Thanks you very much!

But now I have another problem in another script.
The script is called as familiar, but I get an error that it maintask is not an existing function and I can't find the problem.
http://pastebin.com/e21ceiw7 (http://pastebin.com/e21ceiw7)
Can somebody help me with this?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 14, 2013, 10:59:23 PM
Your script didn't give any errors when I tried it but it didn't do anything either. The problem is that you're calling a task inside "Initialize". I don't think you can do that.

I moved the "maintask;" to the main loop and it started working. It also creates lag due to the fire task being called every frame, use a "if" statement for fire. Like

if(frame==XX){
dosomething
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on August 15, 2013, 12:15:31 AM
The problem is that you're calling a task inside "Initialize". I don't think you can do that.

You actually can, though. If you define the given task somewhere within the script, you can call said task anywhere you want as long as you keep in mind the local scope.

As for the actual problem, this is somewhat strange--it did not give me any errors either, even when spawned as a familiar (as it was intended), and it executed the entirety of the MainTask correctly. Are you sure you did not mess up brackets somewhere? This kind of error makes it seem you prematurely closed script_enemy_main and left the MainTask outside the script, but I see no such mistake in the pastebin you provided. Here are both the familiar and a dummy boss I created for testing purposes: 1 (http://pastebin.com/W7Pi55Q8) | 2 (http://pastebin.com/RdfnmnQg).

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: PhantomSong on August 15, 2013, 12:16:31 AM
The problem is that you're calling a task inside "Initialize". I don't think you can do that.

You can call tasks inside Initialize. I run mainTask and InitializeAction in it o3o
Code: [Select]
     
@Initialize{
                  SetLife(4800);   
                  SetTimer(80);
                  SetMovePosition01(GetClipMinX+10,GetClipMinY+20,10);
                  LoadGraphic(imgBoss);
                  LoadGraphic(cut);
                  LoadGraphic(bg);                 
                  MagicCircle(false);
                  LoadUserShotData(shot);
                  SetInvincibility(120);
                  InitializeAction;
                  mainTask; }

(This is for a Familiar, but same purpose applies)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 15, 2013, 05:52:37 AM
Well, I remember it not working before... but it works now. Weird. I don't remember fixing it.
When I ran it before, it would come up with an error that maintask was undefined, and the main boss would execute all other tasks except for the familiar.

My memory sometimes fails me, and I think that's what happened; I fixed the script, and then quickly switched to doing something else and the fact that I fixed it was already forgotten.
Well, thanks for trying to figure it out anyway.

@Infinite Ultima Wave:
Calling tasks in @Initialize is indeed possible; that and mainloop scripting are different methods of scripting.
Compare this:
Code: [Select]
#TouhouDanmakufu
#Title[@MainLoop scripting]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main{

let count = 0;

@Initialize{
SetLife(3000);
SetMovePosition01(GetCenterX,GetCenterY-130,3);
}

@MainLoop{
count++;

if(count==60){
CreateShot01(GetEnemyX,GetEnemyY,3,90,RED01,30);
count = 0;
}
}

@DrawLoop{

}

@BackGround{

}

@Finalize{

}
}
To this:
Code: [Select]
#TouhouDanmakufu
#Title[task based scripting]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main{

@Initialize{
SetLife(3000);
SetMovePosition01(GetCenterX,GetCenterY-130,3);

mainTask;
}

@MainLoop{
yield;
}

@DrawLoop{

}

@BackGround{

}

@Finalize{

}

task mainTask{
wait(120);
fire;
}

task fire{
loop{
CreateShot01(GetEnemyX,GetEnemyY,3,90,RED01,30);
wait(60);
}
}

function wait(w){ loop(w){ yield;}}

}
Both will create a boss that will create one bullet every second aimed straight down, but the method used to generate this is different.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on August 18, 2013, 12:04:00 AM
(People may see this if they also checked the request thread)
How do you make an invincible player?
Also, while I was working with AddShot, it doesn't work, can someone see why this doesn't work?  (just modify to use The Super Shotset (ZUN's))
Code: [Select]
if (frame == 60){
loop(4){
CreateShotA(1, GetX, GetY, 0);
SetShotDataA(1, 0, 3, angle, 1, 0, 0, rand(194,200));
SetShotDataA(1, 10, 3, NULL, 0, 0, 0, NULL);
FireShot(1);
angle+=360/4;
AddShot(15, 2, 1, 0);
CreateShotA(2, 0, 0, 0);
SetShotDataA(2, 0, 3, angle, 0, -0.5, 0, rand(134,148));
SetShotDataA(2, 30, 0, NULL, 0.5, 0.5, 4, NULL);
}
angle++;
frame = 30;
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on August 18, 2013, 12:22:31 AM
You don't add the hitbox functions in the player scripts.
The Addshot problem is because you called the second bullet to be spawned by the first bullet, but the second bullet hasn't been defined yet. Put the Addshot after defining the second bullet.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on August 18, 2013, 12:43:01 AM
Now i feel stupid.  :blush:   But thank you!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 18, 2013, 01:35:42 PM
Anyone know how to get rid of the glow effect lasers have? When you make a laser the laser's body is glowing and I'm using a shot sheet that has ZUN's lasers.

I even tried changing the blend and still nothing.
(oddly enough if you pause the game, the glow effect is gone)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on August 18, 2013, 02:08:02 PM
Anyone know how to get rid of the glow effect lasers have? When you make a laser the laser's body is glowing and I'm using a shot sheet that has ZUN's lasers.

I even tried changing the blend and still nothing.
(oddly enough if you pause the game, the glow effect is gone)

ObjLaser_SetSource(obj,boolean)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 18, 2013, 02:37:08 PM
I don't think that works on sinuate lasers. What I'm talking about is not the base, but the actual laser's body.

The first picture shows what the lasers look like when fired. The second shows what the lasers should look like when fired, however, it only looks that way while the game is paused.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on August 18, 2013, 02:43:38 PM
I have misunderstood your question I see. I thought you really meant the glowing laser base for the lasers. Though you didn't mention you were using Sinuate Lasers, which confused me for a moment. Unfortunately I don't know the answer to that as I never used sinuating lasers before. =/ My apologies.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 18, 2013, 02:48:33 PM
It happens on all types of lasers, but thanks for trying.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on August 18, 2013, 03:47:59 PM
I am not quite sure it is possible what you are looking for. Afaik the lasers are always drawn in Additive rendering, regardless of what you're trying. There isn't a function to change the render state of shots and lasers as they are defined inside the bullet sheets and lasers seem to ignore this. If you're trying the ObjEffect, that is meant for effect objects themselves.

I've booted up my shottester script and fiddled around with the render state, doesn't matter what I do: Lasers are spawned with their glow, though I don't see the glow effect disappearing when I pause, they are as bright ever. You should remember that the pause screen lays over a transparent sheet of black/grey making everything look less glowy. I even booted up my Amakasu non-card where I intensively use lasers but they don't really look different either when I pause.

Or I am horribly wrong and missing something somewhere. . .

Edit
Just realised something. Most likely, you need to use lasers which don't have a bright centre, as ZUN's lasers all have a brighter centre, I have created a bland looking one and that one looked less glowly to me. Perhaps that is what you're looking for?

Edit2
Now I am just confused. You're most likely the first one asking this question here :V can't remember anybody ever asked about that in the years I have scripted. I stand with the above points until someone else jumps in to check this out.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 18, 2013, 04:04:30 PM
I'll try it, and see if it'll work.

EDIT: Actually, while the edges still don't look right, making the lasers extremely dark seems to make them easy on the eyes, I remember someone telling me that the lasers were hard to see.

Why Danmakufu ignores the shotsheet blend for lasers is beyond me.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on August 18, 2013, 05:44:00 PM
If you are talking about the laser's body, I don't see the problem.
It seems okay to me.

On the note of sinuate lasers.
Why do the heads and tails of the lasers have a block attached to it.
Is it Danmakufu 0.12's own problem or does it also happen in ph3?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 18, 2013, 06:13:06 PM
On the note of sinuate lasers.
Why do the heads and tails of the lasers have a block attached to it.
Is it Danmakufu 0.12's own problem or does it also happen in ph3?

One of my spellcards uses sinuate lasers, but I never had this issue.
Then again, they are intended to move in a straight line only, and they are object sinuate lasers.

I'm sorry that I'm not able to help, but I never had any of such issues, and I have some more questions to ask :V:

1. How does SetDamageRateEx work? It doesn't work on the (external) familiars that I made. The familiars themselves are damaged, but the bosses life doesn't drop when they are hit,
not even if I set it to something like (100,100,100,100);. Blasting apart 2 or 3 familiars with 20000 life might be a bit hard even with a time limit of 180 seconds.

2. Kinda offtopic, but would people mind if I made a topic asking for feedback? My mind is pretty imaginative in thinking up everything that could go wrong, and I will be tormented by myself at least 1/4 of a year if I even think I might have done something wrong.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on August 19, 2013, 02:08:54 AM
1. Did you put it in the familiar's script.
I myself have never used this function, so I don't know what if that doesn't work.
Edit: Or maybe it's because Danmakufu is comfused which are the familiars, and which is the boss.

2. What kind of Feedback is it?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 19, 2013, 06:23:34 PM
1. Did you put it in the familiar's script.
I myself have never used this function, so I don't know what if that doesn't work.
Edit: Or maybe it's because Danmakufu is comfused which are the familiars, and which is the boss.

2. What kind of Feedback is it?

The SetDamageRateEx was put inside the @Initialize of the familiars' script.
Is there any way to make it work properly? Apart from placing the familiars inside the enemy script, because that could give crashes according to the danmakufu wiki.
I included the (unfinished) boss script and a familiar so that if anyone wants to help they can see what I did for themselves.
Boss (http://pastebin.com/b0D1eCVw)
Familiar (http://pastebin.com/z7USdPi2)

With feedback I was talking about pretty much anything; criticism etc. Would people mind if I, a newbie at Danmakufu, made a topic to post my script(s)/ask for criticism etc.?
Again, I would keep annoying myself for a long time if I did something wrong, so better safe than sorry.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on August 19, 2013, 09:29:38 PM
I don't see anything wrong, maybe I'm missing Something.

For your second question, if it's for personal use, I don't think you can.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 19, 2013, 09:56:04 PM
With feedback I was talking about pretty much anything; criticism etc. Would people mind if I, a newbie at Danmakufu, made a topic to post my script(s)/ask for criticism etc.?
Again, I would keep annoying myself for a long time if I did something wrong, so better safe than sorry.

I don't see why it would be a problem. Since there are many of feedback and personal script threads. (I posted one myself)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on August 20, 2013, 12:13:59 AM
I misunderstood the second question. If it is your thread of projects and feedback, than yes you can.
For some reason, I thouhgt you already had a thread of scripts and you wanted to create another one for only feedback.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: pogisanpolo on August 21, 2013, 09:55:39 AM
I'm having some issues with #include function. The relevant snippet is below:

Code: [Select]
//#include_function ".\sanGayaFramework.dnh"
let spellName = "Frost 'Bouncing Spears'";
let ImgBoss = "script\img\ExRumia.png";
let timer = 20;

#include_function ".\variables.dnh"
#include_function ".\sanGayaFramework.dnh"
#include_function ".\SanGayaLib.dnh"

#include_function ".\moveFunction.dnh"
#include_function ".\shot_variables.dnh"

What's weird is if I remove the commented line, the code breaks with this error message: (http://i1189.photobucket.com/albums/z421/fortesama/Errormessage_zps24d4cd87.png)

But if I leave the commented line in, it works perfectly fine. I've done a bit of programming before and I know a tiny bit of japanese so my guess is the error message translates to something like: "#include_function could not find the file in @directoryHere."
I'm not sure how a commented line is supposed to affect this and how it changes how danmakufu looks for files.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on August 21, 2013, 02:04:50 PM
Try ...variables.dnh if variables.dnh is one directory above the directory the  script is located in.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 21, 2013, 04:31:57 PM
So, I saw something about the include function above, and that reminds me that I wanted to ask what exactly it does...
Or more specific, what can be done with it, what to write in a to be included script etc..
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on August 21, 2013, 04:52:12 PM
So, I saw something about the include function above, and that reminds me that I wanted to ask what exactly it does...
Or more specific, what can be done with it, what to write in a to be included script etc..
Everything?
If you want functions, tasks or create alot of global variables as well as load images and so on, to be shared between all scripts including the script file.
Most people probably just makes a function library to load in all scripts they need them.
For example, a useful function like the function wait(w). Then you can put it in a function library and include it in all your main scripts instead of having to write the function in every script.
If you make a really large/complicated script, you will often have to create alot of functions/tasks to do work in the main scripts and putting them in a function library makes reading the scripts alot easier.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 21, 2013, 11:29:11 PM
(http://i1189.photobucket.com/albums/z421/fortesama/Errormessage_zps24d4cd87.png)
Can you explain why it's looking for the file in the root DNH directory? Where is the script you're running and what do your directories look like? Also, does including sanGayaFramework.dnh before variables.dnh but after the other random variable declarations do anything different?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on August 22, 2013, 01:13:04 AM
How do you make a boss float?  (like that weird animation in the games)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 22, 2013, 01:35:18 AM
Assuming by "float" you mean the hover that bosses like Eirin have. In your main loop.

Code: [Select]
variable++;
yield;

//When the variable = 60 move the boss up 5 pixels.
        if(variable==60){
         SetMovePosition03(GetX, GetY-5, 10, 3);
         }
//When the variable = 80 move the boss down 5 pixels and set the variable back to 40
         if(variable==80){
         SetMovePosition03(GetX, GetY+5, 10, 3);
        variable = 40;
        }

Variable is whatever you want it to be. Make sure you define it at the top before @Initialize. It's tacky but it works. You could task it as well.

EDIT: Make sure when moving the boss, you set "variable" to a value over 80. Why? Because if you move the boss the above function will override the move command.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on August 22, 2013, 01:58:45 AM
Ok.  Thanks!   :)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 22, 2013, 06:00:30 AM
Generally I do

Code: [Select]
let float = 0;
@DrawLoop{
   //set up sprite
   DrawGraphic(x, y + sin(float)*a); //a is amplitude, or max height from center
   float = (float + f) % 360; //f is frequency, or speed of movement
}

It's pretty much the easiest and most-accepted way of doing it. It also doesn't actually move the enemy position, which can otherwise be troublesome.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on August 22, 2013, 11:13:11 AM
I'm making a Player Script, and I want to make a bomb like Reimu's Fantasy Seal.

How do I make them?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on August 22, 2013, 12:04:20 PM
I'm making a Player Script, and I want to make a bomb like Reimu's Fantasy Seal.

How do I make them?
Perhaps gauging your knowledge. How far are you experienced and known with the following:
- Tasks and functions
- Player scripting
- Effect Objects & Objects

Because those are the ones you roughly need to create your spell card bombs. Did you take a look at Stuffman's Sakuya player tutorial? It pretty much shows you how to implement bombs. If you have the knowledge of the above mentioned then you're good to go.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Foremoster on August 25, 2013, 10:10:05 AM
I'm wondering, how do you connect stage files together ?

like Stage 1 --> Stage 2 --> Stage 3

I tried putting them in the same script, but I can't change the background    :qq:

I heard something  about #include_function butttt hmmm I got nothing.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on August 25, 2013, 02:23:56 PM
I'm wondering, how do you connect stage files together ?

like Stage 1 --> Stage 2 --> Stage 3

I tried putting them in the same script, but I can't change the background    :qq:

I heard something  about #include_function butttt hmmm I got nothing.

This is something that you should not focus on until later.
I'll give an example in a moment.

http://pastebin.com/2Y6GKqMe (http://pastebin.com/2Y6GKqMe)
First, look at this link. Here we have the Danmakufu header with [Stage]. Inside script_stage_main we then connect to a number of files named "Stage#tasks.txt"
Then at the end of @Initialize, I call a task, PDDEasy (most people name it Stage or Game or something similar). First we yield; (because it's required to yield the first frame of a stage script), then Setup (function located elsewhere), and then call stages Stage1E, etc. These are functions (NOT tasks) inside the included Stage#tasks.txt files.

http://pastebin.com/vEZGLR2B (http://pastebin.com/vEZGLR2B)

THis is the content of one of those files. If you include the Danmakufu header in one of the included functions, Danmakufu will give you an error, by the way. So avoid. And if you use tasks instead of functions when calling the stage data (Stage#E), then nothing will work because Danmakufu won't wait for the task to finish executing.

--Backgrounds--
Each person does full game backgrounds differently. I set a variable to control which stage was going on and then used that variable to determine which background to use. It may be more efficient to use CommonData, however.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 25, 2013, 04:56:28 PM
Is it possible to make like ~50 variables at once?
I am trying to make my first 3D background, and I need about fifty random places for background elements to spawn.
I tried using an ascent loop with ToString(); , but that didn't work.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on August 25, 2013, 05:45:16 PM
I think you can use arrays. They're pretty much a bunch of variables all stacked together.

Code: [Select]
let Background_Array1 = [10,99,120,900];

@Main Loop
Background_Array1[0]++;  //Increase the first value in the array by 1 every frame.

You can name it whatever you want.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on August 25, 2013, 11:11:42 PM
If you have too many elements in an array, it will lag Danmakufu when it tries to access some of those elements. Avoid using longer arrays. And remember; if you have to debug later, it's hard to debug when you have a lot of numbers in an array.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 26, 2013, 12:03:23 AM
Is it possible to make like ~50 variables at once?
I am trying to make my first 3D background, and I need about fifty random places for background elements to spawn.
You turn that background element into its own procedure/task/function and call it fifty times instead. You likely don't need to access the objects or variables besides in the context of that process, so just keep each as one instance of a task you call or something. It's much easier to manage, and it's scalable.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: PhantomSong on August 26, 2013, 12:07:05 AM
How do I make background effects like the falling cherry petals/maple leaves/snowflakes?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on August 26, 2013, 01:43:18 AM
How do I make background effects like the falling cherry petals/maple leaves/snowflakes?

*Evil grin*

I took and edited the code from the Last Comer (which had random unnecessary crud everywhere) for PDD. The Last Comer used Object Effects.

Ask Miransu; he's doing it for his CURSE 1 contest entry.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 26, 2013, 02:08:44 AM
How do I make background effects like the falling cherry petals/maple leaves/snowflakes?
...Basically do what I said in my above post. Don't put them in the actual background routine, though.
Call startConfetti() -> startConfetti() is a task that calls spawnConfetti() every so often -> spawnConfetti creates an effect object on a low layer and has it do some stuff before being deleted

That's the gist of it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Fujiwara no Mokou on August 26, 2013, 06:37:01 AM
How do I make background effects like the falling cherry petals/maple leaves/snowflakes?

You mean just like the Touhou Games, right? There are several ways to do this.
I recommend using effect objects. Even with that, there are several ways to do it.
Too many effect objects can slow Danmakufu down, however.
But if you just use one object and draw it as a TriangleList primitive, and play with the vertices to make it look as if though there are many objects, that would do you much good.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 26, 2013, 06:35:34 PM
I dunno if this is allowed, but does anybody know which sound in ZUN's SE files is the one used for shooting? (The first sound used in Youmu's first nonspell.)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on August 26, 2013, 09:10:16 PM
Enemy shots are usually tan00, 01 and 02. plst00 is player shot.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 27, 2013, 05:47:12 AM
Okay, thank you!

I kept using plst00 for the really small bullets *facepalm*.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 27, 2013, 03:54:48 PM
How exactly does Collision_Obj_Obj work?
The wiki says to use "object 1" and "object 2" when using it, but are these the task names?
Or are they the object IDs and can it only be called when using 2 objects inside 1 task?
Or is it something else and am I missing something?

Edit: I'm sorry for double posting, I didn't see it until I pressed the post button.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on August 27, 2013, 04:37:54 PM
Yes, they are two object ID's. I'm not entirely sure how to use them correctly, but here is a link to a mini-tutorial I made on making simple 2-way object collision objects: http://www.shrinemaiden.org/forum/index.php/topic,14911.msg1001257.html#msg1001257 (http://www.shrinemaiden.org/forum/index.php/topic,14911.msg1001257.html#msg1001257)

Please correct me or come with a simpler/better version as I would too like to know this. This is just the way I managed to get it working.

If you use the user defined value together with some values in the master/slave script, it should work. Other than that, I guess you have to use common data in some way if you want alot of script-global values.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 29, 2013, 05:54:08 AM
Okay, that seems logical. I cannot say I fully understand, but the problem I had has been resolved anyway, so that's okay to me.
I'll just look over it again once I understand what exactly is happening.

To ask another question:
I am trying to replicate the effect of Youmu's background whenever she slows down time.(A lot of flowers spinning in the background)
However, it doesn't work.
 
Code: [Select]
@BackGround{
SetTexture(bg);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,256,256);
SetGraphicScale(1.9,1.9);
SetGraphicAngle(0,0,0);
DrawGraphic(GetCenterX,GetCenterY);

SetTexture(lay);
SetRenderState(ALPHA);
SetAlpha(timeslow);
SetGraphicRect(0,0,256,256);
SetGraphicScale(1.9,1.9);
SetGraphicAngle(0,0,spin);
DrawGraphic(GetCenterX,GetCenterY);
spin++;
}
timeslow is a variable that is set to 255 whenever time slows down.
Is there a way to fix this? Or do I have to use effect objects?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 29, 2013, 09:33:06 AM
See:
Quote from: Drake
Next time, when you say something is wrong, please also describe what is going wrong, not just what you want and "it isn't working". It helps.

Does it just not show up or what? The code looks fine besides still having to do the processing for the overlay every frame.
Main things:
- wrap the drawing in an if(timeslow>0) clause so you aren't drawing an invisible image all the time
- check if you actually loaded the graphic
- just set the alpha value to 255 to check if it draws at all
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: pogisanpolo on August 29, 2013, 02:24:01 PM
Can you explain why it's looking for the file in the root DNH directory? Where is the script you're running and what do your directories look like? Also, does including sanGayaFramework.dnh before variables.dnh but after the other random variable declarations do anything different?

Sorry about the delay. Got really busy. Anyway, back on topic.

I have absolutely no idea why the script is looking at the DNH root. the directories look something like this:

Touhou Danmakufu
>bgm
>img
>lib
>player
>replay
>se
>snapshot
>script
 |
 >all the other scripts
 >testSign (where all my stuff are.)
     |
     >>>bgm
     >>>devDocs (just to track progress)
     >>>img
     >>>libs (ultimately didn't use this. it's empty. Will probably remove)
     >>>SFX
     >>>system (where libs went to)

The script is running within testSign.
I was doing some code cleanup before the project got too big and decided to take off a number of comments that don't do anything useful in understanding what the code does. If I delete that particular comment however, the code breaks.
I tried moving sanGayaFramework.dnh before variables.dnh. Nothing special happens until I delete that comment which breaks the code. I tried playing around with the comment and it won't accept any other text.

Edit: ran a couple more tests: apparently, the comment must be placed within script_enemy_main before #include_function ".\sanGayaFramework.dnh". I have absolutely no idea why a comment can make or break the code.
Edit2: ran even more experiments. changing ".\variables.dnh" to GetCurrentScriptDirectory~"variables.dnh" still has danmakufu looking at the root.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on August 29, 2013, 04:29:37 PM
Sorry about the delay. Got really busy. Anyway, back on topic.

I have absolutely no idea why the script is looking at the DNH root. the directories look something like this:
//Stuff

The script is running within testSign.
I was doing some code cleanup before the project got too big and decided to take off a number of comments that don't do anything useful in understanding what the code does. If I delete that particular comment however, the code breaks.
I tried moving sanGayaFramework.dnh before variables.dnh. Nothing special happens until I delete that comment which breaks the code. I tried playing around with the comment and it won't accept any other text.

Edit: ran a couple more tests: apparently, the comment must be placed within script_enemy_main before #include_function ".\sanGayaFramework.dnh". I have absolutely no idea why a comment can make or break the code.
Edit2: ran even more experiments. changing ".\variables.dnh" to GetCurrentScriptDirectory~"variables.dnh" still has danmakufu looking at the root.

Can you pastebin the included scripts?

Also, this is probably stupid, but you have the correct number of { and }, right?

And also, you don't do any directory changing or anything, right? And you don't have a #TouhouDanmakufu inside the included files, right? (that will automatically bring up an error).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on August 29, 2013, 06:43:06 PM
Quote from: Drake
Next time, when you say something is wrong, please also describe what is going wrong, not just what you want and "it isn't working". It helps.

See:
Does it just not show up or what? The code looks fine besides still having to do the processing for the overlay every frame.
Main things:
- wrap the drawing in an if(timeslow>0) clause so you aren't drawing an invisible image all the time
- check if you actually loaded the graphic
- just set the alpha value to 255 to check if it draws at all

I'm sorry, I was kind of hasty when I typed that question. Which is why I didn't elaborate on the problem.
The problem was that it wouldn't appear. However, while pentuple-checking the code, I found out that I forgot to type the extension behind the variable name.  :colonveeplusalpha:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 29, 2013, 11:05:15 PM
pogisanpolo: Ah, I remember the problem now.

When you have a header in your script, such as #Title, #Player, and so on, these aren't read at runtime the same way as the rest of the script, they're preprocessed for that header information. The problem occurs from two steps:

1. The file is searched for headers matching valid patterns, and accepts the first instance matching the pattern. If you write #Title[X] then #Title[Y], the script's title will be X. For #include headers, it just finds all of the unique script paths, and will ignore duplicates. This is useful in a way, since if you accidentally include a script twice you won't have duplicates of whatever was in it. This preprocessing is not affected by comments, since it isn't run by the interpreter. You can try commenting out #TouhouDanmakufu all you want but it'll still work.

2. Then when the script is loaded, it grabs the #include headers, loads the associated scripts and basically pastes them directly where the header was found. However, because this is done when the script is actually running (i.e. it's in script_enemy_main), the interpreter is affected by comments, and the #include line is commented out. Since the other instance of the #include was tossed out before, you are no longer loading the script at all.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: pogisanpolo on August 30, 2013, 03:43:33 AM
Can you pastebin the included scripts?

Also, this is probably stupid, but you have the correct number of { and }, right?

And also, you don't do any directory changing or anything, right? And you don't have a #TouhouDanmakufu inside the included files, right? (that will automatically bring up an error).

I've included the main script as well. I've used Victini's and Johnny Walker's stuff as a boilerplate so for those familiar with their work, much of the code may look familiar with a couple of tweaks here and there to serve my purposes. The lack of a dedicated IDE means it's entirely possible I missed something as simple as one or two curly braces. On that note, I prefer tasks.

http://pastebin.com/ejrLdmq9 //main script
http://pastebin.com/E0F48WTM //variables.dnh
http://pastebin.com/pNhdjtsw //moveFunctions.dnh
http://pastebin.com/a8LTSQAk //shotVariables.dnh
http://pastebin.com/MtqDzmFa //sanGayaFramework.dnh
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on August 31, 2013, 01:50:27 AM
I've included the main script as well. I've used Victini's and Johnny Walker's stuff as a boilerplate so for those familiar with their work, much of the code may look familiar with a couple of tweaks here and there to serve my purposes. The lack of a dedicated IDE means it's entirely possible I missed something as simple as one or two curly braces. On that note, I prefer tasks.

http://pastebin.com/ejrLdmq9 //main script
http://pastebin.com/E0F48WTM //variables.dnh
http://pastebin.com/pNhdjtsw //moveFunctions.dnh
http://pastebin.com/a8LTSQAk //shotVariables.dnh
http://pastebin.com/MtqDzmFa //sanGayaFramework.dnh

Yup. This is a unique case for me.

Anyways, I've never seen anyone ever include their @Initialize and everything. The tasks should be in the included script, and the @Initialize, etc. should all be in the main script. What you just did may actually be the problem (others will need to confirm).

Also, regarding Victini, I'm going to let you know now that Victini does not use #DNH[Single] or #DNH[Plural] at all. I highly advise against using his coding style for attacks because he doesn't use more traditional means of scripting.

This is what I would do: move the tasks into sanGayaFramework.dnh and move the all of the contents of sanGayaFramework.dnh after all of the @include_functions in the script_enemy_main.

It may or may not fix your problem, but it will definitely make it easier to debug.

There doesn't seem to be a problem with the other include_functions.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: pogisanpolo on September 01, 2013, 06:35:51 AM
Yup. This is a unique case for me.

Anyways, I've never seen anyone ever include their @Initialize and everything. The tasks should be in the included script, and the @Initialize, etc. should all be in the main script. What you just did may actually be the problem (others will need to confirm).

Also, regarding Victini, I'm going to let you know now that Victini does not use #DNH[Single] or #DNH[Plural] at all. I highly advise against using his coding style for attacks because he doesn't use more traditional means of scripting.

This is what I would do: move the tasks into sanGayaFramework.dnh and move the all of the contents of sanGayaFramework.dnh after all of the @include_functions in the script_enemy_main.

It may or may not fix your problem, but it will definitely make it easier to debug.

There doesn't seem to be a problem with the other include_functions.

I put the initialize and other things within the include after a while since I found most of the code in there to be repetitive with a couple of minor tweaks which can be done by passing variables, in this case it would be the boss sprites to use, spell card timers and spell card names. That way, I can get the repetitive stuff out of the way and work on the patterns themselves. The entire set of scripts are all spell cards. Anyways, I'll try out your suggestion and I'll take note of what you said about Victini's coding style. I might consider moving @Initialize out of sanGayaFramework.dnh for starters and work from there.

And thanks to your comment, now I'm sure I'm probably the only one here who put the in
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 01, 2013, 05:55:49 PM
Can someone help me with this effect object? "while(Obj_BeDeleted(obje)==false){" doesn't seem to be working.
Code: [Select]
function CreateSprite(texture, width, height){
let obje=Obj_Create(OBJ_EFFECT);
let srate = 0;
Obj_SetPosition(obje,GetX,GetY);
ObjEffect_SetTexture(obje,texture);
ObjEffect_SetRenderState(obje,ALPHA);

ObjEffect_SetPrimitiveType(obje,PRIMITIVE_TRIANGLESTRIP);
ObjEffect_CreateVertex(obje, 4);

ObjEffect_SetVertexXY(obje,0,-width/2,-height/2);
ObjEffect_SetVertexXY(obje,1,width/2,-height/2);
ObjEffect_SetVertexXY(obje,2,-width/2,height/2);
ObjEffect_SetVertexXY(obje,3,width/2,height/2);
        ObjEffect_SetLayer(obje,5);
ObjEffect_SetVertexUV(obje,0,0,0);
ObjEffect_SetVertexUV(obje,1,width,0);
ObjEffect_SetVertexUV(obje,2,0,height);
ObjEffect_SetVertexUV(obje,3,width,height);

return obje;

while(Obj_BeDeleted(obje)==false) {
srate++;
ObjEffect_SetAngle(obje,0,0,srate);



yield;
}
}

For some reason it won't spin around like want it to. Normally "while(Obj_BeDeleted(obje)==false) {" is supposed to act like a mainloop right?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 01, 2013, 06:06:32 PM
Can someone help me with this effect object? "while(Obj_BeDeleted(obje)==false){" doesn't seem to be working.
Code: [Select]
function CreateSprite(texture, width, height){
let obje=Obj_Create(OBJ_EFFECT);
let srate = 0;

//Lots of code

return obje;

while(Obj_BeDeleted(obje)==false) {
srate++;
ObjEffect_SetAngle(obje,0,0,srate);



yield;
}
}

For some reason it won't spin around like want it to. Normally "while(Obj_BeDeleted(obje)==false) {" is supposed to act like a mainloop right?

Firstly...

use
while(!Obj_BeDeleted(oboe){}

Secondly, it does act like a @MainLoop, but only after executing everything before it.

Change the code and see if it works.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 01, 2013, 06:18:28 PM
Nope. Still does nothing.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on September 01, 2013, 06:18:37 PM
The while loop never gets to be evaluated because you are returning the Effect Object's ID--and effectively ceasing to execute the rest of the code from that point. The solution is simple if you still want to return the ID: define a separate task containing the while loop inside your CreateSprite function, and call the task before your return call.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 01, 2013, 06:26:27 PM
Thanks it worked.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: ExPorygon on September 01, 2013, 06:44:07 PM
use
while(!Obj_BeDeleted(oboe){}
Um, that line is exactly equivalent to while(Obj_BeDeleted(obje)==false) {}. There's functionally no reason to use one over the other.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 01, 2013, 06:50:25 PM
Um, that line is exactly equivalent to while(Obj_BeDeleted(obje)==false) {}. There's functionally no reason to use one over the other.

Oh, OK. I've never seen it before though.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on September 01, 2013, 11:38:52 PM
Obj_BeDeleted() returns either true or false. With equality, if it returns true, you evaluate (true == false) which is false and the loop ends, and if it returns false, you evaluate (false == false) which is true and the loop continues. Using negation, returning true you would evaluate (! true) meaning "NOT true", which is still false and the loop ends, and if it returns false you evaluate (! false) which is true, loop continues.

That's really odd though. It's like saying you've never seen x = x + 5 and have only seen x += 5.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 02, 2013, 12:23:13 AM
Obj_BeDeleted() returns either true or false. With equality, if it returns true, you evaluate (true == false) which is false and the loop ends, and if it returns false, you evaluate (false == false) which is true and the loop continues. Using negation, returning true you would evaluate (! true) meaning "NOT true", which is still false and the loop ends, and if it returns false you evaluate (! false) which is true, loop continues.

That's really odd though. It's like saying you've never seen x = x + 5 and have only seen x += 5.

Most scripts I remember use !Obj_BeDeleted, and I do too. Maybe that's why it threw me off. I guess I'm just too used to it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on September 02, 2013, 08:09:07 AM
Just to note.

It is has nothing to do with not being used to, however more like knowledge and style. A beginner scripter would not use the exclamation mark like that and only recognize it in statements such as == and !=. I used that style in the old days as well. Later on if someone understands the exclamation mark, he/she will reduce redundancy and apply "proper" style.

It is a non-issue to be pointed out or even commented, unless you're teaching the person code-clean up. Which is in this thread usually not priority. Obviously that change wasn't going to fix his initial problem.

Also another note in general for everybody:
Please refrain from noise posts if you don't test out the script/code yourself. I am noticing too many posts in this thread where people post help but actually never test it out themselves. Don't post because you just want to post. Post because you have tested and/or fixed the issue for the user. There is a secondary reason why we ask people to post their code in pastebin. Not just to see it, but also to quick copy/paste into our own dnh engines and test out what is going on.

Thanks.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on September 02, 2013, 05:02:11 PM
Then I'm going to jump in with another question:
The sprite of my player character won't appear.
The options appear just fine, the life image (which is the same image) appears too.
The sprite however, won't appear.
Does anybody know what causes this?
This (http://pastebin.com/yGqY2CMy) is the script if anybody wants to see.

Thanks in advance!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 02, 2013, 05:16:18 PM
Then I'm going to jump in with another question:
The sprite of my player character won't appear.
The options appear just fine, the life image (which is the same image) appears too.
The sprite however, won't appear.
Does anybody know what causes this?
This (http://pastebin.com/yGqY2CMy) is the script if anybody wants to see.

Thanks in advance!

You don't DrawGraphic (GetPlayerX,GetPlayerY);
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on September 03, 2013, 03:02:22 PM
You don't DrawGraphic (GetPlayerX,GetPlayerY);
*Facepalm*
I keep forgetting the most basic things. I'm sorry for asking such a stupid question.

But, to ask even more questions:
-Is it possible to set a hitbox on effect objects outside spellcards?
I need to make something like that both as an enemy bullet, and as a player bullet (object).
The enemy bullet is just a normal kind of bullet (object), and the player bullet is slightly similar to DDC ReimuA's Gohei.

-And how is the hitbox for user defined bullets calculated? I can't find any text that indicates that.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on September 03, 2013, 11:28:51 PM
It's about a third of the defined rect's smaller dimension.

You can make your own collision checking for the object and use AddLife(-x) to damage the enemy. Use SetCollisionB() on the same object to have it hit the player.
If you're doing this then obviously you don't need to define it as a bullet and so the calculated hitbox won't matter.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 04, 2013, 08:30:58 PM
How do you use the StartConfetti?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on September 04, 2013, 11:57:05 PM
You're supposed to make it yourself, I was just outlining the general structure. You run a task that loops and calls a function every few frames. That function only makes one particle and moves it around and whatever.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 05, 2013, 12:33:35 AM
Oh derp.  :blush:  But thank you.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on September 06, 2013, 03:10:02 PM
The code I made won't run correctly. I can't really say for sure, but the laser seems to spawn just like I want, and does what I want, but it keeps spawning in the top-left corner. (0,0?)
Could somebody please check it out and help me find the error?
http://pastebin.com/bfpY9U7R (http://pastebin.com/bfpY9U7R)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Necrotek on September 06, 2013, 03:16:05 PM
Actually I never tried to write scripts for Danmakufu but... why do you try to use x,y patemeters for task sword() but make them equal to zero at 14-15 lines?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 06, 2013, 03:31:57 PM
Actually I never tried to write scripts for Danmakufu but... why do you try to use x,y patemeters for task sword() but make them equal to zero at 14-15 lines?

Code: [Select]
        task sword(x,y,angle,length,width,graphic,delay){
                let obj = Obj_Create(OBJ_LASER);
                let x = 0;
                let y = 0;
               
                Obj_SetPosition(obj,x,y);
He is right. The laser will always be at 0,0 because of this:
 
Code: [Select]
               let x = 0;
                let y = 0;

X and Y are already defined as arguments that the tasks take. Delete those two lines.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on September 06, 2013, 05:20:50 PM
That idea never occurred to me. Looking back on it, it seems pretty stupid, but when I wrote it I wasn't even thinking about those variables.
The variables having the same name is a coincidence; they were used for some calculations for something I tried before.
I completely forgot about the variables having the same name. Thanks for helping!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 06, 2013, 05:55:26 PM
That idea never occurred to me. Looking back on it, it seems pretty stupid, but when I wrote it I wasn't even thinking about those variables.
The variables having the same name is a coincidence; they were used for some calculations for something I tried before.
I completely forgot about the variables having the same name. Thanks for helping!

You're welcome.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 06, 2013, 11:54:27 PM
I need some help with this little effect script.

Difficulty Display (http://pastebin.com/vPazWQJA)
Stage Script (http://pastebin.com/rAmkmZsX)

This will create a difficulty mode display on the screen just like in official Touhous. Works fine in single scripts, but when I apply it to a stage script the game crashes.

Don't know why.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 07, 2013, 12:08:44 AM
Can you make an enemy (like a fairy) share the same health with the boss?
(working on the Touhou Medley & Seiga needs her zombie)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 07, 2013, 12:58:23 AM
Can you make an enemy (like a fairy) share the same health with the boss?
(working on the Touhou Medley & Seiga needs her zombie)

Yes. If you call it as an enemy, then you use SetLife.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Necrotek on September 07, 2013, 01:16:23 AM
Yes. If you call it as an enemy, then you use SetLife.
I think he meant that the damage done to the fairy is also done to the boss and vice versa (and I guess the defeat one of them would do the same to the other one). SetLife() sets only specific value and you can't make a "reference", right? Or you meant to make a check for both of them to copy other's health?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 07, 2013, 01:24:48 AM
I think he meant that the damage done to the fairy is also done to the boss and vice versa (and I guess the defeat one of them would do the same to the other one). SetLife() sets only specific value and you can't make a "reference", right? Or you meant to make a check for both of them to copy other's health?

Yes.

There is GetLife and GetEnemyLife, as well as SetDamageRateEx. Look these up on the Wiki.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on September 07, 2013, 03:32:35 AM
How do I make an effectobject start straight and the gradually bend so it's curved?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on September 07, 2013, 03:46:14 AM
You'd have to use trigonometry to calculate vertex positions and move them around, and also either adding new vertices as it bends, or just starting the object with a lot of vertices. In any case it's a rather big pain.

Depending on the effect you want, there is probably an easier way to go about it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 07, 2013, 08:21:40 PM
Is there way to disable the life bar and timer? I've found a function to disable the HUD but it doesn't count for those two.

This is probably a exe mod( more than likely).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: ExPorygon on September 07, 2013, 08:53:03 PM
Is there way to disable the life bar and timer? I've found a function to disable the HUD but it doesn't count for those two.

This is probably a exe mod( more than likely).
There is no way to outright remove them. You can only cover them up. If you look at other scripts that have custom HUD effects, you'll see that they usually either cover up the lifebar with their own or just leave it in addition to their own.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on September 07, 2013, 09:03:11 PM
The best thing I could get on my latest 0.12m script is to:
1. Make a folder next to your 0.12m files (like the exe file) and name it "img".
2. Use the danmakufu archiver (http://www.shrinemaiden.org/forum/index.php/topic,4731.0.html) to unpack the images from the "th_dnh.dat" file.
3. Put the unpacked images in the "img" folder.
4. Go to the unpacked image named "System.png".
5. Delete the line graphics which makes up the lifebar in 0.12m.
6. Done! While the lifebar will still be drawn, it will be completely invisible. This however, forces you to upload the entire 0.12m package folder if you want to share your modified script.

Other than that, it remains if it is possible to make a boss fight in 0.12m by chaining together regular enemy files with common data to act like a boss script, which would kind of fix it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 08, 2013, 12:06:55 AM
Ah ok. I'll remember to do that.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 08, 2013, 12:35:39 AM
Other than that, it remains if it is possible to make a boss fight in 0.12m by chaining together regular enemy files with common data to act like a boss script, which would kind of fix it.

You will most likely need to contact Mewkyuu/Miransu if you decide to do this. Or you can wait for RaNGE 10 Sakuya to come out/get his Hatate/Giratina/Grovyle from Bulletforge. That's his scripting style.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on September 08, 2013, 02:42:13 PM
I'm trying to make a custom concentration (http://pastebin.com/95x1JNqc) effect for a script, but currently the image I'm trying to use doesn't appear.
The image is loaded into memory, and the coordinates are okay too. Does anybody know what could be the problem?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 08, 2013, 02:54:32 PM
I'm trying to make a custom concentration (http://pastebin.com/95x1JNqc) effect for a script, but currently the image I'm trying to use doesn't appear.
The image is loaded into memory, and the coordinates are okay too. Does anybody know what could be the problem?

Firstly:
                Obj_SetAlpha(obj,128);
does not work.

You should use
ascent(i in 0..4){ObjEffect_SetVertexColor(obj,i,128,255,255,255);}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on September 08, 2013, 10:10:13 PM
Putting LoadGraphic() outside of a script block won't run it. You have to put it in a routine like @Initialize or @MainLoop, or in any other routine called from such.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on September 09, 2013, 06:35:23 AM
So it has to be loaded using some sort of task?
Like the shot replace script?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on September 09, 2013, 07:16:25 AM
I'm saying that these
Code: [Select]
script_enemy_main{
   LoadGraphic()
   @Initialize{}
   LoadGraphic()
   @MainLoop{}
   LoadGraphic()
   function{}
   LoadGraphic()
   task{}
   LoadGraphic()
}
don't work,
these
Code: [Select]
script_enemy_main{
   @Initialize{LoadGraphic()}
   @MainLoop{LoadGraphic()}
   function{LoadGraphic()}
   task{LoadGraphic()}
}
will

Just put LoadGraphic() at the start of Concentration03().
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on September 10, 2013, 02:32:25 PM
Hi,hi everybody c: how can i make a main menu for my game in danmakufu 0.12 ? and how can i make a stage appear after another stage immidiatley?Thanks for the halp!sorry bad english.. :derp:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on September 10, 2013, 07:06:49 PM
Main menu. (http://www.shrinemaiden.org/forum/index.php/topic,9281.msg618739.html#msg618739)
 chaining stages. (http://www.shrinemaiden.org/forum/index.php/topic,14911.msg1012709.html#msg1012709)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: AkaoniP on September 10, 2013, 08:53:52 PM
How can I know when the boss have the current X and Y coordinates as the player?
I mean, like when the boss is chasing the player and when he reaches it triggers something

And, is there a way to change the default buttons of danmakufu?
I tried using config.exe but didn't work.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 10, 2013, 09:10:02 PM
How can I know when the boss have the current X and Y coordinates as the player?
I mean, like when the boss is chasing the player and when he reaches it triggers something

And, is there a way to change the default buttons of danmakufu?
I tried using config.exe but didn't work.

Code: [Select]
if(((|GetX-GetPlayerX|)^2+(|GetY-GetPlayerY|)^2)^0.5 < 60){
//Stuff
}
This code will only run if the distance between the enemy and the player is 60 pixels or less.

Never use this code:
Code: [Select]
if(GetEnemyX==GetPlayerX && GetEnemyY==GetPlayerY){/*stuff*/}It will never trigger.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: AkaoniP on September 10, 2013, 10:42:16 PM
Code: [Select]
if(((|GetX-GetPlayerX|)^2+(|GetY-GetPlayerY|)^2)^0.5 < 60){
//Stuff
}
This code will only run if the distance between the enemy and the player is 60 pixels or less.
Just what I needed. Thank you very much!

Never use this code:
Code: [Select]
if(GetEnemyX==GetPlayerX && GetEnemyY==GetPlayerY){/*stuff*/}It will never trigger.
I feel stupid right now  :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 10, 2013, 10:45:34 PM
I feel stupid right now  :V

It's fine; it's just that since decimals are used, the boss may never actually hit the player target.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on September 11, 2013, 10:53:46 AM
Main menu. (http://www.shrinemaiden.org/forum/index.php/topic,9281.msg618739.html#msg618739)
 chaining stages. (http://www.shrinemaiden.org/forum/index.php/topic,14911.msg1012709.html#msg1012709)
don't understand  :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on September 11, 2013, 04:44:22 PM
You might want to explain exactly what you don't understand. I linked 2 pages, which explain what you were asking.
In this case, you might not understand the menu part, but it could be the stage chaining part too. Or both.
You might even not know those were links, and you might've come to a stop there.

The basic idea of my post is:
What part do you not understand? Otherwise others can't help you.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on September 12, 2013, 05:42:26 AM
Oh i just need to use functions? :derp: and how can i make the boss to move during the events?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on September 12, 2013, 02:24:16 PM
Oh i just need to use functions?
I have no idea what you mean. I give up.

and how can i make the boss to move during the events?

In the event script, you should place an event step:
Code: [Select]
script_event something{

@Initialize{
(image loading and stuff)
}

@MainLoop{
stuff happens;
SetStep(1); //sets the eventstep value to 1
more stuff happens;
}

@Finalize{
(image deleting etc.)
}
}

And then in the main script's @MainLoop:
Code: [Select]
@MainLoop{
if(GetEventStep==1){ makethebossmove;}
yield;
}

That should be the gist of it.



Now for a question of my own:
What exactly is common data?
From what I've seen, it is a value shared across scripts.
And while the Danmakufu wiki shows how it works, it doesn't explain some things:

1. If the above dfinition of common data is false, could someone post what it is supposed to be?

2. Where are these values stored exactly?

3. I was looking at Mewkyuu's Giratina script, and in the stage script, he used CreateEnemyFromFile together with common data to make the boss file.
But for the location to spawn the enemy, he used common data too instead of simply writing two variables to store this location in.
Are there any benefits when using common data?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 12, 2013, 09:06:29 PM
Can someone give me a tip on how to make the same ripple effect that SA-DDC has?(the one that makes the screen ripple where ever the boss is) I'm completely lost on where I would start.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: gtbot on September 12, 2013, 09:52:11 PM
http://www.shrinemaiden.org/forum/index.php/topic,5164.msg440550.html#msg440550
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 12, 2013, 10:21:00 PM

Now for a question of my own:
What exactly is common data?
From what I've seen, it is a value shared across scripts.
And while the Danmakufu wiki shows how it works, it doesn't explain some things:

1. If the above dfinition of common data is false, could someone post what it is supposed to be?

2. Where are these values stored exactly?

3. I was looking at Mewkyuu's Giratina script, and in the stage script, he used CreateEnemyFromFile together with common data to make the boss file.
But for the location to spawn the enemy, he used common data too instead of simply writing two variables to store this location in.
Are there any benefits when using common data?

When you create a CommonData, it's default is "0" (I think).

He used the common data because otherwise, the enemies would spawn at weird places. You can think of Common Data as variables that exist in multiple scripts and can be accessed in multiple scripts. For example, if you want to make multiple difficulties, Common Data is a very efficient way to communicate to Single scripts what to do. Of course, you would use GetCommonDataDefault instead of GetCommonData.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 12, 2013, 10:26:53 PM
http://www.shrinemaiden.org/forum/index.php/topic,5164.msg440550.html#msg440550
I know about that but I want it to work only for the boss. That script uses a separate image and makes it ripple but I want it to work like what you did in your ph3 mamizou script.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: gtbot on September 12, 2013, 10:49:21 PM
I was able to do that because in ph3 you can re-render the entire gamefield, so I used that code and for the image I just used the rendered game field (background part). For a similar effect in 0.12m, I think the way to do it would be with render targets (http://dmf.shrinemaiden.org/wiki/Render_Targets),  however I am unsure exactly how to do it, or if you can actually do it.

If you just want the effect to be centered on the boss itself, continue reading the code snippet, it tells you where to change GetPlayerX/Y to GetX/Y.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 12, 2013, 11:11:39 PM
Ok, I'll look into render targets.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 15, 2013, 01:15:32 AM
Is there a way to make a boss's movement animation play in reverse when coming to a stop?  (working with seija and it looks really choppy without the reverse to a stop)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 15, 2013, 03:34:52 AM
Just set up the animation order in reverse.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 15, 2013, 03:58:21 AM
But that won't work because it could/will happen before she comes to a stop.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on September 15, 2013, 04:13:26 AM
I don't understand what you mean there. Your animation logic should essentially have the boss perform the desired movement animations, "stall" the process altogether while it is moving, and then do the exact same but in reverse so it can transition smoothly back to an idle state.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 15, 2013, 04:51:32 AM
Is there a way to get the animation library to work with enemy scripts? I tried it but the enemy won't animate. Instead it's stuck in still life on the first frame. The way I'm doing it seems very messy and using fast forward breaks the animations.

EDIT: It also causes graphical error to flicker on the screen if too many appear.
EDIT2: Nvm, calling the task in the Draw Loop was causing the problems. So I moved it to the mainloop and it works perfectly.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on September 15, 2013, 05:26:38 PM
Can I make an object bullet not lose it's properties after the enemy is deleted?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 15, 2013, 06:23:21 PM
Can I make an object bullet not lose it's properties after the enemy is deleted?

I do not believe it to be possible without workarounds.

You will have to clear the enemy graphic but keep the enemy alive until the commands have been executed.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on September 15, 2013, 07:21:54 PM
I do not believe it to be possible without workarounds.

You will have to clear the enemy graphic but keep the enemy alive until the commands have been executed.
Ok, and I hve another related question: How do I use VanishEnemy; without running Finalize?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 15, 2013, 07:32:52 PM
Ok, and I hve another related question: How do I use VanishEnemy; without running Finalize?

if(GetLife<10){VanishEnemy;} should work.

You can't skip running Finalize. Just dump Vanish Enemy inside an if statement in @MainLoop or a task.

[And again. LOCAA will give you a faster reply]
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: The Noodles Guy on September 16, 2013, 08:08:24 PM
Silly question. How do I make bullets that 'explode' into more bullets?

Like some of Miko's nonspells.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 16, 2013, 09:20:36 PM
Silly question. How do I make bullets that 'explode' into more bullets?

Like some of Miko's nonspells.

Use CreateShotA with AddShot.

Or use an Object Bullet that shoots a ring of bullets before Obj_Delete
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 16, 2013, 10:20:55 PM
How would I create the damage sound effect that plays while the enemy/boss is being shot at? I can't seem to figure it out.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Qwertyzxcv on September 16, 2013, 11:24:21 PM
How would I create the damage sound effect that plays while the enemy/boss is being shot at? I can't seem to figure it out.
1. Make a damage task thing.
2. Make the GetLife a variable. (I put enemylife)
3. Wait like 3 frames.
4. Make an if statement that checks if the life is low.
5. Make an if in that if that checks if the current life is less than enemylife. (The life a few frames ago.)
6. If so then the boss is being damaged! Play a sound effect.
7. Loop that and reset enemylife.

I think this is right:

task damage{
 let enemylife = GetLife;
  loop{
  wait(3);

   if(GetLife < 600 && GetLife > 300){
    if(GetLife < enemylife){
     PlaySE(damageSE);
    }
   }

  enemylife = GetLife;
 }
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 16, 2013, 11:41:07 PM
After making some modifications to your task it worked. Thanks.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on September 21, 2013, 02:46:37 PM
Uhm..another silly question c: there are  patterns i can't create without sin,cos? if there are give me please an example :1
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 21, 2013, 03:34:01 PM
Uhm..another silly question c: there are  patterns i can't create without sin,cos? if there are give me please an example :1

Here is a circle.

let angle = 0;
loop(30){CreateShot01(GetX+60*cos(angle), GetY+60*sin(angle), 2, angle, RED01, 5); angle+=360/30;}

This code requires Sine and Cosine. You won't be able to make anything extremely advanced without knowledge of sin/cos/atan, and it will help you in life.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 21, 2013, 04:20:08 PM
Since I've finished stage 2 of MMS I wanted to create my own SetScore function. Why? Danmakufu has some weird graphical glitch on effect objects and it makes some things look bad for the duration of the spell. Not to mention the actual score you set isn't what you get at the end of the spell(you can see it during the spell too)

My question is how does Danmakufu figure out how much score to subtract per second?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Maths ~Angelic Version~ on September 21, 2013, 04:36:30 PM
Uhm..another silly question c: there are  patterns i can't create without sin,cos? if there are give me please an example :1
Why do you ask about this? Don't you know how sines and cosines work? If you don't, I recommend that you try to find it out (I suggest reading about trigonometry or something like that). If the sin/cos functions for some reason don't work, then sorry, I don't know what to do.
For instance, the best way to make a simple circle is this:
Code: [Select]
let angle=0;
let radius=50;
loop(40)
{
CreateShot01(GetX radius*cos(angle),GetY radius*sin(angle),0,angle,BLUE12,60);
angle =360/40;
}
There *is* an alternative way to make a circle that doesn't need sines/cosines, but it gives an uneven distribution of bullets, and it's annoying to get their angles right (you either have to use atan or atan2, which includes sin/cos anyway, or have the circle dissolve another way entirely (Thanks, Drake)). Here's the awkward method:
Code: [Select]
let radius=50;
let x=-radius;
loop(20)
{
let y=(radius^2-x^2)^0.5;
CreateShot01(GetX x,GetY y,0,atan2(y,x),RED12,0);
CreateShot01(GetX x,GetY-y,0,atan2(-y,x),RED12,0);
x =2*radius/(20-1);
}
As Sparen said, sines and cosines will make your life a lot easier. Many patterns, particularly more complex patterns, are difficult/impossible/ugly if you try to create them without sines and cosines.
Edit: Fixed plus signs and added a sentence. Thanks, Drake.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on September 21, 2013, 09:44:50 PM
If you throw an atan in there you're automatically using sin and cos (in a sense) so that doesn't really get around it. Of course the problem is really just a lack of understanding rather than the functions themselves, but yeah.

Your plus symbols didn't show up by the way.

Since I've finished stage 2 of MMS I wanted to create my own SetScore function. Why? Danmakufu has some weird graphical glitch on effect objects and it makes some things look bad for the duration of the spell. Not to mention the actual score you set isn't what you get at the end of the spell(you can see it during the spell too)

My question is how does Danmakufu figure out how much score to subtract per second?
1. What graphical glitch
2. Why do you need to know how DNH calculates spell score if you were going to make a new one anyways
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on September 21, 2013, 10:13:38 PM
I think the graphical glitch he mentions is the pixelation of sprites. I've noticed it happens in a few of my boss spell cards as well, couldn't explain it yet. Though I swear I've read someone posting the cause though on which page was it again? Or was it in the ph3 thread while doing comparisons.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 21, 2013, 11:28:55 PM
Your plus symbols didn't show up by the way.
1. What graphical glitch
2. Why do you need to know how DNH calculates spell score if you were going to make a new one anyways

The graphical glitch is like Helepolis explained, the some of the visuals become pixelated whenever DrawText or SetScore is used. The reason I need to know how danmakufu figures out what to subtract is because the new one isn't going to use SetScore at all, therefor I need to know the formula for decreasing the score overtime.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on September 22, 2013, 12:00:40 AM
The reason I need to know how danmakufu figures out what to subtract is because the new one isn't going to use SetScore at all, therefor I need to know the formula for decreasing the score overtime.
Yes, that's exactly what I mean. If you don't want to use the system the default uses, then just make it up yourself. It isn't as if the internal spell card system uses some amazing magical perfect numbers.

If your lower bound on the score was 0, then you could just reduce it by the maximum spell bonus divided by the number of frames the spell lasts (i.e. timer in seconds * 60). Or more generally, it would be like (maxbonus - minbonus) / (numspellframes - numstartframes) if you wanted a lower bound on the bonus (not zero) and you only wanted the bonus to start descending after a certain number of frames.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 22, 2013, 12:58:21 AM
ok, I'll try that.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 22, 2013, 02:24:49 AM
Is there a tutorial on how to write full game scripts?

And how do you fix the glitching in backgrounds (2d)?
I get random lines when I try to use ZBuffer layers of 2x on tiling of 20+
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on September 22, 2013, 10:40:08 AM
Hi all...it's me again ._. how can i animate bosses?i mean movement,fire and other?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on September 22, 2013, 11:36:01 AM
I reccomend either one of:
- Using the animation library.
- Script it all yourself, by having a task or a phase in which it checks if the boss is moving, standing still or attacking while increasing a frame value. If you have a sprite sheet with evenly placed graphics it also becomes easier to define the graphic rects, which I would do something like this:
Code: [Select]
//somewhere at the start:
let animframe=-1;

let leftrect = 0;
let rightrect = 0;

//In the animation task or whatever.
animframe++;

ascent(anim in 0.."amount of sprites in the animation"){

if(animframe==(anim*5)){
leftrect = anim*"width of sprites";
rightrect = "width of sprites" + anim*"width of sprites";
}

}

if(animframe==("amount of sprites in the animation"*5+5)){animframe=-1;}

SetGraphicRect(leftrect, "top rect", rightrect, "bottom rect");
I'm not sure if this works correctly, but this is mainly how I did boss animations in Ph3. (So I tried to adapt it to 0.12m type scripting.)
The text using quotation marks are just placeholders.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on September 22, 2013, 11:46:47 AM
i don't really understand how yo use animation library .-.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on September 22, 2013, 12:05:54 PM
Isn't there instructions that comes with the download?
It's something like this:
Code: [Select]
//In Initialize:
CreateAnimation("name of the boss", "name of the action", amount of sprites in the animation);
SetAnimationFrame("name of the boss", "name of the action", numerical order of the animation (starts at 0), path to the graphic image, amount of frames, left rect, top rect, right rect, bottom rect);

//In Drawloop or your drawtask:
Animate("name of the boss","name of the action",looping (true==loop, false=no loop, animates until the last graphic) );

That's it really. How to utilize the Animate function and how it works is something you will find out when you try it.

(Obviously you have to include the script first.)
#include_function ".\AnimationLib.dnh"
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on September 22, 2013, 12:08:05 PM
Oh,sorry!thanks ^^"
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 22, 2013, 01:37:12 PM
Is there a tutorial on how to write full game scripts?

Not that I know of. Full games are done through stage scripts, stages are done by tasking and manipulation of tasks and variables to control the background and give the illusion of multiple stages.

Chaining stage tasks is easy as well as changing the background(somewhat easy).

At the end of each stage task, control variables to fade out the background and delete the textures, load new textures and control the background to draw them on to the screen, load the next stage.

You could also make menus. But if you have a hard time understanding how the menus work then stay away from them for now.

I hope I explained it in a way you could understand
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 22, 2013, 03:33:35 PM
That makes sense, thank you!  ^^
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 26, 2013, 11:10:43 PM
Is there a font script, or does anyone know how I would use ZUN's font in danmakufu?(something that can be used like effect objects so I can place it in the frame layer)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: PhantomSong on September 26, 2013, 11:21:00 PM
Is there a font script, or does anyone know how I would use ZUN's font in danmakufu?(something that can be used like effect objects so I can place it in the frame layer)
You mean for dialogue, or spell names and name tags? 
This covers difficulty marker for custom frames, name tags and spell names.  (http://www.bulletforge.org/u/miransu-uwabami/p/zun-style-font-imitations/v/002)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 26, 2013, 11:53:02 PM
You mean for dialogue, or spell names and name tags? 
This covers difficulty marker for custom frames, name tags and spell names.  (http://www.bulletforge.org/u/miransu-uwabami/p/zun-style-font-imitations/v/002)

That's not quite was I meant. But rather a script/function that can imitate DrawText but using the ascii font that Touhou games have the font used in the musicroom, replays, ect....
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 27, 2013, 12:19:34 AM
How do you use SetFog?
Every time I use it, I get a white out of my BG's
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: AkaoniP on September 27, 2013, 02:30:21 AM
That's not quite was I meant. But rather a script/function that can imitate DrawText but using the ascii font that Touhou games have the font used in the musicroom, replays, ect....
Maybe this (http://www.shrinemaiden.org/forum/index.php/topic,12397.msg820400.html#msg820400) is what you are looking for. is not the same font as touhou games though
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on September 27, 2013, 05:47:11 AM
How do you use SetFog?
Every time I use it, I get a white out of my BG's
Could you perhaps show us some code? We cannot judge what you're trying to do without showing your code.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 27, 2013, 09:47:38 PM
Maybe this (http://www.shrinemaiden.org/forum/index.php/topic,12397.msg820400.html#msg820400) is what you are looking for. is not the same font as touhou games though

Yes, thank you. I'll edit the file to include the Touhou font.

EDIT: Luckly me, Blargel's STB Engine has the same script but it's using the real Touhou font. I guess I can use that then.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 27, 2013, 11:11:39 PM
Could you perhaps show us some code? We cannot judge what you're trying to do without showing your code.
The way I've used it is:
SetFog (90, 180, 255, 255, 255);
And I always get a white out
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on September 28, 2013, 02:33:18 PM
The way I've used it is:
SetFog (90, 180, 255, 255, 255);
And I always get a white out
90 and 180 is a pretty close value you know, it means the fog is up really close. How deep is your stage? For example if it is 2048 deep, have you tried setting to 1700-2048 for example etc

[attach=1]
Here is visual aid how you should be approaching fog setting in stages. Of course the numbers are examples. Try what ever works for you.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 28, 2013, 11:53:13 PM
The Stages I use are normally 50*256 long, but thank you for telling me it should be much further away!   :)  (They should write that in Nuclear Cheese's Drawing Tutorial)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on September 29, 2013, 10:41:13 AM
The Stages I use are normally 50*256 long, but thank you for telling me it should be much further away!   :)  (They should write that in Nuclear Cheese's Drawing Tutorial)
You don't understand. If your stage is 256 deep it means that you're putting the fog at very close range, most likely right in front of "the camera". Setting fog is delicate and annoying concept. You shouldn't just think that you need a deeper stage, you need to set your fog at 256,256 -> check results and see what happens. Then you can adjust the minimum parameter until you receive desired effect.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 29, 2013, 04:31:59 PM
Don't use fog with scrolling backgrounds. I tried it and eventually the entire screen is filled with the fog color. It happens faster depending on the speed of the scroll.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 29, 2013, 05:42:04 PM
Don't use fog with scrolling backgrounds. I tried it and eventually the entire screen is filled with the fog color. It happens faster depending on the speed of the scroll.

If you really can't use SetFog, the other option is to spawn object effects. That way you have a lot of control over what happens.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 29, 2013, 09:02:19 PM
Ok, I'm learning effect objects now, so I'll use those instead.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on September 29, 2013, 09:19:21 PM
Don't use fog with scrolling backgrounds. I tried it and eventually the entire screen is filled with the fog color. It happens faster depending on the speed of the scroll.
This is wrong information. Who told you that?

If you really can't use SetFog, the other option is to spawn object effects. That way you have a lot of control over what happens.
This is wrong as well. And major nonsense.

Ok, I'm learning effect objects now, so I'll use those instead.
You're not reading posts. The ones that contain elaborated information.

I guess going through the trouble of explaining things to people is not being appreciated. Post some code first. And I mean your entire code, not just your SetFog.

Edit:

3x SetFog with values. First one showing K's value. 2nd 3rd showing my "tweaked". It is Ph3 you might say, but ph3 and 0.12m has same fog usage, just different function name.
[attach=1]

It seriously cannot be that hard to just follow tutorials and given advise you know.  And yes, this is a scrolling stage.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on September 29, 2013, 09:44:36 PM
This is wrong information. Who told you that?

No one, this is from my own experiences.

SetFog(500,1700,255,100,200);

scroll code
SetGraphicRect(0, 0-f, 640, (400*10));
SetGraphicRect(0-f, 0, 640, (400*10));

This is the result after a few seconds.
(http://s9.postimg.org/p2bgp4xxb/th_dnh_2013_09_29_16_38_48_01.jpg)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 30, 2013, 12:19:25 AM
The Code I was using is:
http://pastebin.com/Bpy3kTUk
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on September 30, 2013, 12:51:38 AM
The Code I was using is:
Code: [Select]

Please pastebin. This giant thing is difficult to scroll through.

Also:
What are these and what function do they hold?
let Y = 0;
let Y2 = -60;
let X = 0;
let X3 = 0;
let Y3 = 0;
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on September 30, 2013, 01:30:44 AM
Those I use in DrawGraphic3D to make the stage scroll... the different layers all move differently
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on September 30, 2013, 06:56:49 AM
Your problem is (if I am not mistaking) that you're stage is even flatter than Suwako. First of all "fog" is related to Z-depth-drawing in stages. I noticed that none of your 3D sprites are set to actually form a 3 dimensional space towards Z, like let us say a box or at least an area that involves Z-distance. All your angles for the sprites are nowhere towards Z as far as I see. If there is no "depth" you won't be able to give the player the impression your stage is fading into the fog.

This is in default (usually advised) how you should be building your stage. Floors along the Z coordinates, flat on its X.  Walls along the Z and Y and ceilings same as floors. The end.

[attach=1]

Again, fog is set based on Z-coordinates. If your stage has no Z-depth then logically it isn't going to work. The way you're viewing your stage can be always altered using the camera functions.

Same goes to you Infinite. I have no idea how you're building your stage. The only thing that should be kept in mind when setting fog is the maximum size of your sprites. It seems that 0.12m will handle fog very strange on textures being larger than 2048 or something. I remember an old discussion with Stuffman in one of the early threads regarding this when I was wrestling with fog. (See edit 3 for the links).

Edit:
Here is some example code to show some example how you should "read" and imagine a 3D stage. Again, all experts have their own way. I am just showing one of them and in my opinion most straightforward one.
Code: [Select]
// FLOOR. This alone is enough to instantly notice the fog.
SetGraphicRect(0,0,512,512);
SetGraphicAngle(90,0,0); // floor is spun flat around its X axis.
DrawGraphic3D(0,-128,0); // floor is slightly placed lower on the Y. (placed lower)

// LEFT wall, notice the X-param for the DrawGraphic
SetGraphicRect(0,0,512,512);
SetGraphicAngle(0,90,0); // walls are spun around their Y axis.
DrawGraphic3D(128,0,0); // This wall is drawn 128 coordinates on X (placed to the left)

// RIGHT wall, notice the X-param for the DrawGraphic
SetGraphicRect(0,0,512,512);
SetGraphicAngle(0,90,0);
DrawGraphic3D(-128,0,0); // This wall is drawn -128 coordinates on X (placed to the right)

You might say, "but Helepolis, your Z-param is also 0! Confusing." That isn't the point here. First of all you need to understand that our sprites are 512x512 by size. This means that if you angle a sprite correctly, it is automatically put down proper along the Z-axis. So our floor is starting at  Z = 0 and ends at Z = 512. Understand? This means that our stage has a depth of 512, because our floor is that long. The floor is also 512 pixels wide, because that is our size.

If you start setting the fog now, you will instantly notice the effect on it by setting for example SetFog(384,512,........);  you don't even need to build walls to notice the effect. A single texture, as long as it has Z-depth, is instantly affected by fog.

Edit 2:
Eventually I think I have to summon a 3D stage drawing tutorial me thinks.

Edit3:  Why texture size matters in 0.12m
http://www.shrinemaiden.org/forum/index.php/topic,296.msg132192.html#msg132192
http://www.shrinemaiden.org/forum/index.php/topic,4771.msg366914.html#msg366914
http://www.shrinemaiden.org/forum/index.php/topic,6424.msg419157.html#msg419157
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on September 30, 2013, 01:12:44 PM
I need Help with making a Script (one spell card because im still a beginner)

My Idea is : Frostbite "Glass Reflection"

How it will work is as the name says:

Cirno will be firing circular pattern constantly  (AQUA02) maintaining a turn of 0.5 and when the bullets goes off screen , it comes back it will become bullet BLUE03 passing cirno and still maintaining a constant bullet turn and goes out with the same rotating speed
The Problem now is how im able to let the bullets come back as a different bullet. and maintain a constant turn speed

the script looks like this
http://pastebin.com/E2yfzcQ0

those two CreateShotA01s is me trying to figure it out my own , but alas if i continue to figure it out on my own i would end up rage quitting  :getdown: so i really need help
any ideas how im able to make it work?

Welcome to RikaNitori, please post large code like this in Pastebin.com. Also please post your post in the correct thread next time. This is a "Help me" post so it goes in the stickies. -Hele
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Spectral Nexus on September 30, 2013, 04:12:11 PM
those two CreateShotA01s is me trying to figure it out my own , but alas if i continue to figure it out on my own i would end up rage quitting  :getdown: so i really need help
any ideas how im able to make it work?

As far as I know, CreateShotA01 doesn't exist. You can either use CreateShotA and SetShotDataA, or CreateShot01, or other bullet functions. If you don't already, you could use the functions list on the wiki for help.

EDIT: Just noticed that the first problem was just a typo, but still, the wiki will always help if you're stuck.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: rikako_asakura on September 30, 2013, 04:39:05 PM
Cirno will be firing circular pattern constantly  (AQUA02) maintaining a turn of 0.5 and when the bullets goes off screen , it comes back it will become bullet BLUE03 passing cirno and still maintaining a constant bullet turn and goes out with the same rotating speed
The Problem now is how im able to let the bullets come back as a different bullet. and maintain a constant turn speed
SetShotAutoDeleteClip is a useful function which can be used to determine at which point the bullets are deleted completely when they are off screen. You could use it to make those bullets go off screen and not be deleted, then use SetShotDataA to move the bullets back to Cirno. Also, you set both CreateShotA lines to be executed at 0 frames, so Danmakufu executes the first then the second at the same time. For the second line, try changing the second parameter after the Bullet ID to any number greater than 0, it is the amount of frames when the SetShotDataA is executed at. For example: SetShotDataA(1, 120, 0, dir, 0, 0.5, -3, BLUE03); will execute that line at 120 frames after the bullet has been shot.

In addition, don't use the variable dir for both lines because that will make the bullets go back to that angle after the amount of frames you specify. Use NULL instead, so the bullet's angle will carry over to the next line. Like this: SetShotDataA(1, 120, 0, NULL, 0, 0.5, -3, BLUE03);

Also, I noticed that you didn't put anything for the turn speed. Instead, you set the acceleration to 0.5 which means that the bullet's speed will increase by 0.5 every frame, not the turn speed. The turn speed is the parameter right after the angle (i.e. dir, NULL etc). Oh yeah, and the speed at that point is 0, so the bullets will not move. The speed is the third parameter. If you look at the functions list on the wiki, as Spectral Nexus said, you'll be able to find all the bullet control functions in Danmakufu and the parameters they have.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on October 07, 2013, 05:19:22 PM
Sorry if necropost  :ohdear:

But is there an easy way to do cylindrical backgrounds?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on October 07, 2013, 09:17:07 PM
But is there an easy way to do cylindrical backgrounds?
Cylindrical backgrounds? That would require you to put pieces of textures with a trig function, like as if you would spawn circle of bullets except spawning "circle" of textures. You'll need to keep in mind the sizes though and number of "faces".
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on October 07, 2013, 09:55:21 PM
Oh my... I hope this looks okay...  :ohdear:
off to test!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on October 13, 2013, 11:58:31 AM
thanks for the help  :) , but another question (im really sorry if i end up bombarding you guys with question , im still learning to script from the very basic through Helepolis' tutorials ) . Lets say i want to make cirno STOP firing.

the script will go

cirno will fire 5 array of bullet
cirno STOP firing
bullets shots more bullets
afterwards, bullets homes in on the player
 and then cirno proceeds to fire once again.

I have no idea how im gonna script that :(  ???

ive tried using wait functions, yield, another task fire command, deleting shots, anything that will stop an execution of a command but nothing works , it either raises an error or cirno will still do her firing bullet things as if no additional commands was added
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on October 13, 2013, 05:32:51 PM
Lets say i want to make cirno STOP firing.

the script will go

cirno will fire 5 array of bullet
cirno STOP firing
bullets shots more bullets
afterwards, bullets homes in on the player
 and then cirno proceeds to fire once again.

ive tried using wait functions, yield, another task fire command, deleting shots, anything that will stop an execution of a command but nothing works , it either raises an error or cirno will still do her firing bullet things as if no additional commands was added

If you are using tasks, then do the following.
Code: [Select]
task fire{
     //5 array bullet thing
     loop(n){yield;} //How long should she stop firing for?
    //I have no clue what you mean by Bullets shots more bullets. If it's an object bullet or a CreateShotA, then just sync the firing with the wait time.
    //Is this a new bullet? You're not specific enough.
}

MainLoop:
Call fire in MainLoop every x frames.

Maintask:
Code: [Select]
task MainTask{
      loop(180){yield;} //random number
      loop(){
            fire;
            loop(180){yield;}
      }
}
Post your code so that we have a better understanding of what you're trying to accomplish.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on October 14, 2013, 09:49:46 AM
i havent scripted this yet and this is the reason for my question , because i dont know if it is even possible to script  ??? :(((((((

what i meant by "bullets shots bullets" is this , BulletA is fired , now BulletA stops and that bullet itself fires BulletB , i think its the AddShot function.

the "bullet homes in on the player" looks confusing but what im trying to say was , it will be a homing shot , you know the GetAngleToPlayer type bullet.

What im trying to do is

BulletA gets fired by cirno
BulletA stops and spawns BulletB ( the bullet itself spawns another bullet)
then when BulletB is done and goes off screen
BulletA then becomes a homing shot that targets the player.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on October 14, 2013, 11:43:39 AM
i havent scripted this yet and this is the reason for my question , because i dont know if it is even possible to script  ??? :(((((((
How would you know if you never tried it? Have you actually tried scripting what Sparen suggested?

Let me ask it differently, what do you know about Danmakufu? Do you know tasking? Do you know object bullets? If both answers are no, please go read/watch tutorials about Tasking and Object Bullets. Because those are the two things you need to know for your Cirno idea.

Please don't expect us to write the entire spell card for you. You would learn nothing from it. Logically we can always help with parts, but you might want to understand things first.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: rikako_asakura on October 16, 2013, 08:20:15 PM
I've wanted to ask this question for a long time, but does anyone know how to make the curving lasers like in Phantasm Romance (i.e. the ones that are initially wide, but then their width decreases)? I've had a look at the code but I don't think I completely understand it. I know that a task has to be created, but I don't know how the task can be operated to move the laser.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on October 16, 2013, 08:48:35 PM
Phantasm Romance and Phantasmagoria Trues use two tasks to accomplish this effect. The first creates a laser object which is set at a certain length and width, both parameters decreasing every frame of its existence until reaching zero. There are minor aesthetic adjustments in place such as making the laser visible after the first couple of frames to make it appear smooth in "motion", and only giving it collision detection based on its current width, but other than that, it is quite simple.

What the other, "controlling" task does is call the aforementioned on a frame-by-frame basis, using trigonometry to calculate where they should spawn next based on speed and angle parameters, thus giving the illusion it is actually a single, trailing laser. That is all to it, really. xD
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Fujiwara no Mokou on October 21, 2013, 03:11:41 AM
Hello everyone. I'm glad to see the community still alive and well. Oh, and yeah.. I'm still working on that engine, if anyone remembers me. It's almost done (an open source danmakufu with identical syntax and scripting sounds nice, doesn't it?)
While I was working on it, I stumbled upon some problems that I found were annoying with Danmakufu that I had no knowledge to fix. Well, it may have been fixed with PH3, or maybe not, but I know it exists with 0.12m. And it's not really a problem with the engine. It's more of a graphical artifact.
Here's a couple of them.

Have you tried to make a beautiful spellcard only to see it turn out like this?
(http://imageshack.us/a/img132/1254/0z62.png)

Can't see it? Let's closer look....
(http://imageshack.us/a/img713/4152/2tsp.png)

Those are not what those bullets are supposed to look like. Even when we have our image dimensions in perfect powers of 2, it won't turn out right. We want them mapped perfectly like this. (http://imageshack.us/a/img9/3264/ljte.png)
It's actually a problem with texel-to-pixel allignment. See, texels are mapped onto the center of pixels. This means that there's a half-a-pixel offset to our image which makes it turn out fuzzy because the rasterizer is trying blend the colors.  This (http://msdn.microsoft.com/en-us/library/windows/desktop/bb219690%28v=vs.85%29.aspx) link explains it very well. Not to mention, the fact that our image is 'rotated' make the artifacts even more apparent. So, if we keep our image unrotated and subtract half a unit of position for our graphic, our graphic will be perfectly mapped, like so.
(http://imageshack.us/a/img62/5057/lfez.png)
And if we look closer, it really is mapped perfectly...
(http://imageshack.us/a/img198/1720/73mc.png)

For these particular bullets, I use the following code to emulate Danmakufu's CreateShot01()

Code: [Select]
task ShootBullet( let x, let y, let speed, let ang, let graphic, let delay )
{
let obj = Obj_Create( OBJ_SHOT );
Obj_SetSpeed( obj, 0 );
Obj_SetAngle( obj, 0 );
ObjShot_SetGraphic( obj, graphic );
ObjShot_SetDelay( obj, delay );
while( !Obj_BeDeleted( obj ) )
{
Obj_SetPosition( obj, floor( x ) - 0.5 , floor( y ) - 0.5 );
x += speed * cos( ang );
y += speed * sin( ang );
yield;
}
}

There is one other problem with v0.12. If you try to create an effect object to customize the vertex colors, you'll notice that the alpha component will work, but lowering it also lowers the colors. This means your image will become darker as it becomes more transparent. This, unfortunately, does not have a hack (through the script) to fix, as it is because the engine is missing a proper vertex pixel shader. Most likely, MKM didn't even write one, and simply uses the default pipeline to handle untransformed vertices and it causes this artifact. Luckily, I won't make the same mistake...

Anyway, sorry for the long post. But I do hope this will relieve a lot of stress that once caused me. Maybe I'll write a full stage sometime soon.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on October 21, 2013, 04:23:50 AM
Blurry aids happens with ph3 as well, to an extent. I would say I'm surprised you weren't aware of this before because I mention it all the time, but obviously not everyone stalks me so whatever.

What has been done is that I suggested to mkm to add a fixed_angle parameter to shot definitions, so that the bullet's movement angle doesn't affect it's render angle.
(http://i.imgur.com/0vv42.png)

What wasn't fixed is the other part of the problem, that bullets are rendered entirely based on their position as a float and are accordingly bastardized. However, fixing the angle stuff makes using user-defined functions for it so much more convenient. I mean you can fix the rendered part of the bullet object yourself. Easy.

Setting alpha values of vertices works properly in ph3, and you can use ObjRender_SetAlpha() to change the alpha of the whole image. Moreover, we now have BLEND_ADD_ARGB type which does what you think it does and lets you use the source alpha channels in add-blended images.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on October 21, 2013, 05:48:08 AM
ZUN doesn't angles the texture of his roundish bullets in any of his official games either. I always wondered if mkm realised this before or not.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Matteo on October 22, 2013, 12:58:44 PM
3 questions:

a) Do you know where can i find the kind of backgrounds suited for stages and bosses? Like a road or a river etc etc that by scrolling give you the impression that you are moving?

b)  How to create shapes with bullets, like for examples stars or squares?

c) How to "create" the addshot function to the obj_bullet and laser? For example, i know how to create shapes with laser segments. But if i try to add bullets, i know only how to spam them or at the end of the laser segment or at the start of the segment. If i want to create bullets also like...10 pixels or in general 0 < pixel < 90 in a laser segment of 90 pixels of lenght? How to set that i want to create a bullet in my laser segment right in a specific place of the segment?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on October 23, 2013, 10:01:11 AM
hi again.Can i make a wide screen and shacking screen in 0.12?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on October 23, 2013, 11:31:46 AM
Let me ask it differently, what do you know about Danmakufu? Do you know tasking? Do you know object bullets? If both answers are no, please go read/watch tutorials about Tasking and Object Bullets. Because those are the two things you need to know for your Cirno idea.

Please don't expect us to write the entire spell card for you. You would learn nothing from it. Logically we can always help with parts, but you might want to understand things first.

yes i have understandings about those two things from watch your tutorials

im still a beginner of danmakufu and im still learning from reading the different functions on the wiki and watching your tutorials ,  so please excuse me if i sound like i want you guys to script the whole spell cards , because that is not what i actually meant
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on October 23, 2013, 02:20:13 PM
Ah, good that you're responding. I thought you disappeared suddenly after my response.

Can you show us some code please what you already have? Preferably your entire script in pastebin, so we can analyse what is going and possible help you fix it.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on October 23, 2013, 03:08:40 PM
If you are using tasks, then do the following.

task fire{
     //5 array bullet thing
     loop(n){yield;} //How long should she stop firing for?
    //I have no clue what you mean by Bullets shots more bullets. If it's an object bullet or a CreateShotA, then just sync the firing with the wait time.
    //Is this a new bullet? You're not specific enough.


soo i decided to neglect the spell card idea for now since im just learning
and instead im just gonna continue Frostbite " Glass Reflection" and learn how to use this function for references
so my revised question now is:

im using tasks
so i use    loop(n){yield;}
however , i dont know where im gonna put it
my code is

Code: [Select]
task fire{
let x = 0;
let dir = 0;
wait(30);
loop{
PlaySE(sfx1);
while(x<36){
CreateShotA(1,GetEnemyX,GetEnemyY,1);
SetShotDataA(1,0,1,dir,2,-0.5,8,AQUA02);
FireShot(1);

dir+=360/36;
x++;
}
x = 0;
dir = 0;
wait(20);


yield;


}
}

now what that is doing at the moment is:

cirno fires circular shots with a 20 frame delay of each array

what i want to happen is to use the command you gave me so that

cirno will stop firing after like 5 seconds (by my calculations results into 5 - 6 arrays of circular bullets )
afterwards
i want to her to STOP firing using
Code: [Select]
loop(n){yield;}

after that
she moves to a random location using SetMovePositionRandom01
( ALSO a side question , i cant seem to make the SetMovePositionRandom01 to loop , i can make her move on a random space but she will never do it again , im a llitle confused on looping movements X_X )
BTW heres the test code i did
Code: [Select]
task move{
loop{
SetMovePositionRandom01(13,13,5,120,120,120,120);
wait(30);
yield;
}
}
can anyone tell me what wrong with that? and why she wont ever move again? , i did loop the command so whats the problem here X_X

back on topic

after she move to random
i make her do something else , like sayyyy.... nuke the screen with bullets while waiting for the circular bullets to come back as BLUE03 from AQUA02
and then the whole spell loops all over again until you defeat her

im not asking for you guys to script the whole thing i just want some help with two things

1. How to make the SetMovement functions loop because in my case they wont ever move again
2. How to Make her stop firing using the command Sparen gave me

Ah, good that you're responding. I thought you disappeared suddenly after my response.

Can you show us some code please what you already have? Preferably your entire script in pastebin, so we can analyse what is going and possible help you fix it.

Im Sorry about random this and that because it seems the problem is me , im a wreck because im trying to code 4 spell cards ( well atleast keep getting sidetracked with experimenting that keep making ideas in my head) at once even though im a begginer
and also sorry for late replies.....i have a tight schedule at the moment    :o  :X

so ive finally decided to focus on 1 spell card at the moment hence that long (really long) message up above

so if you are asking for the script im focusing on
its this one

http://pastebin.com/0AZev087

i would like to know if any problem is occuring in my script , i really want to atleast accomplish one spell card
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on October 23, 2013, 04:44:01 PM
I fused your two posts together since you're basically asking about the same thing. Although it seems you're having redundant post information. I'll leave that up to your own edit. Anyway! Here is your problem. You're having a flow-problem here. While in your mind/brain you're clearly knowing what to do it isn't obviously coming out on "paper".

Let us take a closer look at your code, particular the movement. SetMovePositionRandom01(13,13,5,120,120,120,120);. Now let us look what the Wiki has to say about this function:
Quote from: dmf dnh wiki
SetMovePositionRandom01 Let it move at random in the bounding box.
7 Parameters
    1) x-distance
    2) y-distance
    3) velocity
    4) left bound
    5) top bound
    6) right bound
    7) bottom bound

Are you seeing it already? You're setting a random-movement boundary field of exactly 0. Because all boundaries are 120, it means Cirno has 0 pixels to move in any direction. She tries to move 13 pixels, but she cannot because you pinned her down at 120,120,120,120 which is a "rectangle" of 0 pixels. What you need my dear friend is to give Cirno some more space yo! Remember the boundaries for setting the image size in my tutorials? Imagine it as that.

Second, you said she keeps on firing and firing and want to "hold" that. This is where your mind-set goes wrong. If you take a look at mainTask, you're summoning two tasks which are entering a loop. Remember that tasks are independent so they will be executed according to your script and do their thing. However, both of them are looping and you just said you want a more controlled Cirno.

Solution: Get rid of your loop in task fire. Keep the rest of the values, just make it loopless. Are you getting it already? No? Well here is the structure how it should be:
Code: [Select]
task mainTask{
wait(60);
move;
}

task move{
loop{
SetMovePositionRandom01(80,80,20,100,150,350,200);
wait(60);
fire;
wait(120);
}
}

Did you see I am calling fire inside the loop of "task move"? Our movement task is already looping. So in human language she will 1) Move, 2) wait given frames, 3) fire the circular shot once 4) wait given frames 5) repeat the pattern.

If you want her to fire multiple times, then you do need to loop task fire. But then with a defined loop: Such as  loop(5) { }. I'll leave that up to you.

You were using the wait function correctly, feel free to tweak the values as you please. I am just providing you clarity regarding the tasking.

Final note: You are using curving CreateShotA bullets. Fine with me, but do note that they don't seem to get deleted when they leave the game field. Consider setting the deletion function for this spell card or reduce the angular velocity so they don't "return" like this. (Unless you intended this, then you need to consider bullet deletion).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on October 24, 2013, 12:40:57 PM
Solution: Get rid of your loop in task fire. Keep the rest of the values, just make it loopless. Are you getting it already? No? Well here is the structure how it should be:

I see....
from what i understand from that is :

1.) that im suppose to think that my task fire is a my made up function that i saw in the wiki and im just gonna have to call it through my task move which will be the one doing all  the looping

did i get that right?

Edit after writing some functions:
alright i edited the script its turning out ok now
thanks for the help Helepolis :) im nearly done with the things i want cirno to do only thing left is bringing back the bullet from AQUA02 to BLUE03 while being off screen........so my only next step is to combine the thing all together and loop it for the whole fight but i still need help with the looping part X_X
because im still having an error problem

this is the code

http://pastebin.com/C9RqHXrP

the problem is that whenever i add a new tasks/functions or just add some things like another movement task
danmakufu raises an error about a WAIT FUNCTION

whats wrong here? o.O why is danmakufu erroring a wait function?

also please excuse my redundantness in the forums , this is my first time posting in any kind of forums of a large community
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on October 24, 2013, 01:54:53 PM
What is going wrong is that you're most likely not reading proper what I explained you.  Because you're still having a infinite loop in your fire task. And I also explained you that your bullets are curving so fast that they are never disappearing outside the field boundaries.

Since you're more like hammering on the flow of the card, why don't you return to the basics by spawning a single CreateShot01 bullet or something?

Edit It is most obvious that you're not reading because your mainTask is also unedited while I suggested a lot of things.

Start reading please.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on October 24, 2013, 03:03:26 PM
actually i editted the post just now and i wrote the script completely differently now , i linked the script above and i want to see if theres still a problem with it because like i said it raises an error about the wait functions i put and im confused to why that is o.O , and yes i fixed the infinite loop to loop(5){}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Matteo on October 24, 2013, 04:30:23 PM
3 questions:

a) Do you know where can i find the kind of backgrounds suited for stages and bosses? Like a road or a river etc etc that by scrolling give you the impression that you are moving?

b)  How to create shapes with bullets, like for examples stars or squares?

c) How to "create" the addshot function to the obj_bullet and laser? For example, i know how to create shapes with laser segments. But if i try to add bullets, i know only how to spam them or at the end of the laser segment or at the start of the segment. If i want to create bullets also like...10 pixels or in general 0 < pixel < 90 in a laser segment of 90 pixels of lenght? How to set that i want to create a bullet in my laser segment right in a specific place of the segment?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: rikako_asakura on October 24, 2013, 08:10:02 PM
3 questions:

a) Do you know where can i find the kind of backgrounds suited for stages and bosses? Like a road or a river etc etc that by scrolling give you the impression that you are moving?

b)  How to create shapes with bullets, like for examples stars or squares?

c) How to "create" the addshot function to the obj_bullet and laser? For example, i know how to create shapes with laser segments. But if i try to add bullets, i know only how to spam them or at the end of the laser segment or at the start of the segment. If i want to create bullets also like...10 pixels or in general 0 < pixel < 90 in a laser segment of 90 pixels of lenght? How to set that i want to create a bullet in my laser segment right in a specific place of the segment?
a. You should be able to find scrolling backgrounds on Google Images, however 3D drawing is a better solution because you're not constrained to just one particular image. Nuclear Cheese's Drawing Tutorial (http://dmf.shrinemaiden.org/wiki/Nuclear_Cheese%27s_Drawing_Tutorial#Section_3:_Section_3:_Intro_to_3D) covers this in more detail.
b. There is a function for making polygons here (http://www.shrinemaiden.org/forum/index.php/topic,5164.msg273821.html#msg273821). I'm not so sure about stars though.
c. Try using an ascent loop, with the variable being used for the fourth parameter. Like so:
Code: [Select]
ascent(i in 0..90){
AddShot(30, 1, 2, i);
}
This should make the bullets appear at length i of the laser.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on October 25, 2013, 12:40:18 AM
where is the background in the event picture in th_dnh?
The teal lines one?

EDIT:

Also, when using a stage script how do you set a Spell BG from the Single Spell File?  Or is this possible?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on October 25, 2013, 08:41:17 AM
actually i editted the post just now and i wrote the script completely differently now , i linked the script above and i want to see if theres still a problem with it because like i said it raises an error about the wait functions i put and im confused to why that is o.O , and yes i fixed the infinite loop to loop(5){}
I am not getting any errors if I add a new task in the script. I have absolutely no idea what you're trying to do or achieve in general. About the looping of the pattern / card, I already showed you the example previously in my post. Yet I still see you're not properly reading my post and changing the mainTask and move task.

I am going to explain it one more time. For a looping pattern, you obviously need to loop a task performing anything right? So imagine we have a concentration effect, 2x fire tasks for patterns and a movement task. We want to perform all of these in a pattern sense and looping during the entire spell card.
Code: [Select]
task mainTask {
yield;
}

task movement {}
task fire {}
task fire2 {}
task concentration {}
So the above we need to put in a sense that it is going to perform them all in a certain order. Because right now this is just a core structure with nothing in them. But it is always important to know what tasks you're summoning or which functions.

THIS IS WRONG:
Code: [Select]
task mainTask {
yield;
movement;
fire;
fire2;
concentration;
}

task movement {
loop {
Do lots of stuff
yield;
}
}
task fire {
loop {
Do lots of stuff
yield;
}
}
task fire2 {
loop {
Do lots of stuff
yield;
}
}
task concentration {
loop {
Do lots of stuff
yield;
}
}
Well, it isn't wrong but it makes your life difficult. Forcing you to "time" too much the tasks instead of creating a logical flow.

Because what this does is start all tasks and just loop them forever during the spell card. There is no control and this isn't what you want. What we want is one loop that controls everything while the rest being single time functions/tasks called inside this loop. That is why I had suggested you to call fire inside the movement task, but you didn't do this. So I am showing it to you again.

This is more logical:
Code: [Select]
task mainTask {
yield;
movement;
}

task movement {
wait(60);
loop {
SetMoveRandomPosition
wait(..);
concentration;
wait(..);
fire;
wait(..);
fire2;
wait(..);
}
}
task fire {
fire something;
}
task fire2 {
fire something;
}
task concentration {
concentration stuff;
}
Explanation
Do note the mainTask in comparison to the previous wrong code. Do also note the movement task in comparison to the previous code. Do you see the difference?
1 - Movement task is called in mainTask after 1 frame (yield == 1 frame)
2 - Movement task waits 60 frames before starting the loop
3 - Movement tasks begins his endless loop
4 - Movement task makes Cirno move random position
5 - Movement task waits x-frames
6 - Movement task calls concentration task doing effect
7 - Movement task waits x-frames
8 - Movement task calls task fire to perform a barrage
9 - Movement task waits x-frames
10 - Movement task calls task fire 2 to perform a barrage
11 - Movement task waits x-frames
12 - The loop is reset back to making Cirno move. Thus, repeating the entire process.

Task fire, fire2 and concentration are not loops, but will be called every time the movement loop resets, because that one is the controlling loop.

What you kept doing wrong was calling everything in mainTask once but never assigning a loop anywhere. That way your tasks will only be executed once except for the movement task, since that one was a loop already. Hence I asked you to restructure your script.

I hope this makes it more clear otherwise I am completely clueless.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on October 25, 2013, 11:42:47 AM
Quote
Because what this does is start all tasks and just loop them forever during the spell card. There is no control and this isn't what you want. What we want is one loop that controls everything while the rest being single time functions/tasks called inside this loop. That is why I had suggested you to call fire inside the movement task, but you didn't do this. So I am showing it to you again.

is this what you meant i should do?

http://pastebin.com/eB8smJMn

its not perfect but it works and the spell works how i wanted it to be  :D

but i need one last help to make it look more like at touhou spell card,
you see that barrage task? what that is doing is firing circular bullets with no acceleration on a straight line
how do you make that shoot RANDOM bullets with random color assignments?
like Shizuha Aki's "Falling Leaves of Madness" Spell card from touhou 10

EDIT :
can anyone help me because
after creating a spell card i want to connect it to a non spell card attack but i dont know how i am gonna do that? o.O

I put your code in pastebin =) otherwise it is too large. --Hele
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on October 25, 2013, 02:03:00 PM
I think there are two ways to change the bullet color:
1. Use a custom shotsheet and use rand_int() to make Danmakufu randomly choose an bullet ID between the bounds you specified.

2. Also usable with the default Danmakufu bullets (I think). Make an array of all the bullets you want to use and randomly choose one with rand_int.
If you want different bullets, just include them in the array.
Something like:
Code: [Select]
task barrage{
let x = 0;
                let dir = 0;
                let color = [RED31,BLUE31,YELLOW31];
                wait(1);
loop(5){
                        PlaySE(sfx2);
                        while(x<36){
                                CreateShotA(1,GetEnemyX,GetEnemyY,1);
                                SetShotDataA(1,0,1,dir,0,-0.5,8,color[rand_int(0,2)]); //Arrays start at 0.
                                FireShot(1);
                               
                                dir+=360/36;
                                x++;
                        }
                        x = 0;
                        dir = 0;
                        wait(5);
yield;

}
}

Shooting bullets in random directions is simple, just set the angle to rand(something,something).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on October 25, 2013, 05:37:24 PM
but i need one last help to make it look more like at touhou spell card,
you see that barrage task? what that is doing is firing circular bullets with no acceleration on a straight line
how do you make that shoot RANDOM bullets with random color assignments?
like Shizuha Aki's "Falling Leaves of Madness" Spell card from touhou 10

EDIT :
can anyone help me because
after creating a spell card i want to connect it to a non spell card attack but i dont know how i am gonna do that? o.O

Random bullet colors: depends on if you use a shotsheet or default bullets
Spell-nonspell:

Read the tutorials. Please. It's located in the sticky for RaNGE. If you do not know about Plural scripts, I highly suggest that you read the tutorials. There are many of them, so if one does not answer your questions, another may.

The answer to many of your questions may lie in some of the tutorials. You can also ask via IRC.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on October 30, 2013, 10:48:35 PM
Can stages call other stages? (Recursion of sorts?)
Can stages use arrays for other stages?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on October 31, 2013, 06:47:08 AM
Can stages call other stages? (Recursion of sorts?)
Can stages use arrays for other stages?
I have no idea what you mean with "call", however you can only have one stage file. There is no stage loading function similar to loading external files for enemy scripts, so that is a no. If you mean swapping stages: you need to call functions/tasks that shape that particular stage.

The second question leaves me confused.

Would be useful if you would also tell us what you are exactly trying to achieve.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on October 31, 2013, 08:41:24 PM
forget the second question, that doesn't make sense.
by "call" i mean run other stage scripts
but I figured out how to do this using clears and stage tasks
Another Question: How do you set separate backgrounds for Spells?
When I use @BG in a single script and run the stage, it doesn't change.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on October 31, 2013, 09:19:27 PM
That is odd, because only @Background thread in non-spell cards are ignored and overruled by @Background thread in the stage script. If you want backgrounds for non-spell cards, you need to do like ZUN: Create the proper background within the stage script.

Spell card @Background should not be ignored. That is if it is a spell card.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on October 31, 2013, 10:27:18 PM
This is my BG code and Initialize for reference.
I may have forgotten something...
Code: [Select]
@Initialize{
LoadGraphic(imgBoss);
LoadGraphic(cutin);
LoadGraphic(BG);
SetLife(5000);
SetTimer(120);
CutIn(YOUMU,"Lel Sign 'Murica Circles'",cutin,0,0,250,400);
MagicCircle(false);
SetMovePosition02(GetCenterX, GetCenterY - 100, 120);
}
//mainloop and stuff
@BackGround{
Y3++;
Y2--;
SetTexture(BG);
SetAlpha(128);
SetGraphicRect(0,0,100*512,100*512);
DrawGraphic(0,Y3);
SetTexture(BG);
SetAlpha(128);
SetGraphicRect(0,0,100*512,100*512);
DrawGraphic(0,Y2);
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on October 31, 2013, 10:47:07 PM
SetScore(); .  :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on October 31, 2013, 11:01:10 PM
Now I just feel stupid  :V
Thank you!   ;)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on October 31, 2013, 11:05:31 PM
A classic mistake a lot of us make/made.  :3
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on November 01, 2013, 02:29:30 AM
I already have another question: is there a way to tell the engine not to delete/explode the boss after the timer goes to 0 or it's defeated
I really want the bosses to do what they do in the real games (take Sekibanki's midboss exit for example) -- stall for a second with no hitbox and then fly away
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on November 01, 2013, 02:33:01 AM
I already have another question: is there a way to tell the engine not to delete/explode the boss after the timer goes to 0 or it's defeated
I really want the bosses to do what they do in the real games (take Sekibanki's midboss exit for example) -- stall for a second with no hitbox and then fly away

I did this the really stupid way and added a separate file with 1 HP and a DamageRate of (0,0). In this file, I basically made the boss go offscreen before using VanishEnemy, which does NOT have the explosion effect.

To do it without the roundabout method, you'd need to check HP and then VanishEnemy, I think. I'm not completely sure about its practicality (don't use my method above because it's a really stupid 0.12m workaround), so you will probably want input from others.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on November 01, 2013, 02:51:46 AM
I was considering having it check for 1HP and then spawn an enemy while vanishing the boss
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 01, 2013, 03:01:43 AM
K: That doesn't work; the enemy will be considered a familiar and will be deleted on @Finalize.

I've concluded that the best method in 0.12 is just to have a dummy attack after the last pattern for everything to finish. However, if you intend to use this in a stage where the stage continues during that period, you have to tell it to wait for a different flag to continue, and not wait while IsBossExisting(), since obviously the boss will still exist.

The other usual methods are (in brief, because each requires several additional workarounds)
- checking if HP is under a threshold, then running your stuff in the boss script within the final pattern and calling VanishEnemy() at the end
- setting boss coordinates in commondata and passing it (in some way) to a stage function to do things with
Both of these are terrible ugly messy buggy kludgy garbage piles that I have personally implemented and seriously used as solutions before. Don't be me.

Sparen: Why damage rate and not just y'know not setting a hitbox.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on November 01, 2013, 03:08:55 AM
Couldn't I have it WaitForZeroEnemy; and then spawn it at GetEnemyX & GetEnemy Y?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 01, 2013, 04:02:12 AM
If you wait for no enemies then GetEnemyX/Y has nothing to look at. It defaults to 224 and 240 i.e. center screen.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on November 01, 2013, 10:25:25 PM
Sparen: Why damage rate and not just y'know not setting a hitbox.

...That's a better solution. I just can't remember which hitbox function is which. XD. Hooray for ph3.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on November 02, 2013, 12:57:34 AM
If you wait for no enemies then GetEnemyX/Y has nothing to look at. It defaults to 224 and 240 i.e. center screen.
That's pretty much where my boss is...
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 02, 2013, 02:01:15 AM
If you figured that was a good enough "solution" then you might as well just write a function that draws the enemy graphic the same way at the same place every time without even bothering with knowing the enemy location at all. Sure it may "work", but it's a hacky kludge solution that can't be expanded or changed whatsoever; particularly bad even if you were to just move the boss around a bit during the pattern.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on November 02, 2013, 03:01:57 AM
The pattern is designed to not move the boss or else it would make it impossible
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 02, 2013, 03:54:21 AM
holy crap just do it if you want, i'm just saying it isn't a very good solution
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Yoshilove9 on November 03, 2013, 08:46:50 AM
I'm confused, I made the whole document and did everything it says to, but no bullets'll show up, my little sprite just can move around but can't shoot or be hit...

(@Readers: Regarding the Player scripting tutorial. @Author: I moved your post to the proper thread -Helepolis)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on November 05, 2013, 10:09:19 PM
Hey is there a way to spawn a second player?   ???

If there is, my Phantasmagoria engine is almost complete!   :)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: PhantomSong on November 05, 2013, 11:36:55 PM
Hey is there a way to spawn a second player?   ???

If there is, my Phantasmagoria engine is almost complete!   :)
If it's almost complete and you ask for a vital thing... never mind... this should of been asked a lot earlier.

I believe you can't do it on .12m, nor PH3, sorry.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on November 05, 2013, 11:54:40 PM
If it's almost complete and you ask for a vital thing... never mind... this should of been asked a lot earlier.

I believe you can't do it on .12m, nor PH3, sorry.

I believe that Blargel made an auto-dodging player. Is that the kind of thing you are referring to, K+?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: rikako_asakura on November 06, 2013, 10:02:46 PM
I believe that Blargel made an auto-dodging player. Is that the kind of thing you are referring to, K+?
I think what he means is if he can make another player appear on the screen, like in PoDD and PoFV. I don't think that's possible. I've seen Trick or Treat Night Extra stage have some sort of second "player", but I think that's different.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on November 07, 2013, 02:57:25 AM
Actually I just came up with a great idea... couldn't I use Objects to create a second player?  (Forget shooting from that player for now/dodging)
I could have it check and reset the player if it comes in contact with bullets!
Unfortunately that means everything must be done in Obj. shots but it could work.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on November 07, 2013, 03:27:54 AM
Sorry to tell you this, but a Phantasmagoria game in 0.12m isn't possible. If anything you should've tried your luck with ph3.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 07, 2013, 07:50:34 AM
but it could work.
No it would not.

- 0.12m has no netplay.
- 0.12m has no other keyboard input listening functionality.

These two are most essential for PoFV / PoDD type game.



Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on November 07, 2013, 11:12:10 PM
True, but I never meant for it to have netplay but I could use Spellcards to do the charging spells.  If not, then I'm abandoning it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 08, 2013, 12:07:48 AM
He means you won't be able to get any sort of multiplayer going at all. Are you intending to just have AI?

Also, they play by holding down the shot button; bombs are separate. Not that it matters. Either way it's easy enough to have a shot-charging system.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on November 08, 2013, 02:01:25 AM
Yes I was, it wouldn't be much of a setback, would it?  (tbh, I didn't know that many people used Netplay)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 08, 2013, 11:59:40 AM
Read the tutorials. Please. It's located in the sticky for RaNGE. If you do not know about Plural scripts, I highly suggest that you read the tutorials. There are many of them, so if one does not answer your questions, another may.

OK so I read all the tutorials about plural scripts, Sparen. But there one problem , the BGM won't play ,
I can't show the exact code now since I'm not on the computer right now but , here basically what I remember it looked liked

Code: [Select]

#TouhouDanmakufu [Plural]
#blahbalh
#blahblah
#Player[FREE]
#Script version 2 something

#ScriptDataPath [it goes to my first nonspell]
#scriptdatapath[Spell card]
#newlifebar something
#ScriptDataPath [nonspell2]
#ScriptDataPath[second spell]

#EndScriptBlahblah

OK that's roughly how the script went from what I remember
but there's no BGM when I played it
Whats going on here?
Im sure there's a BGM set for the actual spell scripts
And I'm pretty sure you can't put a #BGM [] in a plural script
And I matched all the music in all the scripts (the music is Necrofantasia BTW)
So I really don't get why its not playing any background music
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on November 08, 2013, 12:19:08 PM
And I'm pretty sure you can't put a #BGM [] in a plural script
Actually, you can do that and I think it works most of the time.
The thing is, #BGM only plays the music if the script using #BGM is the script you're currently playing. If you want to play a general bgm, you can use #BGM for the plural file.
If you want to play it from an individual file, like changing the music in the plural from a single script, you should use the sound functions to play the music instead. (http://dmf.shrinemaiden.org/wiki/Sound_Functions_(0.12m))
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 08, 2013, 03:02:24 PM
No , actually #BGM worked in the plural script , i guess what i did wrong was a directory mistake

Also

how can i make trailing bullets TT_TT , so many of my ideas involve trailing bullets and i dont know how to make one
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 09, 2013, 08:47:35 AM
Trailing bullet? Any reference examples from the original games?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 09, 2013, 09:35:48 AM
I cant think of any from the original games
but an example would be from the touhou all stars medley
http://www.youtube.com/watch?v=85bE4NlzrLE
its the nonspell at 8:51 , im not familiar with that character so i dont know her name

how it works is
it spawn ONE bullet and while that bullet is moving it leaves a trail of other bullets behind and those bullets have their own movement

EDIT

i just got an example from an official touhou game (Undefined Fantastic Object)
its either
Minamitsu Murasa's Nonspells (the one where she swings that stick of hers to create danmaku)
or
Her Spell Cards (specifically the ones that involves the Anchors)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on November 09, 2013, 01:14:20 PM
I think those are something different though...

Your definition of a trailing bullet is seems simple:
Create and fire an object bullet that spawns other bullets in some way.

The example from the all stars medley seems to be something different; multiple clusters of bullets are spawned in a certain pattern, which move outward after a short delay. They aren't spawned by a bullet, that is the delay cloud you're seeing. (Unless I'm missing something.)
Spawning those requires a different approach. What I would do is create a familiar that moves around using SetMovePositionHermite, and periodically activates a task that fires a cluster of bullets.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 09, 2013, 01:36:00 PM
if im gonna use familiars

......theres another thing im not sure how to do

what i want the familiars to do is to spawn from the bottom left and right sides and goes straight up
leaving bullets and despawn? (:ohdear: but...wouldnt that permanently delete the familiar and it wont ever be able to spawn back?  :ohdear: )

moving on,

now the bullets will go outward creating a tornado (via turn speed) for each bullet that the familiar spawned ( but what would that be? o.O a single bullet that somehow transformed into many bullets and went outward? or a cluster of bullets that went outward?  :ohdear: )

this is confusing even me  ??? will this idea work  :ohdear: X_X

After Time Have Passed

After reading through the wiki
I read about AddShot, would that work?  :ohdear:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on November 09, 2013, 02:25:48 PM
You don't have to use familiars; but you gave examples of different things, which require a different solution.

Your definition of trailing bullet, or at least what I gathered from it, are the kind of bullets like bubbles on Remilia's "Red Magic" or "Scarlet Gensokyo" card; they are fired, move over the screen leaving bullets in their wake, which move around on their own. I would make this using Object bullets that spawn other bullets, the kind of bullet depending on the action needed. Meaning CreateShot01 if it just needs to move in a straight line, or other functions if I want to make something else.

This (http://pastebin.com/L8KEPTdA) is an example.

The kind of familiars I was talking about are separate enemies, spawned with CreateEnemyFromScript/File. They are coded just like the main boss, using the same kind of structure.
Spawning/deleting them doesn't use them up or something; you could spawn thousands of them at the same time if you wanted to.

AddShot does use up the bullet after you spawned it IIRC, so if you want to spawn more bullets, that won't work.

I don't completely understand what you're trying to do however, so I'm afraid I can't help you.
Do you want to have bullets spawn other bullets? Or something else completely?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 09, 2013, 03:09:53 PM
Do you want to have bullets spawn other bullets? Or something else completely?

Im trying to spawn a master bullet (they dont curve they just go straight up) that spawn like 5 slave bullets in which after some time those 5 slave bullets will make a tornado/whirlwind.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on November 09, 2013, 06:03:11 PM
The spawning part would be easy. Object bullets that fire another bullet.
But you want to make the master bullet spawn tornadoes? Do you mean like the one here? (http://www.shrinemaiden.org/forum/index.php/topic,865.msg31781.html#msg31781)
If so, your master object bullet will have to spawn a whole series of object bullets that interact with each other. I would recommend reading that part of the tutorial if you want to achieve that.

Or do you mean just having a circle of bullets that spiral as they fly out. You might still need to spawn another object bullet with your master one.
Code: [Select]
      while(Obj_BeDeleted(obj)==false) {
              Obj_SetAngle(obj, Obj_GetAngle(obj) + 2);
              yield;
       }
This piece of code should help. The number can be changed by how much you want it to spiral every frame.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on November 09, 2013, 08:04:16 PM
they dont curve they just go straight up
I wasn't trying to make a spellcard for you, I was trying to help you make one yourself. I listed a spellcard as example, and made a somewhat lookalike spellcard to demonstrate my point.

But enough about that.
"Whirlwinds/tornadoes" is too vague. You could be talking about the whirlwinds shown in the intermediate tutorial, like Lavalake said, or spiralling bullets, or it could mean other things.
You could even have meant that you want to have a tornado lookalike idea on your screen, something like this (http://youtu.be/_azQK68Tsj4?t=7m35s).

The second thing I want to say is that I get the idea you don't really know what you are doing. Please don't take this the wrong way, but it feels like you are just doing the first thing you see without knowing what you are doing. (i.e. you talk about familiars first, but later you suddenly want to use AddShot. They are separate things, and they don't have much to do with each other.)

The reason I started talking about familiars was simple; the movement seen in the all-stars video is somewhat complex, and easiest to reproduce using a movement function called SetMovePositionHermite. Which is only available to bosses/enemies/familiars etc. IIRC. The thing you are seeing in the all-stars video and in Murasa's nonspells is not a bullet - it is a delay cloud, the thing that appears before a bullet is shot if you enter a number higher than 0 in the delay parameter in shot functions. They can be spawned without familiars, but that requires some math and using familiars is the easier option.

The anchor spellcards however, seem different. The anchors are either bullets or effect objects (which one they are doesn't matter right now), and they spawn bullets while moving.
From your reaction I just don't think you understand the difference between the two methods I've described. Which happens to be kind of important for understanding the whole picture.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 09, 2013, 10:00:41 PM
The second thing I want to say is that I get the idea you don't really know what you are doing. Please don't take this the wrong way, but it feels like you are just doing the first thing you see without knowing what you are doing. (i.e. you talk about familiars first, but later you suddenly want to use AddShot. They are separate things, and they don't have much to do with each other)

The reason i talk about familiars and addshot is because I'm still experimenting on how I can approach my spell card , because this is my first time ever doing this , I have no experience with bullets spawning bullet and make them have individual movement.
So please excuse me if I sound confused and don't know what I'm doing because I really am @_@

Secondly,i m not trying to make you make me a spell card , I'm just pointing out on how my spell will work which would be going straight up.

And finally,the whirlwinds you guys is speaking is somewhat what I want to do but I don't want them to go back in I just want them to spin out once and thats it
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on November 09, 2013, 10:46:41 PM
Do you know how to make and use object bullets, because object bullets help a lot. If not, this (http://www.shrinemaiden.org/forum/index.php/topic,865.msg31779.html#msg31779) would help a lot.
Make sure that use know what each line does and how it works.
Then your secondary bullet should use this:
Code: [Select]
      while(Obj_BeDeleted(obj)==false) {
              Obj_SetAngle(obj, Obj_GetAngle(obj) + 2);
              yield;
       }
You call the object bullets using it's task name and filling in its parameters.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 10, 2013, 10:20:52 AM
Well considering i have little knowledge about object bullets ( and by that i mean the only knowledge i know is that the bullets are death and bomb resistant)
so im gonna skip this spell while i study and work on another spell with a new trick i learned ^^

but theres two question ive been itching to ask :
heres the first one

My sound effect feels REALLY out of place and im trying to find this sound effect on talos mistake's video
http://www.youtube.com/watch?v=waZUyVIEEKM
im trying to find the sound effect of the bullet cloud 0:08 , the one that sound like a rapid firing chime or something
Ive been scavenging through the official games just to find this sound effect and CANNOT find it
I even tried listening to every sound effect i find and create a spell that have rapid fire in it , and hope to hear this sound effect and EVEN THAT didnt work TT_TT

This is really bugging me forever ,can anyone PLEASE  :( direct me to or tell me what is the name of the sound effect from the official game files because i dont know where i can find it X_X
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on November 10, 2013, 10:58:20 AM
Well considering i have little knowledge about object bullets ( and by that i mean the only knowledge i know is that the bullets are death and bomb resistant)

My sound effect feels REALLY out of place and im trying to find this sound effect on talos mistake's video
http://www.youtube.com/watch?v=waZUyVIEEKM
im trying to find the sound effect of the bullet cloud 0:08 , the one that sound like a rapid firing chime or something
Ive been scavenging through the official games just to find this sound effect and CANNOT find it
I even tried listening to every sound effect i find and create a spell that have rapid fire in it , and hope to hear this sound effect and EVEN THAT didnt work TT_TT

This is really bugging me forever ,can anyone PLEASE  :( direct me to or tell me what is the name of the sound effect from the official game files because i dont know where i can find it X_X
1. That's not true. They are not really death and bomb resistant, but they can be. Object bullets are just bullets which allows you to manipulate them pretty much every frame they exist in game. Well, atleast if you use the usual way of manipulating them, which is using a while(!Obj_IsDeleted(ID)) loop.

2. I'm pretty sure that "sound effect" is just the sound effects he used at the start of the video but looped repeatedly. In my SE collection they're called Shot1 and BulletWave, but depending on where you got all the sound effects from (Drake's thread?) they may have different names. Linked them as attachments anyway.

(I assume posting this isn't against the rules.)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 10, 2013, 11:31:50 AM
1. That's not true. They are not really death and bomb resistant, but they can be. Object bullets are just bullets which allows you to manipulate them pretty much every frame they exist in game. Well, atleast if you use the usual way of manipulating them, which is using a while(!Obj_IsDeleted(ID)) loop.

Speaking of object bullets....

What is wrong here? (http://pastebin.com/y8HsewwG) o.O , im studying and testing object bullets and ive gotten this far
but.....it crashes :X and i dont know why no error or something , just a Crash.  :ohdear:

Oh And THANK YOU I WAS FINALLY ABLE TO CREATE THAT SOUND!!!!  :]
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on November 10, 2013, 11:49:27 AM
You have an infinite loop in cage.
Infinite loops, the ones without a number between parentheses, must always have at least one yield; inside them.
Otherwise Danmakufu will try to execute it infinitely, and freeze as a result.

You need to put at least one yield; somewhere in the loop to stop it from crashing.
Code: [Select]
task cage{
                loop{
                        left(GetCenterX+185,GetClipMaxY,6,270);
                        yield; or loop(some number){ yield;} (wait function)
                }
        }
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 10, 2013, 12:16:30 PM
OK I have modified this post about 10 times now due to me answering my question through experimenting XD

But here's a question I can't answer myself
On the subject of object bullets
How do you make a half circle traveling east (while the enemy is on the left side of the field)
Hitting the maximum x distance which will cause it to split into more bullets. (This part I know how to do )
But that half circle part I don't know how, or creating a object circle even.
And please warn me if there's math ahead X_X , those sin , cos , atan stuff are things I haven't even learned in school yet X_X
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on November 10, 2013, 06:18:01 PM
OK I have modified this post about 10 times now due to me answering my question through experimenting XD

But here's a question I can't answer myself
On the subject of object bullets
How do you make a half circle traveling east (while the enemy is on the left side of the field)
Hitting the maximum x distance which will cause it to split into more bullets. (This part I know how to do )
But that half circle part I don't know how, or creating a object circle even.
And please warn me if there's math ahead X_X , those sin , cos , atan stuff are things I haven't even learned in school yet X_X

There is math. You will use sin and cos.

angle = 270;
loop(numbullets){ObjBullet(GetX+radius*cos(angle), GetY+radius*sin(angle), 0, etc); angle+=180/numbullets;}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 10, 2013, 10:54:42 PM
OK I think that's simple enough of a code even with the math, so am I just suppose to slap a code like this in my object bullet and then it will make a circle?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 11, 2013, 12:49:16 AM
http://www.shrinemaiden.org/forum/index.php/topic,865.0.html
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 11, 2013, 10:55:28 AM
I have a problem with object bullets

this (http://pastebin.com/9ppCM0mC) code keeps erroring my circle task
and i have no idea why , i set the riht parameters , the is correct so why is it erroring?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 11, 2013, 11:18:07 AM
When you say "error", I'm guessing you mean it doesn't work the way you want it to, rather than an actual error message popping up.
You have if(Obj_GetY(obj) > GetClipMaxX) when I think you mean if(Obj_GetX(obj) > GetClipMaxX).

I think your script should work for the most part, but there are a bunch of issues in your understanding of how Danmakufu works that I think need to be addressed. Maybe I'll do that when it isn't 5AM.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 11, 2013, 11:50:47 AM
no by error i mean an actual error message

it says:
Code: [Select]
circle "some random text"

                            circle(GetEnemyX,GetEnemyY,3,0);
                            wait(240);
and then more text
i know that this means theres something wrong with that specific code there
but i dont know why or how to fix it
i change if(Obj_GetY(obj) > GetClipMaxX) to if(Obj_GetX(obj) > GetClipMaxX)

but the error message still appears

Sorry to bother it seems we have different time zone here in the Phillipines its just 7:45 PM  :ohdear:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 11, 2013, 02:04:45 PM
Your task circle is listening to 6 parameters (task circle(x,y,v,dir,graphic,delay)) and at line #23 you are granting only 5  circle(GetEnemyX,GetEnemyY,3,0,RED01); That is why Danmakufu is pointing at line #23.

This flowchart helps you out as well with those things http://www.shrinemaiden.org/forum/index.php/topic,4155.msg186037.html#msg186037

It is quite easy to track error messages like this. Here is how my thought process went:
- Problem = error message
- Yes, line number provided (though you didn't post it here)
- Something with a function/task (circle)
- Is spelled correctly
- Parameters are incorrect
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on November 11, 2013, 04:45:17 PM
Isn't it easier just to look at the error message, ctrl+c, and paste it inside google translate?
That usually gives some english text that is comprehensible enough to understand. Or at least, that's my opinion anyway.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on November 11, 2013, 05:52:35 PM
If the text is in Japanese, this might work:

https://sites.google.com/site/sparensdanmakufututorials/dnh-0-12m-tutorials-part-3/014-intro-to-danmakufu-part-4 (https://sites.google.com/site/sparensdanmakufututorials/dnh-0-12m-tutorials-part-3/014-intro-to-danmakufu-part-4)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 11, 2013, 06:41:52 PM
Isn't it easier just to look at the error message, ctrl+c, and paste it inside google translate?
That usually gives some english text that is comprehensible enough to understand. Or at least, that's my opinion anyway.
That is what I also sometimes do if I get a message without any function/var  :D
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 11, 2013, 11:03:29 PM
Your task circle is listening to 6 parameters (task circle(x,y,v,dir,graphic,delay)) and at line #23 you are granting only 5  circle(GetEnemyX,GetEnemyY,3,0,RED01); That is why Danmakufu is pointing at line #23.

Ok, I see the problem now , I guess I forgot to input delay  :X

But quick question Helepolis:

On your tutorial you used
Code: [Select]
while(!Obj_BeDeleted(obj)){yield;}And on the tutorial here or wiki it used
Code: [Select]
while(Obj_BeDeleted(obj)==false) {yield;}To detect if the bullet still exist

Is there any significant difference with the two codes?
And what does the exclamation point in there do? o.O
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 11, 2013, 11:21:21 PM
Obj_BeDeleted(obj) returns true if the object is deleted, and false if it still exists. So if the object exists, Obj_BeDeleted(obj)==false will evaluate false==false, which is true. So while(Obj_BeDeleted(obj)==false) runs the code inside in a loop, as long as the object exists.

!(statement) gives the logical negation of the statement. So if the statement is true, it gives false, and if the statement is false, it gives true. So if the object exists, !Obj_BeDeleted(obj) will be true. So while(!Obj_BeDeleted(obj)) runs the code inside in a loop, as long as the object exists.

In other words, there's no difference.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 12, 2013, 09:39:02 AM
Ok I got it, but you said that ! Statement will result in the logical negation of true or false

So i hypothesized(my mind likes to hypothesize XD) Can I used this ! Statement and manipulate it in any other code to negate the statement
Like maybe Something like
Code: [Select]
[CreateShotA(parameters);
SetShotDataA(1,0,//bullet goes right parameters);
And adding
Code: [Select]
SetShotData(!1,60, //same parameters);Will make the object reverse and go left after 60 frames?
Or....is the ! Statement can only be applied on the while(!Obj_BeDeleted(obj)==false) code?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 12, 2013, 10:02:12 AM
That won't work. All it really does is
!(true) = false
!(false) = true
Like IsBossExisting() will give you true if a boss exists, and false if a boss doesn't exist. !IsBossExisting() will give you false if a boss exists, and true if a boss doesn't exist.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 12, 2013, 01:49:57 PM
Oh and one more problem

heres my code

Code: [Select]
//Scatter Shot X side
if(Obj_GetX(obj) > GetClipMaxX) {
PlaySE(sfx1);
loop(15){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),3,dir,,0); dir+=360/8; }
Obj_Delete(obj);
}

//ScatterSide Y Side MAX
if(Obj_GetY(obj) > GetClipMaxY) {
PlaySE(sfx1);
loop(15){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),3,dir,BLUE01,0); dir+=360/8; }
Obj_Delete(obj);
as you can see i have comments "//Scatter Shot X side" and "//ScatterSide Y Side MAX"
why?
well that task is making a half circle
and with those two codes there
the object bullet is reacting to the RIGHTMOST X side and BOTTOMMOST Y side of the field ONLY
i want them to react to the TOPMOST Y Side too, since it is a half CIRCLE

problem is, whenever i add this

Code: [Select]
if(Obj_GetY(obj) > GetClipMinY) {
PlaySE(sfx1);
loop(15){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),3,dir,BLUE01,0); dir+=360/8; }
Obj_Delete(obj);
and im sure that ClipMinY mean it correspond to the TOPMOST Y side of the field
What would happen is that the code would go balls and wouldnt even follow the instructions i give
because what would happen when i put that in is that the bullet will move on to the scatter shot command without even getting to the walls of the FIELD
im sorry for the capital because this Thing is driving me insane  :getdown:

here (http://pastebin.com/nRq2SS3D) the code with the if(Obj_GetY(obj) > GetClipMinY) {} code
and here (http://pastebin.com/pXJBWhXx) is the code without it
can somebody please test both codes and tell me why wont it listen to me when i input the code TT_TT X_X

ADDED INFO
Cirno is on SetMovePosition03(GetCenterX-125,GetCenterY,7,5);
if the placement of her has something to with this
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on November 12, 2013, 02:18:06 PM
GetClipMinY only gets lowest Y point on screen. What you did in your if statement is require the bullet to be greater than the lowest Y point when it should be if Obj_GetY(obj) < GetClipMinY.

EDIT: I recommend checking your code for common mistakes sometime since this could've easily been prevented without the need of our help.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 12, 2013, 02:45:29 PM
Ok i see it now thanks,
oh and uhhh can anyone point me to where i can learn how to shot lasers? im about to use lasers in my spell and i tried to make one but i couldnt figure it out on my own
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on November 12, 2013, 03:12:31 PM
http://www.shrinemaiden.org/forum/index.php/topic,30.0.html
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 13, 2013, 03:10:20 PM
Can anyone give me tips on how i can approach my spell?
Im making an aurora borealis replica out of bullets (well that is the name of the spell XD)

so far i have this mess of an aurora...
Code: [Select]
task aurora{
loop(10){
                                CreateShotA(1,GetEnemyX,GetEnemyY,10);
                                SetShotDataA(1,0,1,290,0.5,-0.2,-3,BLUE01);
SetShotDataA(1,98,0,290,0,0,0,BLUE01);
SetShotDataA(1,100,1,350,0,0.5,2,BLUE01);
SetShotDataA(1,180,1,150,0,0.5,2,BLUE01);
SetShotDataA(1,260,1,350,0,0.5,2,BLUE01);
SetShotDataA(1,390,1,150,0,0.5,2,BLUE01);
SetShotDataA(1,420,1,350,0,0.5,2,BLUE01);
SetShotDataA(1,480,1,350,-1,0.5,2,BLUE01);
SetShotDataA(1,660,1,190,0,0.5,2,BLUE01);
FireShot(1);
                }
        }

and how do i make bullets that looks like theyre extending as they go? (like say stop a barrage of 5 bullets and after 60 frames THE FRONT accelerates first)
Similar to Flandre Scarlet's "Four Of A Kind"
those big GREEN02 and YELLOW02 bullets from the fake Flandres
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on November 14, 2013, 01:21:35 AM
Have them all fire at the same speed and accelerate them.
Ex:
CreateShotA(1,GetX,GetY,0);
SetShotDataA(1,0,1,90,0,0.01,3,RED01);
FireShot(1);
Repeat the bullet statements modifying the glowing parts to make it increase or decrease (negative value to the first glowing) to a higher/lower min/max amount.

https://www.shrinemaiden.org/forum/index.php?topic=865.0
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 18, 2013, 01:50:27 PM
Hmmm its gotten pretty quiet when im not asking XD
( I warned you guys i was gonna bombard you with questions , though Sorry about that )

dont worry its not about a spellcard XD
anyway its about a plural script

here's (http://pastebin.com/55A1a2Ew) the code

the first 4 spells work like a charm 1 Health bar each with a NonSpell and SpellCard
however
once NonSpell05 and Meteor Sign "Ice Comet" hits , from there up to "Snow Warning" they share ONE SINGLE life Bar ( a Single Life Bar thats just sliced to the number of spells left)
soooo....is there some kind of limit to how many spells can appear? o.O
Some Nonspells and Spells are still unfinished sooo does that have any connection to the problem?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on November 18, 2013, 02:46:56 PM
That's because there's alot of typos afterwards.
Change scrptnextstep to scriptnextstep.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 19, 2013, 01:26:24 PM
Hi again!Can you help me please? :V when i'm using animating labrary the sprite is not showing  :V though..the path to image and rect is fine :\

CreateAnimation("boss", "Standing",2);   
SetAnimationFrame("boss", "Standing",0, GetCurrentScriptDirectory~"b1.png", 2, 0, 0, 27, 33);
SetAnimationFrame("boss", "Standing",1, GetCurrentScriptDirectory~"b2.png", 2, 0, 0, 26, 34);

What the problem?I can't figure it out :c
Size of the sprires is  27x33 and 26x34  :derp:
Thanks in advance!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 19, 2013, 01:48:13 PM
though..the path to image and rect is fine :\
That doesn't mean the image it self is fine. Have you tried a replacement image (any random PNG?) What were the results? If this random image shows, then your initial sprite is corrupted. Try to resave it as PNG in Gimp/Photoshop or find a replacement.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 19, 2013, 01:59:28 PM
Another sprite/image isn;t showing too :c though it's showing with DrawGraphic
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 19, 2013, 02:37:47 PM
If another sprite isn't showing either with the animation library then your code is containing errors.

Post code in pastebin.com please.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 19, 2013, 02:53:39 PM
Here  :derp:

http://pastebin.com/TkYFjMWv
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 19, 2013, 04:02:37 PM
Here  :derp:

http://pastebin.com/TkYFjMWv
You never declared and/or loaded b1 and b2.png as far as I can see.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 19, 2013, 04:10:09 PM
Stupid me   :derp:  but the graphic isn't showing :0 maybe graphic rect has wrong parametres?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 19, 2013, 06:53:44 PM
You need to post your new code preferably again.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 19, 2013, 06:58:07 PM
http://pastebin.com/wJDWNJN7    :(
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 19, 2013, 08:10:29 PM
http://pastebin.com/wJDWNJN7    :(
Ok that is indeed odd. Your graphicrect seem fine in line 65 and 66. I assume you have your b1 and b2.png in the same folder as this script. I downloaded your code, tested it out myself with dummy pictures and it indeed doesn't seem to load, regardless of the location of files.

/me shrugs

The code is also extremely messy for me to detect the mistake. Anybody a clue?




Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: ExPorygon on November 19, 2013, 08:41:25 PM
Ok that is indeed odd. Your graphicrect seem fine in line 65 and 66. I assume you have your b1 and b2.png in the same folder as this script. I downloaded your code, tested it out myself with dummy pictures and it indeed doesn't seem to load, regardless of the location of files.

/me shrugs

The code is also extremely messy for me to detect the mistake. Anybody a clue?
I haven't used that 0.12m animation library in some time but iirc shouldn't he be using DrawAnimatedSprite (or something) instead of DrawGraphic?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 20, 2013, 09:11:22 AM
That's right! :V i need to use DrawAnimatedSprite.Stupid,stupid me  :derp: Sorry for my inattention  :( Thanks for your help,Helepolis and Ozzy! :I But in my animation there are 8 prites but only 2 sprites are used.What's wrong? :derp:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on November 20, 2013, 01:53:02 PM
Quote from: script
        CreateAnimation("boss", "Standing",2); 
SetAnimationFrame("boss", "Standing",0, b1, 2, 0, 0, 27, 33);
SetAnimationFrame("boss", "Standing",1,b2, 2, 0, 0, 26, 34);

Maybe because you only give rects etc. for two of them?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 20, 2013, 02:32:25 PM
No,no,no  :derp: i made for 8 sprites  :V and i made another animation for moving\running with 4 frames.Maybe i don't understand how to combine them  :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 20, 2013, 02:54:42 PM
I don't think you can use two separate sprites to animate one boss, can you? I have not used animation library yet so I wouldn't know exactly. But judging from "common sense", even the natural way of animating you usually use 1 single sprite.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 20, 2013, 03:13:59 PM
Is That so? :derp: Okay,thank you! But i don't understand how to use rect with ONE sprite image :т
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 20, 2013, 03:23:24 PM
What do you mean? If you have a file with 4 animations (1 row) let us say 64x64, then you obviously set the first rect at 0,0,64,64  the second at 64,0,128,64 etc. If you have 8 animations (2 rows) you obviously set the rects for the second row.

If you have 2 seperate files of animations, you obviously need to merge them first into one using a graphic editor. 

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 20, 2013, 03:56:28 PM
Why it's 128? :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Spectral Nexus on November 20, 2013, 04:28:14 PM
The order is 1. Left, 2. Top, 3.Right and 4.Bottom.
The top-left corner of any image is known by the rect (0,0).
If the rect of the image is 64 x 64, the parameters would be (0,0,64,64); because the images left and top are on the edges, making the rect boundaries 0 and 0, and the supposed animation frame's right and bottom sides are 64, being a 64 x 64 square.
The next frame is directly next to it, with no border, making the left side of the second animation frame become 64. The image is still touching the top edge, so it still equals 0. The animation frame is still 64 x 64, but because the second animation frame is shifted 64 pixels to the side, to border the first animation, you would have to add 64 (the size of the right side of the animation frame) to 64 (the amount of pixels the animation frame has been shifted by), therefore making 128. The animation frame hasn't moved vertically, so the bottom rect would still be 64. The total rect of the second animation frame would be (64,0,128,64);
In short, 64 + 64 = 128.
As weird as it may sound, I would recommend most people to memorise the 32 times table, as it would definitely help with drawing, with a lot of sprites being 64, and almost every sprites' graphic rects being around or in the 32 times table. Lol  :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Rei Scarlette on November 20, 2013, 04:28:26 PM
Why is it 128, you ask, well first you need to understand image coordinates. I apologize if this explanation is unnecessary, I just always go with the assumption that the other person does not know and I go into as much detail as I think would be useful.

(http://i.imgur.com/1E9kuci.png)

As you can see here, the further over to the right, the more the left number increases (the X value) and the further downwards, the more the right number increases (the Y value). The numbers I have marked represent the coordinates of the nearest corner (northwest of the numbers)

These numbers are the amount of pixels away from the left/top side of the image. You need to find the numbers at the corner of each image you want to draw, and use those.

If I wanted to animate the first row... the numbers I would use are
1: Start point 0,0 end point 64,80.
2: Start point 64,0 end point 128,80.
3: Start point 128,0 end point 192,80.
4: Start point 192,0 end point 256, 80.

Do you see how this works? If you don't know how to find the coordinates, most image editing programs (including microsoft paint yes) will tell you the coordinates of the exact pixel you are pointing to.

e: Ninja'd lol. Well, with both of these posts, I believe it should be well explained, but if you have any further questions do go ahead and ask.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 20, 2013, 04:31:34 PM
I got it!Thanks to you all! V v V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Blargel on November 20, 2013, 07:31:36 PM
For the record, the animation library does allow multiple images for the same animation/sprite.
SetAnimationFrame(sprite_name, animation_name, frame_number, image_file_path, frame_duration, left, top, right, bottom);
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 21, 2013, 07:00:47 AM
 @DrawLoop{
   DrawAnimatedSprite("Boss", GetX, GetY);
   if(GetSpeed>0){
   Animate("boss","Run",true);
   }
   
   if(GetSpeed==0){
   Animate("boss","Standing",true);
   }
   Okaaaay...Standing and Running animations are working,but not this way :\ i mean

if(GetSpeed==0){
   Animate("boss","Standing",true);
   }

is working

   if(GetSpeed>0){
   Animate("boss","Run",true);
   }

is working BUT

DrawAnimatedSprite("Boss", GetX, GetY);
   if(GetSpeed>0){
   Animate("boss","Run",true);
   }
   
   if(GetSpeed==0){
   Animate("boss","Standing",true);
   }

Isn't working correctly  :derp:

Can you help me,pleeease?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on November 21, 2013, 12:28:24 PM
I know I'm new here, and I' still learning danmakufu. I tried Helepolis' tutorials and it really helped me a lot. I'm now at the Familars tutorial.

But when I'm about to debug the script, it keeps giving me this error:

[script_enemy_main]内で「{...}」が対応していません

I've counted every curly braces and they are equal in numbers. Since I'm on a fast time schedule (doing a game using danmakufu in Software Engineering [my major in IT], Web Programming and creating an e-commerce website), i need the experts help.

I hope you guys can help a fellow programmer.

Here's a link to the script: http://pastebin.com/Yau5qhRd
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 21, 2013, 02:32:37 PM
im gonna save post space and give the 3 questions on my mind right now here  :3

1. How do I make the spells become deadlier and deadlier as the time runs out?
2. How do I make the spells become more deadlier and deadlier as you drain the boss' health?
3. How can i make my boss move in a circular motion?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 21, 2013, 02:49:40 PM
1. How do I make the spells become deadlier and deadlier as the time runs out?
GetTimer function using statement(s) to spawn different patterns/stuff.

2. How do I make the spells become more deadlier and deadlier as you drain the boss' health?
GetLife function using statement(s)  to spawn different patterns/stuff.

3. How can i make my boss move in a circular motion?
Same method you would spawn a circle of bullets, but make the boss move in that pattern. You might want to study making circular patterns, since it uses the same principle
http://www.shrinemaiden.org/forum/index.php/topic,865.msg31776.html#msg31776

Edit: For example the following you can do in a task to check the timer for the boss and spawn stuff and more stuff when the timer ticks below your desired moment.
Code: [Select]
task pattern {
while(GetTimer >= 45) {
stuff;
yield;
}
while(GetTimer < 45) {
more stuff;
yield;
}
}

Edited, slight modification, I think this is more efficient when using bullet patterns.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 21, 2013, 10:59:21 PM
I know I'm new here, and I' still learning danmakufu. I tried Helepolis' tutorials and it really helped me a lot. I'm now at the Familars tutorial.

But when I'm about to debug the script, it keeps giving me this error:

[script_enemy_main]内で「{...}」が対応していません

I've counted every curly braces and they are equal in numbers. Since I'm on a fast time schedule (doing a game using danmakufu in Software Engineering [my major in IT], Web Programming and creating an e-commerce website), i need the experts help.

I hope you guys can help a fellow programmer.

Here's a link to the script: http://pastebin.com/Yau5qhRd

/* is a block comment.

I highly suggest using an editor with syntax highlighting.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Blargel on November 22, 2013, 09:05:00 AM
@DrawLoop{
   DrawAnimatedSprite("Boss", GetX, GetY);
   if(GetSpeed>0){
   Animate("boss","Run",true);
   }
   
   if(GetSpeed==0){
   Animate("boss","Standing",true);
   }
   Okaaaay...Standing and Running animations are working,but not this way :\ i mean

if(GetSpeed==0){
   Animate("boss","Standing",true);
   }

is working

   if(GetSpeed>0){
   Animate("boss","Run",true);
   }

is working BUT

DrawAnimatedSprite("Boss", GetX, GetY);
   if(GetSpeed>0){
   Animate("boss","Run",true);
   }
   
   if(GetSpeed==0){
   Animate("boss","Standing",true);
   }

Isn't working correctly  :derp:

Can you help me,pleeease?

You're going to have to tell else what you mean by "isn't working correctly" because we can't read your mind through the internet to know how you meant it to work. Also, it'd probably be better if you gave us the whole script instead of just a section. Use http://pastebin.com to share a big amount of text without cluttering up the forums.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 22, 2013, 09:43:57 AM
Sorry  :derp: by "isn't working correctly" i mean that the standing animation and running isn't  working if i put Running animation and Standing animation in draw loop together.If i do this with while(GetSpeed>0){Animate("boss","running","true"); yield} , danmakufu crashes :т
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on November 22, 2013, 09:46:46 AM
/* is a block comment.

I highly suggest using an editor with syntax highlighting.

Yeah I noticed that I forgot to closed the comment, was doing it late at night, good thing I double checked it while I'm in school working on my practice. Thanks!


I'm using Sublime Text 2 since it is handy with the indentation, maybe I can find a way to include Danmakufu's syntax to Sublime's syntax highliters.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 22, 2013, 12:16:08 PM
Yeah I noticed that I forgot to closed the comment, was doing it late at night, good thing I double checked it while I'm in school working on my practice. Thanks!


I'm using Sublime Text 2 since it is handy with the indentation, maybe I can find a way to include Danmakufu's syntax to Sublime's syntax highliters.
In case you switch to notepad++, I believe there was a syntax highlighter in the information thread for Danmakufu.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Blargel on November 22, 2013, 06:29:40 PM
Sorry  :derp: by "isn't working correctly" i mean that the standing animation and running isn't  working if i put Running animation and Standing animation in draw loop together.If i do this with while(GetSpeed>0){Animate("boss","running","true"); yield} , danmakufu crashes :т

Oh I got it. You're running Animate in the DrawLoop. Don't do that.
The @DrawLoop runs every frame, but you should only use the Animate function when you want to start a different animation. I think you're causing the animations to restart every frame with the way you have it now so you will only ever see the first frame of animation.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 23, 2013, 03:55:53 AM
Yeah I noticed that I forgot to closed the comment, was doing it late at night, good thing I double checked it while I'm in school working on my practice. Thanks!


I'm using Sublime Text 2 since it is handy with the indentation, maybe I can find a way to include Danmakufu's syntax to Sublime's syntax highliters.
Excellent choice, it's what I use as well.

Luckily for you, I did this myself. At some point I also intend to implement a function library and autocompletions (for ph3).
https://mega.co.nz/#!F5lCRaLa!L--4dVYNZGzadanWOlfluS_mGbEd98D_-IHh8H-HA7U
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 23, 2013, 06:59:10 AM
Ok so these questions have been bugging me ever since i started danmakufu

1. How to I make every bullet stop ( lets say you have a boss shooting danmaku pattern and after 160 frames you want EVERY bullet to stop in place , NOT "stop on this frame" , Stop in place wherever that bullet is ( like sakuya's knives that stop in place)

2. lets say you have a BLUE03 trailing bullet, which leave more bullets as it move , but the bullets it makes form a linear path , how do i make it moree randomized (maybe like how remilia's nonspell work with the bubbles/ Flandre's Forbidden Barrage "Catadioptric" , but the idea is that one bullet spawn more bullet that is NOT on its linear path)

3. How do i make bullets spawn randomly from the walls? ( Like Sanae's Nine Syllable Stabs , but instead randomized spawn )

4. its about the custom cutin (WARNING this may be long)
soo i downloaded the custom cutin script from Helepolis' website (cutinscript_v3)  so that i can get the UFO cutin effect,
i read the instructions
the instructions said put it in my scripting directory....ok so i did that
and then
call the function
Code: [Select]
#include_function ".\function_cutin.txt";which i did, afterwards
i change my cutin to "NAZRIN" (because it said not to forget the quotation marks)

when i went to test out my spell
to my surprise..................THERE WAS NOTHING THEREEEEEE!!!!!
not even a picture or the "spell card attack" in the background
This is really pissing me off ever since i started scripting i just want to get that damn cutin TT_TT
To show im doing everything write heres my code
Code: [Select]
script_enemy_main {

#include_function = CSD ~ ".\function_cutin.txt";

 
 
        @Initialize {
stuff;
 
                CutIn("NAZRIN", "Reverse Magic"\""Elemental Shift"\",cut,0,0,507,600);
 
                mainTask;
 
        }
Soooo the spell works , but There just no cutin
is the version of the cutin affect the whole thing
if soo can i please have it that works with version0.12 TT_TT
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: ExPorygon on November 23, 2013, 08:28:05 AM
1. How to I make every bullet stop ( lets say you have a boss shooting danmaku pattern and after 160 frames you want EVERY bullet to stop in place , NOT "stop on this frame" , Stop in place wherever that bullet is ( like sakuya's knives that stop in place)
If you want bullets to stop like Sakuya's knives, then you might want to look into the TimeStop function.

2. lets say you have a BLUE03 trailing bullet, which leave move bullets as it move , but the bullets it makes form a linear path , how do i make it moree randomized (maybe like how remilia's nonspell work with the bubbles/ Flandre's Forbidden Barrage "Catadioptric" , but the idea is that one bullet spawn more bullet that is NOT on its linear path)
It sounds like you've already started working on this. Do you have code to post? It will be easier to suggest revisions from a starting point. In general though, what you probably want to add a rand(-number,number) to the x and y coordinates the the trailing bullet spawn at.

3. How do i make bullets spawn randomly from the walls? ( Like Sanae's Nine Syllable Stabs , but instead randomized spawn )
Again, you're going to want to use the rand functions to add a random element to the spawn positions of the lasers. If you want to make sure the lasers are still equally spaced, then generate a random number and add it to the spawn positions of ALL the lasers (let me know if this doesn't make sense, I don't know if I explained it well enough).

4. its about the custom cutin (WARNING this may be long)
Soooo the spell works , but There just no cutin
You're calling the default function for cutins "CutIn". Helepolis's custom version is "cutin" without the caps. Always remember that Danmakufu is case sensitive. You say you read the instructions but you definitely missed that piece of info.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 23, 2013, 09:12:58 AM
also #include_function = CSD ~ ".function_cutin.txt"; is certainly not #include_function ".function_cutin.txt";
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 23, 2013, 09:28:00 AM
It sounds like you've already started working on this. Do you have code to post? It will be easier to suggest revisions from a starting point. In general though, what you probably want to add a rand(-number,number) to the x and y coordinates the the trailing bullet spawn at.
well heres the code
Code: [Select]
if(time==5){
PlaySE(sfx3);
                                CreateShotA(1,Obj_GetX(obj),Obj_GetY(obj),15);
                                SetShotDataA(1,0,0,rand(0,360),0,0,0,RED01);
                                SetShotDataA(1,160,0,NULL,0,0.01,2,RED01);
FireShot(1);
time = 0;
                        }
                       
                        time++;
                        yield;
sooo i just make it like Obj_GetX(obj)+rand,Obj_GetY(obj)+rand? o.O

also #include_function = CSD ~ ".\function_cutin.txt"; is certainly not #include_function ".\function_cutin.txt";

Its a Just To Be on the safe side kinda thing Drake  :3
considering this is my first time playing with the cutins
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: ExPorygon on November 23, 2013, 10:06:27 AM
well heres the code
Code: [Select]
if(time==5){
PlaySE(sfx3);
                                CreateShotA(1,Obj_GetX(obj),Obj_GetY(obj),15);
                                SetShotDataA(1,0,0,rand(0,360),0,0,0,RED01);
                                SetShotDataA(1,160,0,NULL,0,0.01,2,RED01);
FireShot(1);
time = 0;
                        }
                       
                        time++;
                        yield;
sooo i just make it like Obj_GetX(obj)+rand,Obj_GetY(obj)+rand? o.O
Yeah, try something like that. That will make them more spaced out from the bullet that they're spawning from. Just don't overdo it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 23, 2013, 10:22:53 AM
#include_function ignores everything until the next string it encounters so it's useless. Having an = in there and a semicolon at the end is technically invalid syntax. It just happens to work anyways from a parser quirk.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 23, 2013, 10:45:03 AM
Well atleast it works now  :D

Quick question though:
are you able to add new rules to the script?
something like
Code: [Select]
If "The Player Captures all Spell Cards proceed with this one final Card (A Last Word)";
and
If "The Player Dies or does not capture all spells , end this script now";
Is there a function for that? o.O

Oh and just so i can get this question out off the way

How do you change the StgFrame? (The ones where the Bombs, Lives, Score,Diffucult is at )
Ive seen many youtubers or people that have custom Frames
and how can i make the difficulty text[Easy,Normal,Hard,Lunatic] have a different font (I want the one from the recent touhou games , the one where the difficulty is stated above the Score)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on November 23, 2013, 01:55:54 PM
No there's no function for something so specific. You would need to use CommonData and increase it each time the player captures a spellcard using an "if" statement with this function GotSpellCardBonus.
if(GotSpellCardBonus==true){
SetCommonData("create a variable string",GetCommonData("the string you created before")+1);
}
Now I'll let you figure out the rest which is pretty simple.

For your second question you must create an effect object in the 8th Layer which covers everything including the old frame. The same goes for creating a Difficulty display function.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 23, 2013, 02:04:41 PM
For your second question you must create an effect object in the 8th Layer which covers everything including the old frame. The same goes for creating a Difficulty display function.

Ok but uhhhh.....Come Again??  :wikipedia:
I didnt get any of that X_X
ok i Know what an effect object is if your wondering
But what i dont get is this 8th Layer stuff and..... /X_X
please explain in detail.....
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on November 23, 2013, 02:36:31 PM
The 8th layer is the highest drawing layer. When you set the layer of an effect object you have 8 different layers with 0 being the lowest which is the background and 8 being the highest which is the entire frame space. When creating an effect object you need to set the layer to draw it in.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on November 24, 2013, 07:51:03 AM
See ObjEffect_SetLayer
Code: [Select]
2 Parameters
    1) object ID
    2) layer (0 ~ 8)
        0: background
        1: between background and enemies
        2: enemies
        3: player's character (default)
        4: items
        5: bullets
        6: talking character
        7: foreground
        8: frame
As told on the danmakufu wiki.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 24, 2013, 11:46:10 AM
I think I Got it , but i have to test it to be sure
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on November 24, 2013, 01:49:45 PM
Hi!I have a questioon! :V There is a way to expandshrinkshake screen? :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on November 24, 2013, 02:25:06 PM
Hi!I have a questioon! :V There is a way to expand\shrink\shake screen? :V

Uh... that stuff is easily done in ph3, but in 0.12m, you'd have workarounds galore.

Fullscreen is, generally speaking, not something you should attempt in 0.12m given the default AutoDeleteClips and all of the other impediments. I don't understand what you mean by shrink the screen though.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 24, 2013, 05:13:56 PM
Hi!I have a questioon! :V There is a way to expand\shrink\shake screen? :V
Expand/Shrink > Doesn't exist.
Shake screen > Doesn't exist, though you can shake the bullets/player/background pretending that the screen shakes.

Your question is more easily achieved in ph3 engine, as that one has functions available for your desired effects.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 24, 2013, 11:49:20 PM
So I finally finished one boss fight and I am moving over to ph3  8)
But before i Do that
Here's a question

Is the way coding the same as v0.12 in ph3?
Like I can still task and such
I'm quite nervous moving over to the new engine because it might be very different :ohdear:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on November 25, 2013, 12:03:24 AM
Is the way coding the same as v0.12 in ph3?
Like I can still task and such
I'm quite nervous moving over to the new engine because it might be very different :ohdear:
I started ph3 yesterday. And the differences were frightening at first.

You will be using tasks VERY frequently, and you will be using objects for everything. Most of the function names are different (to allow people to not confuse the two languages), and things such like @Background and script_enemy_main are gone. Backgrounds and systems need to be linked a certain way, and...

There's a lot to learn.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on November 25, 2013, 12:23:02 AM
It's better to move versions now. You don't want to be stuck with 0.12 as it was abandoned a long time ago.
Ph3 has so many more functions like getting rid of the frame entirely and I believe shaking the screen.
Although I haven't switched to ph3 yet. I'm in the middle stage where I'm not using 0.12 or ph3 so...

You might want to look towards the already created scripts for a base script.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on November 25, 2013, 12:32:00 AM
I suggest waiting until you fully understand 0.12m. If 0.12m is still having you confused then ph3 would be even worse. As sweet as ph3 is you may not be ready to move on just yet.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 25, 2013, 12:47:51 AM
I suggest waiting until you fully understand 0.12m. If 0.12m is still having you confused then ph3 would be even worse. As sweet as ph3 is you may not be ready to move on just yet.
Yeahhh....you're right I guess I should understand more since I still haven't learned creating events and stages in 0.12

Especially after looking into Helepolis tutorial on ph3
No more script enemy main
The boss is an object now
Set life is gone
Set timer is gone
@Initialize is #Initialize now and there's an #Event
Oh God it gave me a headache /X_X

So I guess I'm gonna stick to 0.12 for now
While testing and learning ph3 when I feel like it...

Although How does one fully understand 0.12? o.O
I can create a boss
I can make it fire
I can make a plural script
I don't know how to make stages
Change the stgframe
Or make event
So am I still missing something left to understand?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on November 25, 2013, 12:55:59 AM
Although How does one fully understand 0.12? o.O
I can create a boss
I can make it fire
I can make a plural script
I don't know how to make stages
Change the stgframe
Or make event
So am I still missing something left to understand?
Make a stage, link stages together, make a menu, understand arrays of objects, understand drawing layers and render targets, make 3D backgrounds, know how to nest tasks, learn how things are executed, make a custom system, and understand Common Data.

Also, master object effects.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: gtbot on November 25, 2013, 01:14:41 AM
Make a stage, link stages together, make a menu, understand arrays of objects, understand drawing layers and render targets, make 3D backgrounds, know how to nest tasks, learn how things are executed, make a custom system, and understand Common Data.

Also, master object effects.
Thing is, all of those can still be learned in ph3 (and are more streamlined than in 0.12m).

--
SetLife (http://dmf.shrinemaiden.org/wiki/Enemy_Object_Functions#ObjEnemy_SetLife) still exists.
SetTimer (http://dmf.shrinemaiden.org/wiki/Boss_Scene_Object_Functions#ObjEnemyBossScene_SetSpellTimer) still exists.
@Initialized is still @Initialize (where did you get the pound sign from)

@Event and the lack of script_enemy_main will admittedly take a while to get used to them, but really they are massive improvements over 0.12m.

I can create a boss
I can make it fire
I can make a plural script
I honestly believe this is all you really need to know to get into ph3. I really recommend switching over to ph3, or at least taking a look at the ExRumia samples; it's not as threatening as it may seem. Creating basic things (a single attack/plural) in ph3 is pretty much the same as 0.12m, just different function names.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 25, 2013, 08:45:21 AM
So am I still missing something left to understand?
Producing actually something.

Have you released anything? Understanding comes from scripting a lot and trying to script more complicated things with each attempt. Do you think that everybody here started with supreme effects? (Well, few did, but those are rare conditional people). My first boss didn't even contain a background, plural or stage etc.

Step by step, like a toddler taking his first ones.


Regarding 0.12m vs ph3. There is nothing to be scared of ph3. Not any more because we have quite the documentation on the wiki. Aside from different names for functions the majority of the engine is, as said above by various people, the same.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 25, 2013, 10:09:13 AM
Have you released anything? Understanding comes from scripting a lot and trying to script more complicated things with each attempt. Do you think that everybody here started with supreme effects? (Well, few did, but those are rare conditional people). My first boss didn't even contain a background, plural or stage etc.

Speaking Of Which , am i able to post my work on this forum? (on Rika and Nitori thread to be exact)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 25, 2013, 11:30:35 AM
All authors are free to create a personal thread to display their work. That is up to you.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on November 25, 2013, 12:00:10 PM
I suggest to start with Ph3 asap.
Might even be better now than when you're "too" used to 0.12m.
The scripting style is smoother and imo, easier (atleast once you've gotten used to it) and the frustration of having to use workarounds goes away in ph3.

Shaking the screen is just one of the many things which gets messy in 0.12m and Ph3 really isn't that difficult to learn, especially if you know the basics of 0.12m, which it seems like you do.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on November 25, 2013, 06:40:06 PM
I feel it's actually better to switch now when you still haven't gotten to comfortable with the functions in 0.12.
All you need to learn is a sense of functions and what the do and ph3 would be a piece of cake to learn.
The only thing that make ph3 seem harder is because there are no full tutorials on firing complex bullets, creating backgrounds, etc.

Speaking of which, I'm going to go start learning ph3 as I'm itching to create a script I'm satisfied with.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on November 25, 2013, 10:32:21 PM
The only problem with starting with ph3 is that if you have no Computer Science experience, it's much harder to learn. If you are fairly good at using C style languages, ph3 is a better starting point than 0.12m since you don't have to deal with learning logic and syntax.

The reason I started with 0.12m was because ph3 wasn't supported by Wine when I joined the forum, and because it was under serious development and I didn't want to throw myself into an unstable language. (Also, I didn't understand objects or tasks at all).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on November 26, 2013, 02:26:16 PM
Well thanks for increasing my faith not to be scared of ph3 (That the only way i can say that phrase  :wikipedia: i dont know how else i would have said it XD )
I guess my plan would be testing ph3 here and there until i get use to it as i am trying to make a full fangame out of 0.12 as sort of a test for myself to show i have understanded everything about 0.12 and is ready to move on to ph3 (And I do not want to lose the progress i have since 0.12 script cant be transfered)

and besides ph3 is still in beta so maybe i will break the system by making a game out of it even though i dont know anything yet

But looking through older posts on this thread i stumbled on someone else trying to change the stgframe

and then Drake said this:
-Make image
-Name it STG_Frame.png
-Make an img folder in the DNH root folder
-Plop image in folder

Or you can make an effect and draw it every frame but bleh.

and then Sparen said:
640*480. If 0.12m, black will be treated as transparent, so make sure that you leave the playing field open or black.
(I dont know what he meant by 640*480....uhhhh can anyone clarify that?)

By the way
 the type of stgframe im making is for myself only
it an stgframe that is there to stay  WHATEVER script i play whether  i made my self or others made it
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on November 26, 2013, 03:16:36 PM
and besides ph3 is still in beta so maybe i will break the system by making a game out of it even though i dont know anything yet

and then Sparen said:(I dont know what he meant by 640*480....uhhhh can anyone clarify that?)
1. Eh, I'm pretty sure Ph3 can do everything 0.12m can and more in the state it is in right now. I did hear of maybe one or two specific functions not being available (?), but that's it.

2. The size of the screen? 640 should be the width and 480 the height.
It's easier to build a frame using an existing one, since 0.12m pretty much forces you to use the same dimensions for the playing field. I put an example in the attachments.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 26, 2013, 10:12:57 PM
ph3 has been out of beta for months. It's currently in a sort of testing-the-waters stage (the "pre" series) where users find all the small bugs and suggest useful features. I guarantee it is very much complete, and on the off-chance you found something important missing you could still be suggest it to be implemented.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on November 26, 2013, 10:22:42 PM
1. Eh, I'm pretty sure Ph3 can do everything 0.12m can and more in the state it is in right now. I did hear of maybe one or two specific functions not being available (?), but that's it.

Basically, just timestop and slow (as far as I know). It's the reason why Miransu made his RaNGE 10 entry in 0.12m.

But yeah. The guy who made the SpellCard Collection managed to make some kind of timestop on his own. It's definitely possible to make your own in ph3.

Just be aware: There is no default cut in for spell cards.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 01, 2013, 11:56:51 AM
This is gonna sound like a wrecked post because i cannot get my head wrapped around animations

Sooo heres the thing, ive done my Cirno script and im moving over to other characters
though heres the catch....i was able to animate my cirno through helepolis tutorial
and now im having trouble animating koishi,I have her sprite sheet and it seems she has an
idle animation , moving animation (just 1 row of movement) and an attack animation

heres (http://pastebin.com/wguwacww) the animation code i used (Straight from the cirno script)

problem is : I never fully understood how animation worked
can anyone please help me understand animations better (using the koishi sprite sheet below) (on second thought that might be copyright and lets just imagine a koishi sortie sheet with 1 row of idle animation, 1 row of movement animation and an attack animation)

questions:
1.) How do i make koishi look normal on idle animation?
(the story is that i copy pasted the cirno animation and slapped it on the koishi script, redirect the pathway of the image, and now koishi looks like a stuttering prick while idle)

2.) I remember reading a comment on helepolis video that if you only have 1 row of movement animation your just gonna have to put a 180??????  ??? o.O on the code?? or maybe i misread it but anyways , koishi only has a 1 row movement animation which goes right so how am i gonna make her go left?
(uhmmm explain this to me please X_X)

3.) Dat Attack Animation!  :o , How am i gonna do that  ???
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on December 01, 2013, 01:53:40 PM
The basic idea is that one image is displayed, but the contents of the image are slightly different every time, so it looks like the character moves.

SetGraphicRect() tells Danmakufu what content to use, which is then drawn using DrawGraphic().
By changing the contents of the part drawn in-game, the character will appear to be moving.

I commented your code so that you know what everything does: http://pastebin.com/AcnpkYbw (http://pastebin.com/AcnpkYbw)

1. The rects (coordinates) you used are for the Cirno sprites. The Koishi sprites are differently sized, or are in a slightly different position than the Cirno sprites, which causes the stuttering.

2. You can see this in one of the comments too, but the 180 should be placed in the SetGraphicAngle to mirror the sprites, making it appear as if the character moves left. (In this case, if the original sprite moves left, it will move right.)

3. Make another block of code in which you check if a variable is on, and if that is true, play the attack animation. Something like this:
Code: [Select]
let attack = false; //at the start of the script

if(attack==true){    //checks if the variable called attack is equal to true. If this is true, it executes the following code.
if(f2<10){ SetGraphicRect(first attack sprite coordinates)}
if(f2>=10 && f2<20){ SetGraphicRect(coordinates for the second sprite)}
        if(f2>=20 && f2<30){ SetGraphicRect(coordinates for the third sprite etc.)}
f2++;
}
Then if you want to use an attack, set the variable attack to true beforehand.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on December 01, 2013, 02:08:19 PM
To add, when animating Koishi, you will probably have to add new animation frames so it becomes like 6, if you want a smooth idle animation when she goes back and forth.

(http://img440.imageshack.us/img440/8550/yrl1.png)

Alternative way of scripting animation:
Code: [Select]
//somewhere at the start:
let animframe=-1;

let leftrect = 0;
let rightrect = 0;

//In the animation task or whatever.
animframe++;

ascent(anim in 0.."amount of sprites in the animation"){

if(animframe==(anim*5)){
leftrect = anim*"width of sprites";
rightrect = "width of sprites" + anim*"width of sprites";
}

}

if(animframe==("amount of sprites in the animation"*5+5)){animframe=-1;}

SetGraphicRect(leftrect, "top rect", rightrect, "bottom rect");
Just an example, (because I like ascent loops, that's why) but I think it looks cleaner this way. I dunno how good this is, just what I would use.
Hopefully it works in 0.12m too  ::)

~ And yeah, if you use KuroArashi's attack script, remember to check if attack==false on the normal idle animation, if it isn't obvious.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on December 01, 2013, 02:16:46 PM
Its best to create a task for animations and control it that way. Constantly changing the rect of a graphic in @Drawloop can cause graphical errors especially for enemy scripts when chained together in stage scripts.


Or, you could use the animation library function which pretty much makes this process easier.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 02, 2013, 10:48:55 AM
thanks for the animation help but uhhh two questions.

(because I like ascent loops, that's why)

Whats an ascent loop? X_X and how does it differ from the run on a mill normal loop?

Or, you could use the animation library function which pretty much makes this process easier.

whats an animation library? o.O
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on December 02, 2013, 02:07:29 PM
thanks for the animation help but uhhh two questions.

Whats an ascent loop? X_X and how does it differ from the run on a mill normal loop?

whats an animation library? o.O
No offence, though I am obliged to ask: how far did you actually study the 0.12m tutorials? The questions you have been asking us so far are vast explained and written in tutorials + wiki. Not that we don't mind to help, however, we also expect you to do some reading as well you know  ???
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on December 02, 2013, 03:21:19 PM
Whats an ascent loop? X_X and how does it differ from the run on a mill normal loop?
An ascent loop is a loop which also gives you a temporary variable (I think it's called a variable?) inside the loop.
For example, the ascent loop
Code: [Select]
ascent(something in 0..3){} would loop what's in the loop 3 times while also giving them the temporary values 0, 1 and 2 with the name "something".
In the first loop, something would be equal to 0, second loop equal to 1 and so on.

Using this, you could easily create a circle pattern with bullets by using ascent(i in 0..10){} and putting i*360/10 as the angle of the bullets in the loop ^^.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 02, 2013, 03:28:04 PM
No offence, though I am obliged to ask: how far did you actually study the 0.12m tutorials? The questions you have been asking us so far are vast explained and written in tutorials + wiki. Not that we don't mind to help, however, we also expect you to do some reading as well you know  ???
No Offence taken , wellllll i am on the "Able to create 1 boss fight because of Helepolis tutorials" stage on my scripting abilities

I have watch all your 0.12 tutorials and currently watching your p3 one , tested out what i learned myself , read some function on the wiki , and once again tested it out to see how it worked

but the reason im asking question like is most likely i havent encountered these things yet

i did not use an ascent loop on making my first boss fight , (nor did i even know there was one in the first place , or maybe its because i avoided the math functions that are on the wiki like a swarm of very grumpy turkeys) so i dont know what that does

and i never heard of an animation library ever since i was born because danmakufu is my first ever programming experience as im still in third year high school student in the phillipines and have not encountered programming even in school from the day i went to nursery

again really sorry if i keep spouting out random question because i have not encountered the words or programming language in my entire life.........ESPECIALLY THESE THINGS  :getdown:
Code: [Select]
cos
sin
tan
acos
asin
atan
atan2
log
log10
rand
rand_int
prand
prand_int
psrand
int
truncate
round
ceil
floor
absolute
length
integral
ToString
Collision_Line_Circle
Collision_Obj_Obj

An ascent loop is a loop which also gives you a temporary variable (I think it's called a variable?) inside the loop.
For example, the ascent loop
Code: [Select]
ascent(something in 0..3){} would loop what's in the loop 3 times while also giving them the temporary values 0, 1 and 2 with the name "something".
In the first loop, something would be equal to 0, second loop equal to 1 and so on.

Using this, you could easily create a circle pattern with bullets by using ascent(i in 0..10){} and putting i*360/10 as the angle of the bullets in the loop ^^.
Let me see if i understand this
so, using what you posted as an example
Code: [Select]
ascent(anim in 0.."amount of sprites in the animation"){

this ascent loop is a loop that will loop (Yeah....loops XD)  from 0 to 4 times( number of animation) and i presume the bracket means it will do something

did i get that right  ???
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on December 02, 2013, 04:35:56 PM
Let me see if i understand this
so, using what you posted as an example
Code: [Select]
ascent(anim in 0.."amount of sprites in the animation"){

this ascent loop is a loop that will loop (Yeah....loops XD)  from 0 to 4 times( number of animation) and i presume the bracket means it will do something

did i get that right  ???
It runs the statement
Code: [Select]
if(animframe==(anim*5)), yes. The temporary loop is called anim, which means that if the ascent boundaries are 0..4, it will check if the variable animframe is equal to 0, 5, 10 or 15.
This is the unique thing about an ascentloop. The variable (called anim in the example) which is created at the start of each loop and deleted at the end. This means that every loop gets a personal value which can be used with everything inside the loop.

Another example is using
Code: [Select]
ascent(i in -3..4) with bullets to shoot a bullet wave/wall.

Also, if you don't know what the animation library is, it's a "script library" you can download to make animation easier in 0.12m. Look in the stickies here on RaNGe to find it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on December 02, 2013, 11:32:44 PM
http://www.shrinemaiden.org/forum/index.php/topic,30.0.html

http://www.shrinemaiden.org/forum/index.php/topic,865.0.html
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on December 02, 2013, 11:50:28 PM
Thank you Drake.

On a related note, you should really be checking the Danmakufu Wiki. I know that it's under construction (I will probably start a 0.12m=>ph3 transition guide), but nevertheless, do look at the 0.12m tutorials and read them. The tutorials are also linked in the FAQ sticky (which... people don't read).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on December 03, 2013, 06:31:57 AM
Everything is in the sticky. It's quite helpful even though I might be the only one who read each thread like three times each.
You should also read the other tutorial threads that Drake linked to. They are organized for easy access to information.

And you shouldn't worry about trigonometry, you will learn it in time. (Even if you only know a bit about it enough to make a simple function.)
I'm not even sure about cosine and sine. All I learned is that they are helpful to make circles.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on December 03, 2013, 06:54:18 AM
0.12m to ph3 is this link http://dmf.shrinemaiden.org/wiki/0.12m/ph3_Function_Equivalents#Common_Functions which is the same as on the official site. Which yet needs to be logically finished but that is a matter of time since we're all busy in some sort of way which makes it slightly hard.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on December 04, 2013, 12:28:15 AM
0.12m to ph3 is this link http://dmf.shrinemaiden.org/wiki/0.12m/ph3_Function_Equivalents#Common_Functions which is the same as on the official site. Which yet needs to be logically finished but that is a matter of time since we're all busy in some sort of way which makes it slightly hard.

My main issue when transitioning was ObjMove_SetPosition vs ObjRender_SetPosition, #Background, #System, etc. I was using 0.12m-style workarounds on my first ph3 spell though, so...

P.S. Regarding trigonometry, it shouldn't be hard to find resources online.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 07, 2013, 08:46:23 AM
Ok no more of the very easy questions that i dont know the answer because i didnt read the whole tutorial section
So! i went back and read it all so the noob questions ends here
by the way i figured out how the animations worked now , thanks guys ^^

but im scripting yet another boss and this time its reisen
i dont know if there was a tutorial for this , because i sure did not see one

so heres the question :

On reisen's spells her danmaku stops (this is an easy part) and somehow "disappears" to a blur (the bullets dosent have collision which made it more confusing for me) and appears once again...now how in the world am i suppose to do that in danmakufu

side questions:

those red eyes that appear in the background before the bullets "disappear" are those an effect object? or something else completely?

and im new to custom shot sheet usage , so how am i suppose to call the bullets? is it like BLUE99, RED57? or what? ( it did not say anything in the readme or the actual shot coding)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on December 07, 2013, 09:01:40 AM
The easiest solution comes down to having a set of blurred bullets in your shot sheet, using Obj_SetCollisionToPlayer(object, false) to remove hit detection with the player (true to reactivate) and ObjShot_SetGraphic(object, shot_graphic) to change the shot graphic to the blurred one (and back).

The red eyes you would indeed make with an effect object.
In the shot sheet you make id just be some number like
Code: [Select]
ShotData{
id=1
rect=(0, 16, 0, 16)
}
and then when you shoot it that number is used instead of RED01 or whatever.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 07, 2013, 12:53:28 PM
The easiest solution comes down to having a set of blurred bullets in your shot sheet, using Obj_SetCollisionToPlayer(object, false) to remove hit detection with the player (true to reactivate) and ObjShot_SetGraphic(object, shot_graphic) to change the shot graphic to the blurred one (and back).
Can coding it like this work?
Code: [Select]
Time = 0;
object stuff
ObjShot_SetCollisionToPlayer(obj,true); //shot bullet

Time++;
While(Time>50){
More object stuff
Objsetblahbalcollision(obj,false);
//uhhh can I ask what function can change the bullet mid spawn? Is it like obj(NULL stuff,this parameter change the bullet)?

If(Time==60){
Object stuff
Objcollision(obj,true);
//return to original sprite and NULL Dir
}
Time=0;
}

In the shot sheet you make id just be some number like
Code: [Select]
ShotData{
id=1
rect=(0, 16, 0, 16)
}
and then when you shoot it that number is used instead of RED01 or whatever.
By "shot sheet" do you mean the ACTUAL text file that was coded by helepolis where the data of bullets is stored or the spell text file which I am gonna use the shot sheet for or I am gonna have to make my own text file and type Id=1and stuff
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on December 07, 2013, 02:16:13 PM
Reisen's blurred bullets are actual shot graphics on the shotsheet, I'm not sure how well you can pull this off in 12m being that bullets aren't as flexible as they are in ph3 which I have been able to pull off exactly what you're asking for with ease.

//uhhh can I ask what function can change the bullet mid spawn? Is it like obj(NULL stuff,this parameter change the bullet)?

The easiest solution comes down to having a set of blurred bullets in your shot sheet, using Obj_SetCollisionToPlayer(object, false) to remove hit detection with the player (true to reactivate) and ObjShot_SetGraphic(object, shot_graphic) to change the shot graphic to the blurred one (and back).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on December 07, 2013, 03:01:20 PM
Reisen's blurred bullets are actual shot graphics on the shotsheet, I'm not sure how well you can pull this off in 12m being that bullets aren't as flexible as they are in ph3 which I have been able to pull off exactly what you're asking for with ease.

Call the graphic after Loading the shot sheet.

Ex: CreateShot01(GetX, GetY, spd, ang, graph, delay) where graph is the NUMBER of the bullet.

// Fading suppository
// Note that only ONE shot declared as there is no need for 16 different colours of suppository.
ShotData{ id=156 rect=(1,294,16,308) render=ADD angular_velocity = 0 delay_color= (128,128,128) } //gray

You would use 156 for the graphic of the fading suppository
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 08, 2013, 07:17:08 AM
hmmm maybe ill have to test it out to be sure

but can anyone help me with scrolling my backgrounds
using this code as an example
Code: [Select]
SetTexture(lay);
                SetRenderState(ADD);
                SetGraphicRect(0,0,20000,20000);
                SetGraphicScale(1,1);
                SetGraphicAngle(0,0,0);
                DrawGraphic(GetCenterX+slide,GetCenterY+slide);
 
                slide+=2;
can anyone tell me which of these codes control the direction its going?

so far its moving to the bottom right
and i managed to reverse it anddddd thats about it.

so my problems/questions are

1.)how to move it up or down
2.) make it scroll from top right to bottom left
3.) Spin the background
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on December 08, 2013, 09:36:07 AM
hmmm maybe ill have to test it out to be sure

but can anyone help me with scrolling my backgrounds
using this code as an example
Code: [Select]
SetTexture(lay);
                SetRenderState(ADD);
                SetGraphicRect(0,0,20000,20000);
                SetGraphicScale(1,1);
                SetGraphicAngle(0,0,0);
                DrawGraphic(GetCenterX+slide,GetCenterY+slide);
 
                slide+=2;
can anyone tell me which of these codes control the direction its going?

so far its moving to the bottom right
and i managed to reverse it anddddd thats about it.

so my problems/questions are

1.)how to move it up or down
2.) make it scroll from top right to bottom left
3.) Spin the background
Lunarith, I seriously though have to point out my previous post again:
No offence, though I am obliged to ask: how far did you actually study the 0.12m tutorials? The questions you have been asking us so far are vast explained and written in tutorials + wiki. Not that we don't mind to help, however, we also expect you to do some reading as well you know.
What you're asking here is seriously basic tutorials. It is all written there, even in the videos.

If you ask us questions like: "can anyone tell me which of these codes control the direction its going?" it means you cannot even understand your own code or not willing to understand or haven't bothered understanding it by simply reading or watching tutorials. I can tell that code is an example from my video tutorials, since you're using the same parameters. So you bothered on "copy/pasting" the code but haven't bothered understanding?

I am confused. Since it is explained exactly in the video and even an annotation at 3:05 is given for alternative. How can you totally miss what code is causing the scrolling?



Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 08, 2013, 11:35:04 AM
Yahh really sorry ^^" about very easy in which I just have to read questions
But.
Its not that "I don't know how to scroll the background"
I know what causes that
Its the slide on the getcenterx and y parameter and that slide counter (slide+=2;) and that setgraphicrect making the image expand so its able to loop morethan once , right? I already know that (watch me get that completely wrong XDDD)

What I'm asking is which code control the direction its going to scroll towards , you never stated how to make it go in different directions(the only one you showed were top left to bottom right) in your videos that why I was confused , I experimented the hell out of the codes and didn't quite get satisfying (it either went reverse or not scroll at all) result that's why I posted it here,because I wanted to clarify this

By the way you don't need to worry about the spaces I occupied on this post forums once this is all done I'd  gladly remove my post about these teeth grinding Noob questions
Cause quite frankly
I myself thinks I look stoppid asking these questions  :colonveeplusalpha:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on December 08, 2013, 01:21:08 PM
Its the slide on the getcenterx and y parameter and that slide counter (slide+=2;) and that setgraphicrect making the image expand so its able to loop morethan once , right?
This and
What I'm asking is which code control the direction its going to scroll towards ,
This contradict.

"I know what causes that" "SetGraphicRect/DrawGraphic" You say this yet you claim you ask us the question on how to control the direction.

I experimented the hell out of the codes and didn't quite get satisfying (it either went reverse or not scroll at all) result that's why I posted it here,because I wanted to clarify this
Obviously you haven't experimented proper neither got the hell out of it. You mention you managed to reverse the direction. Most likely you changed the +  into - . Well good. That is one way to discover a thing. But that is where you probably stopped. Have you even bothered on making the other parameters slide? I highly doubt that. You're making up excuses to make us post and feed you the solutions on a silver plate, just because you refuse to learn or to even think.

We spent effort and time in creating tutorials. We lay down a basic on explaining certain effects and behaviour. Do you really expect us to go create 8 different tutorials for showing you how to move it into four directions and 4 diagonal directions? If we show one, you should be able to adapt it yourself.

But if you simply ignoring all this, you're being disrespectful to all the authors who have put time and hard work in the tutorials.


Hint to your problem, because I am not going to tell you how to exactly how to do it. I'll merely point you in the correct direction:
Maybe start adding/removing/reversing the slide variable inside SetGraphicRect / DrawGraphic for magical things.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 08, 2013, 01:43:18 PM
This andThis contradict
:objection!: Well I did say "watch me get this completely wrong" didn't I? BV

I kid you not , I even flipped the image all willy nilly just to get it to go toward One Direction ,
Used multiplication division sin cos tan (even though I don't know what does do XD) , make the numbers larger ,and change the actually, variable let slide = 10;  , 360/36 , even put it as an effect object didn't work, and even bloody fliiped the actual screen of the computer and say "yes I made it go this way" until I realize I can't play upside down to make it work

Soooo since I'm not on a computer right now I'm gonna a have to wait till I get my hand on it tomorrow

So you said change a variable , hmmm...... you mean like this?
Code: [Select]
SetTexture(lay);
                SetRenderState(ADD);
                SetGraphicRect(0,0,20000000+slide,20000000+slide);
                SetGraphicScale(1,1);
                SetGraphicAngle(0,0,0);
                DrawGraphic(GetCenterX-slide,GetCenterY-slide);
 
                slide-=2;
Will this work (I'm not on the computer so I cant test)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on December 08, 2013, 03:10:22 PM
So you said change a variable , hmmm...... you mean like this?
Code: [Select]
SetTexture(lay);
                SetRenderState(ADD);
                SetGraphicRect(0,0,20000000+slide,20000000+slide);
                SetGraphicScale(1,1);
                SetGraphicAngle(0,0,0);
                DrawGraphic(GetCenterX-slide,GetCenterY-slide);
 
                slide-=2;
Firstly, 20000000 is excessive, and if the dimensions of your background do not go into that evenly, you will have problems, because eventually, the entire graphic will slide off of the screen and you will be left with (if a spell) black or (if a stage) whatever the default stage background is (also black).


Let me give you an example.
Code: [Select]
    @BackGround {
SetTexture(Background);
SetGraphicRect(0, 0, 1600, 1600);
SetAlpha(120);
SetGraphicAngle(0, 0, 0);
SetGraphicScale(1, 1);
DrawGraphic(GetCenterX,GetCenterY-count%400);

SetTexture(backicon);
SetGraphicRect(0, 0, 210, 199);
SetAlpha(150);
SetGraphicAngle(0, 0, count/2);
SetGraphicScale(1, 1);
DrawGraphic(GetX,GetY);
    }

This is the @Background for my LOCAA 3 Suicune.
Code: [Select]
SetTexture(Background);
SetGraphicRect(0, 0, 1600, 1600);
SetAlpha(120);
SetGraphicAngle(0, 0, 0);
SetGraphicScale(1, 1);
DrawGraphic(GetCenterX,GetCenterY-count%400);
Here we have the spell background, which scrolls upwards. As you can see, the X direction does NOT move. Also, the graphic is a 400x400, so the SetGraphicRect is basically (0, 0, 400*4, 400*4), where the *4 is to prevent the entire background from moving off screen. When I draw the graphic, the X stays the same and the Y decreases. This moves the graphic upwards (count is incremented by 1 each iteration of @MainLoop). The %400 prevents the 20000000 thing by fixing the graphic so that once it has completely moved 400 pixels, it goes back 400 pixels. However, since the graphic's height is 400 pixels, this change is not visible to the player.

Code: [Select]
SetTexture(backicon);
SetGraphicRect(0, 0, 210, 199);
SetAlpha(150);
SetGraphicAngle(0, 0, count/2);
SetGraphicScale(1, 1);
DrawGraphic(GetX,GetY);
Here we have a rotating icon that completes a full rotation every 720 frames.

Now, back to your code.
Code: [Select]
SetTexture(lay);
                SetRenderState(ADD);
                SetGraphicRect(0,0,20000000+slide,20000000+slide);
                SetGraphicScale(1,1);
                SetGraphicAngle(0,0,0);
                DrawGraphic(GetCenterX-slide,GetCenterY-slide);
 
                slide-=2;
[/quote]
Firstly, you are doing a heck of a lot of things with that slide variable. Either use it in the SetGraphicRect OR in the DrawGraphic. Otherwise your code gets confusing and hard to debug. I can't even tell which direction the image is moving in because you're doing too many things with slide. Simplify it, and then see what happens.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Spectral Nexus on December 08, 2013, 03:11:56 PM
Here we go. Spectral Nexus: Tutorial Mode Activate!

I don't think that you need to use "slide" for the DrawGraphic AND SetGraphicRect, you can use it for SetGraphicRect, OR DrawGraphic, but I don't think both.

The first 2 parameters of SetGraphicRect are 0, and 0, because the top-left corner of any picture has the coordinates 0,0.
The second 2 parameters are the right and bottom of the picture, which vary according to the size of the picture.
In Helepolis' tutorial, he mentions that to make an infinitely tiled picture (or at least a VERY big tiled picture), you would need to set the coordinates to a huge number, like 200000.
You understand this, right?

Also, the 3rd parameter of SetGraphicRect is the right side. This means that by adding slide (an increasing variable) to the picture, the picture will grow in width, but because DrawGraphic keeps the picture in place, it gives off the illusion of the picture moving to the left alone, which is what you want.

Same for the fourth parameter, the bottom side. It grows if you add slide, so the picture increases by length, but because DrawGraphic is there, it keeps it in place and makes it look as if it is moving upward on its own.

Because the image is growing (or scrolling) by the left and top, the picture srolls to the top-left of the screen.

Reversing slide, would make the picture shrink, so to counteract that, you make the parameters on the right and bottom of the picture negative, so that the picture still increases, although it will be negative. This means that the picture will scroll to the bottom-right.

In short.

If "slide" goes up by 2 each time (slide+=2;) then...

SetGraphicRect(0,0,200000+slide,200000+slide); = Top-Left Scrolling
SetGraphicRect(0,0,-200000-slide,200000+slide); = Top-Right Scrolling
SetGraphicRect(0,0,200000+slide,-200000-slide); = Bottom-Left Scrolling
SetGraphicRect(0,0,-200000-slide,-200000-slide); = Bottom-Right Scrolling

SetGraphicRect(0,0,200000+slide,200000); = Left Scrolling
SetGraphicRect(0,0,-200000-slide,200000); = Right Scrolling
SetGraphicRect(0,0,200000,-200000-slide); = Downward Scrolling
SetGraphicRect(0,0,200000,200000+slide); = Upward Scrolling

For a rotating background, use:

SetGraphicAngle(0,0,slide/3);
I divided slide by 3 because without it, my test picture started spinning out of control.

Hope that helps, and I hope I got that right, because I only use ph3 now. I don't know that much about this lol.
Remember, there are more tutorials than Helepolis's. Even though Helepolis's Tutorial are VERY helpful (I used them myself), they don't cover absolutely everything. Blargel, Stuffman, Naut, Azure, Nuclear Cheese, Sparen and other people have also made tutorials, which go into more detail for one specific subject, and the wiki is helpful too. Try to experiment a little more.

EDIT: Nooooooo, Sparen beat me to it! T_T


Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on December 08, 2013, 04:05:03 PM
The tutorial I made is faulty in that sense like Spectral Nexus and Sparen pointed out. That is why I added the alternative as annotation later in the video.

What happens in my tutorial is this:
[attach=1]
The texture is multiplied xxxxxxx times virtually being larger than the game field. Then it is just "shoven around". 

It is a faulty method, even though it works it will eventually "run out" like Sparen mentioned and leave you with no background. SetGraphicRect mutation mimics texture UV scrolling. If your texture is 1024x1024, you can merely use those values + slide var and decide which direction you wish the scroll the texture.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 10, 2013, 10:18:15 AM
Hmmm i think I get How to scroll it now , thanks! ^^
and by the way i guess i got confused because it always though that you NEED to put a slide on both parameters
really MAJOR thanks though and you even put the effort of puting a tutorial
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on December 10, 2013, 04:05:49 PM
and by the way i guess i got confused because it always though that you NEED to put a slide on both parameters
If you subtract/add the X-parameter, you will obviously scroll it along its X (horizontal). If you add/subtract the Y parameter, obviously it will scroll along the Y (vertical). If you touch both parameters, you will get a diagonal scroll. Read the post of Nexus who has listed you the entire list.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on December 11, 2013, 01:03:20 AM
What would be the best way to go about making a version of Th13's Stage 1 Background.  Namely the stairs.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on December 11, 2013, 04:31:53 AM
3D stairs are easier to make than they seem, if you're already familiar with 3D rendering somewhat.

Take an image. Mentally segment it into your "steps", these are the rectangles you draw.

(http://i.imgur.com/3YoUA9v.png)

Unlike what might seem to be the most obvious option, chaining the vertices of each rectangle together so the image makes a sort of accordion shape, you split each stair into two different parts, a rectangle laying "upright" and a rectangle laying "flat".

Say the stair height is 32 pixels, and say your first "upright" rectangle is described with the vertices (x, y, z), (x+256, y, z), (x+256, y+32, z), (x, y+32, z). Then to get the next stair, you move upwards in the y-direction and deeper in the z-direction. You can keep doing that every new stair, so the next few rectangles are:
(x, y-32, z+32), (x+256, y-32, z+32), (x+256, y+32-32, z+32), (x, y+32-32, z+32)
(x, y-64, z+64), (x+256, y-64, z+64), (x+256, y+32-64, z+64), (x, y+32-64, z+64)
(x, y-96, z+96), (x+256, y-96, z+96), (x+256, y+32-96, z+96), (x, y+32-96, z+96)
(x, y-128, z+128), (x+256, y-128, z+128), (x+256, y+32-128, z+128), (x, y+32-128, z+128)

Clearly this can easily be thrown into a loop!
Code: [Select]
ascent(i in 0..number_steps){
//vertex 0, 1, 2, 3
(x, y-32*i, z+32*i), (x+256, y-32*i, z+32*i), (x+256, y+32-32*i, z+32*i), (x, y+32-32*i, z+32*i)
}
By doing it this way it also easily matches up with the rectangles on your image, so you can imagine that this basically draws your image, but with each segment pushed further back in the z-direction.

The "flat" rectangles are similar, they're just drawn like (x, y, z), (x+256, y, z), (x+256, y, z+32), (x, y, z+32) instead. Again, you want to make each new stair go up in the y-direction and back in the z-direction, so you can just toss this in the same loop as the first one:

Code: [Select]
ascent(i in 0..number_steps){
// "upright" rectangle vertices 0, 1, 2, 3
(x, y-32*i, z+32*i), (x+256, y-32*i, z+32*i), (x+256, y+32-32*i, z+32*i), (x, y+32-32*i, z+32*i)

// "flat" rectangle vertices 4, 5, 6, 7
(x, y-32*i, z+32*i), (x+256, y-32*i, z+32*i), (x+256, y-32*i, z+32+32*i), (x, y-32*i, z+32+32*i)
}

And that is your stairs.



EDIT: Accordion method is still pretty easy though and uses fewer vertices because it uses the strip primitive for the whole thing. It's just looping and alternating between "make the next two vertices higher in y-direction" and "make the next two vertices deeper in the z-direction".

Code: [Select]
// first two vertices
(x, y, z), (x+256, y, z)
ascent(i in 0..number_steps){
// next two go "up"
(x, y-32*(i+1), z+32*i), (x+256, y-32*(i+1), z+32*i)
// next two go "back"
(x, y-32*(i+1), z+32*(i+1)), (x+256, y-32*(i+1), z+32*(i+1))
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on December 11, 2013, 07:55:31 PM
Thank you!  Also, how do you do a camera angle like that?  (kinda sideways)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on December 11, 2013, 11:53:52 PM
http://dmf.shrinemaiden.org/wiki/Nuclear_Cheese%27s_Drawing_Tutorial#Section_3:_Section_3:_Intro_to_3D
Moving the camera to the right or left will do that. SetViewFrom(distance, longitude, latitude) sets the camera position, default being (500, 90, 45). The camera moves along a sphere of radius distance, where longitude and latitude are the angular coordinates of the camera on the sphere.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 12, 2013, 02:03:10 PM
how can you make those DNA formation bullets?
like the spell card in this one http://www.youtube.com/watch?v=TlF30axNOVE

Edit
and can anyone help me on how in the world am i gonna do aya's nonspell circle bullet formations? (im having trouble even on a single circle formation)
btw has any done a Hata no Kokoro sprite sheet? o.O
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Spectral Nexus on December 12, 2013, 05:58:57 PM
I'm afraid I don't know how to make DNA patterns because I am still a noob.
But for a circle, you would need to this. There are many other methods, but for me, this is the easiest and it can let you change the radius. Helepolis also explains this in his video tutorial.
 Please at least try to look for a tutorial if you trouble, instead of immediately asking here, as Helepolis's tutorial is literally called, "[ 弾幕風 Tutorial] CreateShotA & Spawning circle patterns".

I use:

Code: [Select]
let a = 8;            // A is for Amount, though you change it. You can change this to change the number of bullets in each circle.
let dir = 0;        // Dir is for Direction. Important. I'll explain later.
let x = 0;      // X is for any variable of your choice. Also quite important.
let r = 60;       // R is for Radius . Again, I'll explain later, although this should be self-explanatory.

loop{
while(x<a){  // While 'x' is less than the number of bullets, this loop carries. If you don't do this, bullet will overlap each other, and Danmakufu might crash.

CreateShot01(GetEnemyX+r*cos(dir), GetEnemyY+r*sin(dir), 2, dir, RED01, 10); // This holy magic, makes a normal shot, with dir as it's direction. Self-explanatory. Don't worry about cos and sin, you don't need to know about it, but it helps a tiny bit. They make circles. That's it really.

dir+=360/a; // The most important part, increases dir by 360 (the amount of degree in a circle), divided by the number of bullets.
x++; // Makes 'x' increase, making the loop stop when 'x' reaches 'a'.
}
x = 0;
dir = 0;
loop(60){ yield;}   // Waits for 60 frames (1 second)
}

Good luck, and I hope it helps. If it doesn't, watch Helepolis's tutorial please.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on December 12, 2013, 07:00:40 PM
I think DNA like patterns are made using sines and cosines.
If you take the sine/cosine from an increasing number, you'll get a number between 1 and -1 that increases and decreases between those boundaries with the increase/decrease between two points being smaller the closer you are to 1 or -1.

If anyone can explain this a better way, please do so, my English vocabulary is kinda lacking.

If you use that number as the width between the spawning place and the line you can draw through all of the places where the DNA lines intersect, you should be able to make something that resembles it.

And I really recommend you go take another look at those tutorials. I mean there are Helepolis's tutorials, there are some on this site, Sparen made some, the wiki has a few...
Try looking at those, they have the answer to a lot of common questions.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on December 12, 2013, 10:09:00 PM
Making Aya's nonspell can be easy.
Code: [Select]
let dir = 0;
let ang = 0;

loop{
   loop(number of shots in a circle){
      CreateShot01(GetEnemyX+radius*cos(dir), GetEnemyY+radius*sin(dir), 2, ang, RED01, 10);
      dir+=360/number of shots in a circle
   }
   ang+=however much you want   //this increases the angle of each circle pattern
}
This GetEnemyX+radius*cos(dir) and GetEnemyY+radius*sin(dir) make the bullet spawn away from her in a circle. You just need to change the radius to a number.
The variable ang changes the angle where the whole circle pattern is shot.

This might be a bit sketchy but it works.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on December 13, 2013, 02:20:18 AM
Any known way to reduce lag on effect objects?
Finally figured out the sakura winds and now 20fps  ???
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on December 13, 2013, 03:14:10 AM
You can probably do so by coding it better but nobody can know how to improve it without seeing what you have.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on December 13, 2013, 04:20:15 AM
I'm using this:
Code: [Select]
task CreateSnowEffect {
yield;
let a = rand(-150, 150);
let obj = Obj_Create(OBJ_EFFECT);
Obj_SetPosition(obj, GetClipMaxX-a, 0);
ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
ObjEffect_SetLayer(obj, 0);
ObjEffect_SetTexture(obj, cherry);
ObjEffect_SetRenderState(obj, ADD);
ObjEffect_CreateVertex(obj, 4);
ObjEffect_SetVertexUV(obj, 0, 0, 0);
ObjEffect_SetVertexUV(obj, 1, 32, 0);
ObjEffect_SetVertexUV(obj, 2, 32, 32);
ObjEffect_SetVertexUV(obj, 3, 0, 32);
ObjEffect_SetVertexXY(obj, 0, -16, -16);
ObjEffect_SetVertexXY(obj, 1, 16, -16);
ObjEffect_SetVertexXY(obj, 2, 16, 16);
ObjEffect_SetVertexXY(obj, 3, -16, 16);
let anglex = rand(0,360);
let angley = rand(0,360);
let b = rand(-1,1)*3;
ascent(n in 0..470) {
let v = 1+n/340;
ObjEffect_SetAngle(obj, anglex, angley, anglex);
Obj_SetPosition(obj, Obj_GetX(obj)+v*cos(140+a/10), Obj_GetY(obj)+v*sin(140+a/10));
ObjEffect_SetScale(obj, n/580, n/580);
let alpha = (n/300)*192*(1-bgspell_alpha);
ascent(j in 0..4) { ObjEffect_SetVertexColor(obj, j, alpha, alpha, alpha, alpha); }
a+=b;
anglex+=b;
angley+=a/100;
yield;
} Obj_Delete(obj);
}
from Victini's RaNGE 10 entry -- the Sakuya.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on December 13, 2013, 04:30:50 AM
That isn't a huge amount of calculating, I don't think it should be a massive problem. How many are you spawning to get it to drop FPS that much, and how many can you spawn without negative effects? Can you run the contest entry without lag?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on December 13, 2013, 11:43:52 AM
That isn't a huge amount of calculating, I don't think it should be a massive problem. How many are you spawning to get it to drop FPS that much, and how many can you spawn without negative effects? Can you run the contest entry without lag?
Is the problem isolated to this code? Or did you make other changes and add other effects? I used the Last Comer's code, and was spawning one petal every 6 or so frames, and I had no FPS dropping.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 13, 2013, 02:52:21 PM
This might be a bit sketchy but it works.

Yeah your right its sketchy but hey i wont complain ^^

oh and concerning my last question about animation

both of these codes wont show an attack animation at all
http://pastebin.com/KsXy4teT
http://pastebin.com/MQQCJFvB

even though i did what KuroArashi and the others told me to do soooo am i missing something here? X_X
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on December 13, 2013, 04:23:50 PM
Yeah your right its sketchy but hey i wont complain ^^

oh and concerning my last question about animation

both of these codes wont show an attack animation at all
http://pastebin.com/KsXy4teT
http://pastebin.com/MQQCJFvB

even though i did what KuroArashi and the others told me to do soooo am i missing something here? X_X
I really hope this is not the error:
Code: [Select]
SetGraphicRect(more more stuff)which should be:
Code: [Select]
SetGraphicRect(more more stuff);Since you aren't showing the "real" code for those graphic rects, it's hard to tell.

Another obvious error is if you didn't call attack correctly in your attack (single) script, as in setting
Code: [Select]
atk = true; when you want the attack animation to play and later turn it to false again when you don't want it to show anymore.
The second script you post would work better.

Another thing to mention is that by using f2 for the attack animation and only resetting it at the idle animation, if you set "atk" to true while the boss is moving, something strange would happen~

Hope this helps in any way since I don't really see what is wrong otherwise.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 13, 2013, 04:26:37 PM
well i kinda rushed that post

but no the semi colon was not the error because if it was there would be an error
and as i said it was rushed to attack is "atk" as it was in the variable

and by turn it to false again do you mean this?

Code: [Select]
       if(attack==true){
                if(f2<10){ SetGraphicRect(stuff)}
        if(f2>=10 && f2<20){ SetGraphicRect(more stuff)}
        if(f2>=20 && f2<30){ SetGraphicRect(more more stuff)}
        f2++;
}
    attack = false;
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on December 13, 2013, 04:33:27 PM
and by turn it to false again do you mean this?

more like:
Code: [Select]
task shoottask{
loop{

wait(120);

//start attack animation for having the boss firing bullets.
attack = true;

//Insert bullet code here.

//end attack animation once the bullets are all shot.
attack = false;
wait(60);
//movement code?

//end of task.
}}

My point here is that you should probably show how you did the script using the animation as well. Since the error might be there (unless I just simply missed something important in your drawing script), only showing the animation part may not help.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on December 13, 2013, 09:30:25 PM
Is the problem isolated to this code? Or did you make other changes and add other effects? I used the Last Comer's code, and was spawning one petal every 6 or so frames, and I had no FPS dropping.
This code, without it, runs 60FPS. 
That isn't a huge amount of calculating, I don't think it should be a massive problem. How many are you spawning to get it to drop FPS that much, and how many can you spawn without negative effects? Can you run the contest entry without lag?
Contest  ??? Wat
i think ascent(n in 0..470) is spawning them.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on December 13, 2013, 10:26:10 PM
Contest  ??? Wat
i think ascent(n in 0..470) is spawning them.
He wants to know if you can run Victini's RaNGE contest 10 entry without lag.

And the ascent loop only moves the petals around, it doesn't spawn them.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on December 13, 2013, 10:35:21 PM
         let v = 1+n/340;
this was the line  :D sorry  :blush:

and yes I can run it without lag
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on December 18, 2013, 02:53:37 AM
Is there a way for a certain boss (example: yuyuko in the script provided in the link) to move from (example: the top-right to the center or top-left to the center) other than from the top center?

here's the link:
http://pastebin.com/gucmYbVW

And oh, I've been trying to make the spiral patterns execute in sequence, not just in instant after a certain number frames that has been decleared in the loops and in the main task.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on December 18, 2013, 03:28:42 AM
Is there a way for a certain boss (example: yuyuko in the script provided in the link) to move from (example: the top-right to the center or top-left to the center) other than from the top center?

here's the link:
http://pastebin.com/gucmYbVW

And oh, I've been trying to make the spiral patterns execute in sequence, not just in instant after a certain number frames that has been decleared in the loops and in the main task.

First point: What exactly do you mean by move from something other than from the top-center?

Second point: Is this thing about spiral patterns a question or a comment?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on December 18, 2013, 04:27:45 AM
You probably just mean that you want the boss to spawn elsewhere. All you need to do for a single script is use SetX(x) and SetY(y) before using SetMovePosition().
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on December 18, 2013, 06:47:35 AM
First point: What exactly do you mean by move from something other than from the top-center?

Second point: Is this thing about spiral patterns a question or a comment?

Sorry about not being precise to the point, I want the boss (Yuyuko) to spawn elsewhere rather than from the top-center of the screen, like in the official games. In my opinion, spawning from the top-center is not a good entrance for a boss.

And about the second, sorry for an another misunderstanding.  :(
I'm trying to spawn the spiral bullets in sequence without them overlapping at some intervals. I've been trying to modify the delays so that each pattern will execute at a time, yet it seems I can't get the right timing for the delays.


You probably just mean that you want the boss to spawn elsewhere. All you need to do for a single script is use SetX(x) and SetY(y) before using SetMovePosition().

Yeah, that's the point. So the value in SetX and SetY will be initial starting point for the boss?
Not being a bother but umm....can you provide a sample code? I hope it's okay.

 


Edit: Seems that I figured out the solution to the boss positioning problem that I had.  xDDD
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: rikako_asakura on December 20, 2013, 10:33:24 PM
Hey, I know this might be a bit of a nooby question, but how do I turn off the floating white square things that float around the enemy?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: PhantomSong on December 20, 2013, 11:45:16 PM
Hey, I know this might be a bit of a nooby question, but how do I turn off the floating white square things that float around the enemy?

MagicCircle(false);

or something like that
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on December 21, 2013, 09:27:50 AM
Keep in mind that it will also turn off the magic circle itself for your bosses. Either insert your own or if you insist on keeping the magic circle of danmakufu, edit out the white squares in the dnh system textures.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 22, 2013, 07:44:55 AM
Okey so this is just a point me towards question

(i havent seen a tutorial about this so i want to ask for directions)
can anyone show me a tutorial where i can learn how to make my own concentration effect and apply it in my boss?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on December 22, 2013, 10:03:42 AM
Okey so this is just a point me towards question

(i havent seen a tutorial about this so i want to ask for directions)
can anyone show me a tutorial where i can learn how to make my own concentration effect and apply it in my boss?
There is no specific tutorial for this indeed, though concentration effects are part  of Effect Objects which is again a part of Objects in danmakufu.

The learning curve is
1) Tasking / functions
2) Objects and behaviour
3) Effect objects

http://dmf.shrinemaiden.org/wiki/Nuclear_Cheese%27s_Effect_Object_Tutorial
http://www.youtube.com/watch?v=EMw7DOWYMkw

Once you understand how to make effect objects and control them, you should be able to make your own and apply it.  Basically it is almost same principal as firing bullets, instead you fire effect objects.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 22, 2013, 10:23:47 AM
Thanks for directions Helepolis ^^  :D
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on December 22, 2013, 10:47:45 AM
Keep in mind that a concentration effect is a small square texture/sprite being summoned as effect object then pulled towards the boss. It isn't a beginner or intermediate task you're taking. I think such effects and ideas would easily categorize under expert level, because it combines a lot of different things to achieve one thing. Therefore start simple. First try to summon several effect objects around the boss (like 4-5) and make them move towards the boss disappearing. And if you learn to do this, you can pretty much make any custom-X-effect for your bosses: Explosions, glitters, beams, fog and so on.

The biggest mistake people make is think too difficult and try to do everything in one go. This is why you need to break it down in steps.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 22, 2013, 10:51:28 AM
Understood Helepolis!  :justasplanned:

Soo i guess first order of buisness is Learning Effect Object (oh joy this is gonna be fun XD)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on December 22, 2013, 02:45:00 PM
Soo i guess first order of buisness is Learning Effect Object (oh joy this is gonna be fun XD)
Oh boy. You have a lot of fun ahead of you. -_-
Make sure that you understand TriangleStrip and TriangleFan before you make your vertices (UV is on the image file, XY is rendering). Understanding the order of the vertices will save you a lot of stress. The player script tutorial should also help with rendering effect objects.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on December 22, 2013, 03:08:52 PM
Wayyyy ahead of you sparen just reading the things on the tutorial, made my head bleed  :colonveeplusalpha: , *sigh* well you know what they say. "Let's do this shit"  8)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake on December 31, 2013, 05:38:46 PM
Normally I use the wiki's list of functions and parameters to help with the many, and I mean many, different functions.
And also, some spaces in between lines might help organize the different steps. I like to separate the SetVertexXY and the SetVertexUV on its own. Making it a lot easier to find when you have a visual problem with the sprite.
The main action parts of the effect object, I like to also organize the steps into miniature tasks. I usually put these tasks outside the effect objects main task and call it inside. This way you can have two tasks, one being the moving part and another being the lengthening of the effect objects to make it look like it's actually being pulled. Afterwards, a simple deletion of the effect object will end the task and you can finally move on to other things.
Of course, though, I've never actually tried such a big effect object bullet task, so my only other advice left is to start with an easier part, test it, than try for the more difficult one.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on January 02, 2014, 01:42:34 AM
I've been creating this 4th non-spell card of Yuyuko's for a while and somehow it is "almost" how I want it to be like in this video (http://www.youtube.com/watch?v=QnLjHKfNhbQ). But somehow it is still not that accurate.  :(

The first pattern (which fires the purple/lilac shots) should fire towards the player, but somehow it is not working even though I used GetAngleToPlayer.

Here's the source code:
http://pastebin.com/urWadbv5

Note:
the fastMovement, InitBoss and the global variables are separated in another textfile/s (variables.txt* and functions.txt*)
*See the attachments if it is needed



Any suggestions or modifications can be made so that it can be almost like the original non-spell attack?

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on January 02, 2014, 02:40:38 AM
I've been creating this 4th non-spell card of Yuyuko's for a while and somehow it is "almost" how I want it to be like in this video (http://www.youtube.com/watch?v=QnLjHKfNhbQ). But somehow it is still not that accurate.  :(

The first pattern (which fires the purple/lilac shots) should fire towards the player, but somehow it is not working even though I used GetAngleToPlayer.

Here's the source code:
http://pastebin.com/urWadbv5

Any suggestions or modifications can be made so that it can be almost like the original non-spell attack?

Your problem is not easily solved. The thing is that you are your setting your bullets to go towards the player, but by the time the bullets reach the point when they are supposed to change angles, the angle to the player is different because they're no longer in the same location.

Create object shots and after the x number of frames, call Obj_GetAngleToPlayer. You can find the function in the helpful function thread, but I'll just post it her to be sure.

P.S. The code is ugly and not optimized, but it works.

Code: [Select]
function Obj_GetAngleToPlayer(obj){
  return Obj_GetAngleToPoint(obj,GetPlayerX,GetPlayerY)
}
   
function Obj_GetAngleToPoint(obj,tarX,tarY){
  if(Obj_GetX(obj) > tarX && Obj_GetY(obj) < tarY){
    return 180 - atan2((|Obj_GetY(obj)-tarY|),(| Obj_GetX(obj)-tarX |));
  }
  if(Obj_GetX(obj) > tarX && Obj_GetY(obj) >= tarY){
    return 180 - atan2((tarY-Obj_GetY(obj)),(| Obj_GetX(obj)-tarX |));
  }
  if(Obj_GetX(obj) < tarX && Obj_GetY(obj) >= tarY){
    return atan2((tarY-Obj_GetY(obj)),(| Obj_GetX(obj)-tarX |));
  }
  if(Obj_GetX(obj) == tarX && Obj_GetY(obj) >= tarY){
    return 270;
  }
  if(Obj_GetX(obj) == tarX && Obj_GetY(obj) < tarY){
    return 90;
  }
  return atan2((|Obj_GetY(obj)-tarY|),(| Obj_GetX(obj)-tarX |));
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on January 02, 2014, 04:37:04 AM
The problem here is not only that "GetAngleToPlayer" largely misses the activation timing of 90 frames, there is also the fact "GetAngleToPlayer" only calculates the angle from the boss to the player. What you are doing here is setting a bullet which waits 90 frames before it is aimed at the angle given to you by "GetAngleToPlayer"... 90 frames ago. The solution is to code an object bullet which you can then accurately calculate the position of with Obj_GetX or Obj_GetY functions, and then use the atan2 function to calculate the angle from these coordinates to the player's. Either that, or you can cheat a bit and use SetShotDirectionType. :V

Code: [Select]
SetShotDirectionType(PLAYER);
SetShotDataA(1,90,2,0,0,0,0,12);
SetShotDirectionType(ABSOLUTE);

What this does is change the way angles are calculated in Danmakufu; "PLAYER" makes them all relative to the player's position, so simply inputting a value of "0" will make the bullets be redirected towards the player. It then changes it back to ABSOLUTE (which is the default), so it does not get in the way when calculating angles outside whatever loop you put them in.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on January 02, 2014, 08:46:03 AM
Important to remember: I would use atan2() no matter what for any bullet that isn't spawned from the boss' centre. ShotDirectionType isn't working when the bullet has an offset, i.e: GetX+30 or similar.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow on January 02, 2014, 09:25:19 AM
That is strange, because I recall using SetShotDirectionType like that and working for me as desired. Needless to say, though, this is a very roundabout way of making bullets aim at the player with CreateShotA, and as Helepolis mentioned, using atan2 would be a much "safer" route if you find problems using the aforementioned method. You will need to use object bullets for that, of course.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on January 02, 2014, 10:29:55 AM
It is indeed quite confusing and odd.

It is somewhere in an ancient 0.12m Q&A thread where I stumbled on similar issue with aiming towards the player. Several people suggested to use the SetShotDirection. It didn't matter for me what ever type I used, the bullet would graze the player at the exact offset it was fired at.
[attach=1]

Yes, the bullet goes towards the angular position of the player, but not AT the player's centre. That is why someone told me to use obj bullets with atan2() for homing bullets in such conditions. Basically it boils down to the question:
- Is the bullet fired from centre of boss/familiar? --> GetAngleToPlayer or atan2 (if obj).
- Is the bullet fired from boss, but with an offset? --> atan2 advised.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on January 02, 2014, 11:09:52 AM
Strange, since SetShotDirectionType seems to work well for me. Atleast in the cases I've tried for 0.12m.
Example:
Code: [Select]
SetShotDirectionType(PLAYER);
CreateLaserA(1,GetClipMinX-15,-10,600,10,2,1);
SetLaserDataA(1,0,0,0,0,0,0);
SetShotKillTime(1,2);
FireShot(1);
SetShotDirectionType(ABSOLUTE);
Fires a short laser from the left corner of the screen aimed at the players hitbox.

Not sure if SetShotDirectionType only works with some types of positions, because I have no idea where everyones different views on the questionable usage of SetShotDirection comes from.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on January 02, 2014, 12:06:55 PM
My concern was regarding shots fired from the boss. Not a static location on the game field. Try to fire that at an offset from the boss?  GetEnemyX/GetX minus / plus <value> as offset. I am extremely curious.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic 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
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Fujiwara no Mokou 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  (http://www.shrinemaiden.org/forum/index.php/topic,7038.msg429788.html#msg429788)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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake 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,
I think there's a break function that ends a task,
after a certain amount of time.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Shadow 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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen 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
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic 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 (http://pastebin.com/caCYQKfV)
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);
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lavalake 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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis 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 (http://pastebin.com/caCYQKfV)
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?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic 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....(http://i43.tinypic.com/33xh82s.png)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on January 03, 2014, 07:00:36 AM
Also it's @BackGround, not @Background
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen 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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro 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:


(http://i40.tinypic.com/15e78df.jpg)

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:

(http://i40.tinypic.com/105ung9.jpg)


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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake 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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro 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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis 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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro 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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 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...

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake 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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 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...
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Monkeypro257 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?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Monkeypro257 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.)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis 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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Monkeypro257 on February 06, 2014, 08:06:34 AM
It didn't have danmakufu with it, just The Last Comer file.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro 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. (http://pastebin.com/bSfaWjea)

And here's an image preview:
(http://oi61.tinypic.com/2wnsoll.jpg)

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
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis 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. (http://pastebin.com/bSfaWjea)

And here's an image preview:
(http://oi61.tinypic.com/2wnsoll.jpg)

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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro 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:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis 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)

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake 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.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Monkeypro257 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)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on February 06, 2014, 09:33:45 AM
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)
What did you download anyway? I downloaded the http://www1.axfc.net/uploader/so/3013625?key=mrkn (1.00a) it is a 200+ mb download. I have extracted this into my script folder and it functioned.

This is what you should see (3 options for the game). Then you can apply the patch updates I think.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on February 06, 2014, 11:25:31 AM
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).

Well, at the moment that was my plan, now I feel like an idiot for that idea xDDD. Sorry about that.

Using SetCollisionB()

Well that worked perfectly, thanks!
At first I thought SetCollisionA and SetCollisionB will only work for enemy scripts, guess I was wrong. Thanks for the solution :)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on February 06, 2014, 02:53:20 PM
There is a reason why you define x and y for SetCollisionB :V So if you can define it for a boss, you can also define it for objects.

The more you know, right?  :D
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Monkeypro257 on February 07, 2014, 03:56:18 AM
Thanks I can play it now. :) (Weird. I downloaded from the same website, but those options weren't there before . . .)

EDIT: Every time the boss casts a spellcard, my computer drivers crash(then tries to recover sometimes) and my computer shutsdown. I know this isn't suppose to happen.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on February 07, 2014, 09:43:59 AM
Time to check your drivers for your GPU.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Monkeypro257 on February 07, 2014, 10:52:28 PM
Time to check your drivers for your GPU.

I checked my drivers and their up-to-date. I first just encountered this by playing the Last Comer, but nothing else.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on February 10, 2014, 06:12:11 AM
There is a reason why you define x and y for SetCollisionB :V So if you can define it for a boss, you can also define it for objects.

The more you know, right?  :D

Thanks to this Hele-san xDD




Now, back to the task at hand. I'm now doing a second trial on the Nuclear Fireballs.....USING THEM AS GRAPHICS FOR A BULLET PATTERN.

 Here's the code. (http://pastebin.com/3Y8w6KD1)

And here is the spellcard script. Yes, I also implemented the 1st trial of the fireballs here. (http://pastebin.com/96CxD71y)

Now, I want to use the effect objects as graphics for the fire task in the spell script. But, somehow Danmakufu crashes instantly when it's about the run the fire task. No errors being pointed out, it just immediately crashes. I even tried on just spawning the effect object first, but it also crashes (even without using the fire task and changing the task into a normal one, instead of having parameters next to the task name) .

Can anyone help me on this one? :ohdear:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: KuroArashi100 on February 10, 2014, 06:28:16 AM
It seems you forgot to yield; the firing task. while loops will keep looping until the statement between brackets becomes false, which in this case never happens.
Danmakufu tries to loop it an infinite amount of times, and will crash as a result.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on February 10, 2014, 06:54:29 AM
forgot to yield; the firing task

Yeah, after reading the code for about multiple times, I totally forgot the:

Code: [Select]
yield;
frame++;
spin+=2;

I think I'm having my 'senior moments' now xDDD

Now that one problem is done, all I need to know now is how to implement the effect objects into a bullet pattern (example for this one is one of Utsuho's  spellcards where the effect objects are in a ring pattern).

Any idea how to do this?

EDIT1:
I let the whole script to end by itself (letting the time to count down to 0), somehow the pattern executes after the boss dies. I mean literally...when the boss died, the pattern executed itself. Weird, is that some glitch or just bad coding one the script that I don't seem to know? ???
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 on February 13, 2014, 12:03:46 AM
So this piece of code works perfectly, but there is a aesthetic change I want to add, and that is the TBOrb object to rotate, which I cannot accomplish. Can someone help me with it?

http://pastebin.com/vCqYMhQt
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on February 13, 2014, 12:51:59 AM
You can't just use ObjEffect_SetAngle()?

I would also like to ask what you're doing with your XY vertex mappings. You're doing scaling on one and some odd trig on the other, and scaling at least is totally unnecessary to do there and just overcomplicates things. There is ObjEffect_SetScale() for a reason.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 on February 13, 2014, 01:35:48 AM
I was given the code, so I am not entirely sure of how it works.  And I have tried with SetAngle and it works. I am quite rusty with my danmakufu knowledge...
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: alice_8 on February 16, 2014, 08:34:00 PM
=_=...

I'm trying to run danmakufu on windows 8 and it crashes. I tried running it with applocale, but it still crashes. Why does it keep crashing, even with applocale? What am I doing wrong? Please help! Thanks...

 :ohdear:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on February 16, 2014, 11:16:25 PM
you need compatibility mode for 12m to work on Win8. The japanese scripts won't work without applocale iirc, so make sure your scripts don't have any japanese text in them to prevent crashing.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Gusano Wornis on February 17, 2014, 06:29:44 PM
open config.exe, go to "option" , and change the option where it says #Player (various symbols or ????)
and that should be the solution, i can play japanese scripts fine on win8 :P
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Facundo on February 24, 2014, 09:49:28 PM
Excellent tutorial, I am learning a lot!!! But I have a problem with the last tutorial (the "Player Script with Bomb" Tutorial).
I did it as similar as you did on the video, but when I press the BOMB-BUTTON, Marisa doesn't do anything and instead I lose a Bomb Counter
Here is my script, I CAN?T SEE THE ERROR!!! can you help me pleases???

http://pastebin.com/j9eqvQMS

...Please save me.

Hello and welcome Facundo, next time please post in the correct thread your questions and use pastebin when your code is too large to show. Thanks =) -Hele
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on February 25, 2014, 02:49:41 PM
Excellent tutorial, I am learning a lot!!! But I have a problem with the last tutorial (the "Player Script with Bomb" Tutorial).
I did it as similar as you did on the video, but when I press the BOMB-BUTTON, Marisa doesn't do anything and instead I lose a Bomb Counter
Here is my script, I CAN?T SEE THE ERROR!!! can you help me pleases???

What you are saying here is not helpful. If the invincibility circle loading? Are you invincible? Did you check all of your brackets? Are there any errors? Are your file paths correct?  Is the cut in text showing?

I tested it and yes, it's not working. In a case like this, calm down and think, step by step, what the program is doing when you hit the bomb button. It calls @Spellcard, then...

Whoops! There's your error!

You need   @SpellCard {

Note the Capital C. Problem solved.

(You have bugs in the spell code, btw.)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on March 05, 2014, 01:03:34 AM
Hey!  Haven't been on here in a while and I have a question about objects (namely effects), is there anyway to check if an object has collided with the boss or an enemy?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on March 05, 2014, 03:37:23 AM
Hey!  Haven't been on here in a while and I have a question about objects (namely effects), is there anyway to check if an object has collided with the boss or an enemy?

I assume that Collision_Line_Circle and Collision_Obj_Obj will not work well for you, the former being unusable in your case (most likely) and the latter being a royal pain.

The latter involves EnumEnemyBegin, EnumEnemyEnd, EnumEnemyGetID and GetEnemyInfo. It's definitely possible, but it would cause an unnecessarily painful time trying to implement (in ph3, this is MUCH easier to do).

Unfortunately, I don't have a solution. You can check the list of helpful functions here on MotK if that helps.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on March 05, 2014, 06:44:47 AM
What are you trying to accomplish with this in the first place? If we could have some context on why you want to check this, there might be a better way to accomplish it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on March 07, 2014, 02:21:31 AM
I assume that Collision_Line_Circle and Collision_Obj_Obj will not work well for you, the former being unusable in your case (most likely) and the latter being a royal pain.

The latter involves EnumEnemyBegin, EnumEnemyEnd, EnumEnemyGetID and GetEnemyInfo. It's definitely possible, but it would cause an unnecessarily painful time trying to implement (in ph3, this is MUCH easier to do).

Unfortunately, I don't have a solution. You can check the list of helpful functions here on MotK if that helps.
Thanks for the help :D

What are you trying to accomplish with this in the first place? If we could have some context on why you want to check this, there might be a better way to accomplish it.

I'm messing with a Reimu A player replica from UFO, i made it so the shots spin (new gimmicks!) but they delete and cause this shoteffect:
http://pastebin.com/m4VJ2SN3
I want it to show the shot effect when it hits an enemy, instead of being deleted.  (if it's possible)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on March 07, 2014, 04:06:23 AM
Is it supposed to do anything after hitting the enemy? Normally this is already how the flow goes. Fire shot, hits things, deals damage and gets deleted (by engine), ends the !Deleted loop, then triggers some effect or whatever. So unless you don't want the shot to stop, I'm not sure what you're trying to do.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on March 07, 2014, 02:36:56 PM
Solution (from gtbot's code):

When it hits an enemy (while(!Obj_BeDeleted(objShot))), run a task that creates the effect graphic at the location of the short object.

Basically, that's all you need to do. I have code for use in ph3, but it shouldn't be too hard to do in 0.12m if you're comfortable with Effect Objects and tasking.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on March 08, 2014, 02:55:28 AM
Solution (from gtbot's code):

When it hits an enemy (while(!Obj_BeDeleted(objShot))), run a task that creates the effect graphic at the location of the short object.

Basically, that's all you need to do. I have code for use in ph3, but it shouldn't be too hard to do in 0.12m if you're comfortable with Effect Objects and tasking.

Awesome!  Thanks ^-^
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on March 10, 2014, 10:59:19 AM
This maybe seems kind of newbie-ish to ask or whatnot but, what are the basic fundamental needs in making or creating 3D Stage Backgrounds?

I kind of need to rush it, since my game's deadline is getting near....still, a lot of things to be done. And this might be one of the aspects that might take most of my remaining time. So, can anyone shed a light on this simple question? :ohdear:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on March 10, 2014, 12:52:53 PM
This maybe seems kind of newbie-ish to ask or whatnot but, what are the basic fundamental needs in making or creating 3D Stage Backgrounds?

I kind of need to rush it, since my game's deadline is getting near....still, a lot of things to be done. And this might be one of the aspects that might take most of my remaining time. So, can anyone shed a light on this simple question? :ohdear:
Since you said you need to rush it, you need to minimum understand the following fundamentals.

- Understanding the @BackGround Loop (as all the code from the stage is put here).
- Understanding how 3D space works in danmakufu and how to interpret.
- Decide which dimensions you want to use for the axis (x = horizontal, y = vertical, z = depth by default, but some people prefer to swap y and z).
- Understanding how you can summon sprites in 3D space http://dmf.shrinemaiden.org/wiki/Stage_Script_Functions_%280.12m%29#Drawing_Functions
- Understanding how to scroll the stage (texture scrolling / sprite moving)
- Understanding how fog is set up to "blur" the "end of the stage"
- Understanding the Zbuffer

Basically, 3D sprites are defined the same as 2D ones for spell cards. You load the texture, define the scale, rect, drawtype, colour, etc), but instead of using DrawGraphic on the x,y you use  DrawGraphic3D on the three parameters (x,y,z). Your texture is automatically placed in 3D space (rectangle). You then build up your stage like lego.

What are you even trying to make? Is it a simple stage with just a floor and 2d sprite trees/bamboo or is it an indoor location?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on March 10, 2014, 11:02:13 PM
Hey!  I was wondering if there is a function (or if someone could write one  :blush: ) for deleting shots in a rectangle with the defined top bottom left and right.
(I'm editing Blargel's StB Aya player to work in normal scripts)
-Thanks ahead of time
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on March 11, 2014, 12:44:39 AM
Not in a normal way. You'd have to do some crappy hack where you use DeleteShotInCircle() by fractally filling the rectangle with circles or something, since you can't just enumerate or access the bullet objects.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on March 11, 2014, 01:24:40 AM
Not in a normal way. You'd have to do some crappy hack where you use DeleteShotInCircle() by fractally filling the rectangle with circles or something, since you can't just enumerate or access the bullet objects.
Wait... I could have it start and the left top and have it place a circle with radius of 1 at each point until it hits bottom right...
like...
Code: [Select]
int x = left;
int y = top;
while (x<=right){
x++;
DeleteEnemyShotInCircle(x,*ZZZ*,1);
}
but i dont know what to put for ZZZ since it should be the Y point... or should i just have it run a loop in there to wait for it to go all the way down the Y and then move to the right?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on March 11, 2014, 02:11:23 AM
You could do that, but it would be incredibly inefficient. Computers aren't magic.

(http://i.imgur.com/GmkCZyR.png)

See how only a few circles gets rid of most of the area? If the aspect ratio (width versus height) of your camera rectangle isn't ever going to change you could really just hardcode the circles used. (Rather than calculate what the "best" fill is)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on March 11, 2014, 03:28:48 AM
You could do that, but it would be incredibly inefficient. Computers aren't magic.

See how only a few circles gets rid of most of the area? If the aspect ratio (width versus height) of your camera rectangle isn't ever going to change you could really just hardcode the circles used. (Rather than calculate what the "best" fill is)

It doesn't, so I'll use this, and thank you!   :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on March 11, 2014, 08:51:15 PM
What are you even trying to make? Is it a simple stage with just a floor and 2d sprite trees/bamboo or is it an indoor location?

Well, my plan is to have different stage backgrounds in each boss of my game. Like for example, Stage 1 will be the SDM or like the Stage 2 Stage Background in DDC.

I'm not going to plan for an indoor location since that may take longer, due to still learning DnH, I still don't know that much.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on March 11, 2014, 09:06:12 PM
Well, my plan is to have different stage backgrounds in each boss of my game. Like for example, Stage 1 will be the SDM or like the Stage 2 Stage Background in DDC.

I'm not going to plan for an indoor location since that may take longer, due to still learning DnH, I still don't know that much.
I see, well the fundamentals I explained in the post are the ones essentially required. If you're comfortable with designing spell card backgrounds, then the transition to 3D shouldn't be too much of an issue codewise. For scrolling a stage I could always give you more directions, though I would advise you firstly to focus on summoning your sprites in 3D and using the camera. After that, you may worry about scrolling, fog and so on.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on March 15, 2014, 01:41:17 PM
I'm having a problem figuring things out _ _ll , how do you do the "bullets are patternized already when they get shot out" thing, kinda like how flandre does her non spells? , I tried removing the wait command , using ascent loops , using variables , even object bullets , I just can't figure it out
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on March 15, 2014, 02:56:46 PM
I'm having a problem figuring out what your problem is here.

Flandre's non-spells are just a bunch of stacked circles. Circles can in general be done easily by using this manner of code:
Code: [Select]
loop{
ascent(T in 0..20){
CreateShot01( X, Y, Speed, T*360/20, Graphic, Delay);
}
wait(120);
}
This would create a loop which shoots out rings of 20 shots every 120 frames.
If you want to stack several patterns, like in Flandre's first non, you can just stack Ascent loops for easy handling of the shots, like this:
Code: [Select]
loop{
ascent(L in 0..2){
ascent(T in 0..20){
CreateShot01( X, Y, Speed+L, T*360/20, Graphic, Delay);
}}
wait(120);
}
Which would spawn two identical circles, with one of the circles having a larger speed by the "ascent variable" L. In this case, it would return one circle with the speed "Speed+0 = Speed" and one with "Speed+1", since ascent and descent loops go from "lower value" to "top value -1", which in this case would give L equal to 0 and in the second loop equal to 1.

If this was the problem, I hope this helped with understanding how it works.
If not, I'm sorry for the misunderstanding ^^".
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on March 16, 2014, 06:02:58 AM
Well you didn't misunderstand it and sorry for confusion although you also unintentionally solved one of my other problem ^_^;\

Well the one you taught me will work with circle pattern but I'm trying to do things that is semicircle or not circle at all , take kanako's nonspell for example , (the "blue , red , green" pattern switch before miracles of otensui) the blue and red pattern INSTANTLY shot out blue bubble and purple knives shots respectively that are already patternized ( the same pattern you would have if it had Dir+=2; except as I said it shot out instantly and is already patternized even before the player sees any shots) , this is the one I'm having trouble figuring out
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on March 16, 2014, 04:43:00 PM
Well, for drawing half circles or circular patterns you'll need to adjust your values. That shouldn't be too hard to grasp really.

If you have 12 bullets and you want to evenly shape them as a circle, you would use 360 / 12 for the direction. But this is the case when you're bullets start at 0 degree. If you want half a circle with 12 bullets, you don't use 360 / 12 but 180 / 12. If your first bullets spawns at 0 degree, your last bullet will end at 180 degrees. Or in other words, you have a half circle.

Code: [Select]
Begin position of first bullet: 0 degrees >>
360/<#bullets> = Draws full circle.
180/<#bullets> = Draws half circle.
90/<#bullets>  = Draws quarter circle.
etc. etc. etc.

This way of thinking forms the base for circular patterns. Hope that helps somewhat.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on March 16, 2014, 05:06:09 PM
That did the trick  :D , thanks Helepolis and darkness ^^
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: 7636kei on March 20, 2014, 05:07:06 PM
Speaking of that nonspell of Kanako, I'm wondering if there's a way to let a boss switch its intangibility in the script, just like said nonspell. Take an example of one of the cards I made. (http://www.mediafire.com/download/jo7me6a00yxd6pd/spellcard_sample.zip)

(Yeah, I know that's Kuroda Kanbei. It's just a temporary fill-in.)

By the way, the boss' gimmick is that the boss alternates period of vulnerability and invulnerability. Ideally, the shots will pass through the boss during the invulnerable phase, rather than hitting it still. (Of course, if it's just invulnerability, I can have the boss set its damage rate to 0/0, which I did already. The big problem is the intangibility; homing shots will still home on the boss. Ideally, they won't home on.)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TalosMistake on March 20, 2014, 06:02:26 PM
Speaking of that nonspell of Kanako, I'm wondering if there's a way to let a boss switch its intangibility in the script, just like said nonspell. Take an example of one of the cards I made. (http://www.mediafire.com/download/jo7me6a00yxd6pd/spellcard_sample.zip)

(Yeah, I know that's Kuroda Kanbei. It's just a temporary fill-in.)

By the way, the boss' gimmick is that the boss alternates period of vulnerability and invulnerability. Ideally, the shots will pass through the boss during the invulnerable phase, rather than hitting it still. (Of course, if it's just invulnerability, I can have the boss set its damage rate to 0/0, which I did already. The big problem is the intangibility; homing shots will still home on the boss. Ideally, they won't home on.)

Did you try SetCollisionA and SetCollisionB function ? I think that works, but I'm not sure about homing shot.  :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on March 20, 2014, 07:01:18 PM
The big problem is the intangibility; homing shots will still home on the boss. Ideally, they won't home on.)

Unfortunately, you have near-0 control over this. The people making the player scripts are the ones who have to take this into account. You can do some pretty complicated workarounds, but that's far easier in ph3 than in 0.12m.

Yeah; you really need the player characters themselves to implement it. My Magnamon player was lagging the default ExRumia survival to 20 FPS with its homing bullets, and my solution was to manually change the direction of the player shots after a certain time if a boss was present. I'll link the post... if I can find it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: 7636kei on March 21, 2014, 03:08:47 PM
@Talos: I've already tried flip-flopping the parameters for SetCollisionA (to be precise, flipping the radius from 0 and his default, 32), thanks. And it still tangible.

(And if I want it to be intangible at all times, might as well turn said card into a survival since there's no other way to beat the card.

Speaking of survival cards, I've made a boss script whose gimmick is that all his cards are survival cards. And by all, I meant six, an already ridiculous amount for someone designed with power level similar to an Act 5 boss. (Sure, PCB Youmu packed six cards too, but one was dispensed as Act 5 midboss, four as Act 5 boss, and one as Act 6 midboss (ditto with SA Orin). His cards was all dispensed during the boss fight.) Factor in the fact that not even Extra bosses (not even the Phantasm boss, in fact) pack more than two survivals and that some Act 6 bosses only pack five cards, and hilarity ensues. Said boss isn't yet ready to be released, tho, still perfecting his nonspells. :V)

FYI, messing with the parameters for SetCollisionB won't affect the intangibility; it's for player-enemy collision, not bullet-enemy collision. ;)


@Sparen: Aah, so that's that. Thanks a lot.
One will still need workarounds implemented on the player script to have bullets simply get past the boss at one time, then hits the boss at another time (again, ala Kanako's last nonspell), right? Might as well keep that bullet tangibility unaddressed, then. Especially since one of "Kanbei's" (well, I actually have assigned a name for the boss, but I'd keep it for now, so it's better to refer to him as Kanbei) other card have him dash around the screen, invisibly, with the capability to dash-kill the player if the player gets too close to him. (Fortunately, tho, the movement pattern's fixed and does never reach the lowermost quarter or so of the screen.)

(BTW, I learned a good part of my 0.12m skills from your tutorials. I owe you a lot. *bows*)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on March 24, 2014, 01:43:22 PM
Guys how do you do the fountain spawning ang gravity falling property to the bullets?

kinda like this one
http://i58.tinypic.com/9ll749.png 

Image almost 500kb, please mind the poor mobile users! -Hele
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on March 24, 2014, 05:16:14 PM
Use a bullet movement method that splits up the y-acceleration and the x-acceleration, such as CreateShot11/12 or SetShotDataA_XY. "Gravity" is accomplished just by having a positive ("downward") y-acceleration.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on March 25, 2014, 04:37:47 AM
Thanks Drake~!  :D Ill keep that in mind ;)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on March 25, 2014, 11:02:56 AM
I don't know if this is the right thread to ask this but...

In the game engine, is it possible to change the text (or the sprites) being used in the pause menu?

 About a month ago (i think), I presented a small part of my   
rubbish
game I'm developing. Then my professor (and a fellow classmate of mine) asked if the pause menu's text (or sprite images) can be changed. I said "I don't know..." since I don't have the knowledge to configure the .dat files of the game engine and I don't want to cause some serious glitches *might be overdoing it* since the deadline for my game's defense is on the 1st of April.

Any suggestions or can anyone help me on this?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on March 25, 2014, 12:23:28 PM
It's pretty easy to do that in the latest version of the engine, Danmakufu Ph3.

I don't think it's possible to do in 0.12m without modding data...
You could try using a Data Extractor to edit the 0.12m images, (can be found in the stickies here on RaNGE) but sadly I don't think it can change the text font itself.
Correct me if I'm wrong, though.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on March 25, 2014, 02:49:44 PM
(This Is A Stage Script BTW)
I think my background f'd up guys.....

i clearly have this in my variables
Code: [Select]
let bg = CSD ~ "background.png";Loaded the graphic here
Code: [Select]
LoadGraphic(bg);and heres my background code
all is there , rects , alphas , DrawGraphic
Code: [Select]
SetTexture(bg);
SetGraphicRect(0,0,600,375);
SetAlpha(255);
SetGraphicAngle(180,0,0);
SetGraphicScale(1,1);
DrawGraphic(GetCenterX,GetCenterY);
I even followed the drawing order
Code: [Select]
1) In your script's @Initialize, you must load the image file using LoadGraphic()
 2) In your script's @DrawLoop or @BackGround, you must do the following:
    2a) Set the current image to the image file you want using SetTexture()
    2b) Set the texture coordinates (the area of the image file to use) with SetGraphicsRect()
    2c) Set the alpha value with SetAlpha()
    2d) Set the rotation with SetGraphicAngle()
    2e) Set the scaling with SetGraphicScale()
    2f) Draw the graphic, using DrawGraphic()
And Darkness1 aya background script
Code: [Select]
SetTexture(bg1);
  SetGraphicRect(0,0,384,448);
  SetAlpha(250);
  SetGraphicScale(1,1);
  DrawGraphic(GetCenterX,GetCenterY);
No errors or anything just ....no background  :X

Full code is here http://pastebin.com/JQLZxxB0
and to show you im not crazy , heres the directories
(http://i58.tinypic.com/2n9yh3r.png)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on March 25, 2014, 05:18:55 PM
Took me some time to realise, but you wrote Background with a small g, needs to be a capital G.

> @BackGround  then it will function.

It is one heck of a devil this one. Writing without capital G won't error but won't also trigger your background because it simply thinks there is no @BackGround available. :V (hence the default swirly bg is summoned, otherwise it would've been black).

Keep in mind for future  ;)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on March 25, 2014, 05:21:50 PM
Fvcking Hell Danamakufu Capitalization (# ゚Д゚) ムッカー

i hate how the engine keeps blabling about capitalization on task
Yet it dosent mind capitalization of the fvcking @ codes _ _ll

Youve done it again , thanks Helepolis
Ill definitely keep that in mind in the future
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on March 25, 2014, 06:10:24 PM
In the game engine, is it possible to change the text (or the sprites) being used in the pause menu?
As Darkness mentioned, you can modify the sprites not the actual text. If you want to customize this after all (because we're all stubborn), you need to summon a pseudo-menu like most large games did.

i hate how the engine keeps blabling about capitalization on task
Yet it dosent mind capitalization of the fvcking @ codes _ _ll
Quite. It seems that it has to do with the @ symbol being stated.

I wrote @Charisma { }  in your script and it didn't throw errors at me either. Odd.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on March 25, 2014, 06:42:14 PM
Quite. It seems that it has to do with the @ symbol being stated.

I wrote @Charisma { }  in your script and it didn't throw errors at me either. Odd.

Σ(゚Д゚) Remember Kids @ is something you should never fvcking care about when it comes to capitalization even though Its The Basic Framework of The Script!. Alright now that thats out off my system of anger , ill go scripting now. thanks again Hele  :D
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on March 25, 2014, 08:33:23 PM
The reason it doesn't care about @InvalidRoutine is just because nothing ever calls it. There are no errors in the script as long as the brackets are matching, and if it doesn't find a @BackGround routine when launching the script it'll just fall back to what's in the #BackGround header and never bother running @BackGround. If there isn't any #BackGround set then it'll default to the standard wavy one. This sequence of fallbacks is the only reason why it doesn't throw errors at you for using @Background, just as if you have a player script without a @SpellCard but never bomb then you won't get errors.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on March 25, 2014, 09:21:22 PM
using a Data Extractor to edit the 0.12m images

modify the sprites not the actual text

I tried extracting the th_dnh.dat with an extractor I found here in the forums. Good thing it extracted it amazingly fast but, I have not found the sprite image for the pause menu of the engine.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on March 26, 2014, 12:26:25 AM
There is no image for the pause or continue menu, they're just text. You might be able to change it by finding where they're stored using a hex editor, but really why does it matter? Is how some text looks that big a deal?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on March 26, 2014, 12:46:47 AM
Like I said a few posts ago, I presented a small portion of the my beta to my professor about a month ago(?) and he asked if the text in the pause menu could be changed. So I honestly told him that I didn't know how.


So he asked me "What if nobody could understand what the text said?"
I explained everything that I could, even though those text can be easily understood because of the functions they're doing *duh*. Even I though I will add my translated version of the pause menu to the documentation of my game, he asked that 'if it's possible to change the text in the pause menu, please do so'.




Sorry about the misunderstanding about this situation, I'm having hard time right now managing the remaining time that I have in order to finish the game AND the documentation of it, even though I'm drastically phasing out some aspects of the game in order the complete the necessary parts of it.  :blush:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on March 26, 2014, 03:01:00 AM
Changing the pause menu text is impossible, it is hard coded within the game itself. I recommend switching to Ph3 which allows you to change the text of the pause menu ect....  In other words, its better and allows you to create a better game with more customization and less workarounds. No more having a full game ran from a single stage and now we can design our games like official Touhou games. MPP is a great example of this. Ph3 isn't very hard to learn especially if you've used 12m in the past. The biggest change is how nothing is really done for you anymore but that isn't something you can't pick up on in a short amount of time.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on March 26, 2014, 05:48:42 AM
yeah because recoding his entire project in such a short amount of time sounds totally doable rite
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on March 26, 2014, 01:23:30 PM
yeah because recoding his entire project in such a short amount of time sounds totally doable rite

That's why This (http://dmf.shrinemaiden.org/wiki/Sparen's_0.12m_to_ph3_Transition_Guide) exists.

Also, I've seen what he has. The bullet patterns and animations and graphic manipulation aren't actually that bad to port over since he hasn't done an absurd amount. (Unless he isn't showing most of his project, in which case there might be an issue).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: ExPorygon on March 26, 2014, 01:37:01 PM
That's why This (http://dmf.shrinemaiden.org/wiki/Sparen's_0.12m_to_ph3_Transition_Guide) exists.

Also, I've seen what he has. The bullet patterns and animations and graphic manipulation aren't actually that bad to port over since he hasn't done an absurd amount. (Unless he isn't showing most of his project, in which case there might be an issue).
It's not the difficulty problem of porting it's the TIME issue here. Like it or not, it's going to take a lot of time he probably doesn't have to port an entire game over to ph3.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on March 26, 2014, 09:34:22 PM
yeah because recoding his entire project in such a short amount of time sounds totally doable rite

Maybe if this place wasn't so centered on 12m and people came together to promote Ph3 he probably wouldn't have a worry about this at all.

Also, what exactly are you recoding? Patterns are mainly just renaming since creating bullets is almost exactly the same between all versions. I don't know how much special effects he have put into his game but that shouldn't be hard to bring over in such a short amount of time either. Ph3 pretty much sets up the basics for replays and linking stages for you.(unless you want to go the extra mile) He doesn't have to port it over but that's the only way to solve his and problem.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: PhantomSong on March 27, 2014, 12:46:00 AM
May I note that this is a .12m Q&A thread not "Promote PH3"? I mean I get PH3 good, but seriously, some people don't get that not everyone can convert fast as others (*coughULTIMAANDSPARENcough*). Transferring a game and progress is completely demotivating because you have to spend time in making the switch can be long for others...

Anyway, the menu shouldn't really be THAT big, it's just aesthetics, work on your game first, then worry about it later.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on March 27, 2014, 12:59:18 AM
some people don't get that not everyone can convert fast as others (*coughULTIMAANDSPARENcough*).
Not everyone is as stubburn as you Phantom. If it may be hard for people to convert to ph3 then how about we remove that process completely so no one really has to.

Its just that simple...
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: PhantomSong on March 27, 2014, 01:08:05 AM
Not everyone is as stubburn as you Phantom. If it may be hard for people to convert to ph3 then how about we remove that process completely so no one really has to.

Its just that simple...
Hey, you can't give me that, I'm learning PH3. I'm just saying,.
Struggling =/= Stubborn. I have no clue where you get that they are the same. ._.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on March 27, 2014, 01:30:32 AM
Hey, you can't give me that, I'm learning PH3. I'm just saying,.
Struggling =/= Stubborn. I have no clue where you get that they are the same. ._.

Oh I know the difference between them very well. I don't see the struggling part because you're always on the opposing end when the conversation is brought up on Skype. Regardless, how about we end this sidebar before it goes too far from Yukario's problem.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on March 27, 2014, 05:35:19 AM
Hey guys, there's no need for a big argument over a small problem I have concerning about the pause menu. If it can't be changed, it's fine...I just want to know if it's possible for the change. Sorry for bringing up such a trivial problem, I really am.  :ohdear:


@Sparen
I couldn't show my project because I want to at least finish normal mode so that maybe I could upload a beta version for testing. Since I have other projects with the same submission date, I'm having time management issues.


@Ex
That's the exact point, time it just against me these days with so much projects that I can't handle all at the same time. And porting my project to ph3 will just slow me even further, even for just a small part of it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on March 27, 2014, 06:30:48 AM
Enforcing your own opinion on others regarding how easy things are or fast to do, doesn't mean they are in fact the same for someone else (i.e: Infinite and Sparen's judgement). Not everyone has the same experience or skills and people can struggle to make a good transition. Hence we have our Q&A 0.12m

I do want to note that the last few replies on some questions were not offering help but continuously telling that ph3 can do it easier, ph3 can do this, ph3 can do that. As Phantom said, we get it, ph3 is better at some things which were impossible or hard to do in 0.12m. But please stick to the Q&A, the person is asking how to do specifically something in 0.12m. If he/she wanted to ask which engine would service X-situation better, he/she would've asked that.

Quote from: Infinite Ultima
Maybe if this place wasn't so centered on 12m and people came together to promote Ph3 he probably wouldn't have a worry about this at all.
You don't have to help/post/read the 0.12m Q&A you know?

This isn't about being stubborn, this is about knowledge and being objective. We got splendid tutorials and a better maintained wiki for both engines. Let the people decide which one they want to use.

Edit: We don't discriminate engines. We offer help for both of them, but when someone asks: "Hey I am new to danmakufu, which should I use" we would vouch for ph3, mainly because we know the new user will want to create menus, custom things and in 0.12m it is not possible by default. This is based on facts / objective viewpoints and not because we think ph3 is great.

If it may be hard for people to convert to ph3 then how about we remove that process completely so no one really has to.
Its just that simple...
So you're just saying that I should have trash my 2 years work and just restart from zero? Rofl, my apologies but that is just nonsense what you're saying now.


Also, I am pretty sure that a lot of people are actually promoting ph3. Take a look at our wiki and growing tutorial list. 

Hey guys, there's no need for a big argument over a small problem I have concerning about the pause menu. If it can't be changed, it's fine...I just want to know if it's possible for the change. Sorry for bringing up such a trivial problem, I really am.  :ohdear:
Don't worry about it and lol, no need to apologise. :D I am pretty sure we can all have a mature discussion about this. In fact, it is good that this argument occurred as sometimes you need to have those.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SilentYukiro on March 27, 2014, 10:28:19 AM
Don't worry about it and lol, no need to apologise. :D I am pretty sure we can all have a mature discussion about this. In fact, it is good that this argument occurred as sometimes you need to have those.


When I saw the arguments while doing my php reservation system at school, I had a sudden feeling of guilt deep inside xDDD. Still, I had a feeling that I still need to apologize for almost being the reason of the argument.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on March 27, 2014, 12:28:33 PM

When I saw the arguments while doing my php reservation system at school, I had a sudden feeling of guilt deep inside xDDD. Still, I had a feeling that I still need to apologize for almost being the reason of the argument.
Meh. People are people. It's not really your fault in any way.

People seem to forget that it should be possible to do some sort of pseudomenu in 0.12m. I mean, those who made CtC had their own custom pause menu, right? I think this was what Hele mentioned too.
I don't really know how hard it is do that however, since I'm not sure what method they use.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on March 27, 2014, 02:37:31 PM
Excuse me in the heat of the argument , but why wont my enemies die when they go offscreen? o.O i mean
Code: [Select]
SetMovePosition01(GetClipMaxX+400,GetCenterY,7);this is far enough for them to despawn right?

this will be a major problem because it seems that unless the first set of enemies dies , the bullets of the next group wont fire and More Importantly the boss wont appear since WaitForZeroEnemy; is there TT_TT

heres a picture, the left is the first group and as you can see in the right , it wont show bullets Yet the sound effects are playing
(the blue bullets at the bottom right of the right picture is from the first group BTW)
(http://i58.tinypic.com/j6kke9.png)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on March 27, 2014, 03:02:11 PM
I don't remember enemies having an autodelete border.
You could easily set your own with a enemy deletion task inside the enemy object, like this:
Code: [Select]
task enemydeletion(){
loop{

if( GetX>(GetClipMaxX+100) || GetX<(GetClipMinX-100) || GetY>(GetClipMaxY+100) || GetY<(GetClipMinY-100) ){
VanishEnemy;
}

yield;
}}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on March 27, 2014, 03:25:11 PM
Uhmmm Naut said so in the Intermediate tutorial? o.O
Quote
For enemies, you won't want them to have too much health, so you can kill them quickly. Typically have them spawn a really basic flurry of bullets, and just continue off in one direction (they will be destroyed upon leaving the game screen).

Alright , i put this in the enemy script right?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on March 27, 2014, 03:40:52 PM
Yes, you put it in the enemy script. It should work in both types of enemy scripts, I think.

That's strange. I don't know about everyone else, but I always used this task in my 0.12m enemy scripts.
But if the enemies aren't deleting for you, when you even move them as far as (GetClipMaxX+400), I would guess that the EnemyAutoDeleteBorder simply isn't there.
(Edited the task because GetClipMin should be more accurate in 0.12m)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on March 27, 2014, 08:03:39 PM
You could also "shorten" the condition a bit to
Code: [Select]
if( (|GetX - 224|) - 224 > 100 || (|GetY - 240|) - 240 > 100 )not that it matters
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on April 01, 2014, 04:15:17 AM
Is it there a way to make the object lasers infront of the bullets?
so that it dosent look like this
(http://i57.tinypic.com/2z6t6ro.png)
ObjEffect_SetLayer wont work because it will only respond to effects
so any ideas?  ???
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: ExPorygon on April 01, 2014, 04:43:22 AM
Is it there a way to make the object lasers infront of the bullets?
There isn't really any way in 0.12m that I know of, unless you are somehow able to spawn the bullets before the lasers.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TalosMistake on April 01, 2014, 07:30:15 AM
Make lasers invisible, but keep their hitbox, and spawn effect objects instead by using a laser graphic(in shotsheet), then use ObjEffect_SetLayer on them. This is the best way I can think. xD
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on April 01, 2014, 08:18:44 AM
Could also just not spawn the bullets until they're needed, if that's an option.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on April 01, 2014, 12:17:23 PM
Make lasers invisible, but keep their hitbox, and spawn effect objects instead by using a laser graphic(in shotsheet), then use ObjEffect_SetLayer on them. This is the best way I can think. xD
Could also just not spawn the bullets until they're needed, if that's an option.
Σ(゚Д゚) I found the solution! , Instead of making the lasers invisible like talos mistake said , ishould just make the bullets invisible instead(well CreateShotA gives a "frame to perform" so it should work) and like drake said , i should just make the "frame to perform" value the excat time the lasers dissappear
[/quote]
There isn't really any way in 0.12m that I know of, unless you are somehow able to spawn the bullets before the lasers.
I really want to get to ph3 soon TT_TT , i surrender to how lacking 12m is T_T
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Zialopido on April 03, 2014, 03:41:18 PM
First let me  start off and say i'm new at scripting and now hate trig. I am making my first almost original script and Im having problems where Rumia (because i don't even know how to begin to make sprites) won't even appear  :ohdear:...Am im making a mistake? Did i capitalize something i shouldn't have (Why is it case sensitive anyways ???)? I don't get an error so its not the brackets thank god. But tell me what you think .

http://pastebin.com/JyY8ABmR
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Darkness1 on April 04, 2014, 05:43:27 AM
First off, hello and welcome to RaNGE!
But you probably should start off by reading all the stickies. For example,  longer parts of code, like what you posted, are supposed to be posted via pastebin.com. Secondly, as you may notice, general questions about 0.12m scripting goes in the Q&A 0.12m thread in the stickies.

About your question,  I honestly can't tell since the code ends so abruptly. But you never defined any graphic rects with SetGraphicRect, so that won't give you any visible result.
And a tip; don't animate with commands like that (setgraphicmove). If that works like I think you made it work, that will be horribly stale and invite problems.

Also, do you mean that the boss or the graphic doesn't appear,  since errors doesn't always show up.
Even if you defined the rects, we can't see it because all of the code isn't there.
Your loop(nshot) may be causing an error since it doesn't loop anything at all.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on April 04, 2014, 06:08:05 AM
- You close script_enemy_main before @Initialize. Get rid of that closing bracket and move it to the very end, script_enemy_main should encompass the whole script (after the #Headers). This is basically what's causing nothing to happen.
- @Initialize needs a capital I.
- CutIn needs a capital I. It takes 7 parameters: cut-in type (either KOUMA for EoSD-style cut-ins or YOUMU for PCB-style cut-ins), name, path to cut-in image file, left bound, top bound, right bound, bottom bound. The last four parameters describe the coordinates of your cut-in image within the file.
- NAME in CutIn needs to match your variable, Name.
- The @DrawLoop won't do anything because you haven't set up an image to draw.
- You have no wait() function defined, so that will error. I also can't see any of the setGraphicSomething() functions, or concentrate().
- You have a ` in the line with SetDamageRate(40, 40) which will cause an error.
- Your loop(nShot) at the end has nothing in it, I think you missed copying the end of the script.

I think the biggest problem here is that you obviously just tried to write the whole script in one sitting without testing anything. Really, you should be writing the script in pieces and testing every time you add something to make sure it works before moving onto something else.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunarethic on April 04, 2014, 10:29:28 AM
Yey im helping XD

Hmmm if not appearing is your problem you might wanna look at your drawloop

First off you already told the program do DrawGraphic where you didnt even set coordinates and Renderstate and stuff and i doubt its in a separate script because you didnt even have an include function in there

And like drake said move the closing bracket of script_enemy_main to the very end of the notepad because otherwise it wont read anything other than your variables

Another thing is your cutin , case sensitivity is a MUST. Check spelling and capitalization or nothing will work.(its either have black or get an error.
Another thing about it is SAKUYA , i dont remember having a cutin called SAKUYA. Use YOUMU or KOUMA or use a custom cutin function. Again i doubt its in a separate script since no include function
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: lionminhu on April 10, 2014, 02:58:18 AM
Code: [Select]
@DrawLoop{
    SetViewTo(0,0,0);
    SetViewFrom(200,90,45);
    SetTexture(background);
    SetGraphicRect(0,0,511,511);
    SetGraphicAngle(45,0,0);
    DrawGraphic3D(GetCenterX(),GetCenterY(),0);
}

In this piece of code of @DrawLoop, where background is the string of the directory of the file to use for the background picture, the game kept showing error for either SetViewTo or SetViewFrom.

Is there any problem with this part of the code, or would it have originated from other part of the boss script?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on April 10, 2014, 03:15:39 AM
3D drawing goes in a stage script, not an enemy script.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on April 12, 2014, 12:54:12 PM
Hi there,can i ask a question please?How can i make..uhm..when enemy goes right,its image changes to image when enemy looks left,and when enemy goes left,its image changes to image when enemy looks right?Maybe i should use if(GetEnemySpeed<0) and if(GetEnemySpeed>0)?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on April 12, 2014, 02:06:32 PM
Hi there,can i ask a question please?How can i make..uhm..when enemy goes right,its image changes to image when enemy looks left,and when enemy goes left,its image changes to image when enemy looks right?Maybe i should use if(GetEnemySpeed<0) and if(GetEnemySpeed>0)?
Yes, and to mirror the sprite you can use SetGraphicAngle(0,180,0);  (flipped horizontally)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on April 12, 2014, 02:13:02 PM
Yes, and to mirror the sprite you can use SetGraphicAngle(0,180,0);  (flipped horizontally)

Thank you a lot,Helepolis!

Edit: And how can i make an afterimage for CutIn and other things?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on April 12, 2014, 02:37:49 PM
An after image for CutIn and other things? Well, there is:
http://dmf.shrinemaiden.org/wiki/Enemy_Script_Functions_%280.12m%29#MotionBlur
http://dmf.shrinemaiden.org/wiki/Enemy_Script_Functions_%280.12m%29#MotionBlurEx

Not sure how well they work for effect objects.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 on April 13, 2014, 04:26:54 PM
Nevermind... figured out why.... the problem was not the laser but the shoot code...
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Dan The Jerk on April 15, 2014, 02:44:00 AM
Hi, I was wondering on the following things:
1. How do you make a boss' name appear on the upper left corner and make it disappear after the boss is defeated?
2. I was planning to use a different font for my game, and I can't find a tool of some sort to make this font to be usable in danmakufu.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on April 15, 2014, 05:48:39 AM
Hi, I was wondering on the following things:
1. How do you make a boss' name appear on the upper left corner and make it disappear after the boss is defeated?
2. I was planning to use a different font for my game, and I can't find a tool of some sort to make this font to be usable in danmakufu.
1 - You can use effect objects and pre-drawn boss names (which ZUN also usually does) to spawn/despawn that.
2 - Font changing requires you to edit the graphical font file. A tool isn't really required except for an image editing tool.  As danmakufu reads the images directly from the dnh\img directory.

You can use http://www.shrinemaiden.org/forum/index.php/topic,4731.0.html to extract the default font first.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on April 15, 2014, 12:47:15 PM
2 - Font changing requires you to edit the graphical font file. A tool isn't really required except for an image editing tool.  As danmakufu reads the images directly from the dnhimg directory.

Correct me if I'm wrong but doesn't the font inside of the img/ folder only include the numbers? I assume he's talking about the font in general which is not saved to a file and he would have to make a hardcoded text script like what Blargel did with his StB thing.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on April 15, 2014, 01:36:08 PM
Not quite, It was both numbers and letters. The font image is no longer displayed in the X-files thread (http://www.shrinemaiden.org/forum/index.php/topic,3167.0.html) which Drake had posted. Imageshack seems to error.

Also what Blargel did was using effect objects in order to create his own font system. It is basically written from scratch and has nothing to do with the default font in Danmakufu.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sage Ω (Ultima) on April 15, 2014, 02:20:33 PM
Not quite, It was both numbers and letters. The font image is no longer displayed in the X-files thread (http://www.shrinemaiden.org/forum/index.php/topic,3167.0.html) which Drake had posted. Imageshack seems to error.

Ah, ok. I never touched the game's font files other than removing the numbers probably overlooked it but that was a long time ago. I've always wondered why the font looked so ugly.

Also what Blargel did was using effect objects in order to create his own font system. It is basically written from scratch and has nothing to do with the default font in Danmakufu.

I know, I'm just saying that would be an alternative to using danmakufu's font functions. However, more work is needed because you have to understand how primitives, vertices, and UVs work since 12m doesn't have a automatic 2D sprite functions like ph3 does.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on April 16, 2014, 06:55:37 AM
Same reason why the bullets looked ugly :) I guess to avoid direct data ripping from original touhou games the author just put in some things as 'place holders'.

Regarding Effect Objects, before ph3 existed we had no choice but to grasp primitive triangle, strip and fan. True that we had to grasp lots of knowledge to get it right. Definitely not newbie friendly though such was life with 0.12m and we had to deal with it :V. Good thing indeed ph3 makes rectangle/square sprites easier to implement.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Chuckolator on April 17, 2014, 02:42:31 PM
Alright, now that I'm looking in the right topic and I still haven't solved it, I'll ask again. How do I run this on Windows 8, now that applocale is not a thing? Before, it wouldn't even boot, but then I found this (http://www.shrinemaiden.org/forum/index.php/topic,14911.msg1071045.html#msg1071045), did it...and it boots to the All/Single/Plural/etc screen, but whenever I select something it crashes. I tried the "program compatibility troubleshooter" or something, but same result. What am I missing?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on April 17, 2014, 11:51:12 PM
Mostly that's just confusing, since most people report DNH working perfectly fine on Win8.
Anyways, all that option does is choose to do one of the following when there's no #Player header in a script:
- Do nothing (default)
- Insert #Player[FREE] in Single scripts
- Insert #Player[FREE] in Single and Plural scripts

Have you tried using AppLocale, in any case? If it's erroring when trying to install you can run the installer from an admin command prompt by using the advanced context menu (right-click bottom left corner of screen).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Chuckolator on April 18, 2014, 01:13:23 AM
Ah, did the install via command prompt thing and it worked fine. Never would have figured it out on my own though, so thanks.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on April 21, 2014, 04:10:53 AM
It's interesting to know what are Objects Effects for?Or it's different from DrawLoop where i can change size,angle,position of the graphic?Are they more flexible or what? :derp:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on April 21, 2014, 06:44:24 AM
It's interesting to know what are Objects Effects for?Or it's different from DrawLoop where i can change size,angle,position of the graphic?Are they more flexible or what? :derp:
Have you tried reading our tutorials?
http://en.touhouwiki.net/wiki/Touhou_Danmakufu:_Nuclear_Cheese%27s_Effect_Object_Tutorial
http://www.shrinemaiden.org/forum/index.php/topic,2852.0.html
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on April 21, 2014, 07:07:29 AM
Have you tried reading our tutorials?
http://en.touhouwiki.net/wiki/Touhou_Danmakufu:_Nuclear_Cheese%27s_Effect_Object_Tutorial
http://www.shrinemaiden.org/forum/index.php/topic,2852.0.html

i tried  :wat: but i don't understand these object effects :\
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on April 21, 2014, 08:23:28 AM
Effect Objects are Objects which, as the name implies, are used for ~ Effects ~. You create them and they can be controlled as most objects. They are not related to the @DrawLoop as that is only used for drawing bosses and familiars. Although you could draw a boss sprite with the effect object as well (for illusional bosses for example). Effect Objects are created as normal objects except the drawing is done using the Vertex approach (covered in the tutorials). It is also considered an intermediate area and requires knowledge of functions, tasking and objects.

If you're wondering where they are all used in:
- The maple leaves when a boss explodes
- The cut-in images
- Illusions for bosses (not multiboss, but clones)
- Spell circle of bosses
- Other effects on screen
- Etc etc (ry
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on April 21, 2014, 09:08:00 AM
Effect Objects are Objects which, as the name implies, are used for ~ Effects ~. You create them and they can be controlled as most objects. They are not related to the @DrawLoop as that is only used for drawing bosses and familiars. Although you could draw a boss sprite with the effect object as well (for illusional bosses for example). Effect Objects are created as normal objects except the drawing is done using the Vertex approach (covered in the tutorials). It is also considered an intermediate area and requires knowledge of functions, tasking and objects.

If you're wondering where they are all used in:
- The maple leaves when a boss explodes
- The cut-in images
- Illusions for bosses (not multiboss, but clones)
- Spell circle of bosses
- Other effects on screen
- Etc etc (ry

Oh..i think i understood..Thank you Helepolis!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on April 25, 2014, 12:42:31 PM
Hi again!How can i connect stages together?How to use SetCommonData?I know that there were explanations for this things..but i can't figure it out! :ohdear:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on April 25, 2014, 03:01:25 PM
There is no such thing as connecting stages together like you would do for spell cards to make a plural. If you want multiple stages, you need to write 1 big stage file and swap the textures, enemies, etc. around when you advance in the stage. For bosses you can call the plural files within the stage file (as you probably already did).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on April 25, 2014, 03:31:03 PM
There is no such thing as connecting stages together like you would do for spell cards to make a plural. If you want multiple stages, you need to write 1 big stage file and swap the textures, enemies, etc. around when you advance in the stage. For bosses you can call the plural files within the stage file (as you probably already did).
Is this hard?To write this big stage file?Is this hard to swap textures?Sorry bout that,i'm just stupid  :V
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on April 25, 2014, 03:35:51 PM
Define 'hard'. It is a matter of knowledge, let us ask the question different, have you made any stages yet?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on April 25, 2014, 03:40:27 PM
Define 'hard'. It is a matter of knowledge, let us ask the question different, have you made any stages yet?

Yup!I have made some  :derp: it isn't so hard
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on April 25, 2014, 04:13:00 PM
Ok, so in order to combine those stages, you need to figure out a way to change the background of your stage. For example a very simple and dirty method:
Code: [Select]
let stageLook = 1;

@BackGround{
if(stageLook == 1) {
// drawing code for stage 1
}
if(stageLook == 2) {
// drawing code for stage 2
}
}
And somewhere in your stage file, after "finishing the boss" you put stageLook to 2 and the game will start drawing your 2nd stage. This method is just an example.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on April 25, 2014, 07:29:38 PM
Ok, so in order to combine those stages, you need to figure out a way to change the background of your stage. For example a very simple and dirty method:
Code: [Select]
let stageLook = 1;

@BackGround{
if(stageLook == 1) {
// drawing code for stage 1
}
if(stageLook == 2) {
// drawing code for stage 2
}
}
And somewhere in your stage file, after "finishing the boss" you put stageLook to 2 and the game will start drawing your 2nd stage. This method is just an example.

Note that if your background code gets excessively messy, you might want to #include a file containing tasks for the background code and call the tasks inside the if blocks. It will make your code 100% more readable, and if you have a different stage file for different difficulties (don't do this please or your game will be super complicated like PDD), it will greatly simplify the work you need to do.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Chuckolator on April 30, 2014, 04:45:20 AM
[00:27:43] <chuckolator> holy crap
[00:27:49] <chuckolator> I don't know what is up with PT
[00:27:53] <chuckolator> it is very strange
[00:27:59] <chuckolator> so I start a regular run
[00:28:07] <chuckolator> after stage 1 I pause and do other things for a minute (sidenote: other things on the computer, not afk)
[00:28:16] <chuckolator> I come back and it's back to the danmakufu title screen
[00:28:20] <chuckolator> wtf, that's annoying, whatever
[00:28:27] <chuckolator> I start again and it's at 150fps! (sidenote: a bit later I notice it's actually 166.67fps)

Has anyone had this happen before, or know why it does? If it's relevant, I usually boot PT by hitting "all" and finding it there, but when I came back to it on the danmakufu menu it was on "directory". I've had it accept my inputs despite it not being the focus before, could I have been fumbling around without knowing it and did something that would cause this? I have no idea, and you probably don't either, but I'm really curious so I thought I'd ask anyway.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on May 08, 2014, 10:19:48 PM
Why hello again~

I was wondering if in a Single continuous script, if there's a way to clear the spell background once its been raised.  Like:

task TaskTask{
//nonspell things
LoadGraphic(graphic);
CutIn(things,cutin,0,0,0,0);
SetScore(1);
//spell things
//Remove the Spell BG for another nonspell
//nonspell 2
}

@Background{//things}

I tried deleting the graphic with DeleteGraphic(); and it just went to black, is there a way to fix this?  Also this is a single script called as a Boss on a stage for the BG purposes.
Thanks!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: PhantomSong on May 08, 2014, 10:59:15 PM

I tried deleting the graphic with DeleteGraphic(); and it just went to black, is there a way to fix this?  Also this is a single script called as a Boss on a stage for the BG purposes.
Thanks!
This is only possible if you make your own spell system which can be a pain in the rear-end.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on May 08, 2014, 11:00:21 PM
@BackGround{
  if(spell){
    //render spell bg
  }else{
    //render nonspell bg
  }
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on May 09, 2014, 12:57:07 AM
<code>
Oh... I can use CommonData with this!  Thanks~

EDIT:
http://prntscr.com/3hid5e
I managed to get this error when I run it... I know my CommonData is set up right (or at least I hope), can anyone translate it?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on May 09, 2014, 02:20:13 AM
Oh... I can use CommonData with this!  Thanks~

EDIT:
http://prntscr.com/3hid5e
I managed to get this error when I run it... I know my CommonData is set up right (or at least I hope), can anyone translate it?

https://sites.google.com/site/sparensdanmakufututorials/dnh-0-12m-tutorials-part-3/014-intro-to-danmakufu-part-4#TOC-ERR-B08:- (https://sites.google.com/site/sparensdanmakufututorials/dnh-0-12m-tutorials-part-3/014-intro-to-danmakufu-part-4#TOC-ERR-B08:-)

[Ignore that sly comment; it happens to everyone sometime or other]
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on May 09, 2014, 05:34:53 AM
Hi again!It's interesting to know how to use SetCommonData CORRECTLY i just can't figure it out  :V can you help me with this?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on May 09, 2014, 06:28:43 AM
K+: I'm just wondering why you need to do it this way. Putting multiple patterns in a Single script? Like, why? Normally you'd have the stage background running in the Stage script, call the Plural script, and for the noncard Single scripts you just don't call SetScore(), while you do call SetScore() in the card Single scripts .
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: K+ ~ Bake-Danuki on May 10, 2014, 03:39:19 AM
K+: I'm just wondering why you need to do it this way. Putting multiple patterns in a Single script? Like, why? Normally you'd have the stage background running in the Stage script, call the Plural script, and for the noncard Single scripts you just don't call SetScore(), while you do call SetScore() in the card Single scripts .

It's a little special script as a surprise to show one of my teachers what I can do in this engine, even in a single script.  Its basically a task with tons of subs to make the patterns loop once (or more) and go to another pattern without having a lot of nonspells.  I got this working btw and i like it :D
(I actually may release this script soon, just want to get a bit of feedback from a few people and then tweak it.  Then you'd see what I mean.)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: namohysip on May 17, 2014, 07:45:18 AM
So I've been playing with Concealed the Conclusion and love the player scripts. Problem is, whenever I try to play as the various Marisas in certain scripts, I get errors before I can even start playing. This doesn't happen for any other player script that I've tried, only the CTC Marisas. Has there been a thread on this before, or is this just unsolvable using the CTC player scripts? For more info, I've checked with the other threads regarding error messages. Normally the error has to do with either trying to change a variable's type or comparing two different variables that can't be compared, like a string to a number.

This leads me to believe that something in the Marisas' coding seems to use certain variable names already, or something like that. But I have no idea where to go from there. For example, one problem line is "score=GetCommonData("Score");"which gives the changing a variable type error. Any ideas on what's going on? Are there versions of the  CTC Marisas that are compatible with other scripts?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on May 17, 2014, 03:51:13 PM
So I've been playing with Concealed the Conclusion and love the player scripts. Problem is, whenever I try to play as the various Marisas in certain scripts, I get errors before I can even start playing. This doesn't happen for any other player script that I've tried, only the CTC Marisas. Has there been a thread on this before, or is this just unsolvable using the CTC player scripts? For more info, I've checked with the other threads regarding error messages. Normally the error has to do with either trying to change a variable's type or comparing two different variables that can't be compared, like a string to a number.

This leads me to believe that something in the Marisas' coding seems to use certain variable names already, or something like that. But I have no idea where to go from there. For example, one problem line is "score=GetCommonData("Score");"which gives the changing a variable type error. Any ideas on what's going on? Are there versions of the  CTC Marisas that are compatible with other scripts?

Regarding the CommonData:
-This is the reason why player scripts meant for a certain script do not always work elsewhere. The default value for a CommonData is, I think, "0" or something along those lines. (Might be ""). If the Score CommonData is not set to a number outside of the player, problems may arise.

Then again, this *could* be a local issue
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: namohysip on May 17, 2014, 08:33:19 PM
I think I fixed the problem! I made a duplicate of everything in the THC_MARISA folder first just so I still have the compatible version for CtC, but then looked at the code for the player in the duplicates I made. I started with the assumption I made and what you confirmed regarding CommonData, and looked for everything that had to do with that. I found a line in the Common file in the lib folder's THCCL folder. The line simply read "ClearCommonData();" which seemed problematic for other types of games. So I put two slashes // in front of it to block it out, and suddenly everything works. It might cause stability issues or something for the game these four were meant for, though, so I'd have to remove the double slashes again if I want to play CtC again. Thanks for the help!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 on May 30, 2014, 05:14:51 AM
Can somebody tell me why does this happen?

http://i61.tinypic.com/2ihmgyu.jpg

The laser is supposed to come out from the options, but it doesn't. Furthermore, if I adjust the summoning point so it appearsright on the spot, it's like  pixels away  from the actual damaging point.

The code is simple: [ CreatePlayerShot01(GetPlayerX - 45, GetPlayerY + 5, 30, 270, 0.02, 100, 3); ] and the shotdata for the laser is
[ ShotData { id = 3 rect = (256, 0, 270, 316) render = ADD alpha = 200 } //Laser ]

Whatever could be wrong here?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on May 30, 2014, 07:19:30 AM
Impossible to judge this  because you're not providing any code.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 on May 30, 2014, 12:11:23 PM
This would be it. This pastebin includes both the code for Marisa's player character and her shotdata, separated by lots of ///////////

http://pastebin.com/F3GH6DYA
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on May 30, 2014, 01:41:24 PM
Ehm, is Blackout piece of code your laser graphic code? Or are you using CreatePlayerShot and simply defined the size of the "laser" from the sprite sheet?

In case of black out piece being your laser
As expected, you're trying to create a laser which hits like a regular shot bullet.  OT: Is there any specific reason you didn't went for a laser object instead?

Well, that is up to you to decide. To help you out with your problem (Drake suspected the same). You're using an effect object which you are most likely spawning somewhere. Please keep in mind that the actual centre point of an effect object is not always the starting point of your laser.
[attach=1]

You defined your vertex in an odd way so it is hard for me to read. But in basic: If you try to use an 128x128 image as effect object, then in common situations you use  x-64,y-64  for the first vertex (Ry. The image will be 128x128 as a result but your actual centre point for "moving" the sprite around is exactly at the centre. Which is logical as you drawn 64 to the left + right and 64 to the bottom and up.

You could also immediately draw the vertex at  x-64,y0 and x64,y0 for example forming the bottom side of the laser. Then the top two vertex would be -64,-128 and 64,-128. Your "centre" point will be the "bottom of the laser". So if you spawn it at the familiar, it will look proper.

This only fixes your graphical issue. The actual damage point is dependant on your CreatePlayerShot.

In case not
The centre of the rect code for your bullet is always the centre of the bullet. In your case, your laser is 256, 0, 270, 316  which is  270-256 > 14 pixels from left to right and 316 pixels long. The centre of your "laser" is the centre of 14 and 316 rectangle. (see the image above). The laser appears exactly at that point but the graphical look will fool you since it is is 316 pixels long. This is also your error, as you're focussing too much on the graphical issue rather than the actual main problem.

How to solve it
If you're spawning a laser, use a Laser object. It is basically a regular laser shot object but by setting the damage parameters and penetration it becomes a player shot, which is: ObjShot_SetDamage();  and ObjShot_SetPenetration();

You will need most likely an effect object on top of this to display the laser. AFAIK setting a graphical texture doesn't show but  my 0.12m code is too ancient right now to confirm.

Good luck.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 on May 30, 2014, 07:53:49 PM
Well, what do you know?

http://i58.tinypic.com/2gsrfco.jpg

Ultimately, a simple, non-animated laser proved to function perfectly. I will deal with using other graphic later, I care more about playability right now.

Currently, I have yetto balance the damage, but that is not really a problem and more something of trial and error. Thanks a lot~!
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on May 30, 2014, 08:10:11 PM
The animated laser you basically spawn an effect obj (as I said previously) on top of your "real laser" then just give your Laser shot an non-existent ID so it becomes invisible. The animated laser will take care of that then.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Mahou Shoujo Nel! on June 02, 2014, 11:22:59 AM
Well.... Is it possible to create a non-installed Object laser?
I want to create a simple laser like on "CreateLaser01".
The... "AddShot" function would also be a solution ,but i dont know how to use it probably ._.
Can anyone give me an example for one of these?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: ExPorygon on June 02, 2014, 11:18:39 PM
Well.... Is it possible to create a non-installed Object laser?
I want to create a simple laser like on "CreateLaser01".
The... "AddShot" function would also be a solution ,but i dont know how to use it probably ._.
Can anyone give me an example for one of these?
The Obj_SetSpeed function does not work on object lasers. However, you can move them by repeatedly setting their positions with Obj_SetPosition. You will probably also want to use ObjLaser_SetSource to turn off the laser base glow.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on June 03, 2014, 12:53:01 AM
Well.... Is it possible to create a non-installed Object laser?
I want to create a simple laser like on "CreateLaser01".
The... "AddShot" function would also be a solution ,but i dont know how to use it probably ._.
Can anyone give me an example for one of these?

I believe I have code for this (Miransu gave it to me for one of Pikachu's spells in PDD)

However, I edited it for use specifically in the spell it was used for and it's probably best not to use it. Do what Ozzy said; use SetPosition to move the laser depending on its speed and angle.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on June 03, 2014, 05:54:47 AM
Can anyone give me an example for one of these?
See below. V is the speed of the laser which you can define yourself. Angle will be the direction it is moving to.  This will also make the laser extend first until it reaches max length then continue to move on. If you don't do this, the laser will pop up in full length looking more like a spear being thrown instead of a laser like laser01.

http://pastebin.com/VVihdFXQ
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Mahou Shoujo Nel! on June 03, 2014, 01:23:46 PM
Thank you all!
By the way... To make a simple 3D image mowing in a loop (like the water in EoSD in stage 2)
do i need to use the postion of the image or the graphic rect?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on June 03, 2014, 03:40:12 PM
do i need to use the postion of the image or the graphic rect?
Always scroll the graphic rect. Example:  SetGraphicRect(0+scroll,0,1024+scroll,1024); or which ever you wish.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Mahou Shoujo Nel! on June 05, 2014, 04:48:02 PM
Thank you a lot ,Helepolis-sanbe!
And to all other people too! :P
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 on June 24, 2014, 07:31:11 PM
http://i.imgur.com/ZWwT3yq.png

I need help regarding these three images in my folder:

Ring.png will just be placed on the field. It will be the frame for the other ones. I have no problems with this one.

BG.png will be drawn before Ring, so it's below and doesn't overlays with it. This image will be filling the empty space of the ring as a functions tracks the amount of items collected. When beggining, the image will be empty and will go filling little by little. I have no problems with this one either.

BG2.png is the troublesome one. I want this image to scroll over BG.png without going outside the borders. I don't know if I made myself clear, but this image must be withing the current borders that BG2 has. Is there any way to do it?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on June 24, 2014, 07:48:18 PM
It is possible, you'll be needing an effect object forming a nice circle from vertex (You need the Primitive Fan type). Then you'll use UV mapping to place the texture and then simply scroll that. You can set the specific drawing layer to modify the order of drawing.

Hope that will help you out.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 on June 24, 2014, 08:33:37 PM
It is possible, you'll be needing an effect object forming a nice circle from vertex (You need the Primitive Fan type). Then you'll use UV mapping to place the texture and then simply scroll that. You can set the specific drawing layer to modify the order of drawing.

Hope that will help you out.

Wouldn't that be way to much vertex-es? I can do it, sure, but I wonder if it would cause danmakufu to lag a lot... (Unless it has something to do with the Fan type, since I only use Triangle Strip.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on June 24, 2014, 10:28:52 PM
So I'm a bit confused here. Is this what you want?

(http://i.imgur.com/VH0cIkc.png)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on June 25, 2014, 05:46:19 AM
Wouldn't that be way to much vertex-es? I can do it, sure, but I wonder if it would cause danmakufu to lag a lot... (Unless it has something to do with the Fan type, since I only use Triangle Strip.
You can be at ease that it won't lag. And you won't be replacing/recalculating the vertex positions so the engine doesn't gets beaten. Triangle Strip is going to make your life harder, you'll be needing Fan. Because with Fan, you keep your first vertex at the centre then place the others around it connecting. If you play X-number of vertex in a circular position then you'll get a nice circle. See for yourself how smooth you need it to be and increase/decrease the number of vertex
(http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh_help_v2_data/PrimitiveType.jpg)

Also: What Drake posted is what I imagined as well when I read your post. I am not sure if Drake has an alternative approach but you'll need to confirm that first.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 on June 25, 2014, 05:55:45 AM
@Drake: Exactly. What is the lines in your image would be BG2 scrolling towards a direction (Which I can do without troubles)

@Hele: Ok, then. I shall give it a try.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on June 25, 2014, 09:22:25 AM
My idea was to use render targets to draw BG2 on top of the BG texture (and scroll BG2), and then drawing that combined texture (with the gradually increasing height). It would require you use add-blend for BG2 though, and it might be a bit awkward to script if you're unfamiliar with render targets. But it's pretty much exactly what you're asking for.
http://dmf.shrinemaiden.org/wiki/Render_Targets
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: AJS on June 30, 2014, 02:22:07 AM
How can I make an object bullet that will delete another (different) object bullet when it comes into contact with it?  I've tried using common data to exchange bullet position info between the object bullet tasks and setting a condition for the to-be-deleted bullet to delete itself if their positions are the same, but Danmakufu freaks out whenever I try to do that.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 02, 2014, 08:51:23 PM
How can I make an object bullet that will delete another (different) object bullet when it comes into contact with it?  I've tried using common data to exchange bullet position info between the object bullet tasks and setting a condition for the to-be-deleted bullet to delete itself if their positions are the same, but Danmakufu freaks out whenever I try to do that.
Depends on how precise you want the collision to be. If it is just specifically object bullets then you cannot use the Collision_Obj_Obj function, because it is I think calculated from the centre for each bullet. You'll need to define one of the object bullets as global then apply custom collision detection for the other one in a circle. For example if distance of obj is x-pixels in range of the other obj > delete.
Code: [Select]
let bulletObj = (ry

task otherBullet {
let obj = (ry
<stuff about obj>

while(!Obj_BeDeleted) {

if(collision code(ry
}
}

If you don't care about whatever bullet is deleted, you can use DeleteEnemyShotInCircle(TYPE,x,y,radius); where TYPE =      ALL: Deletes all bullets, no exceptions.  SHOT: Ignores lasers and bomb-resistant bullets.  CHILD: Only deletes the bullets the enemy fired.  (wiki source).

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Python on July 04, 2014, 08:14:52 PM
Uh, hello there. I'm new here and already complaining about Shit not working:
I use this Code in Order to reflect my Bullet off of the Screen Borders (found it somewhere on the Forum):
Code: [Select]
while(Obj_BeDeleted(obj) == false && reflect < 10){
ObjShot_Reflect(obj, 0);
reflect++;
yield;
}

The Function:

Code: [Select]
function ObjShot_Reflect(id, dist){
    if(Obj_GetX(id)<GetClipMinX-dist || Obj_GetX(id)>GetClipMaxX+dist){Obj_SetAngle(id, 180-Obj_GetAngle(id));}
    if(Obj_GetY(id)<GetClipMinY-dist || Obj_GetY(id)>GetClipMaxY+dist){Obj_SetAngle(id, 0-Obj_GetAngle(id));}
}

However Danmakufu seems to not run the While-Loop for whatever Reason. Might someone help me here, if possible?
I'll provide any additional Information needed. Thanks!  :)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on July 04, 2014, 10:55:14 PM
First reaction is that it's just going to increment reflect for 10 frames then exit the loop. I assume you instead want it to increment only when it's reflected.

If you want to keep that code in a function, you could return true if the reflect condition is met and return false otherwise. Then your statement would become if(ObjShot_Reflect(obj, 0)){ reflect++; }.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Python on July 05, 2014, 01:41:21 PM
Thanks for answering, but it doesn't seem to work correctly (or I did something wrong :/ )
I changed the Code to:
Code: [Select]
while(Obj_BeDeleted(obj) == false && reflect < 10){
ObjShot_Reflect(obj, 0);
if(ObjShot_Reflect(obj, 0)){
reflect++;
}
yield;
}
and left the ObjShot_Reflect Function as before.

Also, if there is better Way to have a Bullet reflect off the Border a fixed Amount of Times, please say so.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on July 05, 2014, 10:39:50 PM
No no, you want ObjShot_Reflect() to return a value: true if the object reflects, and false if the object does not reflect. So in your loop it would then ask if it returned true or false, and if it returned true (the bullet reflected), then increment the variable.

Code: [Select]
function ObjShot_Reflect(id, dist){
if(Obj_GetX(id)<GetClipMinX-dist || Obj_GetX(id)>GetClipMaxX+dist){
Obj_SetAngle(id, 180-Obj_GetAngle(id));
return true;
}
if(Obj_GetY(id)<GetClipMinY-dist || Obj_GetY(id)>GetClipMaxY+dist){
Obj_SetAngle(id, 0-Obj_GetAngle(id));
return true;
}
return false;
}

while(Obj_BeDeleted(obj) == false && reflect < 10){
if(ObjShot_Reflect(obj, 0) == true){
reflect++;
}
yield;
}
Like this.

But if you don't care about ObjShot_Reflect() being its own function, you could just plop its contents into the loop:
Code: [Select]
while(Obj_BeDeleted(obj) == false && reflect < 10){
if(Obj_GetX(id)<GetClipMinX-dist || Obj_GetX(id)>GetClipMaxX+dist){
Obj_SetAngle(id, 180-Obj_GetAngle(id));
reflect++;
}else if(Obj_GetY(id)<GetClipMinY-dist || Obj_GetY(id)>GetClipMaxY+dist){
Obj_SetAngle(id, 0-Obj_GetAngle(id));
reflect++;
}
yield;
}

Lastly I forgot to mention that you should make sure that your @MainLoop has a yield statement in it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Python on July 06, 2014, 07:33:45 AM
Ohhhhhhh! OK! :)
I guess I misunderstood something. Thank you.

EDIT: To prevent Double-Posting, I'll post another Problem here:

For my Boss Script, I want a Conversation to occur between the Fight and the Last Spells, so I added a Talk Event into the Script of the last
Attack and put this in @MainLoop:

Code: [Select]
if(GetPlayerScriptName == "player\Flandre\Flandre.txt" || "player\Flandre\FlandreB.txt" && GetLife < 1){
CreateEventFromScript("flan");
}

if(GetPlayerScriptName == "player\Remilia\RemiA.txt" || "player\Remilia\RemiB.txt" && GetLife < 1){
CreateEventFromScript("remi");
}

All Player Scripts exist, of Course.
However upon clearing the Spell Card, the Enemy just dies and the Script ends. Once the Talk Event showed up for about one Second and
then the Script ended. What am I doing wrong?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: shockdude on July 07, 2014, 12:57:24 AM
So I think I found a dead-simple method of running Danmakufu without AppLocale. It involves downloading less than 1MB of files and copy-pasting them into the Danmakufu directory.
Would anyone mind testing it to see if it works?
https://www.shrinemaiden.org/forum/index.php/topic,17082.0.html
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on July 07, 2014, 04:25:04 AM
Python: Generally in the rest of the forum, double-posting should be avoided, but here I would recommend double-posting if you have another question afterwards, because it notifies people that there's been a new post that might need addressing. Otherwise it might be skipped over.

For my Boss Script, I want a Conversation to occur between the Fight and the Last Spells, so I added a Talk Event into the Script of the last
Attack and put this in @MainLoop:

Code: [Select]
if(GetPlayerScriptName == "player\Flandre\Flandre.txt" || "player\Flandre\FlandreB.txt" && GetLife < 1){
CreateEventFromScript("flan");
}

if(GetPlayerScriptName == "player\Remilia\RemiA.txt" || "player\Remilia\RemiB.txt" && GetLife < 1){
CreateEventFromScript("remi");
}

All Player Scripts exist, of Course.
However upon clearing the Spell Card, the Enemy just dies and the Script ends. Once the Talk Event showed up for about one Second and
then the Script ended. What am I doing wrong?
The statement a == b || c doesn't mean "a is either b or c", it means "either a is b, or c". So what you're looking for there is
GetPlayerScriptName == "string" || GetPlayerScriptName == "other string". Currently it wouldn't matter what player you were since any string or nonzero number will evaluate to true in an if statement.

Which means the problem is elsewhere anyways. It's probably that the script is just ending before the event actually plays out, but I can't tell without more. Maybe just pastebin the script you're talking about. Can you just run the event by itself (at the start of the script, for example) without any problems?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Python on July 07, 2014, 03:54:49 PM
Hm, here you go:

http://pastebin.com/raw.php?i=0C1L0wmx
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on July 08, 2014, 06:19:35 AM
Oh. The problem is just that the script is ending before the event can be played. You can delay the next card after reaching zero health but it's more complicated than necessary. You can instead call the event from your final spell before anything actually starts, or you can make a dummy script that just contains the event. Not sure why I didn't catch that earlier.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Python on July 08, 2014, 12:53:15 PM
OK, thanks for your Help!
Yet another Question:

Is it possible to switch the Background Music in a Plural Script, like, have BGM1.wav for Spell 1 through 5 and then switch to BGM2.wav for Spells 6 through 8?
If so, how do you do it?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 08, 2014, 01:24:18 PM
OK, thanks for your Help!
Yet another Question:

Is it possible to switch the Background Music in a Plural Script, like, have BGM1.wav for Spell 1 through 5 and then switch to BGM2.wav for Spells 6 through 8?
If so, how do you do it?
As far as I know, 0.12m only allows 1 music stream. If you simply stop the current music with the stop function then simply load + launch your new music and should be fine, make sure you do this in initialize. As long as you don't stop the music after loading, it will keep playing throughout the plural.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Python on July 08, 2014, 04:41:02 PM
Thank you.
Regarding the Talk Event:

You can instead call the event from your final spell before anything actually starts.

I tried inserting the Code calling the Event into @Initialize, however the Talk Event still doesn't work. I also removed the && GetLife < 1, otherwise
it wouldn't load anyways.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on July 09, 2014, 01:07:52 AM
Ugh, it sucks having to remember all this 0.12-specific stuff. The problem now is just that GetPlayerScriptName() gives you the filename of the player script, without the path. So all you want is "RemiA.txt" instead of "player\Remilia\RemiA.txt".

Really though dude you should be testing these things to make sure the individual parts work at all. Does calling the talk event without the conditions work? If so, then the problem is obviously with the conditions. Can you force the condition to evaluate to true at all? What are the functions involved? What are they supposed to return and what do they actually return? This stuff is important.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Python on July 09, 2014, 12:42:29 PM
Yeah, I apologize.
I changed the File Path to just the Script Name and now it works.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 on August 31, 2014, 11:55:21 AM
This ain't a problem on my danmakufu. Somebody else that does not knows this forum )and cannot speak english) had this trouble, so I'm here on his behalf:

http://s11.postimg.org/jt9qayz6r/ZZZZZZZ.png

He installed Applocale, he has the japanese fonts, his OS is Windows 7 32 Bits and Danmakufu simply does not runs. Any ideas? Is there any other info I must ask him?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on August 31, 2014, 12:03:43 PM
He likely isn't actually running Danmakufu through AppLocale, since the window title is still mojibake. I can see "th_dnh.exe" selected in the file explorer window too.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on October 03, 2014, 09:05:36 AM
So, I returned to Danmakufu after a long break, and I can't figure out what this error means (see attachment).

Here is the script: http://pastebin.com/t23gkMgF
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on October 03, 2014, 09:35:35 AM
== is a logical operator. You're currently evaluating the expression (x == 0) and trying to execute the result (true or false), which makes no sense. The error is just that you can't call a variable (although in this case it's just a constant value) as though it were a function.

Really you just messed up = and ==.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on October 03, 2014, 02:07:05 PM
I see. I guess I forgot. I haven't programmed anything C-like in a while. (I have done 6502 assembly lately which is completely different in structure).

Anyway, I wanted to make the boss to fire a wavy stream, but I can't figure out now to do it properly (I'm trying to use arrays to give the extra direction to add or subtract to the direction of the shot). I just can't seem to find how to read arrays so that it goes through the array, and goes to the beginning when the array ends. The task seems to just read the first value of the array.

Code: [Select]
task fire01 {
let Array = [0, 1, 1.75, 2.25, 2.5, 2.25, 1.75, 1, 0, -1, -1.75, -2.25, -2.5, -2.25, -1.75, -1, -0];
loop {
CreateShot01(GetEnemyX, GetEnemyY, 3, GetAngleToPlayer+Array, BLUE12, 10);
PlaySE(CSD ~ "SFX\se_tan02.wav");
wait(1);
}
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on October 04, 2014, 03:52:41 AM
Code: [Select]
ascent(i in 0..length(Array)){
    CreateShot01(GetEnemyX, GetEnemyY, 3, GetAngleToPlayer + Array[i], BLUE12, 10);
}

Elements of an array are accessed by their index in the array. Syntax is as above. An ascent loop creates a temporary variable that starts at the lower value and increments on each loop until it hits the top value.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on October 04, 2014, 10:11:19 AM
Got it working. Thanks.

By the way; Is there any way to play replays in Danmakufu since it doesn't seem to have it as a built in feature in 0.12m version.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on October 04, 2014, 02:20:10 PM
Got it working. Thanks.

By the way; Is there any way to play replays in Danmakufu since it doesn't seem to have it as a built in feature in 0.12m version.

...It's built in. Go to the script you have a replay of, click it, and there should be "Play" followed by all replays of that script.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on October 04, 2014, 08:16:11 PM
...It's built in. Go to the script you have a replay of, click it, and there should be "Play" followed by all replays of that script.

What? It's there? I never actually looked there since I usually "spam" through the menus after I choose the script because I always use Reimu A. :D
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: 7636kei on October 09, 2014, 08:50:30 AM
What? It's there? I never actually looked there since I usually "spam" through the menus after I choose the script because I always use Reimu A. :D

Why, yes, they're there. Just before you get to choose who will play the script, if there's any replay, there will be a few lines below the Play menu. To replay it, just choose the replay. Mind that if you changed the script after the replay has been made, expect to face desynch.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on October 10, 2014, 09:04:00 AM
Mind that if you changed the script after the replay has been made, expect to face desynch.

I know. That's just logical.

Anyway, does anyone know how I can custom libraries for Danmakufu? You probably know about the CtC Shot Replace library. It's similar, but instead of shots, it contains my custom functions. It will become handy to keep scripts nice and clean.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on October 10, 2014, 10:16:16 AM
If you know how to use the CtC shot replace thing then you've already answered your question.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on October 10, 2014, 10:24:56 AM
If you know how to use the CtC shot replace thing then you've already answered your question.

But the shot replace files use .dnh format. I don't know how to create them.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on October 10, 2014, 10:54:37 AM
But the shot replace files use .dnh format. I don't know how to create them.
They can just be opened with notepad afaik. They don't use any encryption or anything last time I check their code.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on October 10, 2014, 11:00:50 AM
".dnh files" are just text files saved with a .dnh file extension instead of .txt. You can tell your computer to open all .dnh files with a text editor if you want.

The point is that you can just write up your functions in a separate script, just like how the shot replace script has a shot_init function in it, and use #include_function to include those functions in your script, just as you've already been doing when using the shot replace script.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on October 22, 2014, 05:48:35 PM
I just got a new problem. I'm getting error that Danmakufu doesn't recognize "obj2" in "Collision_Obj_Obj(obj, obj2)" even though is clearly exists right under "task BreakerShot(x, y, v, dir, graphic, delay)". I also tried firing a BreakerShot first to make sure that the "obj2" is initialized before ShotA is fired, but it didn't change anything. I also tried setting "task BreakerShot" before "task ShotA", but that didn't work either.

Code: [Select]
task ShotA(x, y, v, dir, graphic, delay) {
let obj = Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj, x, y);
Obj_SetSpeed(obj, v);
Obj_SetAngle(obj, dir);
ObjShot_SetGraphic(obj, graphic);
ObjShot_SetDelay(obj, delay);
ObjShot_SetBombResist(obj, false);

let c = 0;
while(!Obj_BeDeleted(obj)) {
if(Collision_Obj_Obj(obj, obj2) == true) {
loop(25) {
CreateShot01(Obj_GetX(obj), Obj_GetY(obj), rand(2, 3.5), rand_int(0, 359), RED23, 5);
}
Obj_BeDeleted(obj);
}
wait(360);
ObjShot_FadeDelete(obj);
}
}

task BreakerShot(x, y, v, dir, graphic, delay) {
let obj2 = Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj2, x, y);
Obj_SetSpeed(obj2, v);
Obj_SetAngle(obj2, dir);
ObjShot_SetGraphic(obj2, graphic);
ObjShot_SetDelay(obj2, delay);
ObjShot_SetBombResist(obj2, false);

let c = 0;
while(!Obj_BeDeleted(obj2)) {
yield;
}
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on October 22, 2014, 05:51:52 PM
I just got a new problem. I'm getting error that Danmakufu doesn't recognize "obj2" in "Collision_Obj_Obj(obj, obj2)" even though is clearly exists right under "task BreakerShot(x, y, v, dir, graphic, delay)". I also tried firing a BreakerShot first to make sure that the "obj2" is initialized before ShotA is fired, but it didn't change anything. I also tried setting "task BreakerShot" before "task ShotA", but that didn't work either.

[ code has been removed from quote ]

When you define a variable inside of a task/function (a local variable), it only exists within that given task or function. Therefore, the object created in BreakerShot does not exist outside of BreakerShot and therefore cannot be accessed by ShotA.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on October 22, 2014, 06:14:58 PM
To add, even if you could access the same obj2 value across tasks, if you call BreakerShot() more than once then suddenly it's impossible to tell what obj2 means.

You're going to run into trouble with what you're doing. You have two sets of objects that you want to check collision between, but you can't simply tell any ShotA() object to collide with any BreakerShot() object. In order to be able to do what you want, you'll have to have an array of one kind of object, accessible by the other objects so they can loop through it and check collision. Or have an array for each, and a separate process to perform collision. (Or some other structure.)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on October 23, 2014, 07:34:58 AM
I not that familiar with arrays so someone probably has to explain me how I should do this. Just a basic array that goes through different values (like shot types) are not that hard, but I have no idea how to do it with object shots.

EDIT: I got a new problem now (the above one is still unsolved, but forget that for now). The @DrawLoop isn't working reliably. This means that the animation to a specific direction works sometimes, and sometimes it doesn't. It always loads the first sprite of the animation, but doesn't always "play" it. Also, when the boss stops, it rarely goes to the "idle" animation. I'm not really sure why this happens.


Code: [Select]
@DrawLoop {
SetTexture(Boss);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(2, 2);
SetGraphicAngle(0, 0, 0);

if(int(GetSpeedX())==0 && int(GetSpeedY())==0) {
if(frame<40){ SetGraphicRect(0, 0, 31, 31); }
if(frame>=40){ SetGraphicRect(32, 0, 64, 31); }
frame+=4;
frame2 = 0;
}

if(GetAngle()>=315 && GetAngle()<=360) {
if(frame2<20){ SetGraphicRect(0, 96, 31, 128); }
if(frame2>20 && frame2<40){ SetGraphicRect(32, 96, 63, 128); }
if(frame2>40 && frame2<60){ SetGraphicRect(64, 96, 95, 128); }
if(frame2>60){ SetGraphicRect(32, 96, 63, 128); }
frame = 0;
frame2+=4;
}

if(GetAngle()>=0 && GetAngle()<=45) {
if(frame2<20){ SetGraphicRect(0, 96, 31, 128); }
if(frame2>20 && frame2<40){ SetGraphicRect(32, 96, 63, 128); }
if(frame2>40 && frame2<60){ SetGraphicRect(64, 96, 95, 128); }
if(frame2>60){ SetGraphicRect(32, 96, 63, 128); }
frame = 0;
frame2+=4;
}

if(GetAngle()>=135 && GetAngle()<=225) {
if(frame2<20){ SetGraphicRect(0, 64, 31, 96); }
if(frame2>20 && frame2<40){ SetGraphicRect(32, 64, 63, 96); }
if(frame2>40 && frame2<60){ SetGraphicRect(64, 64, 95, 96); }
if(frame2>60){ SetGraphicRect(32, 64, 63, 96); }
frame = 0;
frame2+=4;
}

if(GetAngle()>225 && GetAngle()<315) {
if(frame2<20){ SetGraphicRect(64, 32, 95, 63); }
if(frame2>20 && frame2<40){ SetGraphicRect(32, 32, 63, 63); }
if(frame2>40 && frame2<60){ SetGraphicRect(0, 32, 31, 63); }
if(frame2>60){ SetGraphicRect(32, 32, 63, 63); }
frame = 0;
frame2+=4;
}

if(GetAngle()>45 && GetAngle()<135) {
if(frame2<20){ SetGraphicRect(0, 32, 31, 63); }
if(frame2>20 && frame2<40){ SetGraphicRect(32, 32, 63, 63); }
if(frame2>40 && frame2<60){ SetGraphicRect(64, 32, 95, 63); }
if(frame2>60){ SetGraphicRect(32, 32, 63, 63); }
frame = 0;
frame2+=4;
}

if(frame == 80) {
frame = 0;
}

if(frame2 == 80) {
frame2 = 0;
}

DrawGraphic(GetX, GetY);
}

EDIT 2: I also need to make a custom shot sheet. Doing that is not the problem itself. What I can't figure out is that how do you actually fire the custom shot. There is literally no information about this anywhere...
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 15, 2014, 05:55:19 PM
Sotty for double post, but I have this enemy script: http://pastebin.com/qyeiirz5
Running it causes danmakufu to completely crash (not just freeze). I don't know why.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lefkada on November 15, 2014, 06:06:11 PM
Quote
EDIT 2: I also need to make a custom shot sheet. Doing that is not the problem itself. What I can't figure out is that how do you actually fire the custom shot. There is literally no information about this anywhere...
LoadUserShotData("shotdatapath"); for load the shot data and use the shot ID (set in the shot file) instead of the default shot's RED01 ?
Something like:

CreateShot01(x,y,speed,angle,1,delay); for spawn the shot with the ID=1.

For the animation, do you use frame1 and frame2 in the mainloop?
To make this I do somthing like that (adapted from ph3 so functions are not necessary good but is almost the same way in 0.12m):
Code: [Select]

        let anim = 0;
        let timer_anim = 0;
timer_anim++;
if(timer_anim == 0) {anim = 0;}
if(timer_anim == 10) {anim = 1;}
if(timer_anim == 2*10) {
anim = 2;
timer_anim = -1;
}
if((bossSpeed < 0) {
SetGraphicRect(1+32*anim, 0, 32+32*anim, 32);
} else if((bossSpeed > 0) {
SetGraphicRect(32+32*anim, 32, 64+32*anim, 64);
} else {
SetGraphicRect(1+32*anim, 64, 32+32*anim, 96);
}
The animation frames on the boss graphic file are 32x32 squares. And the "anim" variable horizontally shift the GraphicRect by 32 to shift to the next square.
I think you can also use a task instead of the drawloop.

(i hope it's clear).

Edit: for the enemy script problem, CDS is not defined in the script. And enemy have no life (it die immediatly after being created)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 15, 2014, 08:23:39 PM
LoadUserShotData("shotdatapath"); for load the shot data and use the shot ID (set in the shot file) instead of the default shot's RED01 ?
Something like:

CreateShot01(x,y,speed,angle,1,delay); for spawn the shot with the ID=1.

Seems simple enough. Someone should put this to danmakufu wiki. There was nothing mentioned about this (like I said before). On that note someone should also make a tutorial about 3D drawing. I had a lot of trouble getting started because there was no documentation. Just a brief explanation on each function.

For the animation, do you use frame1 and frame2 in the mainloop?
To make this I do somthing like that (adapted from ph3 so functions are not necessary good but is almost the same way in 0.12m):
Code: [Select]
<code cut>The animation frames on the boss graphic file are 32x32 squares. And the "anim" variable horizontally shift the GraphicRect by 32 to shift to the next square.
I think you can also use a task instead of the drawloop.

Hmm... Maybe that's more reliable than inputting values manually. I'll have to test this way later since I'm on my laptop now and I'm too lazy to open my pc just to test this.

Edit: for the enemy script problem, CDS is not defined in the script.

...And once again there is a function I "adapt" as a part of danmakufu. This once happened to me with the wait(); function too...

And enemy have no life (it die immediatly after being created)

Didn't I set the enemy's life to 200 in @Initialize { }?

Just as a by the way question: Is it possible to draw multiple sprites in @DrawLoop { }? One "main sprite" and some "trailing sprites" that disappear after a specific time.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on November 15, 2014, 09:41:09 PM
Seems simple enough. Someone should put this to danmakufu wiki. There was nothing mentioned about this (like I said before). On that note someone should also make a tutorial about 3D drawing. I had a lot of trouble getting started because there was no documentation. Just a brief explanation on each function.

The problem with that is that ph3 has vastly different capabilities, and not many people are willing to go back to 0.12m. I made 3D backgrounds in 0.12m but didn't understand 90% of what I was doing, and even now, I only have a partial understanding of how they work despite having made about a dozen of them already.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lefkada on November 16, 2014, 12:12:13 AM
Quote
Didn't I set the enemy's life to 200 in @Initialize { }?
Mmh. I miss that. But even with this the enemy spawn, die immediatly, spawn bullets and the script end (but maybe it's due to the VanishEnemy in the main task ><. So it's not a problem in fact. It's just me.).

Quote
Is it possible to draw multiple sprites in @DrawLoop { }? One "main sprite" and some "trailing sprites" that disappear after a specific time.
Yeh. I think. I made it in a player script.

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 16, 2014, 10:52:45 AM
Mmh. I miss that. But even with this the enemy spawn, die immediatly, spawn bullets and the script end (but maybe it's due to the VanishEnemy in the main task ><. So it's not a problem in fact. It's just me.).

Right now it doesn't matter if it dies immeniately. I just want to get it working. I did some changes to the enemy script, but it's still crashing danmakufu.
New enemy script: http://pastebin.com/GQHA3680

I was starting to wonder if the issue is in the stage script, so I'll post it here too: http://pastebin.com/DYS2W2Sp
I removed the background because it works fine. Danmakufu crashes as soon as I add the CreateEnemyFromFile commands.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 16, 2014, 11:19:16 AM
Can't load enemies or make an effect object without waiting at least one frame.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lefkada on November 16, 2014, 11:34:13 AM
Okay. It's not the enemy script that makes danmakufu crash. It's the first CreateEnemyFromFile in your mainTask. You can't use CreateEnemyFromfile in @initialize and this first is called in the same time IE in the @initialize.
So, like Drake say, you must use at least a wait(1) before the first CreateEnemyFromFile in your mainTask ;)
There is other functions that can't be used in initialize (but I don't remember what function exactly) so be careful (and check the function list if you have some problems with that. Maybe it's just a function used at the bad place).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 16, 2014, 12:20:05 PM
The script works fine now. The only thing is that @Finalize seems to ignore wait times. Any way around this?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lefkada on November 16, 2014, 12:34:57 PM
Hum @Finalize is not a loop. When the script come to @Finalize it do the stuff in it one time and the script end. Nothing other. Or if it's a way I never find it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 16, 2014, 12:52:20 PM
But shouldn't it get "stuck" in the while loop for a while that I have there?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 16, 2014, 03:39:09 PM
It does go through the while loop, it will just "ignore" yields, in a sense, because @MainLoop stops. You'll never be yielding to a routine that lets the frame end, just currently-running tasks that eventually yield back to @Finalize.

Code: [Select]
Start frame
@Finalize start
loop:
    @Finalize yield
    task1 go, task1 yield, task2 go, task2 yield, ...
    @Finalize go
end loop
@Finalize end

This also has the unwanted behaviour that currently-running tasks get run many extra times on the frame @Finalize runs. Since you can't do what you want anyways, just act as though @Finalize ignores yields and never put them in, so you never have to worry about this side-effect.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: 7636kei on November 16, 2014, 04:16:39 PM
Perhaps this is a bit twisted, but is there any reserved constant danmakufu use to express e (as in, that 2,718 bla bla bla) (like how pi is reserved)? Because if there isn't, I'll have to make do with approximations.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 16, 2014, 10:21:00 PM
Nope, gotta define it.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 17, 2014, 10:18:57 AM
It does go through the while loop, it will just "ignore" yields, in a sense, because @MainLoop stops. You'll never be yielding to a routine that lets the frame end, just currently-running tasks that eventually yield back to @Finalize.

Code: [Select]
Start frame
@Finalize start
loop:
    @Finalize yield
    task1 go, task1 yield, task2 go, task2 yield, ...
    @Finalize go
end loop
@Finalize end

This also has the unwanted behaviour that currently-running tasks get run many extra times on the frame @Finalize runs. Since you can't do what you want anyways, just act as though @Finalize ignores yields and never put them in, so you never have to worry about this side-effect.

Maybe it's best to just make the enemy shoot the pattern. Or if it's possible to spawn enemy in @Finalize, spawn invisible enemy that doesn't have a hitbox that fires the shots and then vanishes.

Is there any better way of making a trailing effect than this:

Code: [Select]
SetTexture(Enemy1);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(1, 1);
SetGraphicAngle(0, 0, 0);
SetGraphicRect(0, 0, 63, 63);

DrawGraphic(GetX, GetY);

SetTexture(Enemy1);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(1, 1);
SetGraphicAngle(0, 0, 0);
SetGraphicRect(64, 0, 127, 63);

DrawGraphic(GetX-GetSpeedX*15, GetY-GetSpeedY*15);

SetTexture(Enemy1);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(1, 1);
SetGraphicAngle(0, 0, 0);
SetGraphicRect(128, 0, 191, 63);

DrawGraphic(GetX-GetSpeedX*25, GetY-GetSpeedY*25);

SetTextureEnemy1);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(1, 1);
SetGraphicAngle(0, 0, 0);
SetGraphicRect(192, 0, 255, 63);

DrawGraphic(GetX-GetSpeedX*30, GetY-GetSpeedY*30);

The only issue with this is that every time I have enemy with different speed, I need to re-calculate the multiplications to get the trailing with a suitable length.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 17, 2014, 12:28:34 PM
Code: [Select]
let drawstack = [[-1, -1, -1], [-1, -1, -1], [-1, -1, -1], [-1, -1, -1]];
let frame = 0;

@DrawLoop{

    SetTexture(Enemy1);
    let rect = // calculate which animation frame you want
// in this case 0, 1, 2, 3 are options, corresponding to the alt/case
    drawstack[0] = [rect, GetX, GetY];

    descent(i in 0..length(drawstack)){ // descent makes the last frames draw first (below the others)
        alternative(drawstack[i][0])
        case(0){ SetGraphicRect(0, 0, 63, 63); }
        case(1){ SetGraphicRect(64, 0, 127, 63); }
        case(2){ SetGraphicRect(128, 0, 191, 63); }
        case(3){ SetGraphicRect(192, 0, 255, 63); }

        DrawGraphic(drawstack[i][1], drawstack[i][2]);

        if(frame == 10 && i > 0){
            drawstack[i] = drawstack[i-1]; // move animation frames down the stack
        }
    }

    frame++;
    if(frame >= 10){ frame = 0; }

}

Something like this? Main question is if you want each trailing sprite to use the same rect as when it was originally drawn (which is what I assume in the above code) or if you have specific sprites for the trailing sprites.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 17, 2014, 02:20:40 PM
Main question is if you want each trailing sprite to use the same rect as when it was originally drawn (which is what I assume in the above code) or if you have specific sprites for the trailing sprites.

Each trailing sprite has same rect for easier SetGraphicRect calculation, but the sprites itself are smaller the further away it is from the enemy it is trailing.
Here is an image of the enemy:
(http://i.imgur.com/nsziluI.png)

BTW, can someone explain how SetMovePositionHermite(); works? It's supposed to move in curve, but no matter what values I use the enemies always fly in a straight line.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 18, 2014, 04:34:20 AM
If that's the case why don't you just use SetGraphicScale()?

Code: [Select]
let drawstack = [[-1, -1], [-1, -1], [-1, -1], [ -1, -1]]; // only need x and y positions if you only use one sprite
let frame = 0;

@DrawLoop{

    SetTexture(Enemy1);
    SetGraphicRect(0, 0, 63, 63);
    drawstack[0] = [GetX, GetY];

    descent(i in 0..length(drawstack)){ // descent makes the last frames draw first (below the others)
        SetGraphicScale(1 - i/6);
        DrawGraphic(drawstack[i][0], drawstack[i][1]);

        if(frame == 10 && i > 0){
            drawstack[i] = drawstack[i-1]; // move animation frames down the stack
        }
    }

    frame++;
    if(frame >= 10){ frame = 0; }

}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 18, 2014, 05:17:57 AM
If that's the case why don't you just use SetGraphicScale()?

I think someone once said that SetGraphicScale() sucks. I tried your code, but I'm not getting a trail.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 18, 2014, 05:51:40 AM
It sucks for detailed sprites, but if you just have a blob or are making effects then it isn't a big deal.

Anyways, its just that I check for frame's value but it never reaches 10. Just move the if(frame >= 10) above the line before it. I never tested this, I sort of expected you to play with it. The important part is working with the frame stack to store previous locations.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 18, 2014, 08:03:00 AM
I never tested this, I sort of expected you to play with it.

It's probably useless to play with it if I don't understand what kind of logic you are going for. I'm sure you know that it's not guranteed that others understand your code as well as you do. I might get it working, but if I don't understand how the code works it's nearly useless. Only thing I can do is just copy paste it and if it doesn't work I have no idea what to do. This might not be so big issue in Danmakufu,  but in some other languages like 6502 it's very likely that you don't understand someone else's code if they don't explain the logic they are going for.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 18, 2014, 10:26:29 AM
That's why I wrote some comments, and I agree. On the flip side, I'm the one taking my time trying to help: if you just reply that it didn't work, and you don't tell me what you tried to do or that you don't understand how it's supposed to work, then I can't really help you either. It'd be more useful for both of us if you asked for elaboration if you didn't understand; I'm not going to assume you don't know what I'm writing unless it's something particularly strange, and you didn't seem put off by the first post, so I expected that you were okay with what I gave you. I don't think that's unreasonable.

The drawstack variable here is an array of positions (which are themselves 2-length arrays, for x and y). Every frame you store the current xy position to the first entry of the array. Then it goes through a descent loop, drawing the sprite at each position stored in the array (with shrinking scale, depending on i). The important bit is that every 10 frames (counted by the frame variable and reset to 0 after it hits 10)*, it sets each entry in the array to the one before it (except the first), which means the array stores the current position, and the positions the enemy was at 10, 20 and 30 frames ago. As written in the comments, I used a descent loop instead of an ascent so the last position gets drawn first then the more recent positions are drawn overtop.

* Maybe I should have just written frame = frame % 10 + 1; instead of the last two lines

All that aside, did you get it to work? It should have if you swapped those lines like I said, or if you use the one line above.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 19, 2014, 02:28:23 PM
All that aside, did you get it to work? It should have if you swapped those lines like I said, or if you use the one line above.

Not working yet. For some reason I have a feeling that either i or stack is not getting updated properly.

Code: [Select]
@DrawLoop {
SetTexture(Enemy1);
SetGraphicRect(0, 0, 63, 63);
stack[0] = [GetX, GetY];

descent(i in 0..length(stack)) {
SetGraphicScale(1-i/6, 1-i/6);
DrawGraphic(stack[i][0], stack[i][1]);
}

if(frame == 10 && i > 0){
stack[i] = stack[i-1];
}

if(frame >= 10) {
frame = 0;
}

frame++;
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on November 19, 2014, 02:54:59 PM
if(frame == 10 && i > 0){  stack[i] = stack[i-1];  } goes inside the descent loop.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 19, 2014, 05:10:06 PM
It works now. I also added alpha fade for the sprites to make it look smoother. I also had to update the stack every frame because the trail wasn't moving smoothly enough otherwise.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: TheTeff007 on November 20, 2014, 05:46:19 PM
Well, I am having some troubles with stage enemies images. I am using Blargel's animation library and enemies created on  boss scripts work fine, and even the boss themselves work fine with the library, but I cannot get the enemies to get their image drawn on stage scripts. Below I am providing the relevant scripts:

http://pastebin.com/NWi9iXzj
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 23, 2014, 09:40:13 AM
I'm having a small issue with a new background. The issue is that I want the texture Pillar to move so that it starts inside the fog (-850) and moves along the wall until it's out of view (-150) and then "jumps" back to the fog. However the pillar is not moving. I tried a starting value of -350 (which is on the view) but it's not going anywhere for some reason. I'm using variable slide2 to control the pillar's movement.

Code: [Select]
@BackGround {
SetTexture(Floor);
SetGraphicRect(0, 0+slide, 256, 256*3+slide);
SetGraphicAngle(0, 0, 0);
SetViewFrom(180, 90, 90);
SetViewTo(0, 0, 0);
SetFog(500, 900, 0, 0, 0);
DrawGraphic3D(GetClipMinX-30, -350, 100);

SetTexture(Wall);
SetGraphicRect(0+slide, 0, 256*3+slide, 256);
SetGraphicAngle(0, 90, 90);
DrawGraphic3D(GetClipMinX-155, -350, -30);
DrawGraphic3D(GetClipMinX+95, -350, -30);

SetTexture(Ceiling);
SetGraphicRect(0, 0+slide, 256, 256*3+slide);
SetGraphicAngle(0, 0, 0);
DrawGraphic3D(GetClipMinX-30, -350, -150);

SetTexture(Pillar);
SetGraphicRect(0, 0, 32, 290);
SetGraphicAngle(-45, 90, 90);
DrawGraphic3D(GetClipMinX-165, slide2, -30);

if(slide2 <= -150) { slide2 = -850; }

slide-=15;
slide2+=15;

}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 23, 2014, 11:46:52 AM
What happens if you comment out the slide variable counters and add multiple pillars with different static values. Do these appear in different locations?

Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: SusiKette on November 24, 2014, 05:19:21 AM
If this is what you meant, then yes they appear in different locations.

EDIT: I fixed it now. My next question is that is it possible to make background "events" so that whenever I change a value in variable something else that 0, @BackGroud {} will execute a backgeound event, such as turn left or turn right. The stage is supposed to be sort of a maze, so it would be nice to get some turns too. What would be even more awesome is that you could take one or more routes to the end of the stage and you could choose which way to go (Similarly how you choose between stage 6a and stage 6b in Imperishable Night).
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on November 24, 2014, 06:45:02 AM
...My next question is that is it possible to make background "events"...
Yes it is possible as long it is all scripted inside the @BG loop.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BlazervaniaX on December 09, 2014, 03:02:21 AM
http://pastebin.com/dby3EWXM
ehhh something is wrong with this bomb and i'm not sure what but i think i messed up somewhere inside the tasks...
when triggered, the bomb is declared properly, but nothing happens, aside gaining 300 frames of invincibility  :V
...any clues?? :T
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on December 09, 2014, 04:27:01 AM
bullet() is a task, so as soon as it yields, End() is called.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BlazervaniaX on December 09, 2014, 06:28:28 PM
in other words, i must remove yield from bullet...
...but the result is the same :v
http://pastebin.com/5F8CdKU2
any other mistake? :T
(i tried taking out the yield inside mainloop, and the spell card is declared properly, name cutin and all, but when the invincibility wears off i can't trigger any more bombs, not even after dying, what's with this? :T)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on December 09, 2014, 10:15:21 PM
The point is that you go through bullet(), it ends, and then the next statement is executed, which is End(). Look at bullet(): You do stuff to the bomb object, set UVs, maybe spawn another task, set XYs, then end. Once that happens, End() hits, which ends the spell script. It doesn't matter that you run other tasks. You have to rethink when you want to call End().
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Jean Fox on January 23, 2015, 06:37:03 AM
How works ALPHA in OBJ_EFFECT?
I want to make picture to appear slowly
Obj_SetAlpha(obj,x);
x++;
Danmakufu doesn't find any mistake, but picture papers suddenly.
How does it works?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Uruwi on January 23, 2015, 06:52:14 AM
How works ALPHA in OBJ_EFFECT?
I want to make picture to appear slowly
Obj_SetAlpha(obj,x);
x++;
Danmakufu doesn't find any mistake, but picture papers suddenly.
How does it works?

I don't really 0.12m but did you yield; inside the loop?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on January 23, 2015, 06:58:44 AM
Obj_SetAlpha() isn't a provided function, neither is ObjEffect_SetAlpha(). You need to do something like
ascent(i in 0..4){ ObjEffect_SetVertexColor(obj, i, alpha, 255, 255, 255); }
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Jean Fox on January 23, 2015, 07:56:18 AM
I don't really 0.12m but did you yield; inside the loop?

yeeees?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Jean Fox on January 23, 2015, 08:00:16 AM
Obj_SetAlpha() isn't a provided function, neither is ObjEffect_SetAlpha(). You need to do something like
ascent(i in 0..4){ ObjEffect_SetVertexColor(obj, i, alpha, 255, 255, 255); }

That I forgot this function O_O
I will try this, it must works
Thanks for helping^_^
(sorry my English is not so good)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Jean Fox on January 23, 2015, 11:38:00 AM
sorry please? but I forgot to ask one more little thing,  could be on 0.12m two script_enemy_main at the same time? :wat:
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on January 23, 2015, 12:09:18 PM
Nope.

If you want to have two "bosses" on screen at the same time, you need to have one be the actual boss. For the other, you have two options:
- Make the other be a regular enemy (with script_enemy) and use SetDamageRateEx() to make the boss take damage when hitting the other enemy. This is the easiest method.
- Or, keep track of a dummy position to represent the location of the "second" boss, add another hitbox there using SetCollisionA(), and draw the second boss there as an effect object.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: michikaze on February 12, 2015, 06:33:36 PM
Trolling. Yeah.

I always was curious, can ZUN edit it's danmaku without restarting the game? In interview with him he shown how he edits code at his right monitor and see changes on the left monitor, I wonder how it really works.

Danmakufu can do runtime code change, right? It's scripting language, right?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on February 12, 2015, 07:01:12 PM
Trolling. Yeah.

I always was curious, can ZUN edit it's danmaku without restarting the game? In interview with him he shown how he edits code at his right monitor and see changes on the left monitor, I wonder how it really works.

Danmakufu can do runtime code change, right? It's scripting language, right?

Not really. You have to stop execution of the current script and restart it for the changes to be in place.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on February 12, 2015, 08:15:34 PM
It isn't like modern Unreal Engine where you develop and play at the same time. His dual screen just means he is putting his output result on another screen and his code on another screen so he has more overview.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BlazervaniaX on February 17, 2015, 06:29:35 PM
So...

Code: [Select]
       let dir = 46;

loop {
loop(20) {
let player = GetAngleToPlayer;

CreateShot01(GetEnemyX+50*cos(dir), GetEnemyY+50*sin(dir), 3, player, BLUE01, 0);
dir+=90/20;
wait(5);
}
dir = 46;
wait(127);
yield;
}

This one task spawns 20 bullets in a 90? arc and aims every bullet towards the enemy, but GetAngleToPlayer is never perfect, is it necessary to use an object bullet and atan2(etc) to direct bullets properly? what other ways are there to make this?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on February 17, 2015, 07:49:16 PM
So...

Code: [Select]
       let dir = 46;

loop {
loop(20) {
let player = GetAngleToPlayer;

CreateShot01(GetEnemyX+50*cos(dir), GetEnemyY+50*sin(dir), 3, player, BLUE01, 0);
dir+=90/20;
wait(5);
}
dir = 46;
wait(127);
yield;
}

This one task spawns 20 bullets in a 90? arc and aims every bullet towards the enemy, but GetAngleToPlayer is never perfect, is it necessary to use an object bullet and atan2(etc) to direct bullets properly? what other ways are there to make this?

Well, in ph3, it's very easy. :)

But in 0.12m, you will have to use atan, since the bullet is spawning at a location other than the boss.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BlazervaniaX on February 17, 2015, 08:09:31 PM
Okay so...

Code: [Select]
       task fire1 {
let dir = 46;

loop {
loop(20) {
bullet(GetEnemyX+50*cos(dir), GetEnemyY+50*sin(dir), 3, atan2(Obj_GetY(shot) - GetPlayerY, Obj_GetX(shot) - GetPlayerX), BLUE01, 0);
dir+=90/20;
wait(5);
}
dir = 46;
wait(127);
yield;
}
}

task bullet(x, y, v, dir, graphic, delay) {
let shot = Obj_Create(OBJ_SHOT);

Obj_SetPosition(shot, x, y);
Obj_SetSpeed(shot, v);
Obj_SetAngle(shot, dir);
ObjShot_SetGraphic(shot, graphic);
ObjShot_SetDelay(shot, delay);
ObjShot_SetBombResist(shot, true);

}

I'm not getting how to tidy up this...
Of course, this doesn't work because i'm calling "shot" object in a place it doesn't exist...
Should task bullet be inside task fire1?
I've tried 2 or 3 other methods i thought of but didn't work...
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on February 17, 2015, 10:32:47 PM
Okay so...

Code: [Select]
       task fire1 {
let dir = 46;

loop {
loop(20) {
bullet(GetEnemyX+50*cos(dir), GetEnemyY+50*sin(dir), 3, atan2(Obj_GetY(shot) - GetPlayerY, Obj_GetX(shot) - GetPlayerX), BLUE01, 0);
dir+=90/20;
wait(5);
}
dir = 46;
wait(127);
yield;
}
}

task bullet(x, y, v, dir, graphic, delay) {
let shot = Obj_Create(OBJ_SHOT);

Obj_SetPosition(shot, x, y);
Obj_SetSpeed(shot, v);
Obj_SetAngle(shot, dir);
ObjShot_SetGraphic(shot, graphic);
ObjShot_SetDelay(shot, delay);
ObjShot_SetBombResist(shot, true);

}

I'm not getting how to tidy up this...
Of course, this doesn't work because i'm calling "shot" object in a place it doesn't exist...
Should task bullet be inside task fire1?
I've tried 2 or 3 other methods i thought of but didn't work...
As far as I can see. You're trying to fire a "fan" of bullets which all aim on the player, right? If so:

 Just move atan2(Obj_GetY(shot) - GetPlayerY, Obj_GetX(shot) - GetPlayerX)  into the task bullet and set the angle.

dir = atan2(Obj_GetY(shot) - GetPlayerY, Obj_GetX(shot) - GetPlayerX);

Clean up tips: Also you can delete the yield; after  wait(127) and just turn that into wait(128). Dual yields are redundant (I know they appear in my tutorials but later on I discovered they are actually bad. Because technically (wait) is also a yield on itself. As in wait(1) is same as just yield;
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BlazervaniaX on February 17, 2015, 10:55:26 PM
Yes, the bullets spawn in a 90? fan from right to left, and each one aims to the player independantly.

And, if i got right what you said, it should be something like this...

Code: [Select]
task fire1 {
let dir = 46;

loop {
loop(20) {
bullet(GetEnemyX+50*cos(dir), GetEnemyY+50*sin(dir), 3,  BLUE01, 0);
dir+=90/20;
wait(5);
}
dir = 46;
wait(127);
yield;
}
}

task bullet(x, y, v, graphic, delay) {
let shot = Obj_Create(OBJ_SHOT);
let dir = atan2(Obj_GetY(shot) - GetPlayerY, Obj_GetX(shot) - GetPlayerX);

Obj_SetPosition(shot, x, y);
Obj_SetSpeed(shot, v);
Obj_SetAngle(shot, dir);
ObjShot_SetGraphic(shot, graphic);
ObjShot_SetDelay(shot, delay);
ObjShot_SetBombResist(shot, true);

}

Or this...

Code: [Select]
task fire1 {
let dir = 46;

loop {
loop(20) {
bullet(GetEnemyX+50*cos(dir), GetEnemyY+50*sin(dir), 3,  BLUE01, 0);
dir+=90/20;
wait(5);
}
dir = 46;
wait(127);
yield;
}
}

task bullet(x, y, v, graphic, delay) {
let shot = Obj_Create(OBJ_SHOT);

Obj_SetPosition(shot, x, y);
Obj_SetSpeed(shot, v);
Obj_SetAngle(shot, atan2(Obj_GetY(shot) - GetPlayerY, Obj_GetX(shot) - GetPlayerX));
ObjShot_SetGraphic(shot, graphic);
ObjShot_SetDelay(shot, delay);
ObjShot_SetBombResist(shot, true);

}

However, the latter one aims at exactly 180? away from the player :V The former... meh
There's something i'm missing...
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on February 17, 2015, 11:13:15 PM
The second is more correct because by the time you call Obj_GetX/Y the object's position is actually set. In the first it isn't so it'll mess up. In both cases you could have just used your x and y parameters instead.

The reason it's backwards is because it's aiming from the player to the bullet, not the other way around. You want the destination coordinates minus the source coordinates.

You don't even need a separate function/task for all this, though. (Your second one should work if you flipped the coordinates though)

Code: [Select]
let dir = 46;
loop {
loop(20) {
let x = GetEnemyX+50*cos(dir);
let y = GetEnemyY+50*sin(dir);
CreateShot01(x, y, 3, atan2(GetPlayerY - y, GetPlayerX - x), BLUE01, 0);
dir+=90/20;
wait(5);
}
dir = 46;
wait(128);
}
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BlazervaniaX on February 17, 2015, 11:28:42 PM
And so, it finally works, thank you all :v

EDIT: That aside...

http://pastebin.com/uhQFWNyy

There's a lot of cleaning up to do, and i'll eventually do it, but i can't seem to figure out how to change between phases properly...

My idea is that when "phase" CommonData reaches 1, the boss stops all actions and gets to perform whatever needs to be done whenever "phase" reaches 1 and higher, etc...
But since all actions depend on an "if/else if/else" statement, i'm not sure where and how to make this happen.
What should be done?
All this is in the same spell card by the way...

EDIT2: I didn't clarify that the next phase is triggered succesfully... but not inmediately after "phase" reaches 1 :v
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Electroll on July 16, 2015, 05:17:21 PM
After downloading Danmakufu 0.12m and following the instructions on how to access it using Applocale, this occurs.
http://prntscr.com/7tg33h
Help please? How do I open the Danmakufu program??
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 17, 2015, 08:05:44 AM
Hmmm, we're going to need some more information. What steps did you exactly undertake.

Did you also configure AppLocal to make the exe run with Japanese local?


Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Electroll on July 17, 2015, 10:36:57 AM
I got the instructions from this thread > https://www.shrinemaiden.org/forum/index.php?topic=6181.0
and this is the step I followed.
Danmakufu is a Japanese application and you probably can't run it correctly as-is; to get around this, you'll want to run it with AppLocale. Once you've got AppLocale, choose the th_dnh.exe file, choose to run it with Japanese settings (it's the very bottom choice in the drop-down box), and you're good to go. You can even choose to make a permanent shortcut for running Danmakufu with AppLocale. As for config.exe, you can get that to run just by putting it in Windows 2000 compatibility mode.
And I don't quite understand about the part where I need to configure Applocale. However, I'm able to access to Mystical Power Plant using Applocale
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on July 18, 2015, 07:20:09 AM
Keep in mind that Mystical Power Plant is a Ph3 script and not 0.12m.

To be honest I am out of ideas why you're crashing. The applocal thing is also described here: https://www.shrinemaiden.org/forum/index.php?topic=4138.0
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Uruwi on July 18, 2015, 07:19:00 PM
I think you need to extract the zip in Japanese locale as some files have Japanese filenames.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Electroll on July 19, 2015, 07:32:40 AM
I'm able to access to Danmakufu 0.12m after running the application, th_dnh as administrator
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Lunatic_Reimu on July 30, 2015, 01:36:58 PM
Hello,
I've been trying to run this script in 0.12m called Fantom Fantasm. For some reason the bgm isn't playing, and worst of all my character and the enemy sprites don't show up! The bullets and the bosses do however, and shot sound effects are there :/ My character also pops up during the bosses, but then vanishes again for the stage! I've run plenty of other danmakufu scripts with AppLocal without a problem. In case it makes a difference, my Touhou 6 EoSD does the same thing with the sprites not showing up (making it unplayable on this laptop). Im using Windows XP. Thanks for any help  :]

EDIT: My bgm issue was solved on this topic: https://www.shrinemaiden.org/forum/index.php/topic,18771.0.html
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Nolegs the Cat on August 25, 2015, 02:48:08 AM
So.
I got TLC and 0.12m running, that's great!  :P

How do you unlock stages for practice =_=
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on August 25, 2015, 12:35:02 PM
So.
I got TLC and 0.12m running, that's great!  :P

How do you unlock stages for practice =_=
Hello Nolegs the cat, your question is specifically about the game content / game play of a fan made game. Your best choice is to post this at Eirin's section.  :D

This thread is designed for Danmakufu issues related to creating games with the 0.12m engine.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: ikaros on December 31, 2015, 04:00:19 PM
Hi, I'm new, I tried to use CutIn with own image, it didn't appear. Does it have to be specific size? I used .png as tutorial told me. And why people are talking about AppLocale? I got it working without it on Win7. When I tried to use it, Danmakufu crashed. Thanks in advance.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: BobTheTanuki on December 31, 2015, 06:26:07 PM
Hi, I'm new, I tried to use CutIn with own image, it didn't appear. Does it have to be specific size? I used .png as tutorial told me. And why people are talking about AppLocale? I got it working without it on Win7. When I tried to use it, Danmakufu crashed. Thanks in advance.

You should check the path to the image :u
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Electroll on January 06, 2016, 03:40:07 PM
Hi, whenever I start danmakufu, the game will start at a very fast pace. As such, I am unable to play the game properly. Help please?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Drake on January 07, 2016, 07:59:56 AM
This can happen when there are no frame limits on the game. Vsync is one such limit, modern Windows' desktop window manager is another, so having no vsync enabled from your graphics card and playing in fullscreen can cause this.

Download the vsync patch and follow the instructions. Basically grab vpatch.exe, vpatch.ini and vpatch_th_dnh.dll from the rev4 folder and put it into your game folder, and run vpatch.exe.
https://mega.nz/#!w8NBxTxC!dt4Yg8Ci-I5sbAbu56SB2v9Zmjdp6zq23lG_EVsblzc

If it complains about UPX compression, download this th_dnh.exe and replace your current one.
https://mega.nz/#!dh8QgAyQ!BzuU-iW6LZ8i_InSAV_ccukzkK3HCeasYctnAOIflNo
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on January 07, 2016, 02:18:48 PM
I should add that to the FAQ imo. Will work it tonight.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Electroll on January 25, 2016, 05:51:39 AM
Hello, whenever I start Embodiment of Scarlet Hair, the game crashes. However, I'm able to play other games perfectly fine. Help please?
The download link I got for that game can be found in the description of this video --> https://www.youtube.com/watch?v=ixO1sF3HBG0
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Sparen on January 25, 2016, 03:48:21 PM
Hello, whenever I start Embodiment of Scarlet Hair, the game crashes. However, I'm able to play other games perfectly fine. Help please?
The download link I got for that game can be found in the description of this video --> https://www.youtube.com/watch?v=ixO1sF3HBG0

Are you using AppLocale? Also, did you unzip the file in Japanese Locale? If not, you may have broken filenames.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Electroll on January 25, 2016, 04:34:26 PM
I unzipped the folder and changed name from the weird symbols to Macdonald. I then placed it into the script folder in danmakufu 0.12m and tried using Applocale on th_dnh.exe and vpatch.exe and.....it didnt work. There is this ???_??.txt folder in the Macdonald folder which Im thinking is the root of the problem(?)
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on January 26, 2016, 11:46:07 AM
You shouldn't rename anything or alter the files. As Sparen mentioned, you need to handle the zip with Japanese character support. If you don't know what any of this means, please google for unzipping in Japanese local or handling files with JP characters. It is bit difficult to explain it all here since partially it is OS dependant as well.

When you get errors during unzipping, it means you need to unzip it with Japanese Locale support (think 7zip does this?)

If you managed to unzip, run 0.12m with AppLocale > Japanese. In the FAQ/tutorials it is shown how to do this.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: ExPorygon on January 26, 2016, 06:36:09 PM
I think I should mention now that Applocale as far as I have tried it does not work on Windows 10 systems. Because of that, I have been using an alternative called Locale Emulator which seems to have all of the functionality of Applocale plus more.

Perhaps adding that to the FAQ would be a good idea, as Applocale seems to be dying off with the advent of Windows 10.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on January 26, 2016, 10:09:49 PM
I think I should mention now that Applocale as far as I have tried it does not work on Windows 10 systems. Because of that, I have been using an alternative called Locale Emulator which seems to have all of the functionality of Applocale plus more.

Perhaps adding that to the FAQ would be a good idea, as Applocale seems to be dying off with the advent of Windows 10.
That is perhaps a good thing to add to the FAQ.

What was the last OS that worked? 8.1?
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: ExPorygon on January 30, 2016, 04:40:09 AM
That is perhaps a good thing to add to the FAQ.

What was the last OS that worked? 8.1?
That was the last one that worked for me, but I'm not even sure that it always worked even on that version.
Title: Re: ※ Q&A/Problem Thread 7 ※ for Danmakufu version 0.12m
Post by: Helepolis on April 26, 2016, 06:18:24 PM
Thread has been closed. Please read the important notice here in the new general Q&A thread for danmakufu (https://www.shrinemaiden.org/forum/index.php/topic,19249.msg1234129.html#msg1234129)