~Hakurei Shrine~ > Rika and Nitori's Garage Experiments
※ Danmakufu Q&A/Problem thread 3 ※
BananaCupcakey:
Thanks for the suggestions, it's working well so far.
And yes I eat codes sometimes mostly for testing but I can't get this working correctly
task BExplode(obj){
wait(50);
let angle = rand(0,360);
loop(15){
if(Obj_IsDeleted(obj)){return;}
ascent(i in -1..4){
ascent(j in 0..3){
let objB = CreateShotA1(ObjMove_GetX(obj), ObjMove_GetY(obj), 3 - j/6, angle + i*3, 320, 5);
Gravity(objB);
}
}
ObjShot_SetDeleteFrame(obj, 5);
angle += 360/15;
}
}
task Gravity(objB){
wait(50);
Choosing(objB);
}
task Choosing(objB){
alternative(rand_int(0, 1))
case(0){
ObjMove_SetAngularVelocity(objB,-0.5);
}
case(1){
ObjMove_SetAngularVelocity(objB,0.5);
}
}
But the rings never set the velocity to 0.5, any ideas ?
Drake:
If you're using the rand_int function I wrote above, the maximum is exclusive. If you want to pick either 0 or 1 you need rand_int(0, 2).
R. P. Genocraft:
Is it normal for ObjMove_SetPosition to not work on the player object? If so, is there an alternative that works?
Drake:
It should work. If it doesn't there's something else going on.
Kinedyme:
Is there a way to get the number of tasks currently running within a script?
I know that a value is displayed in the log window, but it would be great if I was able to capture that value at a specified point in my code.
Thanks in advance