Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Kontra Kommando

[Wandering] Multiple-Monster Spawner [Solved]

Recommended Posts

Kontra Kommando said:

ACTOR spawner Replaces Demon
{
game Doom
speed 8
health 1
radius 21
height 1
Gravity 0.9
Decal None
Monster
+NOTELEPORT
+NOBLOCKMAP
+THRUACTORS
Mass 1
States
{
Spawn:
NONO AA 3 A_Wander
TNT1 A 1 A_SpawnItemEx("Spawn", 0, 0, 0, 0, 0, 0, random(0, 360))
NONO A 0
TNT1 A 1 A_SpawnItemEx("Spawn", 0, 0, 0, 0, 0, 0, random(0, 360))
NONO AA 3 A_Wander
TNT1 A 1 A_SpawnItemEx("Spawn", 0, 0, 0, 0, 0, 0, random(0, 360))
NONO A 0
NONO AA 3 A_Wander
TNT1 A 1 A_SpawnItemEx("Spawn", 0, 0, 0, 0, 0, 0, random(0, 360))
NONO A 0
NONO AA 3 A_Wander
TNT1 A 1 A_SpawnItemEx("Spawn", 0, 0, 0, 0, 0, 0, random(0, 360))
NONO A 0
goto Death

Death:
TNT1 A 0
TNT1 A 1 A_SpawnItemEx("Spawn", 0, 0, 0, 0, 0, 0, random(0, 360))
Stop
}
}

actor Spawn : RandomSpawner
{
DropItem "Shotgunguy", 255, 10
DropItem "Zombieman", 255, 10
DropItem "Doomimp", 255, 10
}


EDIT: Fixed the issue; instead of projectiles, this uses monsters now. THe new spawns are no longer getting stuck in the walls.


Here is a new and simpler formula that I have come up with that works really well. Instead of spawning projectiles, it spawns small invisible wandering monsters that die after a short instant, that drops new monsters as it moves. Thus far I've had some really interesting results.

Share this post


Link to post
Jaxxoon R said:

Give the spawner projectile a slightly larger height and radius than the largest monster it can spawn.


I changed the values of the "spawn" actor's height and radius to be slightly larger. But unfortunately it makes the monsters stack up on top of one another.

Share this post


Link to post

I made an edit to the spawn actor

Spawn:
NONO A 1
Spawn1:
NONO A 1
loop
Death:
TNT1 A 0
EXPL A 0 A_CustomMissile ("Born", 45, 0, random (0, 360), 2, random (40, 90))
Stop
}
}

I changed the death to A_customMissile. It seems to have greatly reduced the chances of monsters getting stuck in walls. Nonetheless, the issue still persists.

Share this post


Link to post

Change the dimensions of the "spawn" actor according to this formula:

Radius = radius of the largest potentially-spawnable monster + speed of the "spawn" actor + 1
Height = height of the largest potentially-spawnable monster + speed of the "spawn" actor + 1

Alternatively, change its speed to match the same conditions, as in:

Speed = minimum ( radius of the "spawn" actor - radius of the largest potentially-spawnable monster - 1 , height of the "spawn" actor - height of the largest potentially-spawnable monster - 1 )


EDIT: And use SpawnHeight 0 in the A_CustomMissile codepointer that fires "Born". Also, its firing angle, direction and pitch are irrelevant, so you can put zeroes there too.

Share this post


Link to post
Kontra Kommando said:

ACTOR spawner Replaces Zombieman
{
game Doom
speed 40
health 1
radius 1
height 1
Gravity 0.9
Decal None
Monster
+NOTELEPORT
+NOBLOCKMAP
+THRUACTORS
Mass 1
States
{
Spawn:
NONO AA 3 A_Wander
TNT1 A 1 A_SpawnItemEx("Spawn", 0, 0, 0, 0, 0, 0, random(0, 360))
NONO A 0 A_Look
TNT1 A 1 A_SpawnItemEx("Spawn", 0, 0, 0, 0, 0, 0, random(0, 360))
NONO AA 3 A_Wander
TNT1 A 1 A_SpawnItemEx("Spawn", 0, 0, 0, 0, 0, 0, random(0, 360))
NONO A 0 A_Look
NONO AA 3 A_Wander
TNT1 A 1 A_SpawnItemEx("Spawn", 0, 0, 0, 0, 0, 0, random(0, 360))
NONO A 0 A_Look
NONO AA 3 A_Wander
TNT1 A 1 A_SpawnItemEx("Spawn", 0, 0, 0, 0, 0, 0, random(0, 360))
NONO A 0 A_Look
goto Death

Death:
TNT1 A 0
TNT1 A 1 A_SpawnItemEx("Spawn", 0, 0, 0, 0, 0, 0, random(0, 360))
Stop
}
}

actor Spawn : RandomSpawner
{
DropItem "Shotgunguy", 255, 10
DropItem "Zombieman", 255, 10
DropItem "Doomimp", 255, 10
}


Here is a new and simpler formula that I have come up with that works really well. Instead of spawning projectiles, it spawns small invisible wandering monsters that die after a short instant, that drops new monsters as it moves. Thus far I've had some really interesting results.

Share this post


Link to post

You shouldn't use A_Look the way you do, in fact you don't even need it. Also you shouldn't have monsters with greater speed that radius - they would pass through walls. Nothing in the new code guarantees that the spawned monster wouldn't get stuck or not spawn at all due to lack of free space.

Share this post


Link to post
scifista42 said:

You shouldn't use A_Look the way you do, in fact you don't even need it. Also you shouldn't have monsters with greater speed that radius - they would pass through walls. Nothing in the new code guarantees that the spawned monster wouldn't get stuck or not spawn at all due to lack of free space.


I changed the speed to 5 and the radius to 6. Also, I removed the a_look; you were right about it having no bearing on it. Seems to work well thus far.

Share this post


Link to post
Kontra Kommando said:

I changed the speed to 5 and the radius to 6.

But Zombieman, ShotgunGuy and DoomImp have radius 20 each. If you don't want them to ever get stuck or fail spawning, your spawner's radius should be at least 20 or 21 then.

Share this post


Link to post
scifista42 said:

But Zombieman, ShotgunGuy and DoomImp have radius 20 each. If you don't want them to ever get stuck or fail spawning, your spawner's radius should be at least 20 or 21 then.


I see, thought you meant the radius of the actor named "spawner". I actually just put those monsters as examples, without paying attention to their radius.

Share this post


Link to post

Also, guess what happens when you do this:

ACTOR spawner Replaces Zombieman
And then this:
DropItem "Zombieman"
I'm sure it will spawn another spawner rather than the original Zombieman.

Share this post


Link to post
scifista42 said:

Also, guess what happens when you do this:

ACTOR spawner Replaces Zombieman
And then this:
DropItem "Zombieman"
I'm sure it will spawn another spawner rather than the original Zombieman.


True, it would have to be a custom-zombieman or some other actor, as the random spawner, cannot spawn an actor it is replacing. Again, I actually am using this for different monsters; i just threw in the generic ones as examples.

At any rate, I changed the values for the radius and speed, and its working better now. I noticed some monsters were stuck within one another, with the way I had it prior.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×