• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Teleport an ENEMY unit

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
Staff of Sanctuary allows a player to teleport a friendly unit home to it's townhall. If I select "Targets allowed: Enemy" it can still not target enemy units.

Any ideas how to teleport enemy units home to their base?
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
Hmmm,you could make an item in Object editor(like the staff of teleportation and set the targets allowed to be enemies too).
Then create a trigger when "item" used,teleport enemy unit to XX(where you want) location.
If you want it to be an ability just add item ability to this ability and change the trigger a bit.
 
Last edited:
Level 4
Joined
Feb 23, 2009
Messages
99
i would make a spell based on anything that takes a unit target, then create the teleportation via triggers..
 
Level 22
Joined
Feb 3, 2009
Messages
3,292
Ok i'll make it.

Here is a demo map:

Spell is MUI, should be leakless.

Edit: I need to tell you this: my spell teleports to a random unit ID which you pick, i used town hall, so in my case it teleports it to any town hall owned by the target. To make it teleport to the highest level town hall (if yo need that) would be a little more work...)
 

Attachments

  • EnemyBlink.w3x
    24 KB · Views: 99
Last edited:
Level 10
Joined
Nov 5, 2008
Messages
536
Thanks for your trigger! It works very well, and it is good that they are teleported to any townhall. But I was a bit unclear, I actually wants the spell to work on both friendly and enemy units. (It shall also be a hero-spell)

Is this possible to make?
 
Level 22
Joined
Feb 3, 2009
Messages
3,292
Both on alies or enemy you say? and levels? ok will do it right away !

Demo map:

JASS:
// The code is actualy still same,
// I made so in the first time that it would work
// for both alies and enemys, just had to change
// the object editor spell, Targets Allowed and 
// added Friend. So now it works, I also added 3 levels,
// and made it a hero spell now.
 

Attachments

  • Teleport.w3x
    22.5 KB · Views: 102
Level 6
Joined
May 1, 2009
Messages
215
You can open two maps at the same time. Open your map first, then the spell map. Copy the ability first from the object editor, the close the spell map. Paste the spell in the obj editor spell section of your map. Open the spell map again and copy the triggers, close the spell map and paste them into your map.

If a dummy unit is involved, you'll need to copy that over too.

If you don't have any triggers in your map currently, you could also file --> export trigger data then import that file into your map.
 
Level 10
Joined
Nov 5, 2008
Messages
536
You can open two maps at the same time. Open your map first, then the spell map. Copy the ability first from the object editor, the close the spell map. Paste the spell in the obj editor spell section of your map. Open the spell map again and copy the triggers, close the spell map and paste them into your map.

If a dummy unit is involved, you'll need to copy that over too.

If you don't have any triggers in your map currently, you could also file --> export trigger data then import that file into your map.


Thanks for the info, but since this is a scripted trigger (MUI) or what you call it, do I need to copy all the scripted text and implent it in my map in some way?
Or is it just that simple to copy and paste the trigger with the script in it?
 
Level 4
Joined
Apr 25, 2008
Messages
75
You can open two maps at the same time. Open your map first, then the spell map. Copy the ability first from the object editor, the close the spell map. Paste the spell in the obj editor spell section of your map. Open the spell map again and copy the triggers, close the spell map and paste them into your map.

If a dummy unit is involved, you'll need to copy that over too.

If you don't have any triggers in your map currently, you could also file --> export trigger data then import that file into your map.
Instead of closing and opening what you can do is open one of the maps, then open the other. Then click on "Window" and at the bottom is a list of maps opened, just click on them to switch between!
 
Status
Not open for further replies.
Top