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

Random Hero Tavern..

Status
Not open for further replies.
Level 2
Joined
Aug 15, 2007
Messages
26
Hello! I'm making a hero tavern on my map with several heroes on it and I want a random icon in my tavern that chooses a random hero. I believe that this would be very similar to the system thing in Footmen Frenzy..

I'm not sure I will need my old triggers, but I'll post them here aswell..

And one more thing, the random system always picks the same hero...

These are my triggers:

  • Events
    • Map initialization
  • Conditions
  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Camera - Pan camera for (Picked player) to (Center of Region 012 <gen>) with height 0.00 above the terrain over 0.00 seconds
    • Set Total_Heroes = 7
    • Set Random_Count = 7
    • Set Hero_Array[1] = Druid of the Talon
    • Set Hero_Array[2] = Ugly Hunter
    • Set Hero_Array[3] = Shadow Caster
    • Set Hero_Array[4] = Secret Keeper
    • Set Hero_Array[5] = Wolf Rider
    • Set Hero_Array[6] = Tauren Chieftain
    • Set Hero_Array[7] = O.o Panda
    • For each (Integer A) from 1 to 7, do (Actions)
      • Loop - Actions
        • Set Random_Data[(Integer A)] = (Integer A)
I don't know if its right, I followed SD_Ryoko's http://world-editor-tutorials.thehelper.net/herotavern.php

  • Random Command
    • 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
    • Conditions
      • (Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
    • Actions
      • Set Random_Hero = (Random integer number between 1 and Random_Count)
      • Unit - Create 1 Hero_Array[Random_Data[Random_Hero]] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Item - Create Scroll of Town Portal at ((Triggering player) start location)
      • Hero - Give (Last created item) to (Last created unit)
      • Item - Create |cff530080Horn of Cenarius at ((Triggering player) start location)
      • Hero - Give (Last created item) to (Last created unit)
      • Game - Display to (All players) for 15.00 seconds the text: ((Name of (Triggering player)) + ( has randomed + (Name of (Last created unit))))
      • Selection - Select (Last created unit) for (Owner of (Last created unit))
      • Player - Set (Triggering player) Current lumber to 0
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Unit-type of (Last created unit)) Unavailable for training/construction by (Picked player)
      • Set Random_Data[Random_Hero] = Random_Count
      • Set Random_Count = (Random_Count - 1)
  • Manual Pick
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
      • Game - Display to (All players) for 15.00 seconds the text: ((Name of (Owner of (Sold unit))) + ( has chosen + (Name of (Sold unit))))
      • Selection - Select (Sold unit) for (Owner of (Sold unit))
Help is very apreaciated!
 
Last edited:
Level 9
Joined
Jun 26, 2007
Messages
659
forget what i've saying, the tuto explain you how to do some thing very complicated: an exclusive hero system
(if a player take the shadow caster, the other ones can't choose it too) is that you want?

(i don't think, because 7 exclusive heroes for 8 players, it's not possible)
 
Level 2
Joined
Aug 15, 2007
Messages
26
What I actually want is a hero tavern (with my heroes ofc) with an icon (question mark) you can
pick and get a random hero. If you've played footmen frenzy you'll know what I'm talking about.
 
Level 9
Joined
Jun 26, 2007
Messages
659
i've not played footmen frenzy

so if you just want an "random" choice:

  • Hero list init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Heroes_count = [COLOR="DimGray"]the number of different heroes in your map[/COLOR]
      • Set Hero_Array[1] = [COLOR="dimgray"]your first hero[/COLOR]
      • Set Hero_Array[2] = [COLOR="dimgray"]your second hero[/COLOR]
      • Set Hero_Array[3] = [COLOR="dimgray"]your third hero[/COLOR]
      • [COLOR="dimgray"]etc etc...[/COLOR]
  • Random Choice management
  • 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
    • [COLOR="dimgray"]etc etc...[/COLOR]
  • Conditions
    • (Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
  • Actions
    • Unit - Create 1 Hero_Array[Random integer number between 1 and Heroes_count] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
    • Game - Display to (All players) the text: (A player has randomed + (Name of (Last created unit)))
    • Selection - Select (Last created unit) for (Owner of (Last created unit))
 
Level 2
Joined
Aug 15, 2007
Messages
26
i've not played footmen frenzy

so if you just want an "random" choice:

  • Hero list init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Heroes_count = [COLOR="DimGray"]the number of different heroes in your map[/COLOR]
      • Set Hero_Array[1] = [COLOR="dimgray"]your first hero[/COLOR]
      • Set Hero_Array[2] = [COLOR="dimgray"]your second hero[/COLOR]
      • Set Hero_Array[3] = [COLOR="dimgray"]your third hero[/COLOR]
      • [COLOR="dimgray"]etc etc...[/COLOR]
Thanks man:thumbs_up: I'm gonna use this one..

Much easier than I suspected :eekani:

  • Random Choice management
  • 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
    • [COLOR="dimgray"]etc etc...[/COLOR]
  • Conditions
    • (Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
  • Actions
    • Unit - Create 1 Hero_Array[Random integer number between 1 and Heroes_count] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
    • Game - Display to (All players) the text: (A player has randomed + (Name of (Last created unit)))
    • Selection - Select (Last created unit) for (Owner of (Last created unit))

The thing is: I would rather not have a player to have to type -random for a random hero, so I want (in my hero tavern, where you eventually choose your heroes) a "unit" I can buy instead of choosing heroes that buys a random hero.

I hope I explained in a way that you would understand ..
 
Level 2
Joined
Aug 15, 2007
Messages
26
Hmm, I made a try :

  • Set stuff Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Total_Heroes = 7
      • Set Random_Count = 7
      • Set Hero_Array[1] = Druid of the Talon
      • Set Hero_Array[2] = Ugly Hunter
      • Set Hero_Array[3] = Shadow Caster
      • Set Hero_Array[4] = Secret Keeper
      • Set Hero_Array[5] = Wolf Rider
      • Set Hero_Array[6] = Tauren Chieftain
      • Set Hero_Array[7] = O.o Panda
      • Set Random_Count = (Random integer number between 1 and Random_Count)
  • Random
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Random Hero
    • Actions
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and Random_Count)] for (Owner of (Sold unit)) at ((Owner of (Sold unit)) start location) facing Default building facing degrees
      • Item - Create Scroll of Town Portal at ((Owner of (Last created unit)) start location)
      • Hero - Give (Last created item) to (Last created unit)
      • Item - Create |cff530080Horn of Cenarius at ((Owner of (Last created unit)) start location)
      • Hero - Give (Last created item) to (Last created unit)
      • Game - Display to (All players) for 15.00 seconds the text: ((Name of (Owner of (Last created unit))) + ( has randomed + (Name of (Last created unit))))
      • Selection - Select (Last created unit) for (Owner of (Last created unit))
      • Player - Set (Owner of (Last created unit)) Current lumber to 0
      • Set Random_Count = (Random integer number between 1 and Random_Count)
The "Random Hero" unit is just a unit I made unselectable and won't be noticed ingame...

Now the problem is that I get the same unit every time I buy the "Random Unit" I get the same hero (shadow caster) for some reason..

I know there must be an easier way, but I just did it like this :thumbs_up:
 
Level 9
Joined
Jun 26, 2007
Messages
659
wrong, let see what is done...
Set Random_Count = 7
so Random_count is set to 7
Set Random_Count = (Random integer number between 1 and Random_Count)
so Random_count is now set to something between 1 and 7... maybe 3
and then a player choose random
Unit - Create 1 Hero_Array[(Random integer number between 1 and Random_Count)]
so the player have a hero between the first and maybe the 3rd
Set Random_Count = (Random integer number between 1 and Random_Count)
so Random_count is now set to something between 1 and maybe 3... maybe 2
an other player choose random
Unit - Create 1 Hero_Array[(Random integer number between 1 and Random_Count)]
so the player have a hero between the first and maybe the 2nd
Set Random_Count = (Random integer number between 1 and Random_Count)
so Random_count is now set to something between 1 and maybe 2... maybe 1
an other player choose random
Unit - Create 1 Hero_Array[(Random integer number between 1 and Random_Count)]
so the player have a hero between the first and the first
Set Random_Count = (Random integer number between 1 and Random_Count)
so Random_count is now set to something between 1 and 1... so 1
an other player choose random
Unit - Create 1 Hero_Array[(Random integer number between 1 and Random_Count)]
so the player have a hero between the first and the first
Set Random_Count = (Random integer number between 1 and Random_Count)
so Random_count is now set to something between 1 and 1... so 1
etc etc...

Unit - Create 1 Hero_Array[(Random integer number between 1 and 7)]
that's all, you give each player a random hero in 1, 2, 3, 4, 5, 6 or 7
 
Level 2
Joined
Aug 15, 2007
Messages
26
Is this suppose to work then?

  • Set stuff Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Total_Heroes = 7
      • Set Random_Count = 7
      • Set Hero_Array[1] = Druid of the Talon
      • Set Hero_Array[2] = Ugly Hunter
      • Set Hero_Array[3] = Shadow Caster
      • Set Hero_Array[4] = Secret Keeper
      • Set Hero_Array[5] = Wolf Rider
      • Set Hero_Array[6] = Tauren Chieftain
      • Set Hero_Array[7] = O.o Panda
  • Random
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Random Hero
    • Actions
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and Random_Count)] for (Owner of (Sold unit)) at ((Owner of (Sold unit)) start location) facing Default building facing degrees
      • Item - Create Scroll of Town Portal at ((Owner of (Last created unit)) start location)
      • Hero - Give (Last created item) to (Last created unit)
      • Item - Create |cff530080Horn of Cenarius at ((Owner of (Last created unit)) start location)
      • Hero - Give (Last created item) to (Last created unit)
      • Game - Display to (All players) for 15.00 seconds the text: ((Name of (Owner of (Last created unit))) + ( has randomed + (Name of (Last created unit))))
      • Selection - Select (Last created unit) for (Owner of (Last created unit))
      • Player - Set (Owner of (Last created unit)) Current lumber to 0
And one more question: how do you make a hidden ability?
 
Level 2
Joined
Aug 15, 2007
Messages
26
Thanks, I got the spellbook thing going nicely :thumbs_up:

But I'm afraid that these triggers don't work yet.. I get the same hero every time ..

  • Set stuff Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Random_Count = 7
      • Set Hero_Array[1] = Druid of the Talon
      • Set Hero_Array[2] = Ugly Hunter
      • Set Hero_Array[3] = Shadow Caster
      • Set Hero_Array[4] = Secret Keeper
      • Set Hero_Array[5] = Wolf Rider
      • Set Hero_Array[6] = Tauren Chieftain
      • Set Hero_Array[7] = O.o Panda
  • Random
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Random Hero
    • Actions
      • Unit - Create 1 Hero_Array[(Random integer number between 1 and Random_Count)] for (Owner of (Sold unit)) at ((Owner of (Sold unit)) start location) facing Default building facing degrees
      • Item - Create Scroll of Town Portal at ((Owner of (Last created unit)) start location)
      • Hero - Give (Last created item) to (Last created unit)
      • Item - Create |cff530080Horn of Cenarius at ((Owner of (Last created unit)) start location)
      • Hero - Give (Last created item) to (Last created unit)
      • Game - Display to (All players) for 15.00 seconds the text: ((Name of (Owner of (Last created unit))) + ( has randomed + (Name of (Last created unit))))
      • Selection - Select (Last created unit) for (Owner of (Last created unit))
      • Player - Set (Owner of (Last created unit)) Current lumber to 0
Maybe I should ask somewhere else?
 
Status
Not open for further replies.
Top