HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

mass teleport edit

01-28-2003, 06:09 PM#1
fr0ggE
i remember this question got asked before, but i don't remember what the answer was...

is there a way to edit what type of unit gets teleported via mass teleport. The targets field only affects what type of thing you can teleport *to*.
01-28-2003, 07:46 PM#2
rwxr-xr-x
I've tried to find a way around this myself at one point, but had no luck. I didn't find any information in regards to the topic, so I pretty much resigned myself to the fact that you can't altar what can actually be teleported. By default, MT will teleport 24 of your units, regardless of what they are.

This, however, was not satisfactory to me, and I got around this via a trigger. The example below will only prevent 1 unit type from not being teleported. But you could easily add another action for each unit type you don't want teleported to add it to the unit group. You will need to create a variable of type Unit Group, which in this example is called noteleport

[DontMassTeleport]
EVENTS
Unit - A unit owned by Player 1 is issued an order targeting an object
Unit - A unit owned by Player 1 is issued an order targeting a point
...(continue for all players)...
CONDITIONS
(Issued order) Equal to Human Archmage - Mass Teleport
ACTIONS
Unit Group - Pick every unit in (Units within 700 of (Position of (Ordered unit))) and do (If ((Unit-type of (Picked unit)) Equal to Footman) then do (Unit Group - Add (Picked unit) to noteleport) else do (Do nothing)
(The range of 700 is default for MT...change this to match your range if you modify it)
Unit Group - Pick every unit in noteleport and do (Unit - Change ownership of (Picked unit) to Neutral Passive and Retain color)
Wait 4.00 seconds [gives time for MT to finish]
Unit Group - Pick every unit in noteleport and do (Unit - Change ownership of (Picked unit) to (Owner of (Ordered unit)) and Retain color)
Unit Group - Remove all units of (Units owned by (Owner of (Ordered Unit)) from noteleport

Hope that helps.

*EDIT* Forgot to mention one caviat...this trigger would actually not behave correctly if you had 2 ppl casting Mt within the 4 second time frame. Say Player 1 were to cast, then Player 2 casts. The variable noteleport would then have units in it that belonged to Player 2, and Player 1 would end up owning them. The only way aound this is to break this out into seperate triggers for each player.