Oh, no, it wasn't working before I added the script.
Sorry, I missed this one, earlier: Wizzrobes summon based on their
random rate and their
halt rate. If you want them to summon, they cannot have a random and halt of 0. Use the defaults, and set their step to 0, and it should work.m If that fails to work, then they may also need a step of at least 1.
If you want, i can just code a summoning ffc for you. That is probably better than this, given that you are using an ffc just to make them intangible.
This is untested, but barring minor typos, it should work:
//////////////////////////////////
/// Timed Summoning Square FFC ///
/// v0.1 ///
/// By: ZoriaRPG ///
/// 22nd Sept, 2017 ///
//////////////////////////////////
//Settings
//Sound to play when summoning. Happens once per summon, not once per enemy.
//Can be overridden in the ffc InitD[]
const int FFC_SUMMONER_SUMMON_SFX = 56;
//Distance to randomise spawn points from the CENTRE X/Y of the ffc.
const int FFC_SUMMONER_SUMMON_WAVER_X_MIN = -24;
const int FFC_SUMMONER_SUMMON_WAVER_X_MAX = 24;
const int FFC_SUMMONER_SUMMON_WAVER_Y_MIN = -24;
const int FFC_SUMMONER_SUMMON_WAVER_Y_MAX = 24;
ffc script SummonerSpace{
void run(int summon_npc, int min_number, int max_number, int min_time, int max_time, int cap, int summon_sfx){
//D0: NPC to summon
//D1: minimum number to generate on summoning. Must be a positive value.
//D2: Max number of npxs to spwan on a single summon
//D3: Minimum time (in seconds_ between summons.
//D4: maximum time (in seconds, between summons)
//D5: If there are this many npcs on the screen, stop summoning.
//D6: Sound to play. If set to 0, the default will play.
npc n;
int q[3];
//0 loop
//1 num of npcs to spawn this cycle
//2 timer
q[2] = Rand(min_time, max_time) * 60;
while(true){
while(q[2]--) { Waitframe(); }
q[2] = Rand(min_time, max_time) * 60; //Set the timer, based in seconds.
q[1] = Abs(Rand(min_number, max_number)); //Determine how many npcs will spawn.
//An option to stop flooding the screen with summons after there are 'cap' number of npcs
//on the screen:
if ( cap > 0 ){
if ( Screen->NumNPCs() >= cap ) { continue; }
}
//Play the summon sound with my usual sanity checks.
if ( summon_sfx > 0 && summon_sfx < 256 ) { Game->PlaySound(summon_sfx); }
else {
if ( FFC_SUMMONER_SUMMON_SFX > 0 ) { Game->PlaySound(FFC_SUMMONER_SUMMON_SFX); }
}
//Spawn the npcs.
for ( q[0] = 0; q[0] < q[1]; q[0]++ ) {
n = Screen->CreateNPC(summon_npc);
//Randomise their spawn locations a bit.
n->X = this->X + ( this->TileWidth * 8 ) + Rand(FFC_SUMMONER_SUMMON_WAVER_X_MIN, FFC_SUMMONER_SUMMON_WAVER_X_MAX);
n->Y = this->Y + ( this->TileHeight * 8 ) + Rand(FFC_SUMMONER_SUMMON_WAVER_Y_MIN, FFC_SUMMONER_SUMMON_WAVER_Y_MAX);
}
Waitframe();
}
}
}
Edited by ZoriaRPG, 22 September 2017 - 03:45 AM.