View Full Version : How to select hero by double click?
01-06-2011, 06:24 PM
Hi, how to select hero by double clicking him like in x hero siege?
01-06-2011, 06:52 PM
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.
01-07-2011, 07:33 AM
Your way is 1 click or i don't understand, anyway i found better way if any one interesting here it is:
Now you have to click on hero 2 times within half second :goblin_yeah:
01-07-2011, 08:36 AM
That's what I said, but with an integer instead of a boolean (imo a boolean is better because it can only be 0 or 1, while an integer can be... quite big).
And of course, I didn't say anything about the timer either because neither did you :D
01-07-2011, 08:46 AM
Supposedly you have 5 heroes in your map, this trigger is the way to go~
Player - Player 1 (Red) Selects a unit
And - All (Conditions) are true
P01_PickedHero Equal to False
Or - Any (Conditions) are true
(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>
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~
01-07-2011, 09:08 AM
- Remove the leak! (Location leak)
- Remove the "and [multiple conditions]"
But yes, that's correct.
01-07-2011, 09:19 AM
Aha, okay, I'll remove it, dear friend =D
01-07-2011, 09:49 AM
That's great, thank you :D
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO