• 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.

Hero Select System Tweak

Status
Not open for further replies.
Level 8
Joined
Feb 17, 2007
Messages
368
This is the hero select system I am using:

Left Arrow
  • Actions
    • Set Hero_Selector[(Player number of (Triggering player))] = (Hero_Selector[(Player number of (Triggering player))] - 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • BossPath[(Player number of (Triggering player))] Equal to 1
      • Then - Actions
        • For each (Integer Path1) from 1 to 7, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Hero_Selector[(Player number of (Triggering player))] Equal to Path1
              • Then - Actions
                • Set HeroSelectInfo = (Player group((Triggering player)))
                • Selection - Select Hero_For_Selection[Path1] for (Triggering player)
                • Camera - Lock camera target for (Triggering player) to Hero_For_Selection[Path1], offset by (0.00, 0.00) using Default rotation
                • Set Current_Hero[(Player number of (Triggering player))] = (Unit-type of Hero_For_Selection[Path1])
                • Custom script: call DestroyForce(udg_HeroSelectInfo)
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Hero_Selector[(Player number of (Triggering player))] Equal to 0
                  • Then - Actions
                    • Set HeroSelectInfo = (Player group((Triggering player)))
                    • Camera - Lock camera target for (Triggering player) to Hero_For_Selection[8], offset by (0.00, 0.00) using Default rotation
                    • Selection - Select Krillin 0003 <gen> for (Triggering player)
                    • Set Hero_Selector[(Player number of (Triggering player))] = 8
                    • Set Current_Hero[(Player number of (Triggering player))] = Krillin
                    • Custom script: call DestroyForce(udg_HeroSelectInfo)
                  • Else - Actions
      • Else - Actions
Right Arrow
  • Actions
    • Set Hero_Selector[(Player number of (Triggering player))] = (Hero_Selector[(Player number of (Triggering player))] + 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • BossPath[(Player number of (Triggering player))] Equal to 1
      • Then - Actions
        • For each (Integer Path1) from 1 to 8, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Hero_Selector[(Player number of (Triggering player))] Equal to Path1
              • Then - Actions
                • Set HeroSelectInfo = (Player group((Triggering player)))
                • Camera - Lock camera target for (Triggering player) to Hero_For_Selection[Path1], offset by (0.00, 0.00) using Default rotation
                • Selection - Select Hero_For_Selection[Path1] for (Triggering player)
                • Set Current_Hero[(Player number of (Triggering player))] = (Unit-type of Hero_For_Selection[Path1])
                • Custom script: call DestroyForce(udg_HeroSelectInfo)
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Hero_Selector[(Player number of (Triggering player))] Equal to 9
                  • Then - Actions
                    • Set HeroSelectInfo = (Player group((Triggering player)))
                    • Camera - Lock camera target for (Triggering player) to Hero_For_Selection[1], offset by (0.00, 0.00) using Default rotation
                    • Selection - Select Goku 0012 <gen> for (Triggering player)
                    • Set Hero_Selector[(Player number of (Triggering player))] = 1
                    • Set Current_Hero[(Player number of (Triggering player))] = Goku
                    • Custom script: call DestroyForce(udg_HeroSelectInfo)
                  • Else - Actions
      • Else - Actions
Hero's for Selection setup
  • Set Hero_For_Selection[1] = Goku 0012 <gen>
  • Set Hero_For_Selection[2] = Gohan 0083 <gen>
  • Set Hero_For_Selection[3] = Vegeta 0014 <gen>
  • Set Picking_Hero[(Player number of Player 1 (Red))] = True
Hero Select
  • Player - Player 1 (Red) skips a cinematic sequence
  • Conditions
    • Hero_Selected[(Player number of (Triggering player))] Equal to False
    • Picking_Hero[(Player number of (Triggering player))] Equal to True
I want to make it so there can only be 1 character of each type, not sure how to do it with this system. Also, I want to be able to have a random character be selected if a character is not picked and a timer runs out. Would really appreciate help on this, been trying to figure this out for a while.
 
Level 6
Joined
May 13, 2009
Messages
260
You can make a unit array and when a unit selects a hero it removes the element of that hero from the array. Next time someone selects the same hero, check if it's in the array, if it isn't display a message which says that the hero has already been choosen.

This is an array:
HeroArray[0] = Goku
HeroArray[1] = Vegeta
HeroArray[2] = Gohan
When a hero is picked simply remove or null that element:
Gohan has been picked!

HeroArray[0] = Goku
HeroArray[1] = Vegeta
HeroArray[2] = Gohan

Next time a player picks the same hero your trigger will check if Gohan is in HeroArray, but since Gohan is not in the array display a message that gohan has already been choosen :)
 
Status
Not open for further replies.
Top