I have a variable that tracks how many monsters there should be (maxMonsters), how many monsters have been killed (monsterCounter), how many have spawned (monstersSpawned), and how many are there before the spawn (currentMonsterCount)
Here is the code
Code: Select all
int currentMonsterCount;
Script "WaveStart" (VOID)
{
While(monsterCounter > 0)
{
Delay(100 - waves);
If(monstersSpawned != maxMonsters)
{
currentMonsterCount = ThingCount(T_NONE,666);
Thing_SpawnFacing(random(1,27),monsterList[random(0,levelOfEnemies)],0,666);
SetThingSpecial(666,80,667,0,0,0,0);
if(currentMonsterCount < ThingCount(T_NONE,666))
{
monstersSpawned++;
}
}
}
}
Script 667 (VOID)
{
monsterCounter--;
}
Script "ViewShower" (VOID)
{
While(monsterCounter > 0)
{
SetFont("BIGFONT");
SetHudSize(520, 400,0);
HudMessage(s:"Monsters left: ", i: monsterCounter; HUDMSG_PLAIN, 0, CR_GOLD, 260.4, 80.4, 0.03);
Delay(1);
}
Thing_Remove(666);
HudMessage(s:"All Monsters Killed!"; HUDMSG_FADEOUT, 0, CR_GOLD, 260.4, 80.4, 0.0,1.0);
Delay(35);
ActivatorSound("BRS/annoucer/complete",128);
HudMessage(s:"Wave Completed!"; HUDMSG_FADEOUT, 0, CR_GOLD, 260.4, 80.4, 2.0,1.0);
Delay(35*3);
FadeTo(0,128,0,0.5,0.0);
for (int i = 1; i < PlayerCount(); i++) {
GiveActorInventory(1000 + i,"horde_live",3);
}
FadeTo(0,128,0,0.0,0.1);
SetFont("SMALLFONT");
HudMessage(s:"Lives recovered!"; HUDMSG_FADEOUT, 0, CR_GREEN, 260.4, 80.4, 1.0,1.0);
Delay(35*2);
//Before all, changes the music
musicRandomizer = Random(0,16);
SetMusic(songList[musicRandomizer]);
SetFont("SMALLFONT");
SetHudSize(520, 400,0);
HudMessage(s:"Now Playing: ", s:songName[musicRandomizer]; HUDMSG_TYPEON, 0, CR_GOLD, 260.4, 70.4, 1.0, 0.1, 0.5);
ACS_NamedExecute("WaveCountdown",0,0,0,0);
}a simple ThingCount won't work, as the number of monsters can be lowered between the spawns.
if anyone is willing to help, thank you in advance.
