This is an actor class which is based on the [wiki=Classes:RandomSpawner]RandomSpawner[/wiki] class. It allows you to do scripted spawning instead of the random one you can achieve with RandomSpawner. What's the advantage of using this over those "custom" spawners people create? Well, since it's based on RandomSpawner, it handles things that those spawners usually overlook or can't when replacing existing monsters, like transferring certain properties, and making sure that boss-death events actually trigger.
This of course requires ZScript, and a GZDoom version which supports it. But don't worry, it's not that hard. Here is an example which demonstrates the kind of thing people like to do when creating custom spawners: spawning actor A or actor B depending on the value of a console variable:
Code: Select all
class SS_DoomImp : DoomImp {} // So the spawner doesn't do recursive spawning since the it replaces DoomImp.
class SS_DoomImpSpawner : SS_ScriptedSpawner replaces DoomImp
{
override name SS_GetActorToSpawn ()
{
if(GetCvar("blah")) // Assuming 'blah' is a boolean console variable.
{
// 'blah' is true, spawn a cyberdemon.
return 'Cyberdemon';
}
// 'blah' is false, spawn an imp.
return 'SS_DoomImp';
}
}