• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

How to select hero by double click?

Status
Not open for further replies.
Create a boolean variable (called "clicked" or something, use arrays if there are multiple players).

Create a trigger with the event "a unit is clicked" (or a specific unit event, your choice).
If clicked == false, then set clicked = true
If clicked == true, then create hero for player.

If a player switches from hero (in the selection screen), set clicked to false.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Supposedly you have 5 heroes in your map, this trigger is the way to go~
  • Load Hero
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • P01_PickedHero Equal to False
          • Or - Any (Conditions) are true
            • Conditions
              • (Triggering unit) Equal to Orist Icebrand 0004 <gen>
              • (Triggering unit) Equal to Shelv Stormcast 0003 <gen>
              • (Triggering unit) Equal to Kelen Wellsun 0000 <gen>
              • (Triggering unit) Equal to Agor Stonebreaker 0001 <gen>
              • (Triggering unit) Equal to Wanderer 0178 <gen>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to P01_LoadHero
        • Then - Actions
          • Unit - Create 1 (Unit-type of (Triggering unit)) for (Triggering player) at (Center of 001 Hero Intro <gen>) facing Default building facing degrees
          • Set P01_PickedHero = True
          • Set P01_Hero = (Last created unit)
          • Set P01_HeroName = (Proper name of (Last created unit))
          • Trigger - Turn off Camera Lock For Intro <gen>
          • Trigger - Turn off Pick Agor Stonebreaker the Dwarf <gen>
          • Trigger - Turn off Pick Orist Icebrand the Hunter <gen>
          • Trigger - Turn off Pick Kelen Wellsun the Mage <gen>
          • Trigger - Turn off Pick Shelv Stormcast the Sorcerer <gen>
          • Trigger - Turn off Pick Anaya Lightsong <gen>
          • Trigger - Run Intro Entrance <gen> (ignoring conditions)
        • Else - Actions
          • Set P01_LoadHero = (Triggering unit)
The Event is "Player - Selection Event"
P01_PickedHero is Boolean-type variable
P01_LoadHero is Unit variable
Just follow the trigger (in my map, I have 5 heroes, in yours, I don't know)
Tell me if you have any problem~
 
Status
Not open for further replies.
Top