• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Create Teleportation Effect on Created Unit

Status
Not open for further replies.
Level 7
Joined
Sep 10, 2022
Messages
94
I am creating a bunch of units in the region. When they are created, I need to appear them with the "Teleportation" Effect, like they were teleported into this region.
I tried to do it like this: I created units in the region with Unit-Create, then I used "Unit Group - Pick every Unit in <region> and do <Special Effect>. But I am sure, that's not how it's done. Because after I had chosen the teleportation effect, it did not work.
So, how to properly play this effect?
 
Level 22
Joined
Aug 29, 2012
Messages
895
Well you have the right idea, maybe you could have a separate trigger like this:

  • SFX
    • Events
      • Unit - A unit enters YourRegion
    • Conditions
    • Actions
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
      • Special Effect - Destroy (Last created special effect)
That way you can detect any unit that enters the region and create the effect individually. You'd probably need to add a condition to make sure it only affects your created unit (and not e.g. an unit that would just step inside this region)
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,721
I am creating a bunch of units in the region. When they are created, I need to appear them with the "Teleportation" Effect, like they were teleported into this region.
I tried to do it like this: I created units in the region with Unit-Create, then I used "Unit Group - Pick every Unit in <region> and do <Special Effect>. But I am sure, that's not how it's done. Because after I had chosen the teleportation effect, it did not work.
So, how to properly play this effect?
If you're creating the units via triggers then you have access to them with the (Last created unit) Event Response:
  • Actions
    • Unit - Create 1 Footman...
    • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
    • Special Effect - Destroy (Last created special effect)
If you create multiple units at once then you can use the (Last created unit group) function inside of a Pick Every Unit function in order to reference all of them at once:
  • Actions
    • Unit - Create 5 Footman...
    • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
      • Loop - Actions
        • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
        • Special Effect - Destroy (Last created special effect)
Any Actions you put in Loop - Actions will happen once per unit in the unit group. To reference the current unit in the loops cycle you use (Picked unit).

Alternatively, you can use a For Loop:
  • Actions
    • For each (Integer A) from 1 to 5, do (Actions)
      • Loop - Actions
        • Unit - Create 1 Footman...
        • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
        • Special Effect - Destroy (Last created special effect)
I prefer the For Loop approach, it's the most flexible.
 
Last edited:
Level 40
Joined
Feb 27, 2007
Messages
5,118
Every model has its own attachment points. Many are standardized but they vary based on how the model looks/what it does/how it’s animated, and the only one that’s guaranteed is origin.

Loading the model in a viewer you should be able to see what they are. Common ones:

overhead
origin
chest
hand,left
hand,right
 
Status
Not open for further replies.
Top