To anyone who wants to use this script here is a tip: Make copies of the enemies you want to spawn and set their spawn type to instant. This will make the spawning look better.
To anyone who wants to use this script here is a tip: Make copies of the enemies you want to spawn and set their spawn type to instant. This will make the spawning look better.
A bug with the hitboxes causes the item saving portion of this script to sometimes not work. In order to fix it, you should change !LinkCollision(it) to it->isValid().
That should be easy enough, but for those who can't be bothered, here is the corrected script:
Code://invisible combos used when setting to layers. const int CMB_SOLID = 9; //an invisible solid combo. const int CMB_INVIS = 8; //a non-solid invisible combo. ffc script ArmosNext { void run(int enemy, int sfx, int delay, bool solid, int layer, int itemDrop, int d, int bit) { this->X = (this->X>>4)<<4; this->Y = (this->Y>>4)<<4; //align to combo grid int posX = this->X; item it; int wait = delay; if(solid){ if(!layer) SetLayerComboD(layer, ComboAt(this->X, this->Y), this->Data); else SetLayerComboD(layer, ComboAt(this->X, this->Y), CMB_SOLID); } while(!LinkCollision(this)) Waitframe(); if(!enemy){ if(solid){ while(delay){ if(LinkCollision(this)){ delay--; this->X = posX + Rand(2); Game->PlaySound(sfx); Waitframe(); } else delay = wait; this->X = posX; Waitframe(); } } } else{ for(;delay>0;delay--){ this->X = posX + Rand(3)-1; Game->PlaySound(sfx); Waitframe(); } this->X = posX; CreateNPCAt(enemy, this->X, this->Y); } if(solid) { if(!layer) SetLayerComboD(layer, ComboAt(this->X, this->Y), this->Data+1); else SetLayerComboD(layer, ComboAt(this->X, this->Y), CMB_INVIS); } this->Data++; if(itemDrop && !(Screen->D[d]&bit)){ it = CreateItemAt(itemDrop, this->X, this->Y); Game->PlaySound(SFX_SECRET); } while(itemDrop && it->isValid() && !(Screen->D[d]&bit)) Waitframe(); Screen->D[d] |= bit; } //end run() } //end script //D0 the enemy number to spawn (if 0 no enemy spawns) //D1 Sound to play while "Armos" shakes //D2 how long to shake the FFC before spawning the enemy //D3 whether or not the armos is solid (0 is false; 1 is true; FFC Combo must be solid) //D4 what layer the FFC combo is placed on. (Solidity only works on layer 0, 1, and 2) //D5 item to drop //D6 Screen Data slot to store to //D7 Bit to store
There are currently 1 users browsing this thread. (0 members and 1 guests)