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

Hero Choosing - Choose a Hero with an Ability

Level 6
Joined
Aug 13, 2009
Messages
197
Hero Choosing - Choose a Hero with a "Choose" Ability
by .Ragnaros

Introduction

Difficult:
Very Easy 2/10
This tutorial consists in teaching you how to make a hero choosing system where the soul or the choosing unit has an custom ability called "Choose" or whatever you want, it doesn't need to be the same ability I'm using.

Here I'm gonna use a Banshee with a custom spell called Choose (I based myself in Storm Bolt ability and edited it in order to make the perfect "Choose" ability ^^)

The Triggers

  • Choose the Hero
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • Multiple ConditionsOr - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Target unit of the ability being cast)) Equal to (==) Paladin
          • (Unit-type of (Target unit of the ability being cast)) Equal to (==) Blood Mage
          • (Unit-type of (TTarget unit of the ability being cast)) Equal to (==) Archmage
    • Actions
      • Unit - Create 1 (Unit-type of (Target unit of the ability being cast)) for (Owner of (Casting unit)) at (Center of Here <gen>) facing Default building facing (270.0) degrees
See below the explanation...

Triggers Explanation

*The Events*

On the First Trigger ("Choose the Hero") we've...

  • Unit - A unit Finishes casting an ability
This event makes the actions run only when a unit finishes casting an ability checking conditions (conditions explained below)

*The Conditions*

  • (Ability being cast) Equal to (==) Choose Hero
    • Multiple ConditionsOr - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Target unit of the ability being cast)) Equal to (==) Paladin
        • (Unit-type of (Target unit of the ability being cast)) Equal to (==) Blood Mage
        • (Unit-type of (Target unit of the ability being cast)) Equal to (==) Archmage
Ok, here's one of the most important part of the trigger, without this, your chooser could just cast the "Hero Choose" on any unit randomly and it would provoke chaos! Now explaining each single condition:

  • (Ability being cast) Equal to (==) Choose Hero
This condition makes sure that the event ability being cast is Choose Hero. If it is, it'll check the other condition:

  • Multiple ConditionsOr - Any (Conditions) are true
    • Conditions
      • (Unit-type of (Target unit of the ability being cast)) Equal to (==) Paladin
      • (Unit-type of (Target unit of the ability being cast)) Equal to (==) Blood Mage
      • (Unit-type of (Target unit of the ability being cast)) Equal to (==) Archmage
This "OR" condition makes sure that the hero you targeted with the "Choose Hero" spell is Paladin, Blood Mage OR Archmage (You can customize it for your own heroes), if it wasn't an OR condition it would check if the targeted hero was Paladin, Blood Mage AND Archmage. Choosing the right condition type is very important, because it could screw up your map.

*The Action*

  • Unit - Create 1 (Unit-type of (Target unit of the ability being cast)) for (Owner of (Casting unit)) at (Center of Here <gen>) facing Default building facing (270.0) degrees
If every condition fits the situation then this action will be ran, it creates an Hero of the same type of the hero you targeted with your "Choose Hero" in the middle of region "Here" (You can change the region "Here" to whatever you want).

Demo Map

Download Demo Map Here - EPICWAR

*I also attached the demo map to the thread.

*** I hope it's good enough to your expectations ***

Regards,
.Ragnaros
 

Attachments

  • Ability Choosing Hero System - Demo Map.w3x
    18.8 KB · Views: 62
Level 6
Joined
Aug 13, 2009
Messages
197
Beep, Where's the leak? o_O I mean... I'm not using variables, I create an unit directly in the center of the region...

The finish the effect of an ability means that the unit will do the ability animation before picking the hero, if It was begins the effect of an ability it would be instantly and without special effects.
 
Level 11
Joined
Feb 16, 2009
Messages
760
Storm bolt is a bad abilty for these things due to it always stunning. Use channel for these things, its also more configurable and made for these things.

Also, instead of making a condition for every hero(Imagine if you have 50 heroes), just make a condition
  • Conditions
  • (Unit type of (Triggering unit) is not equal to Hero Chooser
 
Level 15
Joined
Dec 18, 2007
Messages
1,098
Perhaps it would be simpler if you just based the spell off the Banshee's Possess and allow hero targetting?
You can then simply use "Unit- Changes Owner" or whatever and move the unit to the place you want.

Not really a very useful tutorial IMO, but if you add different stuff, you could consider it a "Snippet" kind of tutorial, which includes different kinds of small systems and stuff.

Good luck with this tutorial, it's ok so far.
 
Top