Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
The Doomlad

Trouble with teleporting enemies in maps

Recommended Posts

I've been struggling with creating effective teleports in my maps. Whenever I try teleporting a group of enemies into an area at least half of them always don't teleport. I'm using UDMF map format. I start with the spawn room and I mark it with a tag. I then tag the monsters with a seperate tag. I've tried placing more teleport spots than are needed and placing the exact amount of enemies that I need to teleport in. However I always run into the issue of less then half of the monsters not teleporting. any help is appreciated.

Share this post


Link to post

This sort of problem requires more context, as there are many different ways to setup teleport traps, and even more ways they can be setup wrong. 

To get to the solution faster, it'd be advantageous to upload a map here so people can probably inspect your setup and any potential shortcomings it may have. 

Share this post


Link to post

Here is the simplest way to make teleporting monsters:

 

Make a sector just large enough to hold your monster. And then put your monster in. The sector size doesn't have to be exact, just don't go overboard on free space or the teleport won't work quite as smoothly. Make sure the monster's "Deaf"/"Ambush" option is not checked. 

 

Make a thin sector on one side of the monster sector, covering the whole length of that side. This sector will be a door. Then, make another sector the same size as the monster sector and put it on the other side of your door sector.

 

All three sectors should have the same floor height. The two monster size sectors should be tall enough that the monster can move around in them. Move the ceiling of the door sector to eight map units above the floor. (Eight is not a magic number, it's just a convenient one that will work. It has to be at least one above so that it doesn't block sound, and less than 56 or so units - depending on the monster height - so that it still blocks the monster until opened.)

 

Assign the door sector an unused tag. Now select one of the passable lines of the door (one of the lines the monster can walk over) and give it the "WR Teleport" action (Boom or Doom in Doom format - this will be slightly different in other map formats, e.g. a "Teleport" action with the line's "repeatable action" and "monster walks over" checkboxes selected.), and choose another different unused tag. 

 

Put one Teleport Destination thing where you want your monster to appear. Tag the sector containing the destination thing with the same tag as your Teleport line. Do not put more than one destination thing in the same sector; when there is more than one, monsters will still teleport to the same destination every time, they will not ever teleport to any destination in that sector except for the first one. 

 

Choose or place a line that you want to trigger the monster teleports. Usually I do this with a player walk-over action, e.g. "W1 Door Open Stay", but you can also do it with a switch, or some other actions. Give it some door open stay action and assign it the same tag as your door sector that you made before. 

 

One more important step. You must attach a small sector, e.g. 32 units square (Exact size isn't important, but it works better when the sector is too small for the monster to enter), to your monster closet - I usually put it on the side opposite the monster from the door, but anywhere works as long as it IS NOT touching the door sector and IS touching one of the other sectors. Now you must join one of the sectors in your map to this small sector. Make sure that the floor is not above the closet sector's ceiling, and that its ceiling is not below the closet sector's floor.

 

This allows sound to reach the monster and wake it up - it won't teleport until both of these things happen: The door is open and the monster has woken up. You should join it with a sector where player is sure to fire a weapon and the sound will reach it, usually because of monsters that are tough to run past without fighting, sometimes because of a gunfire switch. However it is possible to allow interesting player strategies by allowing knowledgeable players to avoid waking up the monsters and causing them to teleport. It is fairly important, though, that a player who isn't specifically trying to not trigger the teleport will trigger it just by normal play. 

 

If I remember correctly ZDoom ports have actions for waking up monsters e.g. when the player walks over a line, so that the teleports are guaranteed to happen, but I don't believe this is possible with Doom or Boom.

 

And there you have it! A teleporting monster. 

 

You can experiment with wide closets holding multiple monsters for larger encounters. Boom ports have a "Scroll Floor, Move Things" linedef action which can be used instead of a wake-up sector, to control the timing of the teleports. You can use raising or lowering floors in the closets instead of doors to produce some different timings and effects. But I suggest starting by getting a single-monster closet with a door and a sound carrying sector working before trying something more creative. 

Edited by meapineapple

Share this post


Link to post
Quote

Do not put more than one destination thing in the same sector; when there is more than one, monsters will still teleport to the same destination every time, they will not ever teleport to any destination in that sector except for the first one.  

 

I was wondering about this. How can I make monsters from one closet teleport to random destinations? I think I used one teleport line with several different destinations which featured the same tag and they teleported randomly around those destinations. Is that a UDMF only feature?

Share this post


Link to post

These are the only items I would add:

 

If the teleport destination is blocked, either by the player or by another monster, then the monster won't teleport to it. The monster will just pass right over the teleport line. If this happens, you can either add several teleport lines one after another, or a teleport line that teleports the monster back to a point to walk toward the teleport line again.

 

Boom conveyor belts can be used to teleport monsters that are still dormant by using short walls or doors to block them from being carried further on the conveyor belt (as meapineapple described). The teleport destination will have to be clear or the monster will just be carried over the teleport line. In this case, I find it easiest to put another teleport line past the first one that takes the monster back to the beginning of the conveyor belt.

 

Share this post


Link to post

ok so to add more context I'm using the teleport group command. The command line looks like this , TeleportGroup (4, 5, 6, 1, 1);. I'm tagging the monsters with 4 the room with 5 and the teleports are with 6, move source seems to not affect the result and the other 1 is for fog. I put the enemies in a room big enough to store all of them. the enemies I'm using are 48 x 48 in size and the room they are stored in is 256 x 256. 

Screenshot (23).png

Screenshot_Doom_20181119_094313.png

Share this post


Link to post

You're not using TeleportGroup correctly... it simply can't do what you want to do. You'll either have to teleport each thing independently (with something like meapineapple described) or use something like SpawnSpot.

Share this post


Link to post

You could use a script like this:

#include "zcommon.acs"

Script 1 (void)
{
	int tid_monster = 1;
	int tid_tele = 2;
	
	While(ThingCount(0, tid_monster))
	{
		SetActivator(tid_monster); //Select one of the monsters (not random)
		
		int x = GetActorX(0); //Get current location
		int y = GetActorY(0);
		
		Teleport(tid_tele); //Try teleporting
		
		int newx = GetActorX(0); //Get new location
		int newy = GetActorY(0);
		
		if (newx != x || newy != y) //If the location changed, teleporting succeeded.
			Thing_ChangeTID(0, 0); //Untag monster to prevent script from teleporting it again
			
		Delay(1); //Delay to prevent script from dying
	}
}

This script will always teleport the monsters in the same order, but they will 'land' randomly on different teleport destinations if there are multiple of them.

 

4 hours ago, elend said:

 

I was wondering about this. How can I make monsters from one closet teleport to random destinations? I think I used one teleport line with several different destinations which featured the same tag and they teleported randomly around those destinations. Is that a UDMF only feature?

ZDoom seems to pick at random if you have multiple teleport destinations and the map is in Hexen or UDMF format. Though if you use a mapspot instead of a teleport destination, it will only choose the first one.

 

 

Share this post


Link to post
54 minutes ago, Worst said:

You could use a script like this:


#include "zcommon.acs"

Script 1 (void)
{
	int tid_monster = 1;
	int tid_tele = 2;
	
	While(ThingCount(0, tid_monster))
	{
		SetActivator(tid_monster); //Select one of the monsters (not random)
		
		int x = GetActorX(0); //Get current location
		int y = GetActorY(0);
		
		Teleport(tid_tele); //Try teleporting
		
		int newx = GetActorX(0); //Get new location
		int newy = GetActorY(0);
		
		if (newx != x || newy != y) //If the location changed, teleporting succeeded.
			Thing_ChangeTID(0, 0); //Untag monster to prevent script from teleporting it again
			
		Delay(1); //Delay to prevent script from dying
	}
}

This script will always teleport the monsters in the same order, but they will 'land' randomly on different teleport destinations if there are multiple of them.

 

ZDoom seems to pick at random if you have multiple teleport destinations and the map is in Hexen or UDMF format. Though if you use a mapspot instead of a teleport destination, it will only choose the first one.

 

 

Thanks this helped alot.

Share this post


Link to post

Since you are using UDMF, set the front wall of the teleport closet to teleport the monsters when they bump it, and make it repeatable, of course. That way, they will keep trying to teleport until the teleport destination is no longer blocked.

Share this post


Link to post

Also bear in mind in GZDoom UDMF (and other similar soureports) you don't even have to teleport the enemies, just spawn them.  Something like this:

 

Script "Ambush" (void)
{
  SpawnSpotFacing([spawnspot tag], "Name of monster", 0);
  SpawnSpotFacing([spawnspot tag], "TeleportFog", 0);
}

 

Give every one of your spawnspots the same tag, and voila, easy spawning.  They won't spawn if something is blocking the way, but as it's likely to be another enemy, is that an issue?  Alternatively you can use SpawnSpotFacingForced to ensure they spawn no matter what.

Share this post


Link to post
On 11/19/2018 at 9:30 AM, elend said:

 

I was wondering about this. How can I make monsters from one closet teleport to random destinations? I think I used one teleport line with several different destinations which featured the same tag and they teleported randomly around those destinations. Is that a UDMF only feature?

 

 

For random destinations, I use large monster pens and have the teleport line broken up with vertexes into a bunch of different lines, each line tagged to teleport to a different sector.

 

Unless you need to move the floors and/or ceilings of the sector you want the monster to teleport into, for what you're doing, I would make four smaller sectors inside the larger one and give each one a different tag and a teleport destination, then put the monsters in individual small closets.

 

But I'm just used to doing things the old-fashioned way.

Share this post


Link to post
14 hours ago, Stabbey said:

 

 

For random destinations, I use large monster pens and have the teleport line broken up with vertexes into a bunch of different lines, each line tagged to teleport to a different sector.

 

Unless you need to move the floors and/or ceilings of the sector you want the monster to teleport into, for what you're doing, I would make four smaller sectors inside the larger one and give each one a different tag and a teleport destination, then put the monsters in individual small closets.

 

But I'm just used to doing things the old-fashioned way.

That's how I do it, combined with the teleport-when-monster-bumps idea I posted earlier. Yes, it is the old-fashioned way, but the advantage over spawning in new monsters is that the monster count that the player sees is accurate. If he sees that there are 157 monsters remaining, that really is how many there are remaining.

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
×