No I don't think they do.
I'd bool personally though.
Printable View
No I don't think they do.
I'd bool personally though.
umm... well i kinda got everything set up for it to check the HP already... i just changed it from checking the ffc's data to checking the enemies HP...
i could change it to bool but it seems pointless to me.
would you like to see it now?
If you want to show it to me :shrug:
ok then XD
im sure that its done now too... except for attacking.
however, i would like to know how the best way to bool it is tho.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);
ghosted_hp_enemy1->HP = bar;
ghosted_hp_enemy2->HP = bar;
ghosted_hp_enemy3->HP = bar;
ghosted_hp_enemy4->HP = bar;
while (true){
eye1-> Vx = speed;
eye1-> Vy = speed;
ghosted_hp_enemy1->X = eye1-> X;
ghosted_hp_enemy1->Y = eye1-> Y;
if(Screen->ComboF[ComboAt(eye1->Y)] == 98){
eye1->Vy *= -1;
}
if(Screen->ComboF[ComboAt(eye1->X)] == 98){
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;
if(Screen->ComboF[ComboAt(eye2->Y)] == 98){
eye2-> Vy *= -1;
}
if(Screen->ComboF[ComboAt(eye2->X)] == 98){
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;
if(Screen->ComboF[ComboAt(eye3->Y)] == 98){
eye3-> Vy *= -1;
}
if(Screen->ComboF[ComboAt(eye3->X)] == 98){
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;
if(Screen->ComboF[ComboAt(eye4->Y)] == 98){
eye4-> Vy *= -1;
}
if(Screen->ComboF[ComboAt(eye4->X)] == 98){
eye4-> Vx *= -1;
}
if((ghosted_hp_enemy4->HP)==0){
eye4->Data = 0;
}
if(ghosted_hp_enemy1->HP ==0 && ghosted_hp_enemy2->HP == 0 && ghosted_hp_enemy3->HP == 0 && ghosted_hp_enemy4->hp == 0){
center->Data = 0;
}
Waitframe();
}
}
would it be like this:
or like this:Code:if(Bool(ghosted_hp_enemy1 && ghosted_hp_enemy2 && ghosted_hp_enemy3 && ghosted_hp_enemy4 == false)){
also, would i use one equal sign or 2? i understand that = means "is set to" and == means "is equal to" but im not sure which i would use with bool. and bool does need to be capitalized, too right?Code:if(Bool(ghosted_hp_enemy1 == false) && Bool(ghosted_hp_enemy2 == false) && Bool(ghosted_hp_enemy3 == false) && Bool(ghosted_hp_enemy4 == false)){
'ComboAt(x,y)' takes two parameters.
You can't put 'ComboAt(x)', because coordinates have two parts to them.
You've done that a lot.
And I don't know what you think you're doing with booleans, but it shouldn't be anything like that...
A bool is just a variable with two states.
So you do it like this:
Code:void run(){
bool eye1check;
bool eye2check;
//etc...
//......
while(true){
//....
if(!eye1->IsValid) eye1check = true;
if(!eye2->IsValid) eye1check = true;
//etc...
if(eye1check && eye2check && etc){
//do stuff
}
...?
this confuses me...
i thought ! meant "not"?
It does, what's confusing?
this part. you said ! meant "not" right? then this says "if not eye1 is valid..."Code:if(!eye1->IsValid) eye1check = true;
if(!eye2->IsValid) eye1check = true;
does this mean that "if anything other than eye1 exists"? of does it check near eye1 for anything out of the ordinary like flags?
isValid is a bool already. It can either mean true or false.
So;
Translation:Quote:
if(!eye1->IsValid) eye1check = true;
if eye1 is not found, (it died), eye1check becomes true.
ahh i understand now lol
thank you gleeok =)