[SOLVED] Weird spawning issue
Posted: Thu Jun 19, 2014 5:41 pm
Hi there guys, I´ve been working in a spawning system for one of my maps that is similar to the stronghold one but I have detected a small problem.
Everything works fine until I reach wave 4 where it is supposed to spawn 5 imps, 5 shotgun guys and 20 spectres. The shotgunners and the imps spawn correctly but only spawns about 9-10 spectres and I dont know what is wrong in the code.
Regards.
Everything works fine until I reach wave 4 where it is supposed to spawn 5 imps, 5 shotgun guys and 20 spectres. The shotgunners and the imps spawn correctly but only spawns about 9-10 spectres and I dont know what is wrong in the code.
Code: Select all
Script 3 (int wave)
{
switch(wave)
{
case 1:
Monsters[0] = 15;
break;
case 2:
Monsters[0] = 15;
Monsters[1] = 10;
Monsters[2] = 10;
break;
case 3:
Monsters[2] = 15;
Monsters[3] = 8;
Monsters[4] = 8;
break;
case 4:
Monsters[1] = 5;
Monsters[2] = 5;
Monsters[4] = 20;
break;
case 5:
Monsters[2] = 10;
Monsters[3] = 10;
Monsters[4] = 10;
Monsters[5] = 10;
break;
}
int angle = GetActorAngle(1) >> 8;
while(getAmount()>0)
{
int i = random(0,5);
if(Monsters[i]>0)
{
Monsters[i]--;
While(!Spawn(MonsterType[i],getCoords(1),getCoords(2),getCoords(3),100,angle))
{
Delay(1);
}
Delay(1);
SpawnSpot("DoomTeleFog",100);
Thing_ChangeTID(100,0);
Delay(17);
}
}
while((ThingCountName("TestZombieman",0) + ThingCountName("TestShotgunGuy",0) + ThingCountName("TestDoomImp",0) + ThingCountName("TestDemon",0) + ThingCountName("TestSpectre",0) + ThingCountName("TestCacodemon",0))>0)
{
Delay(1);
}
int next = wave;
next++;
ACS_Execute(2,0,next,0,0);
}