Code:
// ======================================================
// ENEMY_BOOSTER - This FFC will boost the attributes of any npc that
// comes within 16 pixels of it. After triggering, the FFC will switch to the next
// combo and deactivate for a certain period of time. If you don't want the booster
// to boost all attributes, leave those variables set to 0.
// Most variables can be negative, making this into an enemy weakener.
// D0 - The amount by which the enemy's hit points will be boosted.
// D1 - The amount by which the enemy's damage will be boosted.
// D2 - The amount by which the enemy's movement rate will be boosted.
// D3 - The new Cset that will be assigned to the enemy once it has been boosted.
// D4 - The number of tics that the booster will remain deactivated after activating.
// ================================================================
ffc script enemy_booster{
void run()
{
int hitpoint_boost = D0; //Problem solved up here, it seems...
int damage_boos = D1;
int speed_boost =D2;
int cset_boost=D3;
int delay=D4;
int enemy_num = 0; // Used to check how many enemies there are
// on a screen each tic.
int counter = 1; // Used to check location of each enemy in turn.
npc current_enemy; // Used to load up each enemy in turn.
int state = 1; // Prevents pumping up enemy too much by turning off
// for a few tics once an enemy triggers it.
// 0 = Active
// 1+ = Inactive
while(true){
counter = 1;
enemy_num = Screen->NumNPCs();
// Check each npc on the screen's location. If it is within 16 tiles of this FFC, apply the
// boosts to that npc and then deactivate.
while ( (counter < = enemy_num) && state = 0){ //Seems to be a problem here, but I can't put my finger on it
current_enemy = Screen->LoadNPC(counter);
if ( (current_enemy->X < this->X + 16) && (current_enemy->X > this->X - 16) &&
(current_enemy->Y < this->Y + 16) && (current_enemy->Y > this->Y - 16) ){
this->HP = this->HP + hitpoint_boost;
this->Damage = this->Damage + damage_boost;
this->Rate = this->Rate + speed_boost;
state = 1;
this->Data++;
if (cset_boost !=0){ this->Cset = cset_boost; }
} // end if
counter++;
} // end of internal while
// Deactive once an enemy has been boosted. Stay deactivated for delay tics.
if ( state != 0 ){
if (state = delay) { state = 0; this->Data--; }
else ( state++ }
} // end if
Waitframe();
} // end of while
} // end of void run
} // end of script
Apparently Line 43 is acting up with the following error message
Line 43: Syntax Error, Unexpected Assign, Expecting RPAREN or OR, on token =
Fatal Error P00
Originally Posted by
ShadowTiger
I get an error when I try to import this and compile it in ZQuest:
Pass 1: Parsing
Line 17: Syntax Error, Unexpected Semicolon, Expecting RPAREN, On Token ;
Fatal Error P00: Can't Open or Parse Input File!
I'm unable to figure whether or not the problem is solved here, but I'm not getting any errors from that line now.