• 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.
  • Vote for the theme of Hive's HD Modeling Contest #7! Click here to vote! - Please only vote if you plan on participating❗️

Random Hero - Problem

Status
Not open for further replies.
Level 25
Joined
Dec 30, 2007
Messages
1,554
Hey!
I've tried to make a random hero system,
but I have a problem....
When I buy the random unit, it always "picks"
the same hero. So it's not really random at all...

I used this tutorial:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hero-selection-systems-38699/

  • Random Hero
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Random Hero
    • Actions
      • Set Temp_Pt = ((Owner of (Sold unit)) start location)
      • Unit - Remove (Sold unit) from the game
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Hero_choosen_by_player[(Player number of (Owner of (Sold unit)))] Equal to False
        • Then - Actions
          • Set Hero_choosen_by_player[(Player number of (Owner of (Sold unit)))] = True
          • Unit - Create 1 Tavern1Heroes[(Random integer number between 1 and 36)] for (Owner of (Sold unit)) at Temp_Pt facing Default building facing degrees
          • Unit - Move (Sold unit) instantly to Temp_Pt
          • Camera - Pan camera for (Owner of (Sold unit)) to (Position of (Sold unit)) over 1.00 seconds
          • Hero - Create Scroll of Town Portal and give it to (Last Created Unit)
          • Selection - Clear selection for (Owner of (Sold unit))
          • Selection - Add (Last created unit) to selection for (Owner of (Last created unit))
        • Else - Actions
          • Game - Display to (All players) the text: You already have a ...
      • Custom script: call RemoveLocation (udg_Temp_Pt)
And yes, I'm very new to triggers.
 
Status
Not open for further replies.
Top