No, that's it.
You need to specify the correct (x,y) coordinates though, referencing the ffc's coordinates.
Printable View
No, that's it.
You need to specify the correct (x,y) coordinates though, referencing the ffc's coordinates.
lol im sorry i fail to understand this...
so i take the coordinates... and those are where the flag is so if theres a flag at those coordinates then...? im is so confused...
>_<
Bit like that.Code:if(Screen->ComboF[ComboAt(eye1->X, eye1->Y)] == flag){
ah...Ahhh i get it now...
ok so it tells when the FFC becomes adjacent to the flag? but how do you know which flag to use?
Oh, well what I'd written wouldn't actually compile.
I've used an integer called 'flag', although I haven't declared it, because what I put was just an example.
Replace 'flag' with the flag number you want to use, or actually declare 'flag' and set it to that value.
ahhhh thank you so much man! ok i get it now.
oh and also, will it work with any flag? as in the ones labeled <unused> and stuff too?
Yes, although the ones labelled 'Script Only' or whatever are probably best.
98+.
ok, joe. you might be proud finally XD.
i have,
deleted a bunch of extra spaces (for organization)
checked my punctuation (either ; { or } at the end of every line
completely removed the whole combo thing (replaced with flags)
shortened the script considerably
added a new argument (the enemy's hp)
compiled everything into one while () loop
and checked my scope.
now, here's my monstrosity.
am i ok now? except for attacking, i see nothing else to add. but there are things ive left out too.Code:import "std.zh"
ffc script eyesore{
void run(int barieo, int bar){
int x; int y;
int speed = 2;
npc ghosted_hp_enemy1 = Screen->CreateNPC(barieo);
npc ghosted_hp_enemy2 = Screen->CreateNPC(barieo);
npc ghosted_hp_enemy3 = Screen->CreateNPC(barieo);
npc ghosted_hp_enemy4 = Screen->CreateNPC(barieo);
ffc eye1 = Screen->LoadFFC(1);
ffc eye2 = Screen->LoadFFC(2);
ffc eye3 = Screen->LoadFFC(3);
ffc eye4 = Screen->LoadFFC(4);
ffc center = Screen->LoadFFC(5);
while (true){
eye1-> Vx = speed;
eye1-> Vy = speed;
ghosted_hp_enemy1->X = eye1-> X;
ghosted_hp_enemy1->Y = eye1-> Y;
ghosted_hp_enemy1->HP = bar;
if(Screen->ComboF[ComboAt(eye1->Y)] == flag){
eye1->Vy *= -1;
}
if(Screen->ComboF[ComboAt(eye1->X)] == flag){
eye1-> Vx *= -1;
}
if((ghosted_hp_enemy1->HP)==0){
eye1->Data = 0;
}
eye2-> Vx = speed;
eye2-> Vy = speed;
ghosted_hp_enemy2->X = eye2-> X;
ghosted_hp_enemy2->Y = eye2-> Y;
ghosted_hp_enemy2->HP = bar;
if(Screen->ComboF[ComboAt(eye2->Y)] == flag){
eye2-> Vy *= -1;
}
if(Screen->ComboF[ComboAt(eye2->X)] == flag){
eye2-> Vx *= -1;
}
if((ghosted_hp_enemy2->HP)==0){
eye2->Data = 0;
}
eye3-> Vx = speed;
eye3-> Vy = speed;
ghosted_hp_enemy3->X = eye3-> X;
ghosted_hp_enemy3->Y = eye3-> Y;
ghosted_hp_enemy3->HP = bar;
if(Screen->ComboF[ComboAt(eye3->Y)] == flag){
eye3-> Vy *= -1;
}
if(Screen->ComboF[ComboAt(eye3->X)] == flag){
eye3-> Vx *= -1;
}
if((ghosted_hp_enemy3->HP)==0){
eye3->Data = 0;
}
eye4-> Vx = speed;
eye4-> Vy = speed;
ghosted_hp_enemy4->X = eye4-> X;
ghosted_hp_enemy4->Y = eye4-> Y;
ghosted_hp_enemy4->HP = bar;
if(Screen->ComboF[ComboAt(eye4->Y)] == flag){
eye4-> Vy *= -1;
}
if(Screen->ComboF[ComboAt(eye4->X)] == flag){
eye4-> Vx *= -1;
}
if((ghosted_hp_enemy4->HP)==0){
eye4->Data = 0;
}
if(eye1->Data == 0 && eye2->Data == 0 && eye3->Data == 0 && eye4->Data == 0){
center->Data = 0;
}
Waitframe();
}
}
like the flag #. i need to boot up ZQ and find one that would be useful. but that can wait.
and thats about it as far as i can tell. did i fix everything?
This is indeed much improved.
Problems:
You're setting the HP of each enemy every frame.
You need to do that before the while loop.
Once an ffc's data becomes 0, it is dereferenced (I think), therefore you can't check whether other ffc's datas are 0 before doing things.
98 is the first script-only flag.
uh-oh... big trouble then...
ok ive re-wired things and now im checking if the enemy's HP reaches 0 instead of the ffc's data. does an enemy become derefrenced in the same way as an ffc?
if not, ive got everything right.
and if so, ill just have to bool. shouldnt be too hard, right?