I have tried to do something new that I have not tried before: creating an enemy script inside of a boss script.
However, I have encountered a major flaw. When either the main boss or the sub-bosses' are attacked to the point where their health bars are depleted, or even when time runs out, Danmakufu crashes. I look through my script, but I see nothing wrong.
#TouhouDanmakufu
#Title[Clones]
#Text[Test script]
#Player[FREE]
#BGM[none]
#ScriptVersion[2]
script_enemy_main {
let ImgBoss = "script\img\ExRumia.png";
let count = 0;
@Initialize {
SetLife(2000);
SetTimer(60);
SetScore(10000000);
SetEnemyMarker(true);
CreateEnemyFromScript("Rumia2",GetClipMinX-50,GetClipMinY+180,0,0,0);
CreateEnemyFromScript("Rumia3",GetClipMaxX+50,GetClipMinY+180,0,0,0);
SetMovePosition01(GetCenterX, GetClipMinY + 120, 5);
CutIn(YOUMU, "Test Sign"\""Text"\", "", 0, 0, 0, 0);
LoadGraphic(ImgBoss);
SetTexture(ImgBoss);
SetGraphicRect(0, 0, 64, 64);
}
@MainLoop {
SetCollisionA(GetX, GetY, 32);
SetCollisionB(GetX, GetY, 16);
if(count == 60) {
count=0
}
count++;
}
@DrawLoop {
DrawGraphic(GetX, GetY);
}
@Finalize {
DeleteGraphic(ImgBoss);
}
}
script_enemy Rumia2
{
let ImgBoss2 = "script\img\ExRumia.png";
let count2 = 0;
@Initialize
{
SetLife(2000);
SetDamageRateEx(0,0,100,25);
LoadGraphic(ImgBoss2);
SetTexture(ImgBoss2);
SetGraphicRect(0, 0, 64, 64);
}
@MainLoop
{
SetCollisionA(GetX, GetY, 32);
SetCollisionB(GetX, GetY, 16);
if(count2 == 90){
SetMovePosition03(GetCenterX + 50, GetClipMinY + 150, 20, 5);
}
count2++;
}
@DrawLoop {
DrawGraphic(GetX, GetY);
}
@Finalize {
DeleteGraphic(ImgBoss2);
}
}
script_enemy Rumia3
{
let ImgBoss3 = "script\img\ExRumia.png";
let count3 = 0;
@Initialize
{
SetLife(2000);
SetDamageRateEx(0,0,100,25);
LoadGraphic(ImgBoss3);
SetTexture(ImgBoss3);
SetGraphicRect(0, 0, 64, 64);
}
@MainLoop
{
SetCollisionA(GetX, GetY, 32);
SetCollisionB(GetX, GetY, 16);
if(count3 == 90){
SetMovePosition03(GetCenterX - 50, GetClipMinY + 150, 20, 5);
}
count3++;
}
@DrawLoop {
DrawGraphic(GetX, GetY);
}
@Finalize {
DeleteGraphic(ImgBoss3);
}
}
What could be the possible issue here? Do I need to somehow state that the sub-bosses are erased from the script at the end of the spellcard? If so, how would I do that?