1. The first one just repeats the action inside the brackets the number of times defined as "number".
The second one repeats the action as long as the variable x is lower than the variable "number".
3. Yes, I don't see why not.
Thanks for helping!
But I guess I asked a few wrong questions wrong
So, let me re-ask them:
1. If using "loop(y)" and "while(x<y)"{bullet information and y++;} inside a task, is there a difference gameplay-wise?
I did know about "ascent" and "descent" loops. I also had a recent problem with a script that used them, so I'll just ask that now too :V:
task fire{
loop{
CreateShotA(0,GetEnemyX,GetEnemyY,30);
SetShotDataA(0,0,5,GetAngleToPlayer,0,0,4,231);
CreateShotA(1,GetEnemyX,GetEnemyY,30);
SetShotDataA(1,0,5,GetAngleToPlayer+45,0,0,4,231);
CreateShotA(2,GetEnemyX,GetEnemyY,30);
SetShotDataA(2,0,5,GetAngleToPlayer-45,0,0,4,231);
ascent(i in 1..25){
CreateShotA(3,GetEnemyX,GetEnemyY,15);
SetShotDataA(3,0,0,0,0,0,0,YELLOW05);
SetShotDataA(3,60,rand(1,3),rand(0,359),0,0,1,177);
CreateShotA(4,GetEnemyX,GetEnemyY,15);
SetShotDataA(4,0,0,0,0,0,0,YELLOW05);
SetShotDataA(4,60,rand(1,3),rand(0,359),0,0,1,177);
CreateShotA(5,GetEnemyX,GetEnemyY,15);
SetShotDataA(5,0,0,0,0,0,0,YELLOW05);
SetShotDataA(5,60,rand(1,3),rand(0,359),0,0,1,177);
AddShot(i*2.88,0,3,0);
AddShot(i*2.88,1,4,0);
AddShot(i*2.88,2,5,0);
}
FireShot(0);
FireShot(1);
FireShot(2);
wait(60);
}
}
The nonspell is supposed to fire three bullets at the player and 2 at the sides, which leave dot bullets behind, which scatter randomly after a short wait.
The dot bullets spawn starting from the right bottom corner, and I don't know what I did wrong, so can somebody help me with this?
3. What I did wrong, is that I assumed that you knew what exactly was going on in the script. Since you haven't seen it, you probably don't know. Unless you have acces to my computer of course.
The code that I used was this:
task (parameters)
obj bullet
while(!Obj_BeDeleted){
code telling the bullet to move up and then go down starting at the bottom of the screen.
}
if (Obj_GetY == GetClipMaxY){
Obj_SetSpeed(obj,0);
}
But when I tested it, the bullets would disappear from the bottom of the screen.
In this example, I could did it by calculating the distance to the bottom of the screen(the bullets always were in the same place)
And timing it the right way. But when ? tried it using if statements, it didn't work.
EDIT:
If I want to play music in plural scripts, do I just put the bgm for each spellcard at the beginning?
And do I need to do it for each spellcard? And does it matter if you do one with Load/PlayMusic and the other with #BGM[]?