• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Tavern Random Hero Selection Help!

Status
Not open for further replies.
Level 3
Joined
Jan 8, 2011
Messages
70
Hi everyone, i just need some help fixing a trigger for random selection of heroes in my tavern. Currently, 1 hero is being spawned 4/5 times and i would like some help fixing it (i have an idea of what is wrong but don't want to make it worse). The tavern sells 5 heroes, and the first hero is the one the random hero button always chooses. Please help!

  • Random
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Random
    • 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 MonsterTavernHeroes[(Random integer number between 1 and 5)] for (Owner of (Sold unit)) at (Center of Region 006 <gen>) facing Default building facing degrees
          • Set HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] = True
          • Camera - Pan camera for (Owner of (Sold unit)) to (Center of Region 006 <gen>) over 1.00 seconds
        • Else - Actions
          • Game - Display to (All players) the text: You have already pi...
 
Level 3
Joined
Jan 8, 2011
Messages
70
Thanks alot for the advice, i've been trying the trigger alot more lately and it has been working. I think i was extremely lucky (or unlucky) when i randomed the same hero 10 times in a row, but i guess that it was just luck that made me think it was broken.

Another trigger i use was randomly placing items in the same place, so changing the random seed fixed that. Thanks alot :) + REP
 
Status
Not open for further replies.
Top