• 🏆 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!

Trigger help

Status
Not open for further replies.
Level 5
Joined
Mar 23, 2018
Messages
29
Im struggling with triggers for 3 hours and cant do anything. First of all how to select an type of unit, not to select specific unit on map. Cuz i have hero selection map. Second, How to make an (Summoned unit) Die after i use morph. Cuz its like i have Hero on foor and horse, and when i use morph for hero, he get on horse and i want that horse to dissapear. I tried with mount Hyppograph and pick up archer spells, but hero just die and spawn again, its not working like that. Atleast i think its not....
 
Hello so for your first question
''how to select an type of unit''
you can do something like this
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Defend
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Casting unit)) Equal to Footman
        • Then - Actions
        • Else - Actions
as for the skill
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to ..Mount
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Casting unit)) Equal to Cavalier
          • (Unit-type of (Target unit of ability being cast)) Equal to Riderless Horse
        • Then - Actions
          • Unit - Remove (Target unit of ability being cast) from the game
          • Unit - Replace (Casting unit) with a Knight using The old unit's relative life and mana
        • Else - Actions
So the ...Mount is a dummy skill that i made : I used Ancestral Spirit
Captură ecran (922).png
Next for you Riderless Horse you will need to change his Unit Classification to Tauren
Captură ecran (923).png
And you will need to make 2 units ,for example:
1 Cavalier normal unit/hero
2 Knight is the Cavalier mounted on the Horse
 
View attachment 401900
what is this Unit, when i try copying to my map, i dont know what to do with this [Unit]
  • dismount
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to ...dismount
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Casting unit)) Equal to Lord Garithos
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (Casting unit) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
          • Wait 0.50 seconds
          • Unit - Replace (Casting unit) with a Paladin using The old unit's relative life and mana
          • Unit - Create 1 Riderless Horse for (Triggering player) at (Position of (Casting unit)) facing Default building facing degrees
          • Set Unit = (Last created unit)
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
  • Set Unit = (Last created unit)
Unit is a variable
Go to variable
 
View attachment 401900
what is this Unit, when i try copying to my map, i dont know what to do with this [Unit]
One thing about the special effect here is that if you have another trigger that creates a special effect during this 0.5 seconds wait, the "Destroy (Last created special effect)" of this trigger will destroy that one, because it is created AFTER this special effect.

In this case, for feral spirit (and many other effects), you can destroy it "instantly" (Move up Destroy destroy special effect to before wait and see that it still works).

Another way to solve this issue (if your effect cannot be destroyed before waiting) is to have a Special Effect variable that you set before the wait and the Destroy that variable instead of (Last created special effect).
 
Status
Not open for further replies.
Top