Hero Repick System Help

Status
Not open for further replies.
Level 3
Joined
Jun 5, 2008
Messages
14
Hero Selection

My hero selection is basically like the one in Enfos, where a ghost is created at a hero selection area and has to move to the circle of power infront of the hero of choice to use it. I have already got this worked out.

Repicking
At first I wanted a repick system like DotAs -repick command, but I did not know how to do it. I tried to resolve the problem by creating another style of repick. Basically, the hero would have to move to a region and it will be removed, creating a new ghost at the Hero Selection Area. The repick will be disabled after 60 seconds, I got that worked out.

Problem
Like DotA, I only want the players to be able to repick hero only once, and that is what I need help with.

Thanks for the help, appreciated!
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
Repick command
  • Repick
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerHasRepicked[(Player number of (Triggering player))] Equal to False
        • Then - Actions
          • Set PlayerHasRepicked[(Player number of (Triggering player))] = True
          • Unit Group - Pick every unit in (Units owned by (Player((Player number of (Triggering player)))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
              • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
              • Game - Display to (All players) the text: You've successfully...
        • Else - Actions
          • Game - Display to (All players) the text: You can't repick yo...
Repick off after 60 seconds
  • Repick Off
    • Events
      • Time - Elapsed game time is 60.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Repick has been dis...
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set PlayerHasRepicked[(Integer A)] = True
      • -------- Or use trigger turn off function --------
      • Trigger - Turn off Repick <gen>
PS: I have an exam and I am a little bit late, so I can't explain anything in the trigger.
If someone with more time can explain, then ok.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
The variable is boolean array.

  • Repick
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerHasRepicked[(Player number of (Triggering player))] Equal to False
        • Then - Actions
          • Temp_Loc_1 = Center of (Playable map area)
          • Set PlayerHasRepicked[(Player number of (Triggering player))] = True
          • Temp_Group_1 = (Units owned by (Player((Player number of (Triggering player)))) matching (((Matching unit) is A Hero) Equal to True))
          • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
              • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
              • Game - Display to (All players) the text: You've successfully...
          • custom script: call DestroyGroup(udg_Temp_Group_1)
          • custom script: call RemoveLocation(udg_Temp_Location_1)
        • Else - Actions
          • Game - Display to (All players) the text: You can't repick yo...
^Leaks removed.
 
Last edited:
Status
Not open for further replies.
Top