I edited a few things and changed the number of frames per second to pull the enemies in... but then 2 things happened.
1- the graphic for the blackhole itself stopped appearing. i have no idea why.
2- the black hole effect still happened, but it only seemed to last a short time. shorter than the 5 seconds i told it to.
sooooooooo...
does anyone know what im doing wrong now?
here is the global part of the script. thats all i edited :
CODE
global script global1{
void run(){
while(true){
if(blackhole){
//variables for user edit below.
int seconds_exist= 5; //pretty obvious. the amount of time for the black hole to exist before disappearing, in seconds
int SuctionSpeed = 5; //amount of frames for the enemies to move, in pixels per second
int SuctionRange = 48; //the distance away from the hole for the enemies to be before they are sucked in.
int blank_combo= 7126; //any blank combo on the combo page.
int blackhole_combo= 7124; //ComboID for the sprite for the black hole.
int cset=9; //the cset for the black hole
//don't edit variables after this point.
int frames_exist=seconds_exist*60;
int exist;
bool blackhole_existing;
ffc blackhole_cast=Screen->LoadFFC(1);
blackhole_cast->CSet==cset;
if(!blackhole_existing){
exist=0;
blackhole_cast->Data=blank_combo;
}
else if(blackhole_existing){
blackhole_cast->Data=blackhole_combo;
}
if(Link->Dir==DIR_UP){
blackhole_cast->X=Link->X;
blackhole_cast->Y=Link->Y-48;
blackhole=false;
blackhole_existing=true;
}
if(Link->Dir==DIR_DOWN){
blackhole_cast->X=Link->X;
blackhole_cast->Y=Link->Y+32;
blackhole=false;
blackhole_existing=true;
}
if(Link->Dir==DIR_LEFT){
blackhole_cast->X=Link->X-48;
blackhole_cast->Y=Link->Y;
blackhole=false;
blackhole_existing=true;
}
if(Link->Dir==DIR_RIGHT){
blackhole_cast->X=Link->X+32;
blackhole_cast->Y=Link->Y;
blackhole=false;
blackhole_existing=true;
}
while(blackhole_existing){
exist++;
if(exist==frames_exist){
blackhole_existing=false;
}
else if(exist<frames_exist){
for(int i=1;i<=Screen->NumNPCs();i++){
npc e = Screen->LoadNPC(i);
if((Distance(blackhole_cast->X,blackhole_cast->Y,e->X,e->Y) <= SuctionRange)){
int m;
if(blackhole_cast->X-e->X != 0) m = (blackhole_cast->Y-e->Y)/(blackhole_cast->X-e->X);
if(blackhole_cast->X-e->X > 0) e->X += SuctionSpeed;
else e->X = e->X - SuctionSpeed;
int c = e->Y-m*e->X;
e->Y = m*e->X+c;
if(e->X>=blackhole_cast->X-8&&e->X<=blackhole_cast->X+8&&e->Y>=blackhole_cast->Y-8&&e->Y<=blackhole_cast->Y+8){
e->HP=0;
}
}
}
}
}
}
Waitframe();
}
}
}