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

How do you make a hero selecter??? PLEASE HELP!

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2010
Messages
950
well you have a selector unit like a wisp or something alike.

then you have a power circle in front of the hero or portal, doesn't matter.

make a trigger that when your selector unit enter that power circle you remove entering unit (which is the selector unit)

and finally create that hero for owner of triggering unit at location desired.

probably the easiest way for the recognition part between the region where the power circle is and the hero you want would be make a look up table with an array and make
hero_Region[1] = your region
hero_picked[1] = the hero behind that region

something like that^

then for your trigger for when you enter the power circle just make a loop and do a if then statment like:
if
area of entering unit = to hero_Region[Integer A]
then
remove the triggering unit
create hero_picked[Integer A] at your wanted location
else
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hero-selection-systems-38699/

And to be quick about it: There's a few ways to do it. The SIMPLEST way is to do this:

  • Selection
    • Events
      • Unit - A unit comes within 100.00 of Paladin 0073 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (==) Hero Chooser
    • Actions
      • Unit - Create 1 Paladin for (Owner of (Triggering unit)) at (Center of HeroSpawn1 <gen>) facing Default building facing (270.0) degrees
      • Unit - Remove (Triggering unit) from the game
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of HeroSpawn <gen>) over 0.50 seconds
Then you'd just have to add pathing blockers or rocks or something around the circles or portals. Whatever.

You need a separate trigger for each hero for this.
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Simple enough fix. Just add
  • Unit - Remove Paladin 0073 <gen> from the game
if you only want one of each hero.
 
Level 13
Joined
Mar 24, 2010
Messages
950
this is how you do it.

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Set 1 --------
      • Set i = 1
      • Set hero_Region[i] = Pally region <gen>
      • Set hero_Pick[i] = Paladin
      • -------- Set 2 --------
      • Set i = (i + 1)
      • Set hero_Region[i] = MK region <gen>
      • Set hero_Pick[i] = Mountain King
2nd

  • Hero Pick
    • Events
      • Unit - A unit enters Pally region <gen>
      • Unit - A unit enters MK region <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (hero_Region[(Integer A)] contains (Triggering unit)) Equal to True
            • Then - Actions
              • Unit - Remove (Triggering unit) from the game
              • Unit - Create 1 hero_Pick[(Integer A)] for (Owner of (Triggering unit)) at ((Owner of (Triggering unit)) start location) facing Default building facing degrees
            • Else - Actions
for int A from 1 - (any number of heros you want)
and the whole system can be done with countless heros in 1 trigger. (not counting the initialization trigger.)
;)
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Edit, don't multi-post, mate.

If you want a simpler trigger, use my system. MUCH simpler.

What his does is use integer variable counter to index the arrays so he can loop through them to consolidate the trigger. I was close to replicating that, but didn't have the counter variable in mind, lol.

Anyway, basically, it makes it so you can loop instead of have separate triggers. It does the same thing basically, just more efficient, :)
 
Status
Not open for further replies.
Top