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

Need help with a trigger

Level 1
Joined
May 22, 2023
Messages
1
I've been really trying to figure out how to use triggers effectively but I can only make very basic ones. I'm just trying to make a trigger that will restrict training of a unit while another is still living.

I made a custom Kel'Thuzad (Necromancer) that, when he dies, will turn into Kel'Thuzad (Lich). I do this by using the "Spawn Hydra" ability.

I got the training limit to work for while he is in his necromancer form but when he turns into a lich after dying I can just train another Kel'Thuzad (Necromancer)

I don't know what to use for the Conditions part of my trigger.
Currently looks like this:
Events
Unit - A unit enters (Playable map area)
Conditions
???
Actions
Player - Limit Training of Kel'Thuzad (Necromancer) to 1 for Player 1 (Red)

I'd actually much rather have a trigger that allows me to unlock training him as a hero when his necromancer form dies but I can't figure out these triggers for the life of me. This just seems easier to me.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
I assume you want to check if the unit that entered the map is a Lich:
  • Conditions
    • Unit-Type of (Triggering unit) Equal to Kel'Thuzad (Lich)
It's a Unit-Type Comparison.

Also, you can Limit the training for the owner of said unit instead of always doing it for Player 1 (Red):
  • Player - Limit Training of Kel'Thuzad (Necromancer) to 1 for (Owner of (Triggering unit))
(Triggering unit) is the Unit that is referred to in the Event.

You can use Requirements to prevent the Hero from being trained. This can be done the same way a Rifleman requires a Blacksmith to be trained or how some Units/Upgrades require you to tech to Tier 2 or Tier 3. It shouldn't be too difficult to look at existing examples of these requirements and copy them.

Here's an example. UnlockKel is an upgrade that you would create in the Object Editor. You would then setup Kel'Thuzad (Necromancer) to use this Requirement in the Object Editor. Lastly, you trigger this upgrade to be researched when the hero dies:
  • Events
    • Unit - A unit dies
  • Conditions
    • Unit-Type of (Triggering unit) Equal to Kel'Thuzad (Necromancer)
  • Actions
    • Player - Set level of UnlockKel to 1 for (Owner of (Triggering unit))
Once the Necromancer dies the upgrade is researched. This upgrade is a requirement of the hero.
 
Last edited:
Top