Well, I don't know if I must post this here or in the Bugs Topic. Anyways, I'm experiencing something really confusing. I'm using a for loop to make a PlayerSpawnTrigger spawn certain number of enemies depending on circunstances, but I can't figure out why it always spawns two, like it's the limit. Here's some relative code.
public void Spawn(TriggerArgs args)
{
IObjectPlayerSpawnTrigger playerspawn = Game.GetSingleObjectByCustomID("enemy")as IObjectPlayerSpawnTrigger;
for (int i = 0; i < 6; i++)
{
playerspawn.Trigger();
}
}
this code always spawns the enemy two times, I thought there was a limit, but then I tried this...
public void Spawn(TriggerArgs args)
{
IObjectPlayerSpawnTrigger playerspawn = Game.GetSingleObjectByCustomID("enemy")as IObjectPlayerSpawnTrigger;
while (true)
{
playerspawn.Trigger();
}
}
the previous code crashed the game. Obviously because there was too many players to spawn. I tried doing the equivalent to the for loop using a while loop, and I got exactly the same result: two players being spawned.