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:
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.
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.
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.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.
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.
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.
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? 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.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;
}
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.I did.
Thanks all for the suggestions.What do you mean? If you mean 180 degrees away from the
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 boss, why not just either:It's aiming 180 degrees away from the player.
- put +180 degrees to the atan value in obj_setangle.
- switch the getplayercoordinate functions and Obj_getcoordinate functions around in the atan function.
Obj_SetAngle(obj,atan2(Obj_GetY(obj) - GetPlayerY, Obj_GetX(obj) - GetPlayerX)-180);
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: 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);}
}
How do I make custom STG Frames?
Like CtC's STG Frame.
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
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 (http://pastebin.com/GXvLUa0B)Oops, thank you! C:
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
I knew what the error meant, and I checked it over but could'nt find where the extra bracket wasIs 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.
@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;
}
Ah, you have to use SetShotKillTime for that (if I am not mistaken)~
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
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.
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.loop(20){
Loops the code inside 20 times, before moving on.loop{
This makes the loop infinite and it will never move on unless the script has ended.
So this delay variable should be equal to something like spawning time+some extra time?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.
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.
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.
}
}
task fire {
loop(10) {
CreateShot01(etc...);
}
}
task fire {
loop(10) {
CreateShot01(etc...);
wait(10);
}
}
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
}}
}}
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~
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
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.
I am using AppLocale and I made sure the settings match those in the AppLocale configuration thread.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?
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.
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
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.
loop{
loop(number){
}
}
andloop{
while(x<number){
}
}
?*text*1. The first one just repeats the action inside the brackets the number of times defined as "number".
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.
}
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.
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.
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.
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.
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.
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.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.I'm working in a little script, but the Event won't load.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?
http://pastebin.com/wFkR8bjV (http://pastebin.com/wFkR8bjV)
What's wrong?
yes, my script features Keanu Reeves :V
http://pastebin.com/wRRz0Ls6 (http://pastebin.com/wRRz0Ls6)
I think there's something wrong but I can't figure out what.
#include_script "script\Yamamotos\talk.txt"
@Initialize {
CreateEventFromScript("test");
}
Missing a config.dat file. Just run config.exe and hit OK. Should be good after that.
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.
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++;
}
}
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.
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.
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.
@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.
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.
@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]
}
}
// [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;";
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.
http://pastebin.com/4WpfY1vjOk where are your images located for the event. Inside scripts folder? Or your own personal folder i.e: scriptsInfinitewave
Here's your edit.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:
pastebin blehblehbleh (http://pastebin.com/AZjCR5WY)
let CSD = GetCurrentScriptDirectory; plz
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.At least I tried to do something :VAnd by that, we keep on learning :)
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.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 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.
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.Thanks, let me look into this because I am really confused about it all.
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.
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.
How do I animate bosses?Helopolis has a video tutorial on YouTube of how to c:
I haven't found any tutorial yet.
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)
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.
let dir = 0;
let r = <radius>
SetX(GetEnemyX+r*cos(dir));
SetY(GetEnemyY+r*sin(dir));
dir++; // or dir+=2; for faster speed etc
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.
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.Go back to the directory thing immediately? Not sure what you mean here.
I need it for a menu I'm making.
:)
Go back to the directory thing immediately? Not sure what you mean here.Go right to the folder where the spell/nonspell was in. Isn't there an end for stages too? Or Clear;?There is only 'End' for spell cards available.Edit: End is only for player bombs I noticed.
You're trying to make a menu?I saw a tutorial and it worked in a spellcard, It's not how I make a menu? oh :(
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.
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.I know how to use keypush and objeffect, I already used keypush somewhere in the menu.
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.
>some text<:3
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'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?
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.
The menu script?Whoops didn't see that :derp: Thanks! This will help C:
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.
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:I like to brainstorm before falling asleep. Picturing the danmaku makes it so much easier.
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 can't find the error, but ...Oh I forgot to put that on a seperate line, that's supposed to be there I think.
DeleteGraphic(bg);
}}
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.Really? But Non-Spells don't have score bonuses. :C
Also, you're on LOCAA. There are tons of people you can ask if you need immediate attention.
I think you need Effect Objects to make an attack like Kagome Kagome.Cheeto Lasers, to me, looks like just a large amount of round bullets. Kind of like Seiga's rows of bullets.
And Cheeto Lasers weren't the same as Curvy Lazarz? :getdown:
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.
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): 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.Obj_SetCollisionToObject(ID1,true);
Obj_SetCollisionToObject(ID2,true);
In each respective obj bullet task. 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!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))
An attempt was made to use a variable that once do not even assignment (line 2660)
let objarr = objarr~[ID1];
Why are you using let?Code: [Select]let objarr = objarr~[ID1];
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.
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.
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.
Anyone know how I would make a web of lasers like what Remilia and Eirin do?CreateLaserA.
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?
How are backgrounds made in nonspells?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.
@BackGround only works in spellcards, and #Background didn't work in my script.
loop{
let tiltAngle = angle+45*sin(count*freq);
<Bullet Code>
count++;
yield;
}
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.
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++;
}
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++;
}
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);
1. Sometimes the wrong set of lasers disappears (and I don't know why).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.
2. There will probably be a problem if the player faces to the right because of angles.
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.
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);
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]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.
One goes 22.5 degrees, and one goes 67.5 degrees. Approximately.
How do I omit it?
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.
//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);
}
How to make laser move vertical with laserA?
if Using that is impossible laserA, then how?
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);
}
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.
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.
The most reliable method is just to know what the enemy's life was the previous frame, and compare to what it is now.I need it for the damage sound effect for when the boss is almost dead.
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.
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.
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.
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);
}
}
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.
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);
}
}
}
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 problem is that the bullets fired on the right side will curve upwards instead of towards the player.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)
Is there anyway to change this so that they will curve the right way?
http://pastebin.com/Z2SEMN5E (http://pastebin.com/Z2SEMN5E)
function amod(a){ return (a+360)%360; }
So I'm trying to make a player script but when I bomb it crashes at the end. D:? The pause is part of the Cutin function, so if you're using it, stop.
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?
function ObjEffect_SetAlpha(obj, a){
ascent(i in 0..4){ ObjEffect_SetVertexColor(obj, i, a, 255, 255, 255); }
}
//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);
"A"~ToString(ToString(2)[0])~"B"
This looks really silly, so I think there has to be a better solution, right? :ohdear:
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:
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)function itoa(i){
let a = ToString(i);
return a[0..length(a)-7];
}
Wait how did you do that
if(frame==50){
VanishEnemy;
}
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);
}
}
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.
The problem is that you're calling a task inside "Initialize". I don't think you can do that.
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
@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; }
#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:#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.
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;
}
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)
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?
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?
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.
//#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"
So, I saw something about the include function above, and that reminds me that I wanted to ask what exactly it does...Everything?
Or more specific, what can be done with it, what to write in a to be included script etc..
(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?
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;
}
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
}
I'm making a Player Script, and I want to make a bomb like Reimu's Fantasy Seal.Perhaps gauging your knowledge. How far are you experienced and known with the following:
How do I make them?
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.
let Background_Array1 = [10,99,120,900];
@Main Loop
Background_Array1[0]++; //Increase the first value in the array by 1 every frame.
Is it possible to make like ~50 variables at once?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.
I am trying to make my first 3D background, and I need about fifty random places for background elements to spawn.
How do I make background effects like the falling cherry petals/maple leaves/snowflakes?
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.
How do I make background effects like the falling cherry petals/maple leaves/snowflakes?
@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.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.
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:
//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.
Quote from: DrakeNext 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
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
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.
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;
}
}
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?
useUm, that line is exactly equivalent to while(Obj_BeDeleted(obje)==false) {}. There's functionally no reason to use one over the other.
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.
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.
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);*Facepalm*
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?
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: let x = 0;
let y = 0;
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!
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.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?
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?
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.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.
This is probably a exe mod( more than likely).
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.
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?
script_enemy_main{
LoadGraphic()
@Initialize{}
LoadGraphic()
@MainLoop{}
LoadGraphic()
function{}
LoadGraphic()
task{}
LoadGraphic()
}
don't work,script_enemy_main{
@Initialize{LoadGraphic()}
@MainLoop{LoadGraphic()}
function{LoadGraphic()}
task{LoadGraphic()}
}
willHow 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.
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.if(GetEnemyX==GetPlayerX && GetEnemyY==GetPlayerY){/*stuff*/}
It will never trigger.
Just what I needed. Thank you very much!Code: [Select]if(((|GetX-GetPlayerX|)^2+(|GetY-GetPlayerY|)^2)^0.5 < 60){
This code will only run if the distance between the enemy and the player is 60 pixels or less.
//Stuff
}
Never use this code:I feel stupid right now :VCode: [Select]if(GetEnemyX==GetPlayerX && GetEnemyY==GetPlayerY){/*stuff*/}
It will never trigger.
I feel stupid right now :V
Main menu. (http://www.shrinemaiden.org/forum/index.php/topic,9281.msg618739.html#msg618739)don't understand :V
chaining stages. (http://www.shrinemaiden.org/forum/index.php/topic,14911.msg1012709.html#msg1012709)
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?
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.)
}
}
@MainLoop{
if(GetEventStep==1){ makethebossmove;}
yield;
}
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?
http://www.shrinemaiden.org/forum/index.php/topic,5164.msg440550.html#msg440550I 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.
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.Ok, and I hve another related question: How do I use VanishEnemy; without running Finalize?
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?
Silly question. How do I make bullets that 'explode' into more bullets?
Like some of Miko's nonspells.
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.
Uhm..another silly question c: there are patterns i can't create without sin,cos? if there are give me please an example :1
Uhm..another silly question c: there are patterns i can't create without sin,cos? if there are give me please an example :1Why 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.
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: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.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)1. What graphical glitch
My question is how does Danmakufu figure out how much score to subtract per second?
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 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.
//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.)//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) );
Is there a tutorial on how to write full game scripts?
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?
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....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
How do you use SetFog?Could you perhaps show us some code? We cannot judge what you're trying to do without showing your code.
Every time I use it, I get a white out of my BG's
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
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:
The way I've used it is: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
SetFog (90, 180, 255, 255, 255);
And I always get a white out
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.
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.
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.
This is wrong information. Who told you that?
The Code I was using is: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)
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?
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 speedSetShotAutoDeleteClip 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.
The Problem now is how im able to let the bullets come back as a different bullet. and maintain a constant turn speed
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".
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
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.
}
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.
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?
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;
}
}
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.
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.
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;
}
}
loop(n){yield;}
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_XAh, 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.
SetMovePositionRandom01 Let it move at random in the bounding box.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.
7 Parameters
1) x-distance
2) y-distance
3) velocity
4) left bound
5) top bound
6) right bound
7) bottom bound
task mainTask{
wait(60);
move;
}
task move{
loop{
SetMovePositionRandom01(80,80,20,100,150,350,200);
wait(60);
fire;
wait(120);
}
}
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:
3 questions: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.
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?
ascent(i in 0..90){
AddShot(30, 1, 2, i);
}
This should make the bullets appear at length i of the laser.
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.
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. 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.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;
}
ExplanationBecause 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.
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;
}
}
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
Can stages call other stages? (Recursion of sorts?)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.
Can stages use arrays for other stages?
@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);
}
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
Sparen: Why damage rate and not just y'know not setting a hitbox.
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...
Hey is there a way to spawn a second player? ???If it's almost complete and you ask for a vital thing... never mind... this should of been asked a lot earlier.
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.
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.
but it could work.No it would not.
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.
#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
And I'm pretty sure you can't put a #BGM [] in a plural scriptActually, you can do that and I think it works most of the time.
Do you want to have bullets spawn other bullets? Or something else completely?
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.
they dont curve they just go straight upI 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.
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)
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.
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)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.
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.
task cage{
loop{
left(GetCenterX+185,GetClipMaxY,6,270);
yield; or loop(some number){ yield;} (wait function)
}
}
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
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 thereIsn't it easier just to look at the error message, ctrl+c, and paste it inside google translate?That is what I also sometimes do if I get a message without any function/var :D
That usually gives some english text that is comprehensible enough to understand. Or at least, that's my opinion anyway.
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.
while(!Obj_BeDeleted(obj)){yield;}
And on the tutorial here or wiki it usedwhile(Obj_BeDeleted(obj)==false) {yield;}
To detect if the bullet still exist[CreateShotA(parameters);
SetShotDataA(1,0,//bullet goes right parameters);
And addingSetShotData(!1,60, //same parameters);
Will make the object reverse and go left after 60 frames?//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"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 fieldtask 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);
}
}
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.
Here :derp:You never declared and/or loaded b1 and b2.png as far as I can see.
http://pastebin.com/TkYFjMWv
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.
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.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?
/me shrugs
The code is also extremely messy for me to detect the mistake. Anybody a clue?
CreateAnimation("boss", "Standing",2);
SetAnimationFrame("boss", "Standing",0, b1, 2, 0, 0, 27, 33);
SetAnimationFrame("boss", "Standing",1,b2, 2, 0, 0, 26, 34);
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
task pattern {
while(GetTimer >= 45) {
stuff;
yield;
}
while(GetTimer < 45) {
more stuff;
yield;
}
}
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
@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?
/* 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!In case you switch to notepad++, I believe there was a syntax highlighter in the information thread for Danmakufu.
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.
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 :т
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!Excellent choice, it's what I use as well.
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.
#include_function ".\function_cutin.txt";
which i did, afterwardsscript_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 cutin1. 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)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.
Soooo the spell works , but There just no cutin
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
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.Oalso #include_function = CSD ~ ".\function_cutin.txt"; is certainly not #include_function ".\function_cutin.txt";
well heres the codeYeah, try something like that. That will make them more spaced out from the bullet that they're spawning from. Just don't overdo it.Code: [Select]if(time==5){
sooo i just make it like Obj_GetX(obj)+rand,Obj_GetY(obj)+rand? o.O
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;
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.OFor 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.
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.
Hi!I have a questioon! :V There is a way to expand\shrink\shake screen? :V
Hi!I have a questioon! :V There is a way to expand\shrink\shake screen? :VExpand/Shrink > Doesn't exist.
Is the way coding the same as v0.12 in ph3?I started ph3 yesterday. And the differences were frightening at first.
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 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
Although How does one fully understand 0.12? o.OMake 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.
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.Thing is, all of those can still be learned in ph3 (and are more streamlined than in 0.12m).
Also, master object effects.
I can create a bossI 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.
I can make it fire
I can make a plural script
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.
-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.
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?)
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 yet1. 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.
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.
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.
//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.(because I like ascent loops, that's why)
Or, you could use the animation library function which pretty much makes this process easier.
thanks for the animation help but uhhh two questions.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 ???
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
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.
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".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
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.Let me see if i understand this
For example, the ascent loopCode: [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 ^^.
ascent(anim in 0.."amount of sprites in the animation"){
Let me see if i understand thisIt runs the statement
so, using what you posted as an exampleCode: [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 ???
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.ascent(i in -3..4)
with bullets to shoot a bullet wave/wall.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.
ShotData{
id=1
rect=(0, 16, 0, 16)
}
and then when you shoot it that number is used instead of RED01 or whatever.
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?
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 likeBy "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 stuffCode: [Select]ShotData{
and then when you shoot it that number is used instead of RED01 or whatever.
id=1
rect=(0, 16, 0, 16)
}
//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).
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.
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?hmmm maybe ill have to test it out to be sureLunarith, I seriously though have to point out my previous post again:
but can anyone help me with scrolling my backgrounds
using this code as an exampleCode: [Select]SetTexture(lay);
can anyone tell me which of these codes control the direction its going?
SetRenderState(ADD);
SetGraphicRect(0,0,20000,20000);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
DrawGraphic(GetCenterX+slide,GetCenterY+slide);
slide+=2;
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
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.
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 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 thisObviously 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.
This andThis contradict:objection!: Well I did say "watch me get this completely wrong" didn't I? BV
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)
So you said change a variable , hmmm...... you mean like this?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).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;
@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);
}
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. 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.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]and by the way i guess i got confused because it always though that you NEED to put a slide on both parametersIf 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.
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.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)
}
// 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))
}
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)
}
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.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.
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.
This might be a bit sketchy but it works.
Yeah your right its sketchy but hey i wont complain ^^I really hope this is not the error:
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
SetGraphicRect(more more stuff)
which should be:SetGraphicRect(more more stuff);
Since you aren't showing the "real" code for those graphic rects, it's hard to tell.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. 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;
and by turn it to false again do you mean this?
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.
}}
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
Contest ??? WatHe wants to know if you can run Victini's RaNGE contest 10 entry without lag.
i think ascent(n in 0..470) is spawning them.
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?
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().
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?
Okey so this is just a point me towards questionThere is no specific tutorial for this indeed, though concentration effects are part of Effect Objects which is again a part of Objects in danmakufu.
(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?
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. -_-
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?
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 |));
}
SetShotDirectionType(PLAYER);
SetShotDataA(1,90,2,0,0,0,0,12);
SetShotDirectionType(ABSOLUTE);
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.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
CreateEnemyFromFile(GetCurrentScriptDirectory~"enemies/blue fairy.txt",GetCenterX,GetCenterY,0,0,0);
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 inCode: [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.Yea, @DrawLoop has too many. Line 78 or 80 one needs to go.
Also, test the enemy on its own to see where the problem is.
Also it's @BackGround, not @Background
//////////////////////////////////////////
///////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;
}
}
//////////////////////////////////////////
///////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);}
if(f2 == 60){
f2 = 0;
}
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. 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). 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?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.)
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?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.
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
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.
@ 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)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.
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).
Using SetCollisionB()
Time to check your drivers for your GPU.
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
forgot to yield; the firing task
yield;
frame++;
spin+=2;
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???
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.Thanks for the help :D
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.
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.
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.
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?Since you said you need to rush it, you need to minimum understand the following fundamentals.
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:
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...
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?
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)
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 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.
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.
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.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.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.
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.)
The big problem is the intangibility; homing shots will still home on the boss. Ideally, they won't home on.)
let bg = CSD ~ "background.png";
Loaded the graphic hereLoadGraphic(bg);
and heres my background codeSetTexture(bg);
SetGraphicRect(0,0,600,375);
SetAlpha(255);
SetGraphicAngle(180,0,0);
SetGraphicScale(1,1);
DrawGraphic(GetCenterX,GetCenterY);
I even followed the drawing order1) 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 scriptSetTexture(bg1);
SetGraphicRect(0,0,384,448);
SetAlpha(250);
SetGraphicScale(1,1);
DrawGraphic(GetCenterX,GetCenterY);
No errors or anything just ....no background :XIn 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 taskQuite. It seems that it has to do with the @ symbol being stated.
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.
using a Data Extractor to edit the 0.12m images
modify the sprites not the actual text
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.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.
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).
yeah because recoding his entire project in such a short amount of time sounds totally doable rite
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.
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.Hey, you can't give me that, I'm learning PH3. I'm just saying,.
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. ._.
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?
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.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.
Its just that simple...
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.
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.
Meh. People are people. It's not really your fault in any way.
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.
SetMovePosition01(GetClipMaxX+400,GetCenterY,7);
this is far enough for them to despawn right?task enemydeletion(){
loop{
if( GetX>(GetClipMaxX+100) || GetX<(GetClipMinX-100) || GetY>(GetClipMaxY+100) || GetY<(GetClipMinY-100) ){
VanishEnemy;
}
yield;
}}
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).
if( (|GetX - 224|) - 224 > 100 || (|GetY - 240|) - 240 > 100 )
not that it matters
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.
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
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
@DrawLoop{
SetViewTo(0,0,0);
SetViewFrom(200,90,45);
SetTexture(background);
SetGraphicRect(0,0,511,511);
SetGraphicAngle(45,0,0);
DrawGraphic3D(GetCenterX(),GetCenterY(),0);
}
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)
Yes, and to mirror the sprite you can use SetGraphicAngle(0,180,0); (flipped horizontally)
Hi, I was wondering on the following things:1 - You can use effect objects and pre-drawn boss names (which ZUN also usually does) to spawn/despawn that.
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.
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.
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.
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?
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
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
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
Define 'hard'. It is a matter of knowledge, let us ask the question different, have you made any stages yet?
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.
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;
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.
@BackGround{
if(stageLook == 1) {
// drawing code for stage 1
}
if(stageLook == 2) {
// drawing code for stage 2
}
}
This is only possible if you make your own spell system which can be a pain in the rear-end.
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!
<code>Oh... I can use CommonData with this! Thanks~
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?
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 .
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?
Well.... Is it possible to create a non-installed Object laser?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.
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?
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?
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.
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.
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.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
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.
let bulletObj = (ry
task otherBullet {
let obj = (ry
<stuff about obj>
while(!Obj_BeDeleted) {
if(collision code(ry
}
}
while(Obj_BeDeleted(obj) == false && reflect < 10){
ObjShot_Reflect(obj, 0);
reflect++;
yield;
}
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));}
}
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.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.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;
}
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");
}
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 lastThe 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
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?
OK, thanks for your Help!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.
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?
You can instead call the event from your final spell before anything actually starts.
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);
}
}
ascent(i in 0..length(Array)){
CreateShot01(GetEnemyX, GetEnemyY, 3, GetAngleToPlayer + Array[i], BLUE12, 10);
}
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.
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
Mind that if you changed the script after the replay has been made, expect to face desynch.
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.They can just be opened with notepad afaik. They don't use any encryption or anything last time I check their code.
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;
}
}
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 ]
@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...LoadUserShotData("shotdatapath"); for load the shot data and use the shot ID (set in the shot file) instead of the default shot's RED01 ?
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.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]<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.
Edit: for the enemy script problem, CDS is not defined in the script.
And enemy have no life (it die immediatly after being created)
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.
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.).
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.
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.).
Start frame
@Finalize start
loop:
@Finalize yield
task1 go, task1 yield, task2 go, task2 yield, ...
@Finalize go
end loop
@Finalize end
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.
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);
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; }
}
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.
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; }
}
If that's the case why don't you just use SetGraphicScale()?
I never tested this, I sort of expected you to play with it.
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.
@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++;
}
@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;
}
...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.
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?
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); }
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?
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;
}
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?
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);
}
Okay so...As far as I can see. You're trying to fire a "fan" of bullets which all aim on the player, right? If 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...
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);
}
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);
}
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);
}
So.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
I got TLC and 0.12m running, that's great! :P
How do you unlock stages for practice =_=
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.
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
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.That is perhaps a good thing to add to the FAQ.
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.That was the last one that worked for me, but I'm not even sure that it always worked even on that version.
What was the last OS that worked? 8.1?