Here is a solution I have found for this:
I use map spots for teleport destinations. I raise them into the air. This might not work if you're doing some cramped mapping. Regardless, the next step will help as well. I use this script for spawning:
Code: Select all
while(true)
{
spawnspot("Monstrosity",8,999,0);
if(thingcount(0,999)>0)
{
Thing_ChangeTID(999,0);
break;
}
}
What this does is it attempts to spawn a "Monstrosity" (custom monster) at map spot 8. It gives it ID of 999 (a temporary id used in the next piece of code). It then checks to see if that monster was successful in spawning by checking to see how many monsters with if 999 exist. If it was successful in spawning, it changes the monsters id to 0 and breaks from the loop. If it wasn't successful it will continue looping until the monster spawns successfully (the player or other monsters move off its teleport destination.
This could be a problem if you were running multiple scripts that used this same code, but you could find solutions (use separate temporary ids for each loop).
I can also think of ways in which you could set up multiple map spots in the same area to check as possible destinations, which would multiply the monsters chance for success to spawn each loop.
Just by raising the spot off the floor though you make it a lot easier, since most monsters fall to the ground and start running around, and free the space above for the next monster. Also you might find the code I posted to be quite lengthy for just spawning one monster. This is how I use it in my ACS:
Code: Select all
while(true){spawnspot("Monstrosity",8,999,0);if(thingcount(0,999)>0){Thing_ChangeTID(999,0);break;}}
delay(50);
while(true){spawnspot("Monstrosity",9,999,0);if(thingcount(0,999)>0){Thing_ChangeTID(999,0);break;}}
delay(50);
while(true){spawnspot("Monstrosity",10,999,0);if(thingcount(0,999)>0){Thing_ChangeTID(999,0);break;}}
delay(50);
while(true){spawnspot("Monstrosity",11,999,0);if(thingcount(0,999)>0){Thing_ChangeTID(999,0);break;}}
delay(50);
while(true){spawnspot("Monstrosity",12,999,0);if(thingcount(0,999)>0){Thing_ChangeTID(999,0);break;}}
delay(50);
while(true){spawnspot("Monstrosity",13,999,0);if(thingcount(0,999)>0){Thing_ChangeTID(999,0);break;}}