I'll be posting here when I have questions regarding stage creation scripts in Danmakufu. Feel free to post your own, so we don't clutter the board with questions regarding the same topic.
Here's a relatively easy question to start us off. I'm making a stage, and none of the damn enemies will spawn. I have no idea what I've done wrong, but I know it's gonna be something simple like "lol you left out ; here".
Here's the Stage Script:
#?????e????[Stage]
#Title[Lala Stage]
#Text[Lalalala.]
#Image[]
#BackGround[User(.\PIC\black.png, 1, 1)]
#Player[FREE]
#ScriptVersion[2]
script_stage_main
{
let BlueEnemy = GetCurrentScriptDirectory~"PIC\BlueEnemy.txt";
let imgEnemy = GetCurrentScriptDirectory~"PIC\Fairy.png";
task StageTask{
function Wait(let frames){
loop(frames){yield;}
}
function WaitForZeroEnemy{
while(GetEnemyNum() != 0){yield;}
}
Wait(30);
CreateEnemyFromFile(GetCurrentScriptDirectory~"PIC\BlueEnemy.txt", 30, 120, 0, 0, 0);
CreateEnemyFromFile(GetCurrentScriptDirectory~"PIC\BlueEnemy.txt", 20, 120, 0, 0, 0);
CreateEnemyFromFile(GetCurrentScriptDirectory~"PIC\BlueEnemy.txt", 10, 120, 0, 0, 0);
CreateEnemyFromFile(GetCurrentScriptDirectory~"PIC\BlueEnemy.txt", 418, 120, 0, 0, 0);
CreateEnemyFromFile(GetCurrentScriptDirectory~"PIC\BlueEnemy.txt", 428, 120, 0, 0, 0);
CreateEnemyFromFile(GetCurrentScriptDirectory~"PIC\BlueEnemy.txt", 438, 120, 0, 0, 0);
WaitForZeroEnemy;
Wait(60);
Clear;
}
@Initialize()
{
LoadGraphic(imgEnemy);
StageTask;
}
@MainLoop()
{
yield;
}
@Finalize()
{
DeleteGraphic(imgEnemy);
}
}
And the enemy I'm trying to spawn, "BlueEnemy.txt", located in the PIC directory:
script_enemy_main
{
let imgEnemy = GetCurrentScriptDirectory~"Fairy.png";
let destroy = 1;
let drawcounter = 0;
let frame = 0;
let v = 0;
let angle = 0;
@Initialize{
Concentration01(10);
SetLife(14);
}
@Mainloop{
SetCollisionA(GetX, GetY, 16);
SetCollisionB(GetX, GetY, 8);
frame++;
if(frame%12==0){
loop(5){
loop(7){
CreateShot01(GetX, GetY, v, GetAngleToPlayer + angle, BLUE21, 0);
v+=0.7;
}
v = 1;
angle += 360/5;
}
angle = 0;
}
}
@Drawloop{
drawcounter++;
SetTexture(imgEnemy);
SetRenderState(ALPHA);
SetAlpha(255);
//Blue Fairy drawing information.
if(drawcounter%9==1 || drawcounter%9==2 || drawcounter%9==3){
if(GetSpeedX()==0){SetGraphicRect(0, 0, 31, 31);}
else if(GetSpeedX()>0){SetGraphicRect(160, 32, 191, 63);}
else if(GetSpeedX()<0){SetGraphicRect(0, 32, 31, 63);}
}
if(drawcounter%9==4 || drawcounter%9==5 || drawcounter%9==6){
if(GetSpeedX()==0){SetGraphicRect(32, 0, 63, 31);}
else if(GetSpeedX()>0){SetGraphicRect(192, 32, 223, 63);}
else if(GetSpeedX()<0){SetGraphicRect(32, 32, 63, 63);}
}
if(drawcounter%9==7 || drawcounter%9==8 || drawcounter%9==0){
if(GetSpeedX()==0){SetGraphicRect(64, 0, 95, 31);}
else if(GetSpeedX()>0){SetGraphicRect(224, 32, 255, 63);}
else if(GetSpeedX()<0){SetGraphicRect(64, 32, 63, 95);}
}
DrawGraphic(GetX, GetY);
}
@Finalize{
if(destroy==1){
loop(2){
CreateItem(ITEM_SCORE, GetX + rand(-20, 20), GetY + rand(-20, 20));
}
}
}
}
Doesn't spawn the enemy, Reimu_A won't even lock in on anything. I know the enemy doesn't move, I just want it to spawn at this point.