Teleport trick

From AgeofWiki

The Teleport Trick is a small trigger trick that allows you to

  • circumvent the unhandy Teleport units/Army teleport effects (units walk back after being teleported)
  • teleport a unit to another unit, we will call it 'target unit' (a moving one is possible as well)
  • teleport units in MP scenarios (once MP scenarios are enabled and if the normal Teleport effect doesn't work in MP, like in AoM)

It looks time-consuming at first sight, but under "Is that worth all the fuss?" you'll learn the quick way.

The secrets? The "Garrison" effects and a Fishing Boat.

Table of contents

Setup

At the beginning of the scenario (or at least before the Teleport Trick) you need a Modify Protounit effect once. Select the player whose units you want to teleport, Fishing Boat, Max Contained, and a high number, for example 1000. This increases the carry capacity of a Fishing Boat, so that it can contain many units. (You don't need to do this if you want to teleport less than ten units at a time, but I recommend it anyway.) Now we're ready to go.

How it works

We want to teleport the Highlander to the cubic Cinematic Block.

I think this picture illustrates quite well how it works. The arrows show which effects affect which units.

Image:TelTrick.JPG

You need at least these four effects, pay attention to the order, which is very important. The target unit has to belong to the same player as the teleported units (if that isn't the case, you could insert one or two Convert effects).

  • Change Unit Type: Select the target unit and change it to a Fishing Boat.
  • Unit Immediate Garrison: Garrison the unit(s) that's supposed to be teleported into the target unit, which is now a Fishing Boat. The unit(s) will directly be garrisoned, without walking to the target unit.
  • Ungarrison: Select the target unit. Ungarrisons the teleported unit(s). The unit(s) has now reached its destination.
  • Change Unit Type: Change the Fishing Boat back to its original unit type.

Ta-daa, we're done. The Fishing Boat is what it was before and the teleported unit(s) stand next to it. Everything goes so fast that you can't see it.

Is that worth all the fuss? The simplification (a new effect)

Well, the Trick is definitely handy (for reasons see above). I do admit though that it's kind of much work if you do it manually. I thus coded a new trigger to simplify the process (if you don't know how to add new triggers, you can see the Adding Custom Triggers guide):

  <Effect name="Teleport To Unit">
     <Param name="SrcObject" dispName="$$22295$$Source Units" varType="unit">default</Param>
     <Param name="DstObject" dispName="$$22296$$Target Unit" varType="unit">default</Param>
     <Param name="ProtoUnitA" dispName="Temporary Container" varType="protounit">FishingBoat</Param>
     <Param name="ProtoUnitB" dispName="Unit Type Afterwards" varType="protounit">CinematicBlock</Param>
     <Command>trBlockAllSounds(true);</Command>
     <Command>trUnitSelectClear();</Command>
     <Command loop="" loopParm="DstObject">trUnitSelect("%DstObject%");</Command>
     <Command>trUnitChangeProtoUnit("%ProtoUnitA%");</Command>	  
     <Command>trUnitSelectClear();</Command>
     <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
     <Command>trImmediateUnitGarrison("%DstObject%");</Command>
     <Command>trUnitSelectClear();</Command>
     <Command loop="" loopParm="DstObject">trUnitSelect("%DstObject%");</Command>
     <Command>trUnitEjectContained();</Command>
     <Command>trUnitChangeProtoUnit("%ProtoUnitB%");</Command>
     <Command>trUnblockAllSounds();</Command>
  </Effect>

There you go. A Source Unit which gets teleported to the Target Unit. The Fishing Boat is the default Temporary Container, and after the process the Target Unit is changed to a cinematic block by default (Unit Type Afterwards). You can select any other unit type here. For the container things obviously only work with things that can contain units, like a Fishing Boat.
On a side note, the Modify Protounit effect at the beginning is still needed if you want to teleport more than ten units at a time.

Notes

  • If you don't know what to use as a target unit I recommend Cinematic Blocks (like shown in the picture). They're dummy objects and cannot be seen in-game.
  • I consider Fishing Boats being the best compromise of size and bug-freeness. As they're small, units aren't spread out much around the destination.
  • The disadvantage is, if you want to teleport units to units way bigger than a Fishing Boat, like buildings, the units will get stuck in the buildings afterwards. Here you could try bigger ships, like Frigates (don't forget that the Modify Protounit effect at the beginning must be set to Frigates then).
  • All Fishing boats will be affected by the Max Contained modification. If you want to avoid this, use Modify Protounit before and after the trick. In the second Modify Protounit effect you can reduce Max Contained again. This way the Max Contain boost will last only for the instants the trigger is executed.
  • If you teleport units to other (moving) units, these will cancel all orders, like moving. Not a major bug though in my opinion.
  • All units that can be garrisoned in a Fishing Boat can be teleported this way. (For professionals: Every unit type which has <UnitType>LogicalTypeGarrisonInShips</UnitType> in its proto code.)