• Check out the results of the Techtree Contest #19!
  • 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 void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] problem in -random & -ar

Status
Not open for further replies.
Level 1
Joined
Jun 12, 2010
Messages
51
hi all .
this trigger doesnt work.

plz help.

  • First
  • Events
    • Time - Elapsed game time is 0.01 seconds
  • Conditions
  • Actions
    • Set NumberofHeroes = (NumberofHeroes + 1)
    • Set Hero[NumberofHeroes] = Paladin
    • Set NumberofHeroes = (NumberofHeroes + 1)
    • Set Hero[NumberofHeroes] = Archmage
    • Set NumberofHeroes = (NumberofHeroes + 1)
    • Set Hero[NumberofHeroes] = Mountain King
    • Set NumberofHeroes = (NumberofHeroes + 1)
    • Set Hero[NumberofHeroes] = Blood Mage
    • Set NumberofHeroes = (NumberofHeroes + 1)
    • Set Hero[NumberofHeroes] = Blademaster
    • Set NumberofHeroes = (NumberofHeroes + 1)
    • Set Hero[NumberofHeroes] = Far Seer
    • Set NumberofHeroes = (NumberofHeroes + 1)
    • Set Hero[NumberofHeroes] = Tauren Chieftain
    • Set NumberofHeroes = (NumberofHeroes + 1)
    • Set Hero[NumberofHeroes] = Shadow Hunter
    • Set NumberofHeroes = (NumberofHeroes + 1)
    • Set Hero[NumberofHeroes] = Death Knight
    • Set NumberofHeroes = (NumberofHeroes + 1)
    • Set Hero[NumberofHeroes] = Lich
    • Set NumberofHeroes = (NumberofHeroes + 1)
    • Set Hero[NumberofHeroes] = Dreadlord
    • Set NumberofHeroes = (NumberofHeroes + 1)
    • Set Hero[NumberofHeroes] = Crypt Lord
  • Random
  • Events
    • Player - Player 1 (Red) types a chat message containing -random as An exact match
    • Player - Player 2 (Blue) types a chat message containing -random as An exact match
    • Player - Player 3 (Teal) types a chat message containing -random as An exact match
    • Player - Player 4 (Purple) types a chat message containing -random as An exact match
    • Player - Player 5 (Yellow) types a chat message containing -random as An exact match
    • Player - Player 6 (Orange) types a chat message containing -random as An exact match
    • Player - Player 7 (Green) types a chat message containing -random as An exact match
    • Player - Player 8 (Pink) types a chat message containing -random as An exact match
    • Player - Player 9 (Gray) types a chat message containing -random as An exact match
    • Player - Player 10 (Light Blue) types a chat message containing -random as An exact match
    • Player - Player 11 (Dark Green) types a chat message containing -random as An exact match
    • Player - Player 12 (Brown) types a chat message containing -random as An exact match
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 100, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • PlayerHaveHero[(Player number of (Triggering player))] Equal to False
          • Then - Actions
            • Set RandomNumber = (Random integer number between 1 and NumberofHeroes)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • HeroUsed[RandomNumber] Equal to False
              • Then - Actions
                • Unit - Create 1 Hero[RandomNumber] for (Triggering player) at (Center of (Playable map area)) facing Default building facing degrees
                • Set PlayerHaveHero[(Player number of (Triggering player))] = True
                • Set HeroUsed[RandomNumber] = True
              • Else - Actions
          • Else - Actions
  • Ar
  • Events
    • Player - Player 1 (Red) types a chat message containing -ar as An exact match
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 100, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • PlayerHaveHero[(Player number of (Triggering player))] Equal to False
          • Then - Actions
            • Set RandomNumber = (Random integer number between 1 and NumberofHeroes)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • HeroUsed[RandomNumber] Equal to False
              • Then - Actions
                • Unit - Create 1 Hero[RandomNumber] for (Triggering player) at (Center of (Playable map area)) facing Default building facing degrees
                • Set PlayerHaveHero[(Player number of (Triggering player))] = True
                • Set HeroUsed[RandomNumber] = True
              • Else - Actions
          • Else - Actions
 
Not sure what your trying to do with those poor triggers above but this is all you really should need for random/ar

maybe with a few alterations to fit your specific needs.
  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red) types a chat message containing -ar as An exact match
    • Conditions
    • Actions
      • Unit - Create 1 AR_Hero[(Random integer number between 1 and NumberofHeroes)] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
try it out.
 
This if you want the heroes to not get repeatedly picked

  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red) types a chat message containing -ar as An exact match
    • Conditions
    • Actions
      • Set HeroNumber = Random integer number between 1 and NumberofHeroes
      • Unit - Create 1 AR_Hero[HeroNumber] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Set AR_Hero[HeroNumber] = AR_Hero[NumberofHeroes]
      • Set NumberofHeroes = NumberofHeroes - 1
 
Status
Not open for further replies.
Back
Top