Every time I try to run this, I get some weird error message about tasks and subs or something. What's wrong?
#TouhouDanmakufu
#Title[test_06]
#Text[...]
#Player[FREE]
#ScriptVersion[2]
script_enemy_main{
let CSD = GetCurrentScriptDirectory;
let shotfx = CSD ~ "sfx\tan0.wav";
let shotfx2 = CSD ~ "sfx\shot3.wav";
let lasfx = CSD ~ "sfx\laser01.wav";
@Initialize{
LoadUserShotData(CSD ~"Data\supershot.txt");
SetLife(1900);
SetTimer(80);
SetScore(700000);
SetDamageRate(45,60);
LoadSE(shotfx);
LoadSE(shotfx2);
LoadSE(lasfx);
MagicCircle(false);
SetText("test_05");
SetPlayerInvincibility(9999);
SetMovePosition03(GetCenterX,GetCenterY,1,100);
test;
}
@MainLoop{
SetCollisionA(GetX,GetY,60);
SetCollisionB(GetX,GetY,16);
yield;
}
@DrawLoop{
yield;
}
@BackGround{
yield;
}
@Finalize{
DeleteSE(shotfx);
DeleteSE(shotfx2);
DeleteSE(lasfx);
yield;
}
function wait(w){
loop(w){yield;}
}
// In any given triangle, this function finds one side of a triangle using the angle opposite of it and the two sides that make that angle.
// It uses a derived form of the law of cosines.
function sidefinder(a, anglegiven, b){
return (a^2 + b^2 - 2 * a * b * cos(anglegiven)) ^ 0.5;
}
// In any given triangle, this function finds one angle of a triangle using the sides next to it, then the side opposite of it.
// It uses a derived form of the law of cosines.
function anglefinder(a, b, c){
return acos((-1 * (c ^ 2 - (a ^ 2 + b ^ 2))) / (2 * a * b));
}
task statlaser(x, y, angle, laslength, laswidth, graphic, delay){
let obj = Obj_Create(OBJ_LASER);
Obj_SetPosition(obj, x, y);
Obj_SetSpeed(obj, 0);
Obj_SetAngle(obj, angle);
ObjLaser_SetLength(obj, laslength);
ObjLaser_SetWidth(obj, laswidth);
ObjShot_SetGraphic(obj, graphic);
ObjLaser_SetSource(obj, false);
ObjShot_SetDelay(obj, delay);
ObjShot_ToItem(obj, true);
wait(360);
ObjShot_FadeDelete(obj);
}
task test{
wait(300);
testpattern;
}
task testpattern{
loop(
statlaser(GetCenterX, GetCenterY, 0, 30, 5, WHITE01, 0);
statlaser(GetCenterX, GetCenterY, 90, 40, 5, WHITE01, 0);
statlaser(GetCenterX+30, GetCenterY, anglefinder(30, sidefinder(30, 40, 90), 40) , sidefinder(30, 40, 90), 5, WHITE01, 0);
wait(599);
yield;
}
}
}