by Zippy » Fri Dec 12, 2008 3:25 pm
Enjay wrote:Often I might have a number of map spots with the same tid on a map and use a single spawnspot instruction to spawn actors at each one. The situation may be further complicated by having different numbers of map spots at different difficulty levels. Would the spawnsuccess thingy be able to cope with that (ie can it be used to ensure all actors that there were map spots for have spawned (I suspect not)) or would I have to use a different map spot and tid for each actor that I was going to check for?
Things get a bit more complicated, but it's still somewhat workable. To my understanding, SpawnSpot actually won't return TRUE and FALSE, but the number of things spawned. FALSE happens to be 0, so TRUE and FALSE work in cases of spawning a single thing.
if (SpawnSpot("whatever",1)) will succeed so long as SOMETHING is spawned.
So if you have 5 spots with the same tid and use SpawnSpot, the return value for spawning EVERYTHING should be 5. If you get less, not everything was spawned. Your problem now becomes: at which spots were things spawned? And more problematically, if you only spawned some of them (say it returned 3. You're missing 2) how do you spawn the rest at the appropriate spots? You really can't. One thing you can try is if you don't get them all, remove the ones that were spawned and try again:
Code: Select all
// Keep trying to spawn all 5 at once...
while( SpawnSpot("whatever",1,2) != 5 ) {
Thing_Remove(2);
delay(1);
}
I think the system has enough for clever mappers to work within the confines. If you want to do something like "it spawned only 3, so spawn the other 2 later at the correct spots" you're going to
have to accept the reality that in order to have full control over the individual, unique spawn points then you to assign them unique tid identifiers. Working with a different number of spots on different difficulties shouldn't be much more than using [wiki]ThingCount[/wiki] and [wiki]GameSkill[/wiki] to determine the appropriate number to spawn.
[quote="Enjay"]Often I might have a number of map spots with the same tid on a map and use a single spawnspot instruction to spawn actors at each one. The situation may be further complicated by having different numbers of map spots at different difficulty levels. Would the spawnsuccess thingy be able to cope with that (ie can it be used to ensure all actors that there were map spots for have spawned (I suspect not)) or would I have to use a different map spot and tid for each actor that I was going to check for?[/quote]Things get a bit more complicated, but it's still somewhat workable. To my understanding, SpawnSpot actually won't return TRUE and FALSE, but the number of things spawned. FALSE happens to be 0, so TRUE and FALSE work in cases of spawning a single thing. [i]if (SpawnSpot("whatever",1))[/i] will succeed so long as SOMETHING is spawned.
So if you have 5 spots with the same tid and use SpawnSpot, the return value for spawning EVERYTHING should be 5. If you get less, not everything was spawned. Your problem now becomes: at which spots were things spawned? And more problematically, if you only spawned some of them (say it returned 3. You're missing 2) how do you spawn the rest at the appropriate spots? You really can't. One thing you can try is if you don't get them all, remove the ones that were spawned and try again:[code]// Keep trying to spawn all 5 at once...
while( SpawnSpot("whatever",1,2) != 5 ) {
Thing_Remove(2);
delay(1);
}[/code]
I think the system has enough for clever mappers to work within the confines. If you want to do something like "it spawned only 3, so spawn the other 2 later at the correct spots" you're going to [b]have to[/b] accept the reality that in order to have full control over the individual, unique spawn points then you to assign them unique tid identifiers. Working with a different number of spots on different difficulties shouldn't be much more than using [wiki]ThingCount[/wiki] and [wiki]GameSkill[/wiki] to determine the appropriate number to spawn.