Master Maniac
04-08-2008, 06:53 PM
i have an issue. it might be a cycling thing but im not sure...
i made a script that creates 2 ffc's. one is for looks and the other takes the damage for the enemy. when the ghosted enemy is dead, both the ffc's data is set to 0.
before it dies though, one of the ffcs cycles a lot. so im thinking that may be the cause of this.
anyway what the problem is, the ffc thats just there for looks (has no animation and no cycling) defaults its data to 0 at the right time.
the other ffc (cycles a little bit with no animation) doesent default its data to 0... rather it cycles to a certain combo.
here ill explain how i made it cycle.
its an eye. the eye is closed. the script tells it to cycle and so it cycles to a combo animating the eye opening. then that cycles to an open eye combo.
when it is supposed to go to 0, it goes to the animating/cycling combo instead, and then stops everything.
ill post the script so far too, so you guys can see. maybe i worded something in the script wrong or something.
ill also post 2 screenshots... (or links to them) as before and after shots of killing it.
//ennefenom's ghoma script
//ok so im going ot explain how to set up the script part only.
//im also going to leave notes so hopefully you can do something like this yourself at some point.
//also im going to assume you know nothing about scripting so ill explain every little detail
//first your setup. you will need:
//1 set of combos for the body, and 2 to 3 sets for the eye. the eye will have 2 different colors, which will be cycled back and forth.
//2 ffc's. one that is only the eye, and one that is everything but the eye
//1 custom enemy. you can make its attributes. (shooter, etc.)
//1 sound effect for a "dying ghoma"
//now for your arguments
//D:0=the ID of the enemy that will be used as ghoma's HP. do not set combos for this enemy, as it is supposed to be invisible.
//D:1=the ID of the enemy you want to spawn when it is "invincible"
//D:2=the ID of the combo you want the eye to be when it is vulnerable.
//D:3=the ID of the combo you want to use when ghoma is invulnerable
//D:4=how much health you want ghoma to start with
//D:5=the # of the sound you want to use for "ghoma dying"
import "std.zh" //this imports variables from a file in the build folder, which makes this script possible
ffc script ghoma{//this names your script "ghoma"and sets the type to FFC. also opens a new level of scope with "{"
void run(int m, int n, int c1, int c2,int h, int s){//starts the script to running. also notice i places a tab stroke for organization. layer 1 of scope = 1 tab press.
ffc ghoma_body;
ffc ghoma_eye;
npc ghost;
npc dummy1;
npc dummy2;
int beasts;
ghoma_body = Screen->LoadFFC(1);//notice i didnt use "{" here. there are no functions within what ive told it to do, so no need for them
ghoma_eye = Screen->LoadFFC(2);//with this line and the previous one, ive commanded the screen to draw 2 FFC's and name them ghoma eye and ghoma body
ghost = Screen->CreateNPC(m);//creates an NPC (or an enemy) whose ID is equal to the value of "m"
ghost->X=ghoma_eye->X;ghost->Y=ghoma_eye->Y;//not sure if i worded this right yet... sets the coordinates of the enemy anf the eye to the same every frame
while (true){
if(Screen->NumNPCs()==1){
dummy1= Screen->CreateNPC(n);
dummy2= Screen->CreateNPC(n);//these draw enemies with an ID equal to the value of n
beasts=1;
}
if(dummy1->HP<1&&dummy2->HP<1){
beasts=2;
}
ghost->HP=9999;//gives an "invincible"effect
if(beasts==2){// this is an if function. it says if (whatevers in parentheses is true) then preform the next level of scope.
ghoma_eye->Data = c1;//cycles the combo for the eye to another combo, ID equal to c1
ghost->HP=h;//turns off the enemy's invincibility
Waitframes(900);//waits 15 seconds(i think)
h=ghost->HP;
ghost->HP=9999;//turns invincibility back on
ghoma_eye->Data = c2;
}//this closes a level of scope, here being the if function
if(ghost->HP<1){//another if function
ghoma_body->Data=0;//"kills" the FFCs
ghoma_eye->Data=0;
Game->PlaySound(s);//plays a sound equal to the interger "s"
}
Waitframe();
}
}
}
yep still working on the same one. its useless right now. the boss is so easy to kill its not even funny.
however i will post any further questions involving this script in this thread for now.
i made a script that creates 2 ffc's. one is for looks and the other takes the damage for the enemy. when the ghosted enemy is dead, both the ffc's data is set to 0.
before it dies though, one of the ffcs cycles a lot. so im thinking that may be the cause of this.
anyway what the problem is, the ffc thats just there for looks (has no animation and no cycling) defaults its data to 0 at the right time.
the other ffc (cycles a little bit with no animation) doesent default its data to 0... rather it cycles to a certain combo.
here ill explain how i made it cycle.
its an eye. the eye is closed. the script tells it to cycle and so it cycles to a combo animating the eye opening. then that cycles to an open eye combo.
when it is supposed to go to 0, it goes to the animating/cycling combo instead, and then stops everything.
ill post the script so far too, so you guys can see. maybe i worded something in the script wrong or something.
ill also post 2 screenshots... (or links to them) as before and after shots of killing it.
//ennefenom's ghoma script
//ok so im going ot explain how to set up the script part only.
//im also going to leave notes so hopefully you can do something like this yourself at some point.
//also im going to assume you know nothing about scripting so ill explain every little detail
//first your setup. you will need:
//1 set of combos for the body, and 2 to 3 sets for the eye. the eye will have 2 different colors, which will be cycled back and forth.
//2 ffc's. one that is only the eye, and one that is everything but the eye
//1 custom enemy. you can make its attributes. (shooter, etc.)
//1 sound effect for a "dying ghoma"
//now for your arguments
//D:0=the ID of the enemy that will be used as ghoma's HP. do not set combos for this enemy, as it is supposed to be invisible.
//D:1=the ID of the enemy you want to spawn when it is "invincible"
//D:2=the ID of the combo you want the eye to be when it is vulnerable.
//D:3=the ID of the combo you want to use when ghoma is invulnerable
//D:4=how much health you want ghoma to start with
//D:5=the # of the sound you want to use for "ghoma dying"
import "std.zh" //this imports variables from a file in the build folder, which makes this script possible
ffc script ghoma{//this names your script "ghoma"and sets the type to FFC. also opens a new level of scope with "{"
void run(int m, int n, int c1, int c2,int h, int s){//starts the script to running. also notice i places a tab stroke for organization. layer 1 of scope = 1 tab press.
ffc ghoma_body;
ffc ghoma_eye;
npc ghost;
npc dummy1;
npc dummy2;
int beasts;
ghoma_body = Screen->LoadFFC(1);//notice i didnt use "{" here. there are no functions within what ive told it to do, so no need for them
ghoma_eye = Screen->LoadFFC(2);//with this line and the previous one, ive commanded the screen to draw 2 FFC's and name them ghoma eye and ghoma body
ghost = Screen->CreateNPC(m);//creates an NPC (or an enemy) whose ID is equal to the value of "m"
ghost->X=ghoma_eye->X;ghost->Y=ghoma_eye->Y;//not sure if i worded this right yet... sets the coordinates of the enemy anf the eye to the same every frame
while (true){
if(Screen->NumNPCs()==1){
dummy1= Screen->CreateNPC(n);
dummy2= Screen->CreateNPC(n);//these draw enemies with an ID equal to the value of n
beasts=1;
}
if(dummy1->HP<1&&dummy2->HP<1){
beasts=2;
}
ghost->HP=9999;//gives an "invincible"effect
if(beasts==2){// this is an if function. it says if (whatevers in parentheses is true) then preform the next level of scope.
ghoma_eye->Data = c1;//cycles the combo for the eye to another combo, ID equal to c1
ghost->HP=h;//turns off the enemy's invincibility
Waitframes(900);//waits 15 seconds(i think)
h=ghost->HP;
ghost->HP=9999;//turns invincibility back on
ghoma_eye->Data = c2;
}//this closes a level of scope, here being the if function
if(ghost->HP<1){//another if function
ghoma_body->Data=0;//"kills" the FFCs
ghoma_eye->Data=0;
Game->PlaySound(s);//plays a sound equal to the interger "s"
}
Waitframe();
}
}
}
yep still working on the same one. its useless right now. the boss is so easy to kill its not even funny.
however i will post any further questions involving this script in this thread for now.