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

[Trigger] Need Help with 2 Problems With Random Hero Select, and the Hero Select Code.

Status
Not open for further replies.
Level 2
Joined
Apr 26, 2009
Messages
11
First the Tavern hero selection fault:
I have made this code, but it doesn't kill the hero selector unit!
Things to know:
-Family Farm = Hero Selection Tavern
-Units are used too select/choose/buy a hero from the tavern

  • Hero Spawn
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Sold unit) is A Hero) Equal to True
          • And - All (Conditions) are true
            • Conditions
              • ((Sold unit) is A Hero) Equal to True
              • (Selling unit) Equal to Family Farm 0001 <gen>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] Equal to True
        • Then - Actions
          • Unit - Remove (Sold unit) from the game
          • Game - Display to (All players) the text: You have already ch...
        • Else - Actions
          • Set HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] = True
          • Unit - Move (Sold unit) instantly to (Center of Family Farm Spawn <gen>)
          • Camera - Pan camera for (Owner of (Sold unit)) to (Center of Family Farm Spawn <gen>) over 1.00 seconds
          • Selection - Clear selection for (Owner of (Sold unit))
          • Selection - Add (Sold unit) to selection for (Owner of (Sold unit))

Random Select Problem - It only selects 1 unit, always.
So that isn't random at all.

Things to know:
-I use 3 Heroes in the Tavern

  • Randomise
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Randomiser
    • Actions
      • Unit - Remove (Sold unit) from the game
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] Equal to False
        • Then - Actions
          • Unit - Create 1 TavernHeroes[(Random integer number between 1 and 3)] for (Owner of (Sold unit)) at (Center of Family Farm Spawn <gen>) facing Default building facing degrees
          • Set HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] = True
        • Else - Actions
          • Do nothing
 
Last edited:
Level 5
Joined
May 12, 2008
Messages
80
The first problem is easy: just copy the action "unit - remove (sold unit) from the game", paste it under else actions and swap sold unit with buying unit. this should be all

The second problem: Did you ever start the game via wc3 or did you only use the editor (str f9)? If you only used the shorter way via shortcut then (sorry i do not know the right terms as i do not use the english wc3 editor ;) ) look under presettings. there is an option where you can decide wether the test only uses the same random numbers or if it generates real randoms
 
Status
Not open for further replies.
Top