I now have ANOTHER issue with effect objects. Given that I've done this so many times already, it's probably a stupid error somewhere. However, after the red master spark which used graphics from a completely different folder, I'm starting to question what's going on.
task thunderorb(angle, xcor, ycor){
let thorb = Obj_Create(OBJ_EFFECT);
let origangle = angle;
let thorbx = xcor;
let thorby = ycor;
let orbcount = 0;
let shots = GetCurrentScriptDirectory~"shots.png";
Obj_SetPosition(thorb,thorbx,thorby);
Obj_SetSpeed(thorb,0);
ObjEffect_SetTexture(thorb, shots);
ObjEffect_SetRenderState(thorb, ADD);
ObjEffect_CreateVertex(thorb,4);
ObjEffect_SetPrimitiveType(thorb,PRIMITIVE_TRIANGLEFAN);
ObjEffect_SetVertexUV(thorb,0,99,8);
ObjEffect_SetVertexUV(thorb,1,143,8);
ObjEffect_SetVertexUV(thorb,2,143,52);
ObjEffect_SetVertexUV(thorb,3,99,52);
ObjEffect_SetVertexXY(thorb,0,-22,-22);
ObjEffect_SetVertexXY(thorb,1,22,-22);
ObjEffect_SetVertexXY(thorb,2,22,22);
ObjEffect_SetVertexXY(thorb,3,-22,22);
ascent(i in 0..4){ObjEffect_SetVertexColor(thorb, i, 255, 255, 255, 255);}
while(!Obj_BeDeleted(thorb)){
thorbx = GetPlayerX+45*cos(angle+orbcount);
thorby = GetPlayerY+45*sin(angle+orbcount);
Obj_SetPosition(thorb,thorbx,thorby);
SetCollisionB(GetX, GetY, 24); //I don't know if this is how to do it.
//etc.
orbcount++;
yield;
}
}
Basically, there are eight orbs rotating around the boss. Problem: The graphics don't load.
if(count == 20){
loop(8){
thunderorb(angle, GetX+45*cos(angle), GetY+45*sin(angle));
angle+=45;
}
PlaySE(bullet);
}
I call it with this. However, the SFX plays, so that means that the objects were indeed created. That's why I'm so confused.
Any and all help will be greatly appreciated.