Hey, I'm trying my hand at devising player scripts and I'm trying to make a bomb that creates a green circle as an object spell around the player. After x frames, I want all of the bullets inside the circle (the spell doesn't delete them, but does give the player invincibility) to be counted, and then have the spell circle expand and deal damage enemies proportional to the number of bullets inside the circle at that moment.
I thought I could use GetEnemyShotCountEx for this, but whenever I try to store it in a variable or call it inside a function, danmakufu raises an error and I can't figure out why. I've double checked the function parameters, and tested the same line elsewhere in the script. Am I doing something wrong? And it GetEnemyShotCountEx doesnt work, is there another way for my idea to work? Here's the while loop inside of the object spell task:
while(!Obj_BeDeleted(obj)) {
ObjEffect_SetScale(obj,scale,scale);
Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),96*scale,1,false);
if(count<=240) { scale+=0.005 }
if(count>240) {
scale+=0.05
ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),96*scale,2*GetEnemyShotCountEx(GetPlayerX, GetPlayerY, 96*scale, ALL),true);
}
if(count==300) { Slow(0); Obj_Delete(obj); }
count++;
yield;
}
Thanks in advance.